AWS ML ★ 85 4 min

Enhancing industrial safety AI with synthetic data on Amazon SageMaker AI

Advanced (300)Amazon SageMaker AITechnical How-to

🔗 https://aws.amazon.com/blogs/machine-learning/enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai/

📌 AWS 用 Diffusion 模型「P 圖」,人員偵測 mAP50 衝高 160%

TL;DR:AWS 用擴散模型在真實影像中合成插入人物,解決工業安全偵測最缺的危險場景訓練資料。

在礦場、工地、農場這些部署自主機具的場域,最需要模型能準確辨識「人站在機具危險範圍內」的那一刻。問題是,這種場景在真實資料裡最稀有,同時也是最危險、最不該為了收集資料而刻意重演的場景。AWS 一篇技術部落格提出用合成資料打破這個兩難。

🤔 越危險的場景,越沒有訓練資料

部署自主設備的產業(農業、營建、礦業、製造業)需要可靠的人員偵測模型,但高風險場景,例如工人站在機具死角、孩童靠近移動中的機具,正是真實資料集裡最罕見的樣本,也是最危險、最不適合實地拍攝收集的樣本。這讓邊緣部署的偵測模型在最關鍵的場景上,長期缺乏足夠訓練訊號。

🧩 不是憑空生成場景,而是在真實影像上「編輯」插入人物

AWS 的 pipeline 分兩階段:照片級真實感影像生成、自動標註。關鍵設計是編輯既有的真實影像,而非從頭生成全合成場景,這樣能保留背景真實度、避免 domain gap(模型在合成場景訓練、套用到真實影像時的效能落差),也讓原本機具的標註維持有效。

具體作法是把 Qwen-Image-Edit-2509 擴散模型部署在 Amazon SageMaker AI 的 ml.g5.12xlarge 執行個體上(4 張 NVIDIA A10G GPU,總計 96GB VRAM)。模型接收結構化的 prompt,在已有機具、但沒有人的真實影像上插入合成人物,同時保留原始場景的光線與比例。這個模型有 60 層 transformer,需要自訂 device map 把層分散到多張 GPU 上,官方建議盡量避免跨裝置通訊,若要更有效率,可改用單張大 VRAM GPU(例如 ml.p5.4xlarge 上的 NVIDIA H100)或搭配權重量化,團隊估計這樣每張影像的推論成本可望降低約 10 倍,但這項數字尚未實測驗證。

標註端則透過 Amazon Rekognition 的 DetectLabels API,信心門檻設定 80%,偵測到的邊界框以 IoU 門檻 0.5 的非極大值抑制(NMS)去重,再轉換成 YOLO 格式,並與原始影像既有的機具標註合併,整套流程不需要人工標註合成影像。

📊 三組實驗,把合成資料當超參數來調

  • 放置策略消融實驗(YOLO11-nano,1,000 張合成影像):把人物放在「危險位置」讓 person mAP50 從 0.051 翻倍到 0.106,反觀放在背景位置反而讓效能略微下降。結論是,生成內容放在哪裡,比場景如何變化(例如光線、時段)更重要。
  • 合成資料量掃描(250 至 1,000 張,固定危險位置放置、YOLO11-nano):效能在 750 張時達到高峰,person mAP50 較基準線提升 160%(從 0.051 到 0.134)。超過這個量,累積的生成瑕疵(例如臉部模糊、過度飽和)反而讓偵測定位信心與覆蓋率雙雙下降。
  • 模型容量掃描(5 種 YOLO11 規模,1,000 張合成影像):YOLO11-medium 拿下最佳整體表現(0.604 mAP50)與最高人員召回率(0.340,較基準線翻倍);而 5,700 萬參數的 XLarge 模型反而退步到不如 Nano+合成資料的組合,顯示在僅約 4,200 張訓練影像的規模下,容量太大的模型難以被有效正則化。

💡 「插對地方」比「場景多樣化」更關鍵

這幾組實驗共同指向一個結論:合成資料的價值不在於場景變化夠不夠多,而在於是否把人物放在與領域相關的真實危險位置。同時,合成資料量與模型容量都應該被當作需要驗證的超參數,而不是「越多越好、越大越好」。

🎯 實務啟示

對正在打造邊緣部署偵測模型的工程團隊來說,這套 in-place 影像編輯搭配自動標註的思路值得參考:比起從零生成合成場景,編輯真實影像能更有效避免 domain gap;而合成資料量與模型規模的最佳點,需要靠實驗掃描找出來,而非一味放大。

🔗 來源

#SyntheticData #ComputerVision #IndustrialSafety #ObjectDetection #DiffusionModel #AmazonSageMaker #YOLO #EdgeAI #MachineLearning #AWS

原始資料 AWS ML · 收集於 2026-09-17
來源原標題
Enhancing industrial safety AI with synthetic data on Amazon SageMaker AI
作者
Dimitri Voytan
原始標籤
Advanced (300) · Amazon SageMaker AI · Technical How-to
原始連結
https://aws.amazon.com/blogs/machine-learning/enhancing-industrial-safety-ai-with-synthetic-data-on-amazon-sagemaker-ai/

摘要原文

Industrial 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. In this post, we show how to use a synthetic data augmentation pipeline built on Amazon SageMaker AI and Amazon 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. Industrial 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: These challenges leave edge-deployed models with insufficient training signal for person detection in the exact scenarios where detection failures have the most severe consequences. This section describes our end-to-end synthetic data augmentation pipeline, which operates in two stages: photo-realistic image generation and automated labeling. Our solution is an end-to-end synthetic data augmentation pipeline that generates labeled training images without manual annotation. The pipeline operates in two stages: In 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. We 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: The 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. Each 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. This 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. This section covers the model deployment configuration, the synthetic image generation methodology, and the automated annotation pipeline. The Qwen-Image-Edit-2509 model is deployed on Amazon SageMaker AI with the following configuration: The 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. The 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: Our 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. Each 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: We used an OpenImages subset as a publicly shareable analog to our customer’s industrial equipment dataset: We evaluated the impact of synthetic data augmentation across three dimensions: prompt placement strategy, synthetic data volume, and model capacity. We 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. Our 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. Takeaway: 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. To 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: Takeaway: 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. To explore the impact of model capacity, we swept YOLO11 across five model scales with 1,000 synthetic images (hazardous placement with no scene variation): Takeaway: 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. The combined pipeline improvements are particularly significant for safety: The 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.

由 claude-code/sonnet 自動生成