Welcome to the Vishnu CNN repository. This project implements a Convolutional Neural Network (CNN) for binary image classification (Dog vs Cat). It features a custom Jupyter Notebook with a robust model architecture designed for generalization.
vishnu-cnn/
├── CNN_Classification.ipynb # Main notebook with model training and prediction logic
├── README.md # Project documentation
├── reference/ # External reference material (git ignored)
└── .gitignore # Helper to exclude reference/ and data files
Important: This repository does not include the training and testing datasets. To run the notebook, you must place the following CSV files in the root directory:
input.csv(Training images)labels.csv(Training labels)input_test.csv(Test images)labels_test.csv(Test labels)
Each row in the input CSVs should represent a flattened 100x100 RGB image (30,000 values), and labels should be binary (0 or 1).
- Deep Learning Architecture: A sequential CNN model built with TensorFlow/Keras.
- Conv2D Layers: 3 layers (32, 64, 128 filters) with ReLU activation.
- MaxPooling2D: Reduces spatial dimensions after each convolution.
- Dropout: Integrated
Dropout(0.25)andDropout(0.5)layers to prevent overfitting.
- Data Augmentation:
ImageDataGeneratorconfigured for rotation, shifting, and zooming. - Visualization: Plots for model accuracy and loss over epochs.
A Convolutional Neural Network (CNN) is a deep learning algorithm which can take in an input image, assign importance (learnable weights and biases) to various aspects/objects in the image and be able to differentiate one from the other.
- Convolutional Layer: Extracts features from the input image.
- Pooling Layer: Reduces the spatial size to decrease computational power.
- Fully Connected Layer: Classifies the image based on extracted features.
- Dropout Layer: Randomly sets input units to 0 to prevent overfitting.
- Python 3.8+
- TensorFlow / PyTorch
- NumPy, Pandas, Matplotlib
- Clone the repo:
git clone https://github.com/Rythamo8055/vishnu-cnn.git cd vishnu-cnn - Install dependencies:
pip install matplotlib tensorflow
- Add Data Files: Copy your
input.csv,labels.csvetc. to the folder. - Run the notebook:
jupyter notebook CNN_Classification.ipynb
| Model | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|
| Custom CNN | ~92.5% | 0.91 | 0.93 | 0.92 |
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Give a ⭐️ if this project helped you!
Created with ❤️ by Vishnu Vardhan