Skip to content

Timinesh/image_classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIFAR-10 Image Classifier

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.

Features

  • 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

Classes

  • Airplane
  • Automobile
  • Bird
  • Cat
  • Deer
  • Dog
  • Frog
  • Horse
  • Ship
  • Truck

Technologies Used

  • Python
  • TensorFlow / Keras
  • NumPy
  • OpenCV
  • Matplotlib
  • Tkinter

Installation

Install the required packages:

pip install tensorflow numpy matplotlib opencv-python

Training

Run:

python train.py

This trains the CNN and saves the model as:

image_classifier.h5

Prediction

Run:

python predict.py

Select an image using the file picker. The program will:

  1. Load the image.
  2. Resize it to 32×32.
  3. Normalize pixel values.
  4. Predict the class.
  5. Display the prediction and confidence.

Model Architecture

  • Convolutional Layers
  • Max Pooling Layers
  • Batch Normalization
  • Dropout
  • Dense Layers
  • Softmax Output Layer

Dataset

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

Results

  • Test Accuracy: ~85–90% (depending on training)
  • Loss Function: Sparse Categorical Crossentropy
  • Optimizer: Adam

Future Improvements

  • Support custom datasets
  • Higher-resolution image classification
  • Transfer learning with ResNet or EfficientNet
  • Web-based interface using Flask or Streamlit

License

This project is released under the MIT License.

About

CNN image classifier built with TensorFlow using the CIFAR-10 dataset.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages