More detailed prompts did not yield better helmet classifiers: the most prescriptive tier dropped two LLMs to about 0.58 accuracy
Synopsis
ChatGPT, Claude, Gemini and Grok each generated PyTorch helmet-compliance training scripts from three prompt tiers of increasing specificity, run 20 times on 972 balanced images: ten of twelve configurations converged to a 0.957–0.967 accuracy plateau, but the most detailed tier left Gemini and Grok near 0.58, with scripts that ran yet failed to converge. A backbone-by-scheduler ablation traced the failure to the prescribed from-scratch multi-scale network, which collapsed under both schedulers while a pretrained ResNet18 converged under either.
Interpretation
Training scripts for helmet-wearing compliance classifiers can come directly from large language models, and all four frontier models produced runnable, high-accuracy PyTorch pipelines under minimal constraint. Designing such CNN training pipelines for PPE vision monitoring previously depended on manual architectural decisions and exhaustive hyperparameter search, which is time-consuming and expert-intensive. On 972 balanced images with a 494-image held-out test set, the four models at the basic prompt tier reached 0.957–0.967 accuracy and 0.991–0.993 AUC, on the same plateau as hand-written ResNet50, EfficientNet-B0 and YOLOv8-nano classification baselines.
Greater prompt specificity did not reliably improve outcomes, and the most detailed tier stripped two generated pipelines of discriminative ability. More structure was expected to improve generated-code correctness and downstream performance, yet executability stayed at 100% across tiers while convergence success fell from 100% at Tiers 1 and 2 to 50% at Tier 3. Gemini and Grok at Tier 3 reached 0.576 and 0.591 accuracy, near the 0.5 chance level of a balanced binary task, with AUC falling to 0.651 and 0.663 and performance gains of -0.3854 and -0.3705 against the 0.9613 Tier 1 reference.
The failure came from the literally implemented from-scratch multi-scale architecture, not from prompt length or the learning-rate scheduler alone. The converging ChatGPT and Claude silently substituted a pretrained ResNet18 backbone at Tier 3, whereas the failing Gemini and Grok built the specified from-scratch 32-to-64-to-128-to-256 network with parallel 3x3 and 5x5 paths. In a 2x2 ablation crossing backbone with scheduler, the pretrained backbone reached 0.945 and 0.947 accuracy under CosineAnnealingLR and ReduceLROnPlateau, while the from-scratch multi-scale design reached 0.533 and 0.570.
Perspective
The conclusions rest on single-subject, image-level helmet versus no-helmet classification over 972 balanced images, with all training and inference on an Apple M3 CPU and no GPU acceleration. The comparison baselines are author-written shallow CNN, ResNet50, EfficientNet-B0 and a YOLOv8-nano classification head, all evaluated on the same 494-image test set. The authors state that these results do not constitute a validated industrial monitoring system, since real deployments involve multiple workers, occlusion and variation in illumination, viewpoint and helmet design, which require field validation.
Each model-by-tier cell corresponds to a single generated script, so the 20 replications capture training stochasticity, and the interaction conclusions describe the scripts obtained during the collection window rather than stable provider properties. Prompt clarity is a three-rater human score, and the specificity score is an unweighted count of explicit technical constraints. The three fixed tiers leave intermediate specifications unexplored, and the 972-image dataset may mask tier differences under more complex visual conditions.
