| --- |
| title: AI Pet Classifier |
| emoji: πΆ |
| colorFrom: blue |
| colorTo: indigo |
| sdk: streamlit |
| sdk_version: "1.46.1" |
| app_file: app.py |
| pinned: false |
| license: mit |
| --- |
| |
| # πΆ AI Pet Classifier using CNN |
|
|
| A deep learning application that classifies images of cats and dogs using a Convolutional Neural Network (CNN) built with TensorFlow and Keras. |
|
|
| ... |
|
|
| # πΆπ± AI Pet Classifier using Convolutional Neural Networks (CNN) |
|
|
| ## Overview |
|
|
| AI Pet Classifier is a deep learning project that classifies images as either **Cat** or **Dog** using a Convolutional Neural Network (CNN) built with TensorFlow and Keras. The model is trained on thousands of labeled pet images and predicts the class of unseen images with high accuracy. |
|
|
| --- |
|
|
| ## Features |
|
|
| - Binary Image Classification |
| - TensorFlow & Keras Implementation |
| - Data Augmentation |
| - Batch Normalization |
| - Image Preprocessing |
| - Model Saving & Loading |
| - Single Image Prediction |
| - Beginner-Friendly Notebook |
| - Google Colab Compatible |
|
|
| --- |
|
|
| ## Project Pipeline |
|
|
| ``` |
| Dataset |
| β |
| βΌ |
| Image Preprocessing |
| β |
| βΌ |
| Data Augmentation |
| β |
| βΌ |
| CNN Model |
| β |
| βΌ |
| Training |
| β |
| βΌ |
| Evaluation |
| β |
| βΌ |
| Prediction |
| ``` |
|
|
| --- |
|
|
| ## CNN Architecture |
|
|
| ``` |
| Input Layer (64Γ64Γ3) |
| |
| β |
| |
| Conv2D (32 Filters) |
| β |
| |
| Batch Normalization |
| β |
| |
| MaxPooling |
| |
| β |
| |
| Conv2D (64 Filters) |
| β |
| |
| MaxPooling |
| |
| β |
| |
| Conv2D (128 Filters) |
| β |
| |
| MaxPooling |
| |
| β |
| |
| Flatten |
| |
| β |
| |
| Dense (128) |
| |
| β |
| |
| Dense (1, Sigmoid) |
| |
| β |
| |
| Prediction |
| ``` |
|
|
| --- |
|
|
| ## Technologies Used |
|
|
| - Python |
| - TensorFlow |
| - Keras |
| - NumPy |
| - Matplotlib |
| - Pillow |
| - Google Colab |
|
|
| --- |
|
|
| ## Dataset Structure |
|
|
| ``` |
| Data/ |
| |
| βββ training_set/ |
| β βββ cats/ |
| β βββ dogs/ |
| β |
| βββ test_set/ |
| βββ cats/ |
| βββ dogs/ |
| ``` |
|
|
| --- |
|
|
| ## Hyperparameters |
|
|
| | Parameter | Value | |
| |------------|-------| |
| | Image Size | 64 Γ 64 | |
| | Batch Size | 32 | |
| | Epochs | 25 | |
| | Optimizer | Adam | |
| | Loss Function | Binary Crossentropy | |
| | Activation | ReLU | |
| | Output Activation | Sigmoid | |
|
|
| --- |
|
|
| ## Training |
|
|
| The model uses image augmentation to improve generalization by applying: |
|
|
| - Rescaling |
| - Random Zoom |
| - Shear Transformation |
| - Horizontal Flip |
|
|
| --- |
|
|
| ## Prediction |
|
|
| The trained model predicts whether the uploaded image belongs to: |
|
|
| - π± Cat |
| - πΆ Dog |
|
|
| along with the prediction confidence. |
|
|
| --- |
|
|
| ## Future Improvements |
|
|
| - Early Stopping |
| - Model Checkpoint |
| - Transfer Learning (MobileNetV2 / EfficientNet) |
| - Confusion Matrix |
| - Classification Report |
| - Accuracy & Loss Curves |
| - Grad-CAM Visualization |
| - Streamlit & Hugging Face Deployment |
|
|
| --- |
|
|
| ## Repository Structure |
|
|
| ``` |
| βββ CNN_Model.ipynb |
| βββ cnn_model.keras |
| βββ Data.zip |
| βββ requirements.txt |
| βββ README.md |
| βββ LICENSE |
| ``` |
|
|
| --- |
|
|
| ## Author |
|
|
| **Sudheer Muthyala** |
|
|
| B.Tech (ECE) |
|
|
| Aspiring AI & Data Science Engineer |
|
|
| GitHub: https://github.com/M-Sudheer18 |
|
|
| --- |
|
|
| ## License |
|
|
| This project is licensed under the MIT License. |
|
|
| --- |
|
|
| β If you found this project helpful, consider giving it a star. |