A Convolutional Neural Network (CNN) built using TensorFlow/Keras to classify images into one of the ten CIFAR-10 classes. The project also includes a simple graphical interface for selecting an image and predicting its class.
- CNN built with TensorFlow/Keras
- Trained on the CIFAR-10 dataset
- Image preprocessing (resize to 32×32 and normalization)
- GUI file picker for image selection
- Displays prediction and confidence score
- Saves the trained model as
image_classifier.h5
- Airplane
- Automobile
- Bird
- Cat
- Deer
- Dog
- Frog
- Horse
- Ship
- Truck
- Python
- TensorFlow / Keras
- NumPy
- OpenCV
- Matplotlib
- Tkinter
Install the required packages:
pip install tensorflow numpy matplotlib opencv-pythonRun:
python train.pyThis trains the CNN and saves the model as:
image_classifier.h5
Run:
python predict.pySelect an image using the file picker. The program will:
- Load the image.
- Resize it to 32×32.
- Normalize pixel values.
- Predict the class.
- Display the prediction and confidence.
- Convolutional Layers
- Max Pooling Layers
- Batch Normalization
- Dropout
- Dense Layers
- Softmax Output Layer
The model is trained on the CIFAR-10 dataset, which contains 60,000 color images of size 32×32 across 10 classes.
- 50,000 Training Images
- 10,000 Testing Images
- Test Accuracy: ~85–90% (depending on training)
- Loss Function: Sparse Categorical Crossentropy
- Optimizer: Adam
- Support custom datasets
- Higher-resolution image classification
- Transfer learning with ResNet or EfficientNet
- Web-based interface using Flask or Streamlit
This project is released under the MIT License.