A safety helmet wearing detection method in a complex environment based on YOLOv11 improvement
By improving the MAS module, C2MCA module, and DEGNHead detection head of YOLOv11, the robustness and real-time performance issues of safety helmet detection in complex environments have been resolved, achieving high-precision, low-complexity safety helmet wearing detection, which is suitable for scenarios such as smart construction sites.
Patent Information
- Application Number
- CN202610013556.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-07
- Publication Date
- 2026-07-03
AI Technical Summary
Most existing studies focus on optimizing a single module or specific structure of the model, lacking overall collaborative optimization design for backbone feature extraction, feature fusion, and prediction detection head. This results in insufficient robustness of helmet detection in complex environments, limited feature representation level, and difficulty in balancing real-time performance and accuracy.
A YOLO-MSF model was constructed by replacing the C3k2 module in the backbone network with the MAS module and the C2PSA module in the feature enhancement layer with the C2MCA module. A DEGNHead detection head was also designed to achieve systematic optimization of feature extraction, fusion, and detection. The MAS module enhances multi-scale feature representation through a hybrid aggregation network and star multiplication operations. The C2MCA module performs progressive feature optimization by cascading multiple sub-modules. The DEGNHead improves detection accuracy and stability through deconvolution and group normalization.
It significantly enhances the model's detection performance in multi-scale, occluded, lighting-variable, and dense target scenarios, while maintaining real-time inference capabilities, reducing model complexity, improving resource utilization efficiency, and providing a feasible technical path for intelligent construction site safety supervision systems.
Smart Images

Figure CN122336658A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and artificial intelligence technology, specifically relating to a method for detecting helmet wearing in complex environments based on an improvement of YOLOv11. Background Technology
[0002] With the continuous improvement of deep learning theory and the rapid development of computer vision technology, deep learning-based object detection methods have been widely applied in fields such as information perception, object detection, and intelligent recognition, significantly improving the performance of safety helmet detection technology. To address practical needs such as complex environments, small targets, and real-time detection, researchers have proposed various improvement methods focusing on detection accuracy, inference speed, and model lightweighting, including accuracy enhancement strategies based on a two-stage detection framework and real-time optimization schemes for a single-stage detection framework.
[0003] Among numerous detection frameworks, the YOLO series of models, due to their end-to-end single-stage detection structure, achieves a good balance between detection accuracy and real-time performance, and has gradually become the mainstream technical approach in helmet detection research. Existing research mainly focuses on improving the YOLO architecture in terms of feature representation enhancement, lightweight optimization, multi-scale target detection, and the introduction of attention mechanisms to enhance the accuracy and practicality of helmet detection in complex scenarios.
[0004] However, most existing studies focus on optimizing a single module or specific structure of the model, lacking a holistic and collaborative optimization design for backbone feature extraction, feature fusion, and predictive detection heads. When facing industrial environments with varying lighting, dense occlusion, complex backgrounds, and diverse personnel distribution, problems may still arise such as insufficient detection robustness, limited feature representation levels, or difficulty in balancing real-time performance and accuracy. Summary of the Invention
[0005] The purpose of this invention is to provide a helmet-wearing detection method for complex environments based on an improved version of YOLOv11. This method addresses the issue that most existing research focuses on optimizing a single module or specific structure of the model, lacking a holistic, collaborative optimization design for core feature extraction, feature fusion, and predictive detection heads. In industrial environments with varying lighting, dense occlusion, complex backgrounds, and diverse personnel distribution, problems may still arise such as insufficient detection robustness, limited feature representation, or difficulty in balancing real-time performance and accuracy.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a helmet-wearing detection method based on YOLOv11 in complex environments, comprising the following steps: S1. Dataset Construction and Preprocessing: Obtain a helmet detection dataset containing positive and negative samples. Positive samples represent helmet wearers, while negative samples represent helmetless individuals or ordinary heads. Randomly divide the dataset into training, validation, and test sets in a 7:1:2 ratio to form a complete helmet detection dataset. S2. Constructing the YOLO-MSF model network architecture: The YOLO-MSF model is constructed and trained on the safety helmet detection dataset in S1. The YOLO-MSF model is based on YOLOv11n, replacing the C3k2 modules in the backbone network and neck network with MAS modules; replacing the C2PSA module in the feature enhancement layer with the C2MCA module; and using the DEGNHead detection head. S3. Set training parameters and iterative training: Set training parameters, use the safety helmet detection training set to iteratively train the YOLO-MSF model, and optimize the model hyperparameters by combining the validation set to obtain the detection model with the best performance; S4. Detection using the trained model: Input the image to be tested into the best-performing detection model in S3 for inference, automatically identify and detect the target in the image to be tested, and output the detection result of whether a safety helmet is worn.
[0007] According to the helmet wearing detection method in complex environments based on YOLOv11 provided by the present invention, the MAS module takes the input feature map as the starting data and first completes the initial compression and basic mapping of the feature channels through a linear convolution. Then, the intermediate features are fed into ordinary convolution branches and depthwise separable convolution branches to realize cross-channel correlation learning and spatial geometric information extraction. Furthermore, the intermediate features are divided into two parts in the channel dimension: linear path and nonlinear recursive path. The linear path maintains the original information structure, while the nonlinear path undergoes a progressive feature update process through star multiplication operations. Multiplicative mapping replaces the traditional additive residual structure to form high-order feature interaction and implicit dimensional expansion. Afterward, the linear features, spatial features, and recursively enhanced semantic features from multiple branches are concatenated and fused, and the final features are output through compressed convolution to complete the unified representation and noise suppression of the module. The MAS module is used to replace the original C3k2 module in the later part of the network, while the C3k2 module in the earlier part remains unchanged.
[0008] According to the helmet wearing detection method in complex environments based on YOLOV11 provided by the present invention, in step S2, the MAS module adopts a progressive replacement strategy: the first two C3k2 modules of the backbone network and the neck network remain unchanged, while the middle and later C3k2 modules are replaced with MAS modules.
[0009] According to the helmet wearing detection method in complex environments based on YOLOv11 provided by the present invention, the processing flow of the C2MCA module in S2 is as follows: The C2MCA module realizes progressive feature optimization by cascading multiple sub-modules, including the DyT dynamic normalization module, the TSSA self-attention module, the Mona multi-cognitive visual adapter module, and the EDFFN frequency domain feedforward network module, to realize the processing flow of "stabilization - global perception - multi-scale extraction - re-stabilization - frequency domain enhancement - multi-level integration".
[0010] According to the helmet wearing detection method in complex environments based on YOLOv11 provided by the present invention, the DyT module achieves dynamic range adjustment and normalization stability improvement through scaling parameters and hyperbolic tangent function; the TSSA module performs global modeling based on second-order moment statistics to reduce computational complexity; the Mona module captures multi-scale spatial patterns through parallel 3×3, 5×5 and 7×7 depth-separable convolutional branches; and the EDFFN module transforms features to the frequency domain and selectively enhances high-frequency details through a learnable mask matrix.
[0011] According to the helmet wearing detection method in complex environments based on YOLOv11 provided by the present invention, the DEGNHead detection head in S2 improves the detection accuracy and prediction consistency of small targets by introducing deconvolution operation to restore the spatial resolution and fine-grained positional information of the feature map; and adopting a group normalization strategy combined with a shared convolution mechanism to process the data.
[0012] Compared with the prior art, the beneficial effects of the present invention are: This invention presents a high-performance construction site safety helmet detection method based on an improved YOLO-MSF. It systematically optimizes the method from three core levels: feature extraction, feature fusion, and detection prediction. This significantly enhances the model's detection performance in multi-scale, occluded, lighting-variable, and dense target scenarios. While maintaining real-time inference capabilities, it reduces model complexity, improves deployment flexibility and resource utilization efficiency, and provides a feasible technical path for building an intelligent, low-cost, and highly reliable construction site safety supervision system. Attached Figure Description
[0013] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating a helmet-wearing detection method for complex environments based on an improvement of YOLOv11.
[0014] Figure 2This is a schematic diagram of the improved YOLOv11 network YOLO-MSF structure, which is an improved method for detecting helmet wearing in complex environments based on YOLOv11.
[0015] Figure 3 This is a schematic diagram of the improved MAS module structure for a helmet wearing detection method in complex environments based on YOLOv11.
[0016] Figure 4 This is a schematic diagram of the improved C2MCA module structure for a helmet wearing detection method in complex environments based on YOLOv11.
[0017] Figure 5 This is a schematic diagram of the improved DEGNHead module structure, which is based on the YOLOv11-based method for detecting helmet wearing in complex environments.
[0018] Figure 6 This is a schematic diagram of the detection results of a helmet wearing detection method in complex environments based on the improved YOLOv11. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Please see Figure 1-6 The present invention provides the following technical solution: a method for detecting helmet wearing in complex environments based on YOLOv11 improvement, comprising the following steps: S1. Dataset Construction and Preprocessing: The publicly available SHWD (Safety Helmet Wearing Dataset) dataset was selected. This dataset provides over 7,500 images and over 120,000 labeled objects, including positive samples (wearing helmets) and negative samples (not wearing helmets / ordinary head). This dataset covers a variety of scenes, climates, and lighting conditions, which is an important guarantee for improving the model's accuracy and generalization ability.
[0021] The dataset is processed as follows to form a complete and balanced safety helmet detection dataset: Data partitioning: The dataset is randomly partitioned according to a ratio of 7:1:2 for training set, validation set, and test set.
[0022] S2. Propose the YOLO-MSF model and construct its network architecture: Propose the YOLO-MSF (YOLO-Multi-Scale Feature Enhancement) model as follows: Figure 2 As shown, this model is based on the YOLOv11 framework and addresses its problems such as insufficient representation of small target features, imbalance between global and local information modeling, and loss of spatial details in the detection head by making three core structural improvements: MAS module, C2MCA module, and DEGNHead detection head.
[0023] Specifically, based on the overall architecture of the YOLOv11 network, this invention restructures the Backbone, Neck, and Head components using the following alternative structures: 1. Backbone and Neck improvements: Replace the C3K2 module in YOLOv11 with the MAS module. Objective: To enhance the ability to represent multi-scale features and effectively alleviate the problem of confusion of small targets in complex backgrounds.
[0024] Implementation: Replace the C3k2 module used in the Backbone and Neck sections of the original YOLOv11 network with the MAS (Mixed Aggregation Star) module.
[0025] MAS Module Structure: It integrates the MANet hybrid aggregation network architecture and the StarBlock nonlinear reconstruction unit, which replaces the traditional ConvNeck.
[0026] Core Mechanism: Star Block employs "star multiplication" to achieve high-order nonlinear feature transformation and exponential implicit dimensional expansion through element-wise multiplication, providing a richer representation space for the small target features of the safety helmet.
[0027] 2. Replace the C2PSA module in YOLOv11 with the C2MCA module. Objective: To optimize context awareness and address issues such as imbalance between global and local information modeling and instability in normalization.
[0028] Implementation: Replace the original C2PSA module in YOLOv11 with the C2MCA (Cascade Multi-ContextAttention) module.
[0029] The C2MCA module consists of a cascaded DyT (Dynamic Tanh) module (which implements stable normalization independent of batch size), a TSSA (Token Statistics Self-Attention) module (which captures long-range dependencies in O(n) complexity), a Mona module (which implements multi-scale adaptation), and an EDFFN module (which enhances local detail information in the frequency domain).
[0030] Advantages: Dual DyT ensures numerical stability; TSSA (global) and EDFFN (local) complement each other; effectively compensates for the shortcomings of the original C2PSA in fine-grained modeling and long-range dependency capture.
[0031] 3. Improved Detection Head: Design of the DEGNHead Detection Head Objective: To improve the localization accuracy and training stability of small targets, and to solve the problems of spatial detail loss and unstable batch normalization (BN).
[0032] Implementation: Design a new detection head, DEGNHead (Detail-Enhanced Group-NormalizedHead).
[0033] DEGNHead structure: It integrates a deconvolution enhancement (DEConv) module (to restore spatial resolution and compensate for fine-grained location information), adopts group normalization (GN) instead of batch normalization (to achieve stable normalization independent of batch size), and combines learnable scale layers with a shared convolution mechanism (to reduce redundant parameters and enhance the consistency of multi-scale predictions).
[0034] S3. Set training parameters and iterative training: Set training parameters, use the training set divided in step one to iteratively train the YOLO-MSF model, and optimize the model by combining the validation set to obtain the detection model with the best performance.
[0035] Training environment and parameters: PyTorch framework was used for training, with an initial learning rate of 0.01, a batch size of 32, and a total of 150 training epochs. AdamW was selected as the optimizer for parameter tuning.
[0036] Model optimization: During training, the model's performance metrics were evaluated using a test set, including mAP@0.5, mAP@0.5:0.95, Recall, and Precision. The three major improvement modules—MAS, C2MCA, and DEGNHead—showed a good synergistic effect (as shown in Table 1).
[0037] Table 1 The complete model achieves 94.77% mAP@0.5, a 1.67% improvement over YOLOv11n.
[0038] The model achieves high-precision detection while maintaining a lightweight design (3.16M parameters), achieving the best accuracy-efficiency balance and meeting the deployment requirements of edge devices.
[0039] S4. Perform detection using the trained model: Model Deployment: Deploy the YOLO-MSF model trained in step three to edge devices or high-performance computing platforms.
[0040] Real-time inference: The model is used to detect images or video streams of safety helmets to be tested and outputs the detection results.
[0041] Detection advantages: The model exhibits excellent robustness in complex scenes such as dense, nighttime, multi-scale, and occluded environments. It can accurately identify whether workers in images are wearing safety helmets and output precise bounding box locations and categories.
[0042] In summary, the YOLO-MSF model constructed in this invention maintains high detection accuracy while effectively addressing the shortcomings of the traditional YOLO architecture in terms of resource efficiency, optimization of difficult samples, and adaptability to edge deployment, demonstrating significant technological advancement and practical engineering application value.
[0043] Specifically, based on the overall architecture of the YOLOv11 network, this invention proposes three core technical improvements to address the problems of insufficient small target feature representation, imbalance between global and local information modeling, and loss of spatial details in the detection head: (1) the MAS module performs Backbone and Neck feature enhancement design; (2) the C2MCA module performs context-aware optimization; and (3) the DEGNHead detection head performs detail enhancement and stable normalization design.
[0044] In this embodiment, the safety helmet wearing detection model of the present invention is still based on the standard input layer of the YOLOv11 network, the backbone feature extraction network, the Neck cross-scale feature fusion network, and the head detection prediction network in its overall structure. The input, inference process and output form are consistent with the original YOLO system. On this basis, some key feature processing units are optimized in a targeted manner to solve the problems of insufficient detection accuracy of small targets, feature contamination caused by complex backgrounds, and insufficient stability of the detection head in the working scene. Specifically, the model first receives the image input after normalization and proportional scaling, converts it into a normalized tensor of size 640×640 and feeds it into the original YOLOv11 Backbone structure. In the Backbone and Neck networks, the original C3k2 module is replaced with the MAS module. That is, the top-down feature extraction path and hierarchical stacking structure of YOLOv11 are still used. Only the local computing units are upgraded while keeping the original structural framework unchanged. Channel convolution, depthwise convolution and residual propagation are still executed according to the original path. However, the linear combination calculation of C3k2 is replaced by pointwise convolution, depthwise separable convolution and star-multiplication nonlinear reconstruction inside MAS. In this way, the multi-scale representation capability is enhanced without changing the overall flow of the network. Subsequently, the feature maps entering the Neck feature fusion stage are still upsampled and downsampled and concatenated according to the existing FPN+PAN multi-scale propagation path of YOLOv11. The original C2PSA module is replaced with the C2MCA enhancement module, so that it continues to perform the same data flow and branch connection relationship at the original feature fusion position. Internally, the original spatial attention operation is replaced by DyT dynamic normalization, TSSA global statistical attention, Mona multi-receptive field convolution and EDFFN frequency domain detail recovery, so as to improve the context dependency modeling ability and fine-grained feature preservation ability while keeping the feature fusion topology unchanged. Finally, the multi-scale features output from the Neck are fed into the DEGNHead detection head, enabling deconvolution to restore spatial resolution, GN group normalization to improve stability under small batch inputs, and scale response control to be completed in conjunction with the Scale layer. The output includes bounding box coordinates (x,y,w,h), wearing / not wearing classification results, and confidence scores. Thus, under the condition of maintaining consistency with the overall network structure, data flow, and inference process, the replacement and enhancement of local key computing units are completed, realizing a closed-loop processing link from input image to detection result, and enabling technicians in the relevant field to train and deploy the model according to the conventional operations in the field.
[0045] 1. Multi-scale feature enhancement design for Backbone and Neck structures: MAS module This invention first proposes to replace the C3k2 module used in the Backbone and Neck parts of the original YOLOv11 network with the MAS module to enhance the multi-scale feature representation capability and effectively alleviate the problem of confusion of small targets in complex backgrounds.
[0046] The structure consists of a MANet hybrid aggregation network and Star Block nonlinear reconstruction units: MANet architecture: Provides multi-path feature extraction, and integrates inter-channel correlation, spatial geometric information and hierarchical recursive processing.
[0047] Star Block: The core of this architecture is the "star multiplication operation," which achieves high-order nonlinear feature transformation through element-wise multiplication between features, resulting in an exponential implicit dimensionality expansion. This operation can capture complex nonlinear relationships between features, providing a richer representation space for small target features.
[0048] Advantages: The MAS module achieves a paradigm shift from traditional linear feature aggregation to high-dimensional nonlinear mapping. Compared to the indiscriminate fusion of traditional C3k2, Star Block can adaptively enhance important features and suppress noise interference. This improvement significantly enhances the backbone network's ability to represent features of small targets. Structural changes include... Figure 3 As shown.
[0049] 2. Build the C2MCA module In the traditional YOLOv11 architecture, the C2PSA module is responsible for feature enhancement, but it suffers from a trade-off between global dependency capture and local detail modeling. The module proposed in this invention completely replaces the original C2PSA, constructing a progressive feature optimization pipeline.
[0050] C2MCA module components: The DyT (Dynamic Tanh) module achieves adaptive normalization independent of batch size through learnable parameters and the hyperbolic tangent function, solving the problem of statistical instability in traditional BN under small batch training and ensuring numerical stability.
[0051] The TSSA (Token Statistics Self-Attention) module uses second-order moment statistics for global modeling, reducing computational complexity to O(n) and efficiently capturing long-range dependencies.
[0052] The Mona (Multi-cognitive Visual Adapter) module enables multi-scale adaptation and progressive feature refinement through parallel multi-scale (3×3, 5×5, 7×7) depthwise separable convolutions.
[0053] The EDFFN (Efficient Discriminative Frequency Domain-based Feed-Forward Network) module selectively enhances high-frequency components in the frequency domain using a learnable mask matrix, effectively recovering high-frequency detail information such as the edges and textures of a safety helmet.
[0054] Advantages: The C2MCA module provides a stabilization mechanism through dual DyT, achieves efficient global perception through TSSA, and enhances local details in the frequency domain through EDFFN, forming a complementary global and local feature enhancement mechanism. Compared to the original C2PSA module, C2MCA has achieved significant improvements in computational efficiency, feature representation capability, and training stability, providing a more robust feature representation for safety helmet detection in complex construction scenarios. Structural improvements include... Figure 4 As shown.
[0055] 3. Head Structure Optimization: Design of the DEGN Head Detection Head To address the issues of spatial detail loss after multiple downsampling and normalization instability caused by BN in the original YOLOv11 detector head, this invention constructs the DEGNHead (Detail-Enhanced Group-Normalized Head) detector head.
[0056] DEGNHead module components: Deconvolution Enhancement (DEConv): By transposing the convolution operation, the spatial resolution of the feature map is restored, which effectively compensates for the fine-grained positional information lost during downsampling and significantly improves the localization accuracy of small targets.
[0057] Group Normalization (GN): Instead of BN, GN is used to divide the feature channels into multiple groups and calculate the statistics independently within each group, achieving stable normalization independent of batch size and enhancing the model's generalization ability.
[0058] Shared convolution: It adopts a convolution and parameter sharing mechanism to reduce redundant parameters while maintaining multi-scale detection capabilities.
[0059] Advantages: DEGNHead recovers spatial details through DEConv, GN ensures training stability, and weight sharing improves parameter efficiency, forming a lightweight and efficient detection head architecture. This design effectively solves the problems of poor localization accuracy and low training stability for small targets. Structural improvements include... Figure 5 As shown.
[0060] Performance Improvement and Engineering Value Summary This invention employs the MAS module to enhance multi-scale feature representation, the C2MCA module to optimize context awareness, and the DEGNHead detection head to improve positioning accuracy, thereby reducing redundant feature processing and loss of spatial details at the structural level.
[0061] According to the experimental statistics (as shown in Table 1), the complete YOLO-MSF model achieved 94.77% mAP@0.5, an improvement of 1.67 percentage points compared to YOLOv11; and 62.94% mAP@0.5:0.95, an improvement of 1.63 percentage points.
[0062] (1) Significantly Improved Accuracy and Robustness of Small Target Detection: Through the nonlinear reconstruction of the MAS module and the deconvolution operation of DEGNHead, this invention significantly improves the forward inference speed and response capability of the model, enabling faster and more accurate identification of small-sized safety helmet targets in images. The TSSA and EDFFN modules in C2MCA ensure that the model maintains high accuracy in complex scenes such as dense, nighttime, and occluded environments. In particular, combined with DyT dynamic normalization, it further improves the detection robustness of the model in low-light and complex background scenes, such as... Figure 6 As shown, each group of images, from left to right, represents the detection results of YOLOv8, YOLOv10, YOLOv11, and YOLO-MSF.
[0063] (2) Lightweight and Edge Deployment Adaptability: Despite the introduction of complex feature enhancement modules, the model maintains reasonable complexity due to the efficient depthwise separable convolution and linear complexity design employed within MAS and C2MCA. The model has only 3.16M parameters and 7.6GFLOPs of computation, a significant reduction compared to traditional models such as Faster R-CNN (127.68M). This optimization greatly reduces the model's dependence on hardware resources, making it more suitable for deployment on edge devices and embedded platforms with limited computing power, meeting the requirements for low power consumption and low latency in scenarios such as smart construction sites.
[0064] (3) Enhanced training stability and generalization ability: The DyT dynamic normalization mechanism in the C2MCA module and the GN group normalization strategy used in DEGNHead effectively solve the statistical instability problem of traditional BN on small-batch training and imbalanced datasets. This makes the present invention more reliable and generalization capable in actual engineering deployment.
[0065] (4) Versatility across multiple fields: The core technologies of this invention—MAS feature enhancement, C2MCA context modeling, and DEGNHead detail preservation—are not only applicable to construction site safety helmet detection, but can also be widely applied to other scenarios with high requirements for real-time performance, small target recognition, and low-resource deployment, such as traffic monitoring, smart parks, public safety protection, and mine operation monitoring. This solution has good scalability, portability, and industrialization potential, and is an important supplement and upgrade path to the existing YOLO series of improvement solutions.
[0066] In summary, while maintaining high detection accuracy, this invention effectively addresses the shortcomings of the traditional YOLO architecture in terms of resource efficiency, optimization of difficult samples, and adaptability to edge deployment from both the aspects of model structure and training strategy. It has significant technological advantages and practical engineering application value.
[0067] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting helmet wearing in complex environments based on an improved version of YOLOv11, characterized in that, Includes the following steps: S1. Dataset Construction and Preprocessing: Obtain a helmet detection dataset containing positive and negative samples. Positive samples represent helmet wearers, while negative samples represent helmetless individuals or ordinary heads. Randomly divide the dataset into training, validation, and test sets in a 7:1:2 ratio to form a complete helmet detection dataset. S2. Constructing the YOLO-MSF model network architecture: The YOLO-MSF model is constructed and trained on the safety helmet detection dataset in S1. The YOLO-MSF model is based on YOLOv11n, replacing the C3k2 modules in the backbone network and neck network with MAS modules; replacing the C2PSA module in the feature enhancement layer with the C2MCA module; and using the DEGNHead detection head. S3. Set training parameters and iterative training: Set training parameters, use the safety helmet detection training set to iteratively train the YOLO-MSF model, and optimize the model hyperparameters by combining the validation set to obtain the detection model with the best performance; S4. Detection using the trained model: Input the image to be tested into the best-performing detection model in S3 for inference, automatically identify and detect the target in the image to be tested, and output the detection result of whether a safety helmet is worn.
2. The helmet-wearing detection method in complex environments based on YOLOv11 improvement according to claim 1, characterized in that: The MAS module uses the input feature map as starting data. First, it performs preliminary compression and basic mapping of the feature channels through a linear convolution. Then, the intermediate features are fed into ordinary convolution branches and depthwise separable convolution branches to achieve cross-channel correlation learning and spatial geometric information extraction. Furthermore, the intermediate features are divided into linear paths and non-linear recursive paths in the channel dimension. The linear path maintains the original information structure, while the non-linear path undergoes a progressive feature update process through star multiplication operations. Multiplicative mapping replaces the traditional additive residual structure to form higher-order feature interactions and implicit dimensional expansion. Afterward, the linear features, spatial features, and recursively enhanced semantic features from multiple branches are concatenated and fused, and the final features are output through compressed convolution to complete the unified representation and noise suppression of the module. The MAS module replaces the original C3k2 module in the later part of the network, while the C3k2 module in the earlier part remains unchanged.
3. The helmet-wearing detection method in complex environments based on YOLOv11 improvement according to claim 1, characterized in that: In S2, the MAS module adopts a progressive replacement strategy: the first two C3k2 modules of the backbone network and the neck network remain unchanged, while the middle and later C3k2 modules are replaced with MAS modules.
4. The helmet-wearing detection method in complex environments based on YOLOv11 improvement according to claim 1, characterized in that: The processing flow of the C2MCA module in S2 is as follows: The C2MCA module achieves progressive feature optimization by cascading multiple sub-modules, including the DyT dynamic normalization module, the TSSA self-attention module, the Mona multi-cognitive visual adapter module, and the EDFFN frequency domain feedforward network module, to realize the processing flow of "stabilization - global perception - multi-scale extraction - re-stabilization - frequency domain enhancement - multi-level integration".
5. The helmet-wearing detection method in complex environments based on YOLOv11 improvement according to claim 4, characterized in that: The DyT module achieves dynamic range adjustment and normalization stability improvement through scaling parameters and hyperbolic tangent function; The TSSA module performs global modeling based on second-order moment statistics, reducing computational complexity; the Mona module captures multi-scale spatial patterns through parallel 3×3, 5×5, and 7×7 depth-separable convolutional branches; and the EDFFN module transforms features to the frequency domain, selectively enhancing high-frequency details through a learnable mask matrix.
6. The helmet-wearing detection method in complex environments based on YOLOv11 improvement according to claim 1, characterized in that: The DEGNHead detection head in S2 improves the accuracy and prediction consistency of small target detection in the following ways: it introduces deconvolution operations to restore the spatial resolution and fine-grained positional information of the feature map; and it uses a group normalization strategy combined with a shared convolution mechanism to process the data.