🔍 An end-to-end deep learning web application that detects aircraft damage from images using VGG16 transfer learning for classification and BLIP Transformer for AI-generated image captions and summaries. Built with Flask and served through a clean web interface.
💡 Aircraft maintenance requires rapid and accurate damage detection. This project combines Computer Vision 🖼️ and Natural Language Processing 🧠 to:
- Classify aircraft images as Dent or Crack using a fine-tuned VGG16 CNN
- Generate natural language captions and summaries of the damage using the BLIP Transformer
- Visualize training performance curves (loss & accuracy) interactively
🔗 GitHub Repository: tanishcode-12/Aircraft-Damage-Detection
- 🛩️ Binary Damage Classification — Detects Dent or Crack from uploaded aircraft images
- 🤖 AI Image Captioning — BLIP Transformer generates natural language descriptions of the damage
- 📝 Damage Summarization — Produces a detailed summary of what the image shows
- 📈 Training Curves Visualization — Interactive loss & accuracy charts via Chart.js
- 🌐 Flask Web App — Upload images and get results instantly from your browser
- ⚡ Lazy Model Loading — Heavy ML models load only on first use for faster startup
- 🔒 File Validation — Accepts PNG, JPG, JPEG, WEBP (max 16 MB)
- 📊 Model Info API — Inspect architecture, input shape, optimizer, and hyperparameters
| ⚙️ Parameter | 📝 Value |
|---|---|
| 🏗️ Base Model | VGG16 (pretrained on ImageNet) |
| 🖼️ Input Shape | 224 × 224 × 3 |
| 🔒 Frozen Layers | All VGG16 conv layers |
| 🧱 Custom Layers | Flatten → Dense(512, ReLU) → Dropout(0.3) → Dense(512, ReLU) → Dropout(0.3) |
| 🎯 Output | Dense(1, Sigmoid) |
| 📉 Loss | Binary Cross-Entropy |
| ⚡ Optimizer | Adam (lr = 1e-4) |
| 🏷️ Classes | Dent / Crack |
| 🔢 Batch Size | 32 |
| 🔁 Epochs | 5 |
| ⚙️ Parameter | 📝 Value |
|---|---|
| 🤖 Model | Salesforce/blip-image-captioning-base |
| 🧠 Framework | Hugging Face Transformers + PyTorch |
| 📝 Task | Image Captioning & Damage Summarization |
✈️ Aircraft-Damage-Detection/
├── 🐍 app.py # Flask web app — routes & API
├── 🐍 aircraft_damage_detection.py # Model training pipeline
├── 🌐 index.html # Frontend web interface
├── 📄 requirements.txt # Python dependencies
├── 📁 uploads/ # Uploaded images (auto-created)
└── 📝 README.md
| 🔗 Endpoint | 📡 Method | 📝 Description |
|---|---|---|
/ |
GET |
🌐 Serves the main web interface |
/api/classify |
POST |
🛩️ Classify image as Dent or Crack with confidence score |
/api/caption |
POST |
📝 Generate BLIP caption and summary for uploaded image |
/api/training-curves |
GET |
📈 Returns simulated training loss & accuracy history |
/api/model-info |
GET |
🔍 Returns model architecture and hyperparameter details |
- 🐍 Python 3.8+
- 📦 pip
- 🖥️ GPU recommended (for faster BLIP inference)
- 📥 Clone the repository
git clone https://github.com/tanishcode-12/Aircraft-Damage-Detection.git
cd Aircraft-Damage-Detection- 📦 Install dependencies
pip install -r requirements.txt▶️ Run the application
python app.py- 🌐 Open in your browser
http://localhost:5000
- 🟢 Launch the app using the steps above
- 📤 Upload an aircraft image (PNG, JPG, JPEG, or WEBP — max 16 MB)
- 🛩️ Click Classify to detect whether the damage is a Dent or Crack
- 📊 View the confidence score and raw probability
- 📝 Click Caption to get an AI-generated description and summary of the damage
- 📈 View training curves to see model loss & accuracy over epochs
| 📚 Library | 🔧 Purpose |
|---|---|
flask |
🌐 Web framework & API routing |
werkzeug |
🔒 Secure file uploads |
tensorflow / keras |
🧠 VGG16 model & image preprocessing |
torch |
🔥 PyTorch backend for BLIP |
transformers |
🤗 Hugging Face BLIP model |
Pillow |
🖼️ Image loading & processing |
numpy |
🔢 Array operations |
matplotlib |
📊 Training curve generation |
🙌 Contributions are welcome! Here's how you can help:
- 🍴 Fork the repository
- 🌿 Create a new branch (
git checkout -b feature/your-feature) - 💾 Make your changes and commit (
git commit -m 'Add your feature') - 📤 Push to the branch (
git push origin feature/your-feature) - 🔁 Open a Pull Request
✅ Please make sure your code is clean and well-commented.
Tanish — @tanishcode-12
⭐ If you found this project helpful, consider giving it a star on GitHub!