Practice creating a computer vision model that can recognize items of clothing with TensorFlow library.
A TensorFlow/Keras model that classifies 28x28 grayscale images of clothing into 10 categories.
This project trains a neural network on the Fashion MNIST dataset to recognize different types of clothing such as shirts, shoes, and bags. The model takes image data as input, preprocesses it, and predicts the most likely category.
Please open in Google Colab and make a copy for yourself.
Chau.Google.ComputerVision.TensorFlow.ipynb
I also wrote about what I learned from this project, including insights on data preparation and model design:
Read the full post on Substack
- Loads the Fashion MNIST dataset
- Normalizes pixel values
- Flattens 28x28 images into 784-length vectors
- Builds a neural network using dense layers
- Trains the model
- Evaluates accuracy
- Uses callbacks to stop training early
- Training highest accuracy: ~90% (91.51%)
- Predicts clothing categories labeled from 0 to 9
- T-shirt/top
- Trouser
- Pullover
- Dress
- Coat
- Sandal
- Shirt
- Sneaker
- Bag
- Ankle boot
- Neural networks (Dense layers)
- Data preprocessing and normalization
- Flattening image data (28x28 → 784)
- Model evaluation
- Callbacks (early stopping)
- Click the "Open in Colab" link above. Make a copy for yourself.
- Run all cells (Runtime → Run all)
- View training progress and results
- Please feel free to modify parameters or model structure if desired
notebook.ipynb— main Colab notebook containing all code
- Replace dense network with a Convolutional Neural Network (CNN)
This project is intended as a learning exercise for me to understand the basics of deep learning, model training, and data preprocessing using TensorFlow and Keras.
Please visit Google Codelabs for more resources. Link: https://codelabs.developers.google.com/
