Visual Damage Assessment Pipeline is a full-stack ML system built to automate car damage assessment for the insurance company "Secure Future." It turns photos of damage into ready-to-use reports in minutes instead of days.
demo.mp4
Traditional car damage assessment in insurance is slow and expensive: it requires an adjuster to visit, manually inspect, and fill out paperwork, taking anywhere from 24 hours to several days. This causes unhappy customers, churn, and high operational costs.
Goal of this project — reduce the time from claim submission to a first damage report from several days to under 5 minutes.
- ⭐ North Star Metric: Retention Rate– happy customers who get quick resolutions stay with the company.
- ⏱️ Operational Metrics:
- Time-to-First-Decision (TTFD): Goal < 5 minutes.
- First-Pass Automation Rate (FPAR): % of cases handled without human intervention.
- Adjuster Productivity: Increase cases per adjuster via routine automation.
- 💰 Revenue & Quality Metrics:
- Error/Discrepancy Rate: Minimize differences between automated and manual estimates.
- Churn Cost Avoidance: Save money by keeping customers.
The system is implemented as a FastAPI service wrapping a complex ML pipeline. Key feature — LLM-powered report synthesis, where a large language model (DeepSeek) doesn’t just summarize, but corrects and enriches CV model outputs.
- Data Intake: User uploads 1–N photos + metadata (make, model, year, VIN) to
/assess_damage. - Parallel Inference:
parts_model(YOLOv11-Seg)finds car part masks.damage_model(YOLOv11-Det)finds damage bounding boxes.
- Matching:Algorithm links each damage instance to a part (e.g., “dent on front door”).
- Tiered Cost Estimation:
- Level 1: Look up exact match in
damage_costs.csvby make, model, year, and damage type. - Level 2 (Fallback): If no exact match, use average cost for that damage type/part.
- Level 3 (LLM): If no data, pass assessment task to the LLM.
- Level 1: Look up exact match in
- LLM Report Synthesis: Real critical step. Raw CV outputs go to DeepSeek with a prompt to:
- Act as an expert adjuster..
- Correct physically impossible detections (like “dent on front light → “crack on front light”).
- Format the report in supported languages (English, Italian, Russian, etc.).
- PDF Generation: Professional PDF is created from LLM output + annotated images.
The system runs as a uvicorn server. Example call with curl:
# start
uvicorn app:app --reload
# example
curl -X POST "http://127.0.0.1:8000/assess_damage" \
-H "Content-Type: multipart/form-data" \
-F "images=@/path/to/your/image1.jpg" \
-F "images=@/path/to/your/image2.jpg" \
-F "make=Kia" \
-F "model=Sportage" \
-F "year=2022" \
-F "vin=IT12345" \
-F "first_name=John" \
-F "last_name=Doe" \
-F "generate_llm_report_flag=true" \
-F "language=en"Models were trained on a hybrid dataset (CarDD, Roboflow, proprietary images). To maximize quality with minimal labeling, a self-training loop was used::
- Train on 40% labeled data.
- Infer on 60% unlabeled data.
- Add confident (>0.7) predictions (pseudo-labels) to training set.
- Result: IoU > 90% on dev set.
- Backend: FastAPI, Pydantic
- ML Frameworks: PyTorch, Ultralytics (YOLOv8)
- LLM: ChatGPT/DeepSeek (OpenAI-compatible client)
- Data: Pandas
- Deployment: Uvicorn, Docker (scheduled)
Status: Alpha. It is functional,still under internal testing.
- 3D visualization integration via COLMAP.
- Expand
damage_costs.csvfor more model coverage.
- Add more classes: new parts (e.g, fender, pillar, chassis).
- Increase recall: improve small damage detection (crack, scratch).
- Handle rare cases: strategies for rare cars and custom tuning.
- Human-in-the-loop: interface for adjusters to correct reports; corrections used for retraining.
- Video support: slice video into keyframes for assessment.