Git Product home page Git Product logo

beckerfelipee / cnn-imageclassification Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 21.86 MB

Cats or Dogs? This is a Convolutional Neural Network (CNN) model developed for educational purposes using TensorFlow and Keras to create, train, and evaluate deep neural networks. The model is designed to classify images of cats and dogs, leveraging a dataset provided by TensorFlow.

License: MIT License

Jupyter Notebook 100.00%

cnn-imageclassification's Introduction

Cats or Dogs? CNN Image Classification

ExamplePot

Overview

This is a Convolutional Neural Network (CNN) model developed for educational purposes using TensorFlow and Keras to create, train, and evaluate deep neural networks. The model is designed to classify images of cats and dogs, leveraging a dataset provided by TensorFlow.

Dataset

The dataset consists of 2000 images of cats and dogs for training and 1000 images for validation, organized into separate directories for each purpose. Before training, the images are resized to 160x160 pixels. Color values in the images are normalized to a range between 0 and 1.

You can see more about the dataset by clicking here.

Or just download it here.

Model Architecture

The CNN model consists of several layers:

  1. Rescaling Layer: Rescales the input images to the desired size.
  2. Convolutional Layers: Convolutional layers with ReLU activation functions to introduce non-linearity.
  3. MaxPooling Layers: Downsamples the feature maps generated by the convolutional layers.
  4. Flatten Layer: Flattens the output of the convolutional layers into a 1-dimensional array.
  5. Dense Layers: Fully connected layers with ReLU activation functions.
  6. Output Layer: A single node with a sigmoid activation function for binary classification (0 for cat, 1 for dog).

Training

The model is trained using the Adam optimizer with binary cross-entropy loss. Training occurs over 20 epochs with a batch size of 32.

Usage

To use the model, you can either download the model and load it in your code using the following command:

model = tf.keras.models.load_model('path/to/model')

Alternatively, you can create a copy of the ImageClassification.ipynb notebook and run/manipulate the entire code (including training).

Results

After training, the model's performance can be evaluated by visualizing predictions on a test dataset. The plot_dataset_predictions function generates a visualization of 9 predictions as images, comparing them with their ground truth labels.

What's Next?

This model is still under development. The next steps involve evaluating the quality of the generated model by applying metrics to our validation dataset. After analyzing the performance and accuracy of the model training, I will need to address any related issues found. For example, to find a way to prevent overfitting.

Additionally, I plan to apply transfer learning to this model, leveraging pre-trained models in TensorFlow for similar training tasks.

Dependencies

  • TensorFlow
  • Matplotlib

Author

Felipe Becker

cnn-imageclassification's People

Contributors

beckerfelipee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.