Effect of hierarchical prompt engineering on convolutional neural networks generated by large language models for helmet wearing compliance classification
Abstract Non-compliance with Personal Protective Equipment (PPE) use regulations, particularly helmet wearing, remains a critical occupational safety challenge in high-risk industrial environments. This study investigates how hierarchical prompt engineering shapes the quality of Convolutional Neural Networks (CNNs) generated by Large Language Models (LLMs) for image-level helmet-wearing compliance classification (helmet vs. no-helmet) as a mechanism for PPE compliance monitoring. Four LLMs (ChatGPT, Claude, Gemini, and Grok) produced executable PyTorch scripts across three prompt tiers of increasing specificity. These configurations were evaluated over 20 independent runs on a purpose-built dataset of 972 balanced images, using six classification metrics, four prompt quality metrics, and three resource efficiency dimensions. Ten of the twelve configurations converged to a high-performance plateau (accuracy 0.957-−0.967, AUC 0.985-−0.993). Claude at Tier 1 achieved the highest accuracy (0.967) and the lowest CPU usage (12.2%), whereas the best-calibrated (lowest-loss) pipelines were produced by Gemini and Grok at Tier 1 (test loss 0.127 and 0.142), reflecting an accuracy–calibration dissociation that we analyze in detail. However, Gemini and Grok experienced catastrophic convergence failures at Tier 3 (accuracy $$\approx $$ 0.58), revealing that over-specification of architectural and training constraints can destabilize CNN generation even when the produced scripts are syntactically valid. Higher prompt specificity does not consistently improve accuracy or validity rate. Instead, LLM identity interacts strongly with the prompt tier and emerges as a more critical factor than prompt design alone, although each LLM–tier condition is represented by a single generated script.
- Link
- https://doi.org/10.1007/s44163-026-02501-8
- Found by
- Crossref
- Authors
- Jorge Parraga-Alava, Jorge Rodas-Silva, Jorge Antonio Párraga Álava, Jorge Rodas‐Silva
- Organizations
- Universidad Técnica de Manabí, Universidad Estatal de Milagro
- Categories
- evaluation, dataset
- Published
- 2026-10-17
- Last seen by the radar
- 2026-10-19
- Citations
- 0
- Influential citations
- 0
- Radar score
- 35.50 / 100 (how it is scored)
- Why it scored so
- Also found via Semantic Scholar; Also found via OpenAlex; Matched: dataset, evaluat; Primary record: Crossref
- Related links
- https://www.semanticscholar.org/paper/e7fbb6db506d2694ac2bcaa84da6da44a4b704cd