This project implements a multi-class image classifier for the Fashion MNIST dataset using a Convolutional Neural Network (CNN) and Streamlit for the web interface. Users can upload images to classify them into one of ten fashion categories.
To run this project, you'll need the following Python libraries:
streamlittorchtorchvisiontorchmetricsPillownumpy
You can install the required packages using pip:
pip install streamlit torch torchvision torchmetrics Pillow numpy-
Clone this repository to your local machine:
git clone <repository-url>
-
Navigate to the project directory:
cd <project-directory>
-
Install the required libraries as mentioned above.
-
Run the Streamlit app:
streamlit run app.py
-
Open your web browser and go to the URL provided by Streamlit (usually
http://localhost:8501). -
Use the file uploader to upload an image of clothing. The model will predict the class of the uploaded image.
The CNN architecture consists of the following layers:
- Convolutional Layer: Applies 16 filters of size 3x3 with ReLU activation and padding.
- Max Pooling Layer: Reduces dimensionality with a kernel size of 2x2.
- Fully Connected Layer: Outputs class predictions for the 10 categories in Fashion MNIST.
Uploaded images are preprocessed using the following steps:
- Convert the image to grayscale.
- Resize the image to 28x28 pixels.
- Normalize the pixel values to be between -1 and 1.
This project is licensed under the MIT License - see the LICENSE file for details.
