Skip to content

Jibril14/computer-vision-tensorflow-cnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Convolutional Neural Networks and Computer Vision with TensorFlow

About this Project

This project focuses on modeling a binary image classification task using Convolutional Neural Networks (CNNs) in TensorFlow.

The goal is to detect whether a given image contains pizza 🍕 or steak 🥩 by building a deep learning classifier.

About the Dataset

The dataset used in this project comes from the Food-101 dataset, which consists of 101,000 real-world images categorized into 101 different food types.

For this project, I selected two categories: pizza and steak, making this a binary classification problem.

Computer Vision Tensorflow

Data Preprocessing

One of the most crucial steps in any machine learning project is preparing the dataset. In this case:

  • The dataset is already split into training and test sets.
  • The training dataset contains 1,500 images (750 per class).
  • The test dataset contains 500 images (250 per class).
  • The images are resized using the target_size parameter to match the input size required by our model.
  • Since this is a binary classification problem, we set class_mode='binary'.
  • The batch_size is set to 32 (default value).

Running the Project on Google Colab

This project is designed to run on Google Colab for easy access to GPU acceleration. Follow these steps to get started:

  1. Open Google Colab.

  2. Upload the notebook or open a new one.

  3. Install required dependencies:

  4. Mount Google Drive (if using external data):

    from google.colab import drive
    drive.mount('/content/drive')
  5. Run the notebook cells to preprocess data, train the model, and evaluate performance.

Model Compilation & Training

The CNN model is compiled using:

  • Loss function: binary_crossentropy (since it's a binary classification task).
  • Optimizer: Adam optimizer with default settings.
  • Evaluation metric: accuracy.

After compiling, the model is trained on the dataset.

  • The steps_per_epoch is set as 1500/32 = ~47, meaning the model will go through approximately 47 batches per epoch.

Model Evaluation

Once training is complete, I evaluate the model by:

  1. Plotting the training curves to visualize loss and accuracy trends.
  2. Using pandas to analyze predictions and model performance.

Results & Improvements

The model's performance can be further improved by:

  • Using data augmentation to generate more diverse training samples.
  • Fine-tuning a pre-trained model like MobileNetV2 or ResNet50.
  • Adding more layers or different architectures to improve feature extraction.

License

This project is open-source and available under the MIT License.

About

Convolutional Neural Networks and Computer Vision with TensorFlow

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors