This project demonstrates how to build and optimize neural networks for image classification using the Fashion MNIST dataset. Rather than manually extracting features (like with PCA), this demo shows how neural networks can automatically learn hierarchical features from raw pixel data.
This notebook covers:
- Building baseline neural networks with Keras/TensorFlow
- Experimenting with network architecture (depth and width)
- Visualizing training progress with accuracy and loss curves
- Implementing early stopping to prevent overfitting
- Comparing different network configurations
The Fashion MNIST on Kaggle contains 70,000 grayscale images of clothing items (28×28 pixels = 784 features per image), making it ideal for demonstrating neural network capabilities.
- Python 3.x
- VS Code with Jupyter extension
- Kaggle account (for dataset download)
-
Clone or download this repository
-
Download the Fashion MNIST dataset
- Visit Fashion MNIST on Kaggle
- Download
fashion-mnist_test.csvandfashion-mnist_train.csv - Place both files in the
data/directory
-
Install required packages
Open a terminal in VS Code and run:
pip install numpy pandas matplotlib tensorflow scikit-learn
-
Open the notebook
- Open
pixel-neural-network.ipynbin VS Code - VS Code will automatically activate the Jupyter notebook interface
- Open
-
Select a Python kernel
- Click on "Select Kernel" in the top right corner
- Choose your Python environment (preferably one with the required packages installed)
-
Run the cells
- You can run cells individually by clicking the play button next to each cell
- Or run all cells sequentially using "Run All" from the toolbar
- The notebook is designed to run from top to bottom
DSMII-Clothing-Neural-Network/
├── pixel-neural-network.ipynb # Main notebook with neural network experiments
├── data/
│ ├── fashion-mnist_train.csv # Training dataset (download from Kaggle)
│ └── fashion-mnist_test.csv # Test dataset (download from Kaggle)
└── README.md # This file
- The notebook uses
verbose=0for most training runs to reduce output clutter - Early stopping is demonstrated to show how to prevent overfitting
- All models use the Adam optimizer and sparse categorical crossentropy loss
- A 20% validation split is used to monitor model performance during training