Classifier for images or video input using Google TensorFlow. Research project on Convolutional Neural Networks, feature extraction, transfer learning, adversary noise and DeepDream.
The notebooks from 01 to 07 are referred from Gaetano Bonofiglio Kidel. In notebooks from 01 to 03, mainly followed with references and documentations, with some changes and observations, in order to learn how to use TensorFlow to build Convolutional Neural Networks for OCR and image recognition. Later notebooks follow the project specifications, while notebooks 06 and 07 were used for some more facoltative observations.
Keras subfolder contains more advanced experiments done with Keras. The first 4 notebooks are about MNIST, with single column and multi column CNNs and dataset expansion. Notebook 5 is an implementation of Transfer Learning using Keras with CIFAR-10.
- Notebooks from 01 to 05 (included) use TensorFlow 0.9.0, Notebook 06 uses TensorFlow 0.11.head.
- Notebooks 03 and 04 use PrettyTensor 0.6.2.
- Notebook 07 uses caffe library and some modified code from google/deepdream.
- Notebooks in Keras subfolder use Keras and TensorFlow 0.12.1
- Special thanks and credits to Hvass-Labs for well made tutorials and libraries.
- Notebooks were made on 3 different Docker machines running different environments, thanks to jupyter/docker-stacks and saturnism/deepdream-docker.
A project demonstrating the use of Convolutional Neural Networks (CNNs) for image and video classification, utilizing TensorFlow. This repository includes multiple experiments such as transfer learning, adversarial noise generation, and DeepDream visualization.
Convolutional Neural Networks (CNNs) have revolutionized the field of computer vision. This project leverages CNNs to:
- Perform image and video classification.
- Experiment with advanced techniques like transfer learning and adversarial examples.
- Visualize model activations using DeepDream.
The repository provides a step-by-step implementation of these methods, making it an excellent resource for beginners and enthusiasts.
- Image Classification: Train CNNs to classify images into various categories.
- Transfer Learning: Utilize pre-trained models (like Inception) for feature extraction and fine-tuning.
- Adversarial Noise: Generate adversarial examples to test model robustness.
- DeepDream: Create visually stunning images by maximizing activations in specific layers of the network.
Follow these steps to set up the project:
-
Clone the repository:
git clone https://github.com/codebyte156/DeepLearning-CNN-Image-Recognition.git
-
Navigate to the project directory:
cd DeepLearning-CNN-Image-Recognition
-
Install dependencies:
pip install -r requirements.txt
-
(Optional) Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Train a new CNN model:
python train_model.py --data_path /path/to/dataset --epochs 10 --batch_size 32
-
Perform transfer learning:
python transfer_learning.py --model inception --data_path /path/to/dataset
-
Generate adversarial noise:
python adversarial_noise.py --image_path /path/to/image.jpg
-
Visualize DeepDream:
python deepdream.py --image_path /path/to/image.jpg
DeepLearning-CNN-Image-Recognition/
├── data/ # Dataset storage
├── models/ # Trained models
├── scripts/ # Utility scripts
│ ├── train_model.py # Training script
│ ├── transfer_learning.py # Transfer learning script
│ ├── adversarial_noise.py # Adversarial noise script
│ ├── deepdream.py # DeepDream script
├── results/ # Output results
├── requirements.txt # Python dependencies
└── README.md # Project documentation
Input Image | Predicted Class | Confidence |
---|---|---|
Cat | 95% | |
Dog | 92% |
Original vs. Perturbed Images:
Original Image | Adversarial Image |
---|---|
Original vs. Perturbed Images:
We welcome contributions! To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature"
- Push to the branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, please reach out via GitHub Issues.