Aircraft Type Image Vetting Worker
The ICAO Image Vetting service is an automated serverless image-processing pipeline responsible for validating, cropping, scoring, and persisting aircraft imagery. The system is designed to run as an event-driven AWS Lambda worker triggered via SQS, performing computer-vision inference using an ONNX YOLOv8 model and storing processed assets in S3 while recording metadata in DynamoDB.
- SQS event triggers Lambda handler
- Image downloaded and hashed
- Duplicate hash checked in DynamoDB
- Aircraft detected using YOLOv8 ONNX model
- Image cropped, resized, and composition-scored
- Approved images stored in S3 (multi-size variants)
- Metadata persisted to DynamoDB
The Lambda handler processes SQS records, parses message payloads, and invokes the pipeline orchestrator.
- Parses SQS message JSON payload
- Calls
process_record() - Logs approval / rejection outcomes
- Rejects malformed events safely
Core workflow controller responsible for coordinating all processing stages.
- Downloads source image
- Performs duplicate hash validation
- Executes detection and cropping pipeline
- Uploads processed image variants to S3
- Writes resulting metadata to DynamoDB
Runs YOLOv8 inference using ONNX Runtime to detect aircraft bounding boxes.
- Loads ONNX model via CPUExecutionProvider
- Preprocesses image into model input tensor
- Filters predictions using configurable confidence threshold
- Returns best aircraft detection candidate
Calculates composition quality metrics to determine whether an image meets publishing standards.
- Evaluates aircraft area ratio vs. image
- Measures center offset alignment
- Generates composition score for approval logic
- Uploads processed images to S3
- Handles multipart chunked uploads
- Supports JSON retrieval utilities
- Manages bucket routing via environment configuration
- Serializes Python objects to DynamoDB AttributeValues
- Stores processed image metadata
- Supports duplicate image hash detection
- Ensures normalized storage formats
System behavior is configured through environment variables and centralized config definitions.
- DynamoDB table name and S3 bucket configuration
- Minimum crop size thresholds
- Image size variant definitions (Full, Medium, Thumbnail)
- YOLO model path and detection thresholds
- Fully event-driven serverless architecture
- Stateless Lambda processing nodes
- Deterministic image normalization pipeline
- Automated duplicate detection via hashing
- Computer-vision-driven quality enforcement