This project focuses on automated vehicle damage classification using deep learning. The model analyzes uploaded images of cars and predicts the type and location of damage, enabling applications in insurance automation, inspection systems, and fleet management.
The system is built as an end-to-end ML application, with DL methodological integrations of:
- Deep Learning model (ResNet50)
- FastAPI backend
- Streamlit frontend
Due to GitHub file size limits, the trained model is hosted externally:
https://drive.google.com/drive/folders/1fhkW0NP0Dh_YLnjaaE0FGODOMhS7aIGN?usp=sharing
Manual vehicle damage inspection is:
- Time-consuming
- Subjective
- Prone to human error
This project aims to:
Automate damage detection and classification using computer vision.
The dataset consists of vehicle images categorized into:
- Front Breakage
- Front Crushed
- Front Normal
- Rear Breakage
- Rear Crushed
- Rear Normal
This makes it a multi-class image classification problem (6 classes).
- Resize to 224Γ224 (standard input for ResNet)
- Normalize using ImageNet statistics
transforms.Normalize(
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225]
)- Ensures compatibility with pretrained models
- Improves convergence and stability
We used a pretrained ResNet50 model and modified it:
- Froze initial layers β retain learned features
- Fine-tuned deeper layers β adapt to damage patterns
- Replaced final fully connected layer β match 6 classes
self.model = models.resnet50(weights='DEFAULT')- Proven performance in image tasks
- Deep architecture with residual connections
- Prevents vanishing gradient problem
- Baseline model (no tuning)
- Fine-tuning last layers
- Regularization using Dropout
- Hyperparameter tuning
- Loss: CrossEntropyLoss
- Optimizer: Adam / SGD (depending on experiment)
- Reduces training time
- Works well with limited data
- Leverages pretrained knowledge
Performed tuning to improve model performance:
- Learning rate
- Batch size
- Dropout rate
To balance:
- Underfitting vs Overfitting
- Speed vs Accuracy
The model predicts one of the following:
[
'Front Breakage',
'Front Crushed',
'Front Normal',
'Rear Breakage',
'Rear Crushed',
'Rear Normal'
]User Upload (Streamlit UI)
β
Image Preprocessing
β
Model Inference (ResNet50)
β
Prediction Output
β
Displayed on UI / API Response
| Component | Technology |
|---|---|
| DL Framework | PyTorch |
| Backend | FastAPI |
| Frontend | Streamlit |
| Image Handling | PIL |
| Deployment Ready | Render / Streamlit Cloud |
project/
β
βββ app.py # Streamlit UI
βββ server.py # FastAPI backend
βββ model_helper.py # Model loading & prediction logic
βββ saved_model.pth # Trained model
βββ requirements.txt
βββ README.md
git clone <your-repo-link>
cd projectpip install -r requirements.txtstreamlit run app.pyuvicorn server:app --reloadInput: Image file Output:
{
"prediction": "Front Crushed"
}Through this project:
- Applied transfer learning in real-world scenario
- Built end-to-end ML system
- Integrated model with frontend & backend
- Understood deployment challenges
This project demonstrates how deep learning can be used to automate vehicle damage classification, reducing manual effort and improving efficiency in inspection systems.