Skip to content

tanishcode-12/AeroSpace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✈️ Aircraft Damage Detection — Deep Learning & Transformers

🔍 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.


📌 Overview

💡 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


✨ Features

  • 🛩️ 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

🧠 Model Architecture

🔹 Classification Model — VGG16

⚙️ 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

🔹 Captioning & Summary Model — BLIP

⚙️ Parameter 📝 Value
🤖 Model Salesforce/blip-image-captioning-base
🧠 Framework Hugging Face Transformers + PyTorch
📝 Task Image Captioning & Damage Summarization

🗂️ Project Structure

✈️ 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

🌐 API Endpoints

🔗 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

⚙️ Installation

🧰 Prerequisites

  • 🐍 Python 3.8+
  • 📦 pip
  • 🖥️ GPU recommended (for faster BLIP inference)

🪜 Steps

  1. 📥 Clone the repository
git clone https://github.com/tanishcode-12/Aircraft-Damage-Detection.git
cd Aircraft-Damage-Detection
  1. 📦 Install dependencies
pip install -r requirements.txt
  1. ▶️ Run the application
python app.py
  1. 🌐 Open in your browser
http://localhost:5000

🚀 Usage

  1. 🟢 Launch the app using the steps above
  2. 📤 Upload an aircraft image (PNG, JPG, JPEG, or WEBP — max 16 MB)
  3. 🛩️ Click Classify to detect whether the damage is a Dent or Crack
  4. 📊 View the confidence score and raw probability
  5. 📝 Click Caption to get an AI-generated description and summary of the damage
  6. 📈 View training curves to see model loss & accuracy over epochs

📦 Dependencies

📚 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

🤝 Contributing

🙌 Contributions are welcome! Here's how you can help:

  1. 🍴 Fork the repository
  2. 🌿 Create a new branch (git checkout -b feature/your-feature)
  3. 💾 Make your changes and commit (git commit -m 'Add your feature')
  4. 📤 Push to the branch (git push origin feature/your-feature)
  5. 🔁 Open a Pull Request

✅ Please make sure your code is clean and well-commented.


👤 Author

Tanish@tanishcode-12


⭐ If you found this project helpful, consider giving it a star on GitHub!

About

VGG16 + BLIP Transformer web app for aircraft damage detection — classifies Dent/Crack and generates AI captions using Flask and Hugging Face

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors