This project is a Convolutional Neural Network (CNN) model that can distinguish between cats and dogs in images. Inspired by tutorials and articles, such as Cat & Dog Classification Neural Network in Python, this project was designed as an introduction to using AI models with Python.
Ultimately, the goal was to familiarize myself with building, training, and deploying AI modelsβstarting with a simple binary classification task: Cats vs. Dogs.
Is it cat? Is it dog? Or is it something in between?
- CNN: A straightforward Convolutional Neural Network which knows the difference between a dog and a cat.
- Image Preprocessing: Resizing, normalization, and batching for preparing image data.
- Model Evaluation: Track performance during training, including accuracy and loss metrics.
- Saving & Loading: The trained model can be saved and reloaded for future predictions.
If you for some reason have never seen a cat or dog before or struggle to tell the difference this is a helpful tool to help you figure out what it is.
To get started with this project, follow these steps:
git clone https://github.com/yourusername/cat-vs-dog-classifier.git
cd cat-vs-dog-classifierpython -m venv venv
source venv/bin/activate # On Window, use `venv/Scripts/activate`pip install -r requirements.txtAfter setting up the environment and installing dependencies, you can begin using the model. Follow these steps:
Run train_model this will train the model using Tensorflow dataset
python train_model.pyPlace your cat and dog images the images folder
Change the image_path = 'images/image1.jpg' to your desired image
Run the run_model.py script and view the results in the terminal
python run_model.py
