Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Image Classification Project

This project demonstrates image classification using the CIFAR-10 dataset and a Convolutional Neural Network (CNN) built with TensorFlow and Keras. The CIFAR-10 dataset consists of 60,000 32x32 color images in 10 different classes, with 6,000 images per class.

Project Structure

  • main.py: The main script that loads the dataset, preprocesses the images, defines the CNN model, trains the model, and makes predictions.
  • image_classification.model: The saved model after training.

Requirements

  • Python 3.x
  • TensorFlow
  • NumPy
  • Matplotlib

You can install the required packages using pip:

pip install tensorflow numpy matplotlib

Usage

  1. Load and Preprocess Data: The CIFAR-10 dataset is loaded and the images are normalized by dividing by 255.

  2. Define the Model: A CNN model is defined using Keras' Sequential API. The model consists of convolutional layers, max-pooling layers, and dense layers.

  3. Train the Model: The model is compiled with the Adam optimizer and sparse categorical cross-entropy loss. It is then trained on the training data.

  4. Save the Model: After training, the model is saved to a file.

  5. Load the Model: The saved model is loaded from the file.

  6. Make Predictions: The model is used to make predictions on a sample image from the training set.

Example

To run the project, execute the main.py script:

python main.py

The script will load the CIFAR-10 dataset, preprocess the images, load the pre-trained model, and make a prediction on a sample image. The predicted class will be displayed along with the image.

Results

The model's performance can be evaluated using the test dataset. The accuracy and loss will be printed after evaluation.

Visualization

The script includes commented-out code for visualizing the first 16 images in the training set along with their labels. Uncomment the code to see the images.

License

This project is licensed under the MIT License.

About

This project demonstrates image classification using the CIFAR-10 dataset and a Convolutional Neural Network (CNN) built with TensorFlow and Keras. The CIFAR-10 dataset consists of 60,000 32x32 color images in 10 different classes, with 6,000 images per class.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages