Damage Detection
Turqoa's damage detection system uses deep learning models to automatically identify and classify structural damage on shipping containers as they pass through the gate. The system captures images from multiple angles and produces a damage assessment that feeds directly into the decision engine.
14 Damage Categories
The damage detection model classifies damage into 14 standardized categories aligned with IICL (Institute of International Container Lessors) guidelines:
| # | Category | Description | Severity |
|---|---|---|---|
| 1 | Hole | Puncture or perforation in panel | High |
| 2 | Tear | Ripped or torn metal | High |
| 3 | Crack | Structural fracture in frame or panel | High |
| 4 | Major dent | Deformation > 25mm depth | High |
| 5 | Minor dent | Deformation < 25mm depth | Medium |
| 6 | Corrosion | Rust or oxidation on surface | Medium |
| 7 | Bent frame | Structural member misalignment | High |
| 8 | Door damage | Hinge, locking rod, or gasket failure | High |
| 9 | Floor damage | Visible floor deterioration or breach | High |
| 10 | Roof damage | Top panel deformation or puncture | Medium |
| 11 | Missing part | Absent component (corner casting, etc.) | High |
| 12 | Loose part | Detached but present component | Medium |
| 13 | Paint damage | Surface coating failure, scraping | Low |
| 14 | Graffiti | Unauthorized markings | Low |
Note: Severity levels are defaults. You can reclassify severity per category in your site configuration to match your terminal's policies.
Model Architecture
The damage detection system uses a two-stage architecture:
- Region Proposal Network (RPN) — Identifies candidate damage regions across the container surface
- Classification Network — Categorizes each proposed region into one of the 14 damage types and assigns a confidence score
Both stages run on a single GPU inference call, processing a full set of container images (4-6 views) in under 800 milliseconds.
Model Specifications
| Property | Value |
|---|---|
| Base architecture | EfficientDet-D4 with custom head |
| Input resolution | 1280 x 960 per image |
| Output | Bounding boxes + category + confidence |
| Inference time | 120-180 ms per image |
| GPU memory | 2.4 GB |
| Training data | 2.8M annotated container images |
| Minimum damage size | 50 x 50 pixels in source image |
Confidence Calibration
Damage detection confidence scores require careful calibration because the cost of false positives (unnecessary manual review) and false negatives (missed damage) varies by terminal:
# ~/.turqoa/sites/my-terminal/damage.yaml
damage:
confidence:
detection_threshold: 0.60 # Minimum confidence to report a damage instance
severity_override:
high: 0.50 # Lower threshold for high-severity categories
medium: 0.65
low: 0.75 # Higher threshold — don't flag minor cosmetic damage
aggregation:
method: max_severity # Decision based on worst detected damage
# Options: max_severity, weighted_sum, count_based
Calibration Workflow
- Deploy in shadow mode and collect damage assessments for 7+ days
- Have trained inspectors manually verify a sample of transactions
- Run the calibration analysis:
turqoa damage calibrate --site "my-terminal" --period 7d --sample-size 500
This produces a precision-recall curve for each category and recommends optimal thresholds.
Integration with Decision Engine
Damage detection results feed into the decision engine as structured data:
{
"damage": {
"detected": true,
"count": 2,
"max_severity": "high",
"instances": [
{
"category": "major_dent",
"severity": "high",
"confidence": 0.87,
"location": "left_panel",
"bbox": [120, 340, 280, 490],
"image_ref": "img/txn_abc123/left.jpg"
},
{
"category": "corrosion",
"severity": "medium",
"confidence": 0.72,
"location": "front_panel",
"bbox": [45, 100, 190, 210],
"image_ref": "img/txn_abc123/front.jpg"
}
]
}
}
Decision rules can reference any damage field:
rules:
- name: deny_severe_damage
priority: 10
when:
any:
- field: damage.max_severity
op: eq
value: high
- field: damage.count
op: gte
value: 5
then:
decision: review
reason: "Significant structural damage detected"
flags:
- damage_review_required
- name: accept_minor_cosmetic
priority: 200
when:
all:
- field: damage.max_severity
op: eq
value: low
- field: damage.count
op: lte
value: 2
then:
decision: approve
auto: true
notes: "Minor cosmetic damage only — within tolerance"
Custom Training
For terminals with unique container types or environmental conditions, Turqoa supports custom model fine-tuning:
Preparing Training Data
Export annotated images from your existing transactions:
turqoa damage export-training \
--site "my-terminal" \
--period 90d \
--min-operator-reviews 100 \
--output ./training-data/
The export includes:
- Source images with bounding box annotations
- Operator-verified labels (from manual review corrections)
- Metadata (camera, lighting conditions, container type)
Running Fine-Tuning
turqoa damage train \
--base-model turqoa-damage-v3 \
--training-data ./training-data/ \
--validation-split 0.2 \
--epochs 50 \
--output ./models/damage-custom-v1
Deploying Custom Models
damage:
model: ./models/damage-custom-v1 # Path to custom model
fallback_model: turqoa-damage-v3 # Fallback to base model on error
Warning: Custom models should be validated against a held-out test set before production deployment. Use
turqoa damage evaluate --model ./models/damage-custom-v1 --test-data ./test-set/to measure performance.