{"slug": "enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai", "title": "Enhancing industrial safety AI with synthetic data on Amazon SageMaker AI", "summary": "A synthetic data augmentation pipeline built on Amazon SageMaker AI and Amazon Rekognition improved person-detection mAP50 by up to 160 percent for industrial safety models without manual annotation or hazardous photography, according to an Amazon Machine Learning blog post. The two-stage pipeline uses the diffusion model Qwen-Image-Edit-2509 to insert synthetic people into real scene images and the Amazon Rekognition DetectLabels API to generate bounding-box labels automatically. The approach targets training-data scarcity for high-risk edge cases in agriculture, construction, mining, and manufacturing, where manual annotation costs an estimated $3–$5 per image and teams typically process about 2,000 images per day.", "body_md": "## [Artificial Intelligence](https://aws.amazon.com/blogs/machine-learning/)\n\n# Enhancing industrial safety AI with synthetic data on Amazon SageMaker AI\n\nIndustrial safety AI refers to the use of technologies like computer vision and predictive analytics to find and stop workplace dangers. Synthetic data augmentation is emerging as a practical solution to one of the hardest problems in industrial safety AI: the scarcity of training images depicting people in dangerous proximity to heavy machinery. Industries deploying autonomous equipment (for example, agriculture, construction, mining, and manufacturing) need reliable person-detection models. However, the highest-risk scenarios (for example, a worker standing in a blind spot, a child near a moving implement) are precisely the ones that are rarest in real-world datasets. They are also the most dangerous to stage for data collection.\n\nIn this post, we show how to use a synthetic data augmentation pipeline built on [Amazon SageMaker AI](https://aws.amazon.com/sagemaker/) and [Amazon Rekognition](https://aws.amazon.com/rekognition/) to generate photo-realistic training images with automated labels. Our experiments showed up to 160 percent improvement in person detection mAP50 (mean Average Precision at an Intersection over Union threshold of 0.5) without manual annotation or hazardous photography sessions.\n\n## The challenge: Training data scarcity for safety-critical edge cases\n\nIndustrial companies developing AI-powered safety systems for heavy machinery face a critical bottleneck. They need thousands to millions of training images showing people in dangerous positions near equipment to train object detection models that can help prevent accidents. However, this data is extremely difficult to obtain:\n\n- **Safety and ethics:** Deliberately placing people, including vulnerable populations such as children, near active machinery for photography is unsafe, unethical, and often impractical.\n- **Rarity of real events:** The hazardous scenarios that matter most (a person standing on tracks, climbing on equipment, or in the path of a vehicle) are the rarest in naturally collected datasets. This creates severe class imbalance.\n- **Cost and scale:** Manual data collection and annotation can cost an estimated $3–$5 per image and scales poorly, with annotation teams typically processing on the order of 2,000 images per day.\n- **Edge deployment constraints:** Detection models must run on edge devices co-located with equipment (cameras mounted on tractors, forklifts, or railcars), constraining model size to lightweight architectures where every training example matters disproportionately.\n\nThese challenges leave edge-deployed models with insufficient training signal for person detection in the exact scenarios where detection failures have the most severe consequences.\n\n## Solution architecture\n\nThis section describes our end-to-end synthetic data augmentation pipeline, which operates in two stages: photo-realistic image generation and automated labeling.\n\n### Overview of the two-stage synthetic data generation framework\n\nOur solution is an end-to-end synthetic data augmentation pipeline that generates labeled training images without manual annotation. The pipeline operates in two stages:\n\n1. **Photo-realistic synthetic image generation** – A diffusion-based model (Qwen-Image-Edit-2509) hosted on Amazon SageMaker AI inserts synthetic people into real scene images while preserving background, lighting, and scale.\n2. **Automated labeling** – The Amazon Rekognition DetectLabels API automatically generates bounding-box annotations for the inserted people, alleviating manual annotation.\n\nIn our approach, we edit real images rather than generating entirely synthetic scenes from scratch. This preserves background fidelity, avoids domain gap, and allows existing equipment annotations to remain valid. Domain gap is the performance drop that occurs when a model trained on one data distribution, such as fully synthetic scenes, is applied to real-world images. The diffusion model’s scene understanding produces contextually coherent insertions with realistic lighting and proportions.\n\n### Stage 1: Photo-realistic synthetic image generation\n\nWe deploy the Qwen-Image-Edit-2509 diffusion model on Amazon SageMaker AI using an `ml.g5.12xlarge` instance (4× NVIDIA A10G GPUs, 96 GB total VRAM). The model receives a structured prompt specifying:\n\n- **Object to insert:** A person with randomized gender for demographic diversity.\n- **Placement strategy:** Hazardous positioning relative to equipment (for example, on tracks, on top of equipment, hanging from edges, or standing in a vehicle’s path).\n- **Constraints:** No distortion of existing elements, sharp focus, and realistic integration with the scene.\n\nThe model edits real images containing equipment but no people as substrates, inserting synthetic people while preserving the original scene context, lighting, and scale. This in-place editing approach avoids the domain gap issues that plague fully synthetic scene generation.\n\n### Stage 2: Automated labeling with Amazon Rekognition\n\nEach generated image is processed through the Amazon Rekognition DetectLabels API with a minimum confidence threshold of 80 percent. Detected bounding boxes are deduplicated by using non-maximum suppression (NMS) with IoU threshold > 0.5 and converted to YOLO format. These pseudo-labels (machine-generated annotations produced automatically in place of human labeling) are merged with existing equipment annotations from the original image.\n\nThis automated labeling alleviates manual annotation for synthetic images while maintaining label quality sufficient for training edge-deployed detectors. The synthetic images and their automated annotations are combined with real training data to form the final training set. Pre- and post-processing steps (image filtering, image resizing, prompt assembly, and label processing) allow the pipeline to run as an automated workflow.\n\n## Implementation details\n\nThis section covers the model deployment configuration, the synthetic image generation methodology, and the automated annotation pipeline.\n\n### Technical setup and configuration\n\nThe Qwen-Image-Edit-2509 model is deployed on Amazon SageMaker AI with the following configuration:\n\n- **Instance type:**`ml.g5.12xlarge` (4× NVIDIA A10G GPUs, 96 GB total VRAM).\n- **Model size:** approximately 60 GB unquantized weights distributed across 4 GPUs.\n- **Inference steps:** 25.\n- **CFG scale:** 4.0.\n- **Minimum image dimension:** 512 px.\n- **Generation time:** ~166 seconds per image.\n\nThe model requires a custom device map that distributes its 60 transformer layers across the available GPUS. For efficient inference, we recommend avoiding cross device communication. Deploy on a single gpu with sufficient VRAM, such as the NVIDIA H100 GPU provided by ml.p5.4xlarge instances, or employ weight quantization techniques. We project that inference cost per image will drop around 10x using such hardware, but this measurement is not yet validated.\n\n### Synthetic human insertion methodology\n\nThe pipeline selects real training images that contain locomotives but no people as editing substrates. For each image, the diffusion model receives a structured prompt. Here is an example prompt structure:\n\nOur experiments revealed a critical finding: prompt-guided placement is the single most important factor for downstream detection performance. Instructing the model to place people in domain-relevant hazardous positions doubled person detection mAP50, while placing people in the background actually degraded performance.\n\n### Amazon Rekognition integration for automated annotation\n\nEach generated image is processed through the Amazon Rekognition DetectLabels API. The model computes bounding boxes for humans using the query words: person, human, man, woman, boy, girl, child, adult, people. This automates label creation at scale. We use:\n\n- **Minimum confidence threshold:** 80 percent.\n- **Post-processing:** Non-maximum suppression (NMS) with IoU threshold > 0.5.\n- **Label format:** Bounding boxes converted to YOLO format and merged with existing equipment annotations.\n\n### Dataset composition\n\nWe used an [OpenImages](https://storage.googleapis.com/openimages/web/index.html) subset as a publicly shareable analog to our customer’s industrial equipment dataset:\n\n- **Real training images:** approximately 3,200 images from OpenImages containing trains (as a proxy for heavy machinery).\n- **Synthetic augmentation:** Up to 1,000 additional images with synthetically inserted people.\n- **Test set:** Real OpenImages images only (no synthetic data), filtered to contain at least one locomotive.\n- **Task:** 2-class detection (person and train) with severe class imbalance.\n\n## Results and performance improvements\n\nWe evaluated the impact of synthetic data augmentation across three dimensions: prompt placement strategy, synthetic data volume, and model capacity.\n\n### Evaluation methodology\n\nWe evaluated our pipeline using YOLO11 as a representative edge-deployable detector family, trained on Amazon SageMaker AI with PyTorch 2.1.0. Models were trained with image size 640, early stopping (patience 50), and a maximum of 500 epochs.\n\n### Key finding 1: Domain-relevant placement doubles detection performance\n\nOur prompt ablation study with YOLO11-nano compared four synthetic data conditions against a real-data-only baseline. We used 1,000 synthetic images in each scenario. The following table shows key performance metrics for each scenario.\n\n| **Condition** | **Person mAP50** | **Person Recall** | **Person Precision** | **Agg mAP50 (Person and Train)** | \n| Baseline (real only) | 0.051 | 0.170 | 0.338 | 0.517 | \n| **Hazardous placement** | **0.106** | 0.234 | 0.409 | 0.558 | \n| Hazardous + scene variation | 0.088 | 0.128 | 0.492 | 0.547 | \n| Background placement | 0.046 | 0.219 | 0.217 | 0.527 | \n| Background + scene variation | 0.051 | 0.085 | 0.421 | 0.532 | \n\nTakeaway: What the model generates (a person in a domain-relevant position) matters far more than how the scene is varied around it (for example, ambient condition or time of day). Hazardous placement doubled person mAP50 (from 0.051 to 0.106), while background placement slightly degraded it.\n\n### Key finding 2: Optimal synthetic volume is a hyperparameter\n\nTo explore the impact of synthetic data volume on detection performance, we swept the number of synthetic images from 250-1,000 while keeping the person placement condition and model size constant (hazardous placement with no scene variation, YOLO11-nano). The following table shows key performance metrics for each scenario:\n\n| **Synthetic Images** | **Person mAP50** | **Person Recall** | **Agg mAP50 (Person and Train)** | \n| 0 (baseline) | 0.051 | 0.170 | 0.517 | \n| 250 | 0.069 | 0.170 | 0.540 | \n| 500 | 0.092 | 0.213 | 0.556 | \n| **750 (best)** | **0.134** | **0.213** | **0.597** | \n| 1,000 | 0.106 | 0.234 | 0.558 | \n\nTakeaway: In our experiments, performance peaked at 750 synthetic images with 160 percent improvement in person mAP50 over baseline (from 0.051 to 0.134). Beyond this point, accumulated generation artifacts (for example, garbled faces and over-saturation) introduced noise that degraded both localization confidence and detection coverage. Treat synthetic data volume as a hyperparameter to validate, not maximize.\n\n### Key finding 3: Match model capacity to dataset size\n\nTo explore the impact of model capacity, we swept YOLO11 across five model scales with 1,000 synthetic images (hazardous placement with no scene variation):\n\n| **Model** | **Parameters** | **Person mAP50** | **Person Recall** | **Agg mAP50 (Person and Train)** | \n| Nano (baseline) | 2.6M | 0.051 | 0.170 | 0.517 | \n| Nano + synth | 2.6M | 0.106 | 0.234 | 0.558 | \n| Small + synth | 9.4M | 0.135 | 0.170 | 0.591 | \n| **Medium + synth** | **20.1M** | 0.135 | **0.340** | **0.604** | \n| Large + synth | 25.3M | **0.142** | 0.244 | 0.584 | \n| XLarge + synth | 56.9M | 0.093 | 0.149 | 0.551 | \n\nTakeaway: YOLO11-medium achieved the best aggregate performance (0.604 mAP50) and the highest person recall (0.340), doubling recall compared to the baseline. The 57M-parameter XLarge model regressed below the Nano+synth result, demonstrating that with only approximately 4,200 training images, there is insufficient data to regularize a model of that capacity.\n\n### Significance for safety-critical applications\n\nThe combined pipeline improvements are particularly significant for safety:\n\n- **Person recall doubled** from 17 percent to 34 percent with medium-capacity model, meaning the system detected twice as many people in hazardous positions.\n- **Aggregate detection maintained:** Train mAP50 remained stable (0.73–0.79 range) across all conditions.\n- **Edge-deployable:** All improvements achieved with a 20M-parameter model suitable for real-time inference on edge hardware.\n\n## Cost and efficiency benefits\n\nThe synthetic data pipeline delivers significant cost, safety, and speed advantages over manual data collection. In the following sections, we compare the two approaches, outline scalability benefits, and summarize time-to-deployment improvements.\n\n### Synthetic generation compared to manual collection and annotation\n\nBeyond per-image cost savings, the pipeline provides structural advantages that compound as teams scale their training data efforts. The following table compares the synthetic data augmentation pipeline with the manual approach across five different dimensions.\n\n| **Factor** | **Manual Approach** | **Synthetic Pipeline** | \n| **Per-image cost** | $3–$5 (collection + annotation) | $0.33 assuming ~166s GPU inference ($7.09/hour for ml.g5.12xlarge instance) + Amazon Rekognition DetectLabels API call ($0.001/image) | \n| **Safety risk** | Requires staging dangerous scenarios | Alleviated physical risk | \n| **Annotation labor** | Manual bounding box drawing | Fully automated through Amazon Rekognition | \n| **Rare scenarios** | Years of natural occurrence | Unlimited generation on demand | \n| **Scalability** | ~2,000 images/day with teams | Bounded only by compute budget | \n\n### Scalability advantages\n\n- **Unlimited scenario generation:** Produce training images for a wide range of hazardous position configurations that can be described in a text prompt.\n- **Modular prompt structure:** You can replace placement instructions for your specific domain (construction, agriculture, warehousing) while reusing the generation and pseudo-labeling infrastructure.\n- **Cloud-native architecture:** Built entirely on managed AWS services, requiring no custom infrastructure.\n\n### Time-to-deployment improvements\n\nBy alleviating manual data collection and annotation, the pipeline shortens the path from identifying a training data gap to having labeled images ready for model training. This reduces the timeline from weeks or months to hours. The infrastructure is reusable: After set up, generating additional training data for new scenarios requires only new prompt templates.\n\n## Getting started\n\nThe code for this solution is available in our [GitHub repository](https://github.com/aws-samples/sample-synthetic-data-augmentation). To deploy the solution in your own environment, follow the instructions in the following sections.\n\n### Repository structure\n\nThe [GitHub repository](https://github.com/aws-samples/sample-synthetic-data-augmentation) contains the following directories and files:\n\n### Prerequisites\n\nBefore you start, you will need:\n\n- Python 3.11 (`>=3.11,<3.12` ) and[uv](https://docs.astral.sh/uv/) . We have tested with this Python version, but others might work.\n- An AWS account with credentials configured (`aws configure` , environment variables, or an AWS Identity and Access Management (IAM) role).\n- A GPU with 40 GB+ VRAM for the image-editing step (single H100/B200), or a multi-GPU instance such as `ml.g5.12xlarge` (4× A10G) for the sharded path. The pipeline is set up to run on Amazon SageMaker AI.\n- Amazon SageMaker AI GPU service quota. New accounts have a quota of 0 for GPU training instances (for example, `ml.g5.12xlarge` ). Request an increase in the AWS Service Quotas console before launching jobs. Otherwise, jobs will fail or sit pending.\n- Amazon Rekognition access (`rekognition:DetectLabels` ): A billable AWS service used to auto-label the synthetic people.\n- Hugging Face access to download the `Qwen/Qwen-Image-Edit-2509` model weights (downloaded automatically on first run).\n\n### Usage\n\nFollow instructions for steps 1–6 of the *Usage* section in README.md:\n\nFrom the README’s Usage section:\n\n1. **Download OpenImages Data** : Create an Amazon Simple Storage Service (Amazon S3) bucket, then run`data_prep/download_openimages.py` to copy Train-class images (train/validation/test splits) from the public OpenImages Amazon S3 mirror into your bucket. Images only, no labels yet.\n2. **Stage Annotation CSVs** : Copy the four OpenImages annotation CSVs (cached locally by step 1) up to`s3://<amzn-s3-demo-bucket>/datasets/openimages/annotations/` , because steps 3 and 4 read them from there.\n3. **Create YOLO Dataset** : Run`data_prep/create_yolo_dataset.py` to reorganize the downloaded images into YOLO’s`images/` and`labels/` directory structure and generate`data.yaml` /`data-with-synthetic.yaml` , using the staged CSVs to build labels.\n4. **Generate Synthetic Data** : Use`qwen_image_edit/generate_synthetic.py` (interactively through`generate.ipynb` , as a batch script, or launched as an Amazon SageMaker AI job by using`launch_generation.py` ) to add synthetic people to train images with Qwen-Image-Edit-2509 and pseudo-label them with Amazon Rekognition. Produces a complete augmented dataset under`--dataset-prefix` with its own`data.yaml` .\n5. **Train YOLO Model** : Run`yolo_training/launch_training.py` twice: once on the step-3 baseline prefix (original images only) and once on the step-4 output prefix (original + synthetic), to produce a baseline and a synthetic-augmented model.\n6. **Evaluate** : Use the scripts in`evaluation/` (`download_testdata.py` ,`run_eval.py` ,`extract_per_class.py` ,`compare_results.py` ) to validate both trained models on the held-out test set and compare whether synthetic augmentation improved detection.\n\nThe pipeline is designed to be domain-agnostic. Whether your use case involves construction sites, agricultural equipment, manufacturing floors, or warehouse operations, the same architecture applies with domain-specific prompt templates.\n\n### Clean up\n\nAfter you’re done experimenting, remove the following resources to avoid ongoing charges. Amazon SageMaker AI training and processing jobs and Amazon Rekognition API calls are billed only while they run, and they stop accruing cost automatically. However, a few resources persist until you delete them:\n\n1. Stop or delete any running Amazon SageMaker AI notebook instance (step 4’s interactive `generate.ipynb` path).\n2. Delete the Amazon S3 bucket contents (and the bucket) if no longer needed. All datasets, annotation CSVs, synthetic images/labels, and training outputs live under the bucket you created in step 1.\n3. Remove the Amazon SageMaker AI execution role (optional). IAM roles have no cost on their own, so this step is about hygiene/security rather than billing.\n\n## Conclusion\n\nWe presented a practical, end-to-end pipeline for synthetic data augmentation that addresses the critical training data scarcity challenge in industrial safety AI. The pipeline combines diffusion-based image editing on Amazon SageMaker AI with automated pseudo-labeling through Amazon Rekognition to generate photo-realistic, labeled training images without manual annotation or hazardous staging.\n\nOur controlled experiments yielded three actionable guidelines:\n\n1. Prompt for domain-relevant placement: Spatial positioning of synthetic objects relative to equipment is the dominant factor for detection improvement. Visual diversity (weather, lighting) is secondary.\n2. Validate synthetic volume: More synthetic data isn’t always better. Detection performance peaks at an optimal synthetic-data volume. Beyond that point, accumulated generation artifacts introduce noise that degrades the model.\n3. Match model capacity to data budget: With limited total training data, mid-sized edge models outperform both smaller and larger alternatives.\n\nThe result: a 160 percent improvement in person detection mAP50 and doubled recall for an edge-deployable model, achieved without manual annotation labor or dangerous data collection sessions.\n\nTo get started with this solution, visit our [GitHub repository](https://github.com/aws-samples/sample-synthetic-data-augmentation). To learn more about the services used in this post, see the following resources:\n\n- [Amazon SageMaker AI](https://aws.amazon.com/sagemaker/)\n- [Amazon SageMaker AI documentation](https://docs.aws.amazon.com/sagemaker/)\n- [Amazon Rekognition](https://aws.amazon.com/rekognition/)\n- [Amazon Rekognition documentation](https://docs.aws.amazon.com/rekognition/)", "url": "https://wpnews.pro/news/enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai", "canonical_source": "https://aws.amazon.com/blogs/machine-learning/enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai/", "published_at": "2026-09-17 15:28:08+00:00", "updated_at": "2026-09-17 15:54:59.934018+00:00", "lang": "en", "topics": ["computer-vision", "generative-ai", "ai-infrastructure", "ai-tools"], "entities": ["Amazon SageMaker AI", "Amazon Rekognition", "Qwen-Image-Edit-2509", "Amazon"], "alternates": {"html": "https://wpnews.pro/news/enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai", "markdown": "https://wpnews.pro/news/enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai.md", "text": "https://wpnews.pro/news/enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai.txt", "jsonld": "https://wpnews.pro/news/enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai.jsonld"}}