A collection of deep learning projects demonstrating image classification using PyTorch and pre-trained models. This repository contains two comprehensive projects that showcase different approaches to image classification and transfer learning.
Location: Create Your Own Image Classifier/
A complete deep learning project that trains a neural network to classify flower images into 102 different categories. This project demonstrates how to build, train, and deploy a custom image classifier using transfer learning.
Key Features:
- Transfer learning with pre-trained CNN models (VGG16, VGG13, DenseNet121, AlexNet)
- Custom classifier training on flower dataset
- Command line interface for training and prediction
- Model checkpointing and visualization
- Achieves up to 86.45% test accuracy
Technologies: PyTorch, torchvision, transfer learning, data augmentation
Location: Use a Pre-trained Image Classifier to Identify Dog Breeds/
A comprehensive image classification system designed for a city dog show to ensure only actual dogs are registered for the competition. This project uses pre-trained CNN models to classify images as dogs or non-dogs and identify specific dog breeds.
Key Features:
- Dog vs non-dog classification with 100% accuracy
- Dog breed identification with up to 93.3% accuracy
- Model comparison across different architectures
- Comprehensive performance analysis and timing
- Real-world application for dog show registration
Technologies: PyTorch, pre-trained models, model comparison, performance analysis
| Aspect | Flower Classifier | Dog Breed Classifier |
|---|---|---|
| Purpose | Train custom classifier | Use pre-trained models |
| Dataset | 102 flower categories | 133 dog breeds + non-dogs |
| Approach | Transfer learning + training | Pre-trained model inference |
| Accuracy | Up to 86.45% | Up to 93.3% breed classification |
| Focus | Model training and optimization | Model comparison and evaluation |
| Output | Trained model + predictions | Performance analysis + recommendations |
These projects demonstrate:
- Transfer Learning: How to leverage pre-trained models for new tasks
- Model Training: Complete pipeline from data loading to model saving
- Model Evaluation: Comprehensive performance analysis and comparison
- Real-world Applications: Practical use cases for image classification
- Command Line Tools: Building user-friendly interfaces for ML models
- Data Preprocessing: Proper image augmentation and normalization
- Model Optimization: Hyperparameter tuning and architecture selection
- Python 3.6+
- PyTorch
- torchvision
- PIL (Pillow)
- matplotlib
- numpy
- Clone the repository:
git clone <repository-url>
cd AI-Programming-with-Python- Install required packages:
pip install torch torchvision pillow matplotlib numpycd "Create Your Own Image Classifier"
python train.py data_directory --arch vgg16 --epochs 10
python predict.py image.jpg checkpoint.pth --top_k 5cd "Use a Pre-trained Image Classifier to Identify Dog Breeds"
python check_images.py --dir pet_images --arch vgg --dogfile dognames.txt
python compare_models.pyAI-Programming-with-Python/
├── Create Your Own Image Classifier/
│ ├── Image Classifier Project.ipynb # Complete implementation notebook
│ ├── train.py # Training script
│ ├── predict.py # Prediction script
│ └── README.md # Project documentation
├── Use a Pre-trained Image Classifier to Identify Dog Breeds/
│ ├── data/ # Test images and data files
│ ├── project-workspace-*/ # Individual implementation workspaces
│ └── README.md # Project documentation
└── README.md # This file
- PyTorch: Deep learning framework
- torchvision: Computer vision utilities and pre-trained models
- Transfer Learning: Leveraging pre-trained models for new tasks
- Data Augmentation: Improving model robustness with image transformations
- Model Evaluation: Comprehensive performance metrics and analysis
- Command Line Interfaces: User-friendly ML tool interfaces
- Test Accuracy: Up to 86.45%
- Model Size: ~357 MB checkpoint
- Training Time: ~5 epochs for convergence
- Supported Architectures: VGG16, VGG13, DenseNet121, AlexNet
- Dog Detection: 100% accuracy across all models
- Breed Classification: Up to 93.3% accuracy (VGG)
- Model Comparison: AlexNet, VGG, ResNet performance analysis
- Runtime Analysis: Complete timing measurements
- Botanical research and identification
- Educational tools for plant recognition
- Mobile apps for nature enthusiasts
- Agricultural applications
- Pet registration systems
- Veterinary applications
- Animal shelter management
- Pet adoption platforms
- Support for additional model architectures
- Real-time camera classification
- Web interfaces for both projects
- Mobile app integration
- Model ensemble methods
- Hyperparameter optimization tools
This repository contains educational projects from the AI Programming with Python course. Feel free to explore the code, run the examples, and experiment with different parameters and architectures.
This project is part of the AI Programming with Python course materials.
For questions about these projects or the AI Programming with Python course, please refer to the individual project README files for detailed documentation and usage instructions.