Small-target safety helmet wearing detection method and system for industrial site

By constructing an improved detection network and cascaded verification mechanism, the problem of complex environmental interference in the detection of small safety helmets in industrial sites was solved, the detection accuracy and robustness were improved, the false detection rate was reduced, and efficient safety helmet wearing detection was achieved.

CN121884262APending Publication Date: 2026-04-17CHINA DATANG GRP DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA DATANG GRP DIGITAL TECH CO LTD
Filing Date
2025-11-24
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing single-stage detectors based on deep learning face challenges in detecting small targets such as safety helmets in industrial settings. These challenges include large differences in target size due to camera installation height, viewing angle, and coverage area; severe occlusion and overlap; and numerous interference factors in complex environments. These issues lead to a decrease in detection accuracy and generalization.

Method used

A dataset containing industrial field personnel and safety helmet head targets was constructed. An improved single-stage detection network was adopted, and a multi-dimensional fusion attention mechanism, a cross-scale polarization self-attention mechanism, and a dynamic detection head were introduced. The network was trained and verified by combining a multi-objective loss function and an auxiliary classification model to form a cascaded verification mechanism.

Benefits of technology

It significantly improves the accuracy and robustness of detecting small target safety helmets in complex industrial scenarios, reduces the false detection rate, and achieves efficient and accurate intelligent supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121884262A_ABST
    Figure CN121884262A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial field-oriented small target safety helmet wearing detection method and system, and the method comprises the steps: constructing a data set which comprises industrial field personnel, a head which does not wear a safety helmet, and a head target which wears the safety helmet, and dividing the data set into a detection data set and a binary classification verification data set; constructing an improved detection network based on a single-stage detector; training the improved detection network through the detection data set, and optimizing the network weight by adopting a multi-objective loss function to obtain an optimal detection model; training an auxiliary classification model through the dichotomy verification data set; an industrial field image to be detected is input into the optimal detection model to obtain an initial detection result, the initial detection result is screened and rechecked in sequence, a final detection result is output, and the trained auxiliary classification model is adopted in the rechecking process. According to the scheme of the invention, the precision and robustness of safety helmet detection in a complex industrial scene are remarkably improved by constructing a refined data set and an improved dual model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application generally relates to the fields of computer vision and image processing technology. More specifically, this application relates to a method and system for detecting the wearing of safety helmets on small targets in industrial settings. Background Technology

[0002] In industrial production and construction sites, continuous monitoring of personnel compliance is crucial to ensuring personal safety and reducing accident risks, with safety helmet wearing detection being a core component. Currently, fixed video surveillance systems are widely deployed in industrial sites, and the use of computer vision technology to automatically identify violations has become an industry trend.

[0003] With the development of deep learning technology, deep learning-based one-stage detectors have been widely used in video analysis and surveillance due to their fast inference speed and convenient deployment. The typical approach involves pre-training the model on a general dataset and then fine-tuning it for a helmet detection scenario. This type of method relies on a backbone network to extract multi-layer features, a neck network to construct a feature pyramid and fuse multi-scale semantics, and finally, a head network to output the category and bounding box results. Although this technology performs relatively stably in detecting medium and large targets, it still faces many serious challenges in practical industrial applications.

[0004] First, due to limitations in camera installation height, viewing angle, and coverage, the heads of people and safety helmets in monitored images often exhibit significant size differences and severe overlap. Second, industrial environments are complex, with common interference factors such as backlighting, low light, strong reflections, motion blur, smoke, dust, rain, fog, and cluttered backgrounds. These factors significantly reduce the accuracy and generalization of conventional target detection algorithms.

[0005] In view of this, there is an urgent need to provide a small-target safety helmet wearing detection solution for industrial sites that can solve the detection problems of current technology in complex environments while maintaining detection efficiency. Summary of the Invention

[0006] In order to at least address one or more of the technical problems mentioned above, this application proposes a small-target safety helmet wearing detection solution for industrial sites in several aspects.

[0007] In a first aspect, this application provides a method for detecting the wearing of safety helmets on small targets in industrial settings, comprising: constructing a dataset containing targets in the industrial setting, heads without safety helmets, and heads with safety helmets, forming a detection dataset and a binary classification verification dataset; constructing an improved detection network based on a single-stage detector, wherein the improved detection network introduces a multi-dimensional fusion attention mechanism in the backbone feature extraction stage, constructs a feature pyramid containing multiple scales and uses a content-aware recombination operator in the neck feature fusion stage, and uses a dynamic detection head in the head detection stage; training the improved detection network using the detection dataset, optimizing the network weights using a multi-objective loss function to obtain the optimal detection model; training an auxiliary classification model using the binary classification verification dataset; inputting the industrial scene image to be tested into the optimal detection model to obtain initial detection results, sequentially filtering and verifying the initial detection results, and outputting the final detection results, wherein the trained auxiliary classification model is used in the verification process.

[0008] In a second aspect, this application provides a small-target helmet-wearing detection system for industrial sites, employing the helmet-wearing detection method for industrial sites as described in any embodiment of the first aspect. The system includes: an image input and preprocessing module for constructing a dataset containing industrial site personnel, heads without helmets, and heads wearing helmets, forming a detection dataset and a binary classification verification dataset; and an improved detection network construction module for constructing an improved detection network based on a single-stage detector. This improved detection network introduces a multi-dimensional fusion attention mechanism in the backbone feature extraction stage, focusing on neck features. The feature fusion stage constructs a feature pyramid with multiple scales and employs a content-aware recombination operator, while the head detection stage uses a dynamic detection head. An improved detection network training module trains the network using the detection dataset, optimizes network weights using a multi-objective loss function, and obtains the optimal detection model. An auxiliary classification model training module trains the auxiliary classification model using the binary classification validation dataset. A detection result output module inputs the industrial scene image to be tested into the optimal detection model to obtain initial detection results, sequentially filters and verifies the initial detection results, and outputs the final detection results. The verification process uses the trained auxiliary classification model.

[0009] The above-described small-target safety helmet detection solution for industrial sites significantly improves the accuracy and robustness of small-target safety helmet detection in complex industrial scenarios by constructing a refined dataset and an improved dual-model architecture. The introduction of a multi-dimensional fusion attention mechanism and a content-aware recombination operator into the detection network effectively enhances the suppression of background noise and solves the problem of information loss during the upsampling process of small target features. Combined with a dynamic detection head, this further improves the adaptability to multi-scale targets. By establishing a cascaded verification mechanism including preliminary detection, screening, and auxiliary classification review, and using an independent binary classification model to perform secondary confirmation of the detection results, the false detection rate is significantly reduced, thereby achieving efficient, accurate, and low-false-report intelligent supervision of workers' safety helmet wearing behavior.

[0010] Furthermore, in some embodiments, this method achieves deep and refined recalibration of high-level semantic features by using cascaded channel interactions at the backbone network ends, hybrid domains, and cross-scale polarization self-attention mechanisms. In particular, the introduction of the cross-scale polarization self-attention mechanism, through parallel processing of channel and spatial polarization branches and fusion of locally convolutional enhanced features, effectively balances local detail preservation with global long-range dependency capture, solving the problem of small targets being easily submerged in deep features. This multi-dimensional feature enhancement strategy significantly improves the model's ability to focus on key features, effectively suppresses background noise interference in complex industrial environments, and provides high-quality feature inputs with stronger representational capabilities and richer semantic information for subsequent feature fusion stages.

[0011] Furthermore, in some embodiments, by constructing a multi-objective joint optimization strategy that includes classification, distributed regression, and SIoU bounding box regression, this method significantly improves the convergence speed of model training and the localization accuracy of detection boxes. In particular, the introduction of the SIoU loss function, by adding an angle-aware penalty term to the traditional geometric distance and shape constraints, effectively guides the predicted boxes to prioritize aligning with the orientation axis of the ground truth boxes, greatly reducing oscillations during the regression process. Combined with the DFL loss to optimize boundary uncertainty, it effectively solves the problem of low localization tolerance for small targets due to their small pixel ratio, thereby ensuring high-precision capture of tiny targets such as safety helmets in industrial settings.

[0012] Furthermore, in some embodiments, a cascaded verification mechanism combining spatial geometric constraints and dual model validation is constructed to completely eliminate false alarms and misjudgments from both logical and semantic levels. First, spatial inclusion relationships are used for filtering, leveraging human detection results as a strong prior to directly eliminate falsely detected targets resembling safety helmets in the background. Second, an independent auxiliary classification model is introduced to perform secondary cropping and fine-grained discrimination of the detection box content, and a classification result confidence arbitration strategy is established. The classification model's stronger ability to identify local detail features corrects the classification errors of the detection network. This coarse-to-fine post-processing workflow greatly enhances the system's anti-interference capability in complex backgrounds and significantly reduces the false alarms and missed alarms common in industrial settings. Attached Figure Description

[0013] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this application are illustrated by way of example and not limitation, and the same or corresponding reference numerals denote the same or corresponding parts, wherein: Figure 1 An exemplary flowchart of a method for detecting the wearing of safety helmets on small targets in industrial settings, according to an embodiment of this application, is shown. Figure 2 An exemplary flowchart of the backbone feature extraction stage of an embodiment of this application is shown; Figure 3 An exemplary flowchart illustrating the working process of the cross-scale polarization self-attention mechanism in an embodiment of this application is shown; Figure 4 An exemplary flowchart of the neck feature fusion stage of an embodiment of this application is shown; Figure 5 An exemplary flowchart illustrating the working process of the dynamic detection head according to an embodiment of this application is shown; Figure 6 An exemplary flowchart illustrating an embodiment of this application is shown; Figure 7 An exemplary flowchart illustrating the sequential screening and verification of initial detection results according to an embodiment of this application is shown; Figure 8 An exemplary structural block diagram of a small target safety helmet wearing detection system for industrial sites, according to an embodiment of this application, is shown. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] It should be understood that the terms "comprising" and "including" used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0016] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0017] Figure 1 An exemplary flowchart of a small-target safety helmet wearing detection method 100 for industrial sites, according to an embodiment of this application, is shown.

[0018] like Figure 1 As shown, in step S110, a dataset containing industrial field personnel, heads without safety helmets, and heads with safety helmets is constructed, forming a detection dataset and a binary classification verification dataset.

[0019] In the embodiments of this application, a dataset containing industrial site personnel, heads without safety helmets, and heads wearing safety helmets is constructed by collecting industrial site images and performing data filtering and annotation.

[0020] Specifically, the CVAT tool is used for labeling, where person represents the personnel area, head represents the head area without a helmet, and helmet represents the head area with a helmet.

[0021] In the embodiments of this application, a dataset containing industrial field personnel, heads without safety helmets, and heads with safety helmets is constructed as a detection dataset.

[0022] In some embodiments of this application, the detection dataset is randomly divided into a training set, a validation set, and a test set in a ratio of 8:1:1 for subsequent model training, validation, and testing.

[0023] In the embodiments of this application, the constructed dataset containing industrial field personnel, heads without safety helmets, and heads with safety helmets is cropped to obtain a binary classification verification dataset.

[0024] In the embodiments of this application, regions labeled with head and helmet are cropped from the image and standardized to 128×128 resolution to construct a binary classification dataset, which is then randomly divided into a training set and a validation set in an 8:2 ratio.

[0025] After performing step S110, in step S120, an improved detection network based on a single-stage detector is constructed.

[0026] In the embodiments of this application, the improved detection network introduces a multi-dimensional fusion attention mechanism in the backbone feature extraction stage, constructs a feature pyramid containing multiple scales and adopts a content-aware reorganization operator in the neck feature fusion stage, and adopts a dynamic detection head in the head detection stage.

[0027] For details regarding the specific processes involved in the backbone feature extraction stage in the embodiments of this application, please refer to [link / reference]. Figure 2 .

[0028] Figure 2 An exemplary flowchart of the backbone feature extraction stage of an embodiment of this application is shown.

[0029] like Figure 2 As shown, in step S210, the highest-level features extracted from the backbone network are aggregated using spatial pyramid pooling and then sequentially connected to a channel interaction attention mechanism, a hybrid domain attention mechanism, and a cross-scale polarization self-attention mechanism. In step S220, the aggregated features undergo preliminary recalibration in the channel dimension through the channel interaction attention mechanism. In step S230, the pre-recalibrated features are input to the hybrid domain attention mechanism for further channel dimension recalibration and feature space attention calibration. In step S240, the features that have undergone further channel dimension recalibration and feature space attention calibration are input to the cross-scale polarization self-attention mechanism to generate the final features, which are then input to the neck feature fusion stage.

[0030] Specifically, during step S220, the input features The pooling result is obtained through a channel interaction attention mechanism followed by global average pooling. , For pooling results Apply convolution on the channel dimension Nuclear Chief The weights are odd numbers that adapt to the number of channels and are obtained through the Sigmoid function. Then weight Element-wise multiplication with input features Preliminary recalibration of the channel dimension is obtained. .

[0031] Specifically, during step S230, the Hybrid Domain Attention (CBAM) mechanism is used to enhance salient regions and suppress interference from complex backgrounds, thus improving the initial recalibration. Perform global average pooling and global max pooling to obtain and Both are processed using a shared Multilayer Perceptron (MLP), where the MLP employs dimensionality reduction, ReLU, and dimensionality increase, and the channel weights are obtained by summing the results and then passing them through a Sigmoid function. Complete the recalibration of the channel dimension. Next, regarding Perform averaging and max pooling on the channel dimension and then concatenate the results. Then, a 7×7 convolution is applied and followed by a Sigmoid function to obtain the spatial weight map. Complete channel recalibration for spatial attention .

[0032] By introducing a multi-dimensional fusion attention mechanism in the backbone feature extraction stage, firstly, an adaptive 1D convolution is used for preliminary channel recalibration based on the channel interaction attention mechanism (ECA) to quickly capture local cross-channel interaction information with extremely low computational cost. Subsequently, a cascaded hybrid domain attention mechanism (CBAM) is used, combining global max / average pooling and shared MLP to perform secondary recalibration of the channel dimension, and spatial attention calibration is performed in conjunction with large kernel convolution. This design not only achieves multi-dimensional feature enhancement from channel to space, but also effectively highlights salient target regions and suppresses interference from complex backgrounds through a dual filtering mechanism, providing high-purity and highly semantically discriminative feature inputs for subsequent feature fusion in the neck network.

[0033] The working process of the cross-scale polarization self-attention mechanism in the embodiments of this application can be found in [reference needed]. Figure 3 .

[0034] Figure 3 An exemplary flowchart illustrating the working process of the cross-scale polarization self-attention mechanism according to an embodiment of this application is shown.

[0035] like Figure 3As shown, in step S310, the input features are divided into local convolutional enhancement features and polarization features. The polarization features include channel polarization branches and spatial polarization branches. In step S320, in the channel polarization branch, global feature compression and channel mapping are performed on the input features to generate channel weights, which are then weighted onto the input features. In step S330, in the spatial polarization branch, channel dimensionality reduction and spatial dimension compression mapping are performed on the input features to calculate the spatial correlation matrix and generate spatial weights to weight the input features. In step S340, the output features of the channel polarization branches and the spatial polarization branches are fused according to preset ratio parameters and combined with the local convolutional enhancement features to output the final features.

[0036] In the embodiments of this application, during step S320, the channel that has completed spatial attention is recalibrated. Perform global average pooling (GAP), and obtain the weight channels after linear mapping and normalization. Complete channel polarization branching .

[0037] In the embodiments of this application, during the execution of step S330, the following steps are performed: Q, K, and V are obtained through channel-wise normalization and linear projection. A compression mapping is then performed in the spatial dimension to reduce attention overhead. Correlation is calculated and spatial weights are generated. Complete spatial polarization branch .

[0038] In the embodiments of this application, during the execution of step S340, the output features of the fused channel polarization branch and spatial polarization branch are obtained. Then combined with local convolutional enhancement features , This is a local convolution enhancement feature.

[0039] Based on a cross-scale polarization self-attention mechanism, firstly, by constructing local convolutional enhancement branches and polarization self-attention branches in parallel, simultaneous extraction of local texture features and long-range contextual dependencies is achieved, effectively compensating for the limited receptive field of a single convolution. Secondly, by utilizing a channel- and spatial separation polarization modeling strategy and spatial dimension compression mapping, the computational cost of traditional self-attention mechanisms is significantly reduced while maintaining feature modeling capabilities. Finally, through learnable parameters for adaptive fusion of multi-dimensional features, a dynamic balance between channel saliency and spatial correlation is achieved, significantly improving the model's feature representation ability for cross-scale targets in complex scenes.

[0040] For details regarding the specific processes involved in the neck feature fusion stage in the embodiments of this application, please refer to [link / reference]. Figure 4 .

[0041] Figure 4 An exemplary flowchart of the neck feature fusion stage of an embodiment of this application is shown.

[0042] like Figure 4 As shown, in step S410, a feature pyramid containing multiple scales is constructed, and upsampling nodes and fusion nodes of the same resolution are determined in the top-down feature fusion path of the feature pyramid. In step S420, at each upsampling node, a position-related recombination kernel is predicted based on the input feature content. In step S430, the input features are subjected to pixel-by-pixel content-aware recombination and upsampling operations using the recombination kernel. In step S440, the upsampled features are fused with the fusion nodes of the same resolution and subjected to convolutional smoothing to generate pyramid feature maps at each scale.

[0043] In the embodiments of this application, during the execution of step S420, a content-aware reconstruction (CARAFE) upsampling operator is introduced at each upsampling node to represent the input features to be upsampled. Establish a recombination kernel prediction branch and perform channel compression using 1×1 convolution. And generate position-dependent recombination kernel weights. The effective receptive field size K of the recombinant nucleus is an odd number between 3 and 7, and then the probability weights are obtained by grouping and normalizing. .

[0044] In the embodiments of this application, during step S430, position-by-position content-aware reconstruction is performed based on the input features according to the reconstruction kernel. This process restores high-frequency details and edge structures at the target resolution while reducing texture dilution caused by conventional upsampling. Then, the reconstructed features... Post-processing convolutions are applied to achieve scale alignment and distribution stabilization, resulting in an upsampled result at this resolution. .

[0045] In the embodiments of this application, during step S440, the upsampling result is... By adding and fusing features of the same resolution, we obtain This is followed by a 3×3 convolution to eliminate aliasing, forming a pyramid feature at this scale. Finally, the pyramid features at each scale are consistent and then sequentially output to the next level until features at all scales are obtained.

[0046] Based on the neck feature fusion stage, firstly, by introducing the CARAFE content-aware upsampling operator, a dynamically predicted recombination kernel is used to replace traditional static interpolation, achieving adaptive recombination based on a large receptive field of input content. This effectively solves the texture dilution problem caused by conventional upsampling and accurately restores the high-frequency details and edge structures of the image. Secondly, by combining pixel-by-pixel content-aware recombination with convolutional smoothing, multi-scale feature deep fusion is completed while eliminating feature aliasing effects, ensuring the stability and semantic consistency of feature distribution at each level of the pyramid, and providing high-quality feature pyramid input for subsequent detection heads.

[0047] In the embodiments of this application, during the head detection stage, a dynamic detection head with a uniform structure is set at the output end of each level of the feature pyramid containing multiple scales.

[0048] Specifically, the dynamic detection head contains a series of stacked hierarchical perception attention units, spatial perception attention units, and task perception attention units.

[0049] In embodiments of this application, a hierarchical awareness attention unit is used to generate hierarchical response weights related to scale content.

[0050] In embodiments of this application, a spatially aware attention unit is used to perform cross-layer feature aggregation at the same spatial location through sparse sampling.

[0051] In the embodiments of this application, the task-aware attention unit is used to dynamically generate feature representation channels that are adapted to classification tasks and regression tasks respectively.

[0052] The working process of the dynamic detection head in the embodiments of this application can be found in [reference needed]. Figure 5 .

[0053] Figure 5 An exemplary flowchart illustrating the working process of the dynamic detection head according to an embodiment of this application is shown.

[0054] like Figure 5 As shown, in step S510, for input features of arbitrary scale, a query vector, a key vector, and a value vector are generated. In step S520, the similarity weights between different scales at the same spatial location are calculated, and the multi-scale features are aggregated based on these weights. In step S530, the sampling offset and corresponding weights are predicted for the aggregated features. In step S540, sparse sampling and aggregation are performed on each spatial location based on the sampling offset and corresponding weights using deformable convolution. In step S550, the sparsely sampled and aggregated features are processed through classification mapping functions and regression mapping functions, respectively, to generate dynamic feature representations for classification branches and regression branches.

[0055] In the embodiments of this application, during the execution of step S510, for each scale Input features are denoted as Generate comparable query vectors Key vector Value vector .

[0056] In the embodiments of this application, during the execution of step S520, at the same spatial location At this point, the similarity between scales is calculated, and the similarity weights are obtained through the SoftMax function. Then, the hierarchical aggregation output is calculated based on the similarity weights. .

[0057] In the embodiments of this application, during the execution of step S530, the hierarchical aggregation output is... Presampling offset With weight .

[0058] In the embodiments of this application, during the execution of step S540, for each position Sampling and aggregation are obtained using deformable convolution. Where G is the reference convolution kernel grid, These are the deformable convolution kernel weights.

[0059] In the embodiments of this application, during the execution of step S550, the aggregated features are... Transform it into two representations: one for classification and one for regression. , ,in and This function maps tasks to classification and regression branches, outputting dynamic feature representations for each branch. The dynamic feature representation for the classification branch is the class probability. The dynamic feature representation for the regression branch is the bounding box parameters.

[0060] In the head detection stage, firstly, hierarchical perceptual attention is used to dynamically aggregate cross-scale features using semantic similarity weights, effectively breaking down semantic barriers between pyramid levels and enhancing the model's ability to capture targets of different sizes. Secondly, spatial perceptual attention and deformable convolution are combined to achieve sparse sampling and geometric calibration of salient feature regions, accurately addressing the uncertainty of object deformation and spatial position. Finally, task-aware attention is used to dynamically generate task-specific feature maps, successfully decoupling the conflicting requirements of classification and regression tasks on feature distribution, ensuring simultaneous optimization of classification accuracy and bounding box regression accuracy within a unified network framework.

[0061] After completing step S120, in step S130, the improved detection network is trained using the detection dataset, and the network weights are optimized using a multi-objective loss function to obtain the optimal detection model.

[0062] In the embodiments of this application, the training process includes performing various data augmentations on the detection dataset, including color jitter, left and right flipping, random affine transformation, blending augmentation, copy and paste, etc., and then inputting the processed data into the improved detection network in batches and calculating the total loss.

[0063] In the embodiments of this application, the expression for the multi-objective loss function is: ,in, For multi-objective loss functions, For classifying losses, The weights for the classification loss, For distributed regression loss, The weights for the distributed regression loss, For bounding box regression loss, These are the weights for the bounding box regression loss.

[0064] In the embodiments of this application, , (·) represents the intersection-union function, b is the predicted bounding box, and g is the label bounding box. To predict the Euclidean distance between the center point of the bounding box and the center point of the label box, This is a penalty term for the angle perception between the center point of the predicted bounding box and the center point of the labeled bounding box. This represents the shape difference between the predicted bounding box and the labeled bounding box.

[0065] In the embodiments of this application, the AdamW optimizer is used to update parameters, and early stopping and model selection are performed based on performance indicators such as precision, recall, and mAP50 of the validation dataset. The model weight with the best validation set results is selected as the optimal detection model.

[0066] Based on step S130, firstly, data augmentation strategies effectively expanded sample diversity, enhancing the model's robustness to complex industrial environments and small target variations. Secondly, a multi-objective joint loss function including SIoU was employed, leveraging angle awareness and geometric constraints to significantly accelerate model convergence and improve bounding box localization accuracy. Finally, combining the AdamW optimizer with a performance-based early stopping mechanism, efficient parameter updates and regularization were achieved, automatically locking the model weights that performed best on the validation set. This ensured the final model achieved an optimal balance between precision and recall, avoiding overfitting.

[0067] After completing step S130, in step S140, an auxiliary classification model is trained using a binary classification validation dataset.

[0068] In the embodiments of this application, the specific process of training the auxiliary classification model using a binary classification validation dataset can be found in [reference needed]. Figure 6 .

[0069] Figure 6 An exemplary flowchart illustrating an embodiment of this application is shown, demonstrating how to train an auxiliary classification model using a binary classification validation dataset.

[0070] like Figure 6 As shown, in step S610, a binary classification network is constructed. In step S620, the binary classification validation dataset is divided into a training set and a validation set. In step S630, the binary classification network is trained using the training set, and optimized using the cross-entropy loss function. In step S640, the trained binary classification network is validated using the validation set, and the binary classification network with the best validation result is used as the auxiliary classification model.

[0071] In the embodiments of this application, the samples in the binary classification validation dataset are normalized and augmented, and then input into the binary classification network. Cross-entropy loss is used for optimization. In the case of class imbalance, class weights or resampling strategies are introduced to stabilize training, and the optimal classification model weights are selected based on the classification accuracy of the validation dataset.

[0072] Based on step S140, firstly, normalization and basic data augmentation effectively improve the quality of the input data and the model's generalization ability. Secondly, to address potential distributional differences in the training data, class weights or resampling strategies are introduced to proactively resolve class imbalance, ensuring the fairness and stability of the model's learning of positive and negative samples. Finally, by combining cross-entropy loss optimization with a selection mechanism based on validation set accuracy, the model weights with the best generalization performance can be automatically identified, thus providing a high-precision discrimination basis for the dual verification stage of the entire detection system.

[0073] After completing step S140, in step S150, the image of the industrial site to be tested is input into the optimal detection model to obtain the initial detection result. The initial detection result is then filtered and verified in sequence, and the final detection result is output.

[0074] In the embodiments of this application, images of the industrial site to be tested are collected periodically by a camera, and the collection interval can be set according to the needs of the scenario.

[0075] In the embodiments of this application, a trained auxiliary classification model is used in the review process.

[0076] In embodiments of this application, the initial detection result includes detection boxes and output categories. Specifically, the detection boxes include personnel detection boxes and head region detection boxes. More specifically, the head region detection boxes include detection boxes for not wearing a safety helmet and detection boxes for wearing a safety helmet.

[0077] In the embodiments of this application, the specific process of sequentially screening and verifying the initial detection results can be found in [reference needed]. Figure 7 .

[0078] Figure 7 An exemplary flowchart illustrating the sequential screening and verification of initial detection results according to an embodiment of this application is shown.

[0079] like Figure 7 As shown, in step S710, head region detection boxes whose center points are not inside any person detection box are removed, and head region detection boxes associated with the person detection boxes are selected. In step S720, the image regions corresponding to the selected head region detection boxes are cropped and scaled, and input into the auxiliary classification model to obtain their output categories. In step S730, it is determined whether the output category of the auxiliary classification model is consistent with the output category of the improved detection network. In response to the consistency between the output category of the auxiliary classification model and the output category of the improved detection network, in step S740, the output category is taken as the final category, and the final category and the corresponding detection box are taken as the final detection result. In response to the inconsistency between the output category of the auxiliary classification model and the output category of the improved detection network, in step S750, the output category of the auxiliary classification model is taken as the final category, and the final category and the corresponding detection box output by the improved detection network are taken as the final detection result.

[0080] Step S150, based on a refined post-processing system using logical constraints and cascaded verification, significantly improves the reliability and robustness of the final detection results. First, through logical filtering based on spatial inclusion relationships, isolated head detection boxes detached from the human target are automatically removed, effectively shielding against false detection noise in complex industrial environments and ensuring the logical rationality of the detected target. Second, an auxiliary classification model is introduced to perform secondary discrimination on key regions. By performing targeted inference on the cropped local images, the shortcomings of general detection networks in fine-grained classification are compensated for. Finally, while preserving high-precision bounding box localization, potential category judgment errors are effectively corrected, significantly reducing the false negative and false positive rates.

[0081] In the embodiments of this application, step S150 is implemented by an edge computing device.

[0082] In the embodiments of this application, after obtaining the final detection result, the structured result (including timestamp, camera ID, category, confidence level, bounding box coordinates, and evidence map) is sent to the cloud platform through an encrypted channel. The sampling frequency, alarm threshold and model version can be dynamically adjusted according to the cloud strategy to achieve cloud-edge-device collaboration and closed-loop optimization.

[0083] In summary, the proposed solution for detecting small-target safety helmet wearing in industrial settings, as described above, significantly improves the accuracy and robustness of safety helmet detection for small targets in complex industrial environments by constructing a refined dataset and an improved dual-model architecture. The introduction of a multi-dimensional fusion attention mechanism and a content-aware recombination operator into the detection network effectively enhances the suppression of background noise and solves the problem of information loss during the upsampling process of small target features. Combined with a dynamic detection head, this further improves the adaptability to multi-scale targets. By establishing a cascaded verification mechanism that includes preliminary detection, screening, and auxiliary classification review, and using an independent binary classification model to perform secondary confirmation of the detection results, the false detection rate is significantly reduced, thereby achieving efficient, accurate, and low-false-report intelligent supervision of workers' safety helmet wearing behavior.

[0084] Furthermore, in some embodiments, this method achieves deep and refined recalibration of high-level semantic features by using cascaded channel interactions at the backbone network ends, hybrid domains, and cross-scale polarization self-attention mechanisms. In particular, the introduction of the cross-scale polarization self-attention mechanism, through parallel processing of channel and spatial polarization branches and fusion of locally convolutional enhanced features, effectively balances local detail preservation with global long-range dependency capture, solving the problem of small targets being easily submerged in deep features. This multi-dimensional feature enhancement strategy significantly improves the model's ability to focus on key features, effectively suppresses background noise interference in complex industrial environments, and provides high-quality feature inputs with stronger representational capabilities and richer semantic information for subsequent feature fusion stages.

[0085] Furthermore, in some embodiments, by constructing a multi-objective joint optimization strategy that includes classification, distributed regression, and SIoU bounding box regression, this method significantly improves the convergence speed of model training and the localization accuracy of detection boxes. In particular, the introduction of the SIoU loss function, by adding an angle-aware penalty term to the traditional geometric distance and shape constraints, effectively guides the predicted boxes to prioritize aligning with the orientation axis of the ground truth boxes, greatly reducing oscillations during the regression process. Combined with the DFL loss to optimize boundary uncertainty, it effectively solves the problem of low localization tolerance for small targets due to their small pixel ratio, thereby ensuring high-precision capture of tiny targets such as safety helmets in industrial settings.

[0086] Furthermore, in some embodiments, a cascaded verification mechanism combining spatial geometric constraints and dual model validation is constructed to completely eliminate false alarms and misjudgments from both logical and semantic levels. First, spatial inclusion relationships are used for filtering, leveraging human detection results as a strong prior to directly eliminate falsely detected targets resembling safety helmets in the background. Second, an independent auxiliary classification model is introduced to perform secondary cropping and fine-grained discrimination of the detection box content, and a classification result confidence arbitration strategy is established. The classification model's stronger ability to identify local detail features corrects the classification errors of the detection network. This coarse-to-fine post-processing workflow greatly enhances the system's anti-interference capability in complex backgrounds and significantly reduces the false alarms and missed alarms common in industrial settings.

[0087] This application also provides a small target helmet wearing detection system for industrial sites. It can use the aforementioned small target helmet wearing detection method 100 for industrial sites to perform helmet wearing detection for industrial sites, or it can use other methods to perform helmet wearing detection for industrial sites. This application does not limit it here.

[0088] Figure 8 An exemplary structural block diagram of a small target safety helmet wearing detection system for industrial sites, according to an embodiment of this application, is shown.

[0089] like Figure 8 As shown, the system 800 includes an image input and preprocessing module 810, an improved detection network construction module 820, an improved detection network training module 830, an auxiliary classification model training module 840, and a detection result output module 850.

[0090] Specifically, the image input and preprocessing module 810 is used to construct a dataset containing targets including industrial site personnel, heads without safety helmets, and heads with safety helmets, and to form a detection dataset and a binary classification verification dataset.

[0091] Specifically, the improved detection network construction module 820 is used to construct an improved detection network based on a single-stage detector. This improved detection network introduces a multi-dimensional fusion attention mechanism in the backbone feature extraction stage, constructs a feature pyramid containing multiple scales and adopts a content-aware reorganization operator in the neck feature fusion stage, and adopts a dynamic detection head in the head detection stage.

[0092] Specifically, the improved detection network training module 830 is used to train the improved detection network using the detection dataset, optimize the network weights using a multi-objective loss function, and obtain the optimal detection model.

[0093] Specifically, the auxiliary classification model training model 840 is used to train the auxiliary classification model using the binary classification validation dataset.

[0094] Specifically, the detection result output module 850 is used to input the industrial site image to be tested into the optimal detection model to obtain the initial detection result, and to filter and verify the initial detection result in sequence, and output the final detection result. In the verification process, the trained auxiliary classification model is used.

[0095] When system 800 uses the aforementioned method 100 for detecting the wearing of small targets in industrial settings, the following steps are executed: image input and preprocessing module 810 executes step S110; improved detection network construction module 820 executes step S120; improved detection network training module 830 executes step S130; auxiliary classification model training module 840 executes step S140; and detection result output module 850 executes step S150. The specific execution process can be found above and will not be repeated here.

[0096] While numerous embodiments of this application have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will arise for those skilled in the art without departing from the spirit and intent of this application. It should be understood that various alternatives to the embodiments of this application described herein may be employed in the practice of this application. The appended claims are intended to define the scope of protection of this application and therefore cover equivalents or alternatives within the scope of these claims.

Claims

1. A method for detecting the wearing of safety helmets on small targets in industrial settings, characterized in that, include: Construct a dataset containing industrial field personnel, heads without safety helmets, and heads with safety helmets, and form a detection dataset and a binary classification validation dataset; An improved detection network based on a single-stage detector is constructed. The improved detection network introduces a multi-dimensional fusion attention mechanism in the backbone feature extraction stage, constructs a feature pyramid with multiple scales and adopts a content-aware reorganization operator in the neck feature fusion stage, and adopts a dynamic detection head in the head detection stage. The improved detection network was trained using the aforementioned detection dataset, and the network weights were optimized using a multi-objective loss function to obtain the optimal detection model. The auxiliary classification model is trained using the binary classification validation dataset; The initial detection results are obtained by inputting the industrial site image to be tested into the optimal detection model. The initial detection results are then filtered and verified sequentially, and the final detection results are output. The verification process uses a trained auxiliary classification model.

2. The method for detecting the wearing of safety helmets on small targets in industrial settings according to claim 1, characterized in that, The following steps are performed during the backbone feature extraction stage: The highest-level features extracted from the backbone network are aggregated by spatial pyramid pooling and then sequentially connected to the channel interaction attention mechanism, the hybrid domain attention mechanism, and the cross-scale polarization self-attention mechanism. Preliminary recalibration of features in the channel dimension after aggregation through channel interaction attention mechanism; The features that have been initially recalibrated are input into the hybrid domain attention mechanism to perform recalibration of the channel dimension and calibration of the feature space attention in sequence. The features that have undergone recalibration in the channel dimension and calibration in the feature space are input into the neck feature fusion stage through a cross-scale polarization self-attention mechanism to generate the final features.

3. The method for detecting the wearing of safety helmets on small targets in industrial settings according to claim 2, characterized in that, The cross-scale polarization self-attention mechanism performs the following steps: The input features are divided into local convolutional enhancement features and polarization features, wherein the polarization features include channel polarization branches and spatial polarization branches; In the channel polarization branch, global feature compression and channel mapping are performed on the input features to generate channel weights, and the input features are weighted. In the spatial polarization branch, the input features are subjected to channel dimensionality reduction and spatial dimension compression mapping, the spatial correlation matrix is ​​calculated and spatial weights are generated to weight the input features. The output features of the channel polarization branch and the spatial polarization branch are fused according to a preset ratio parameter and combined with the local convolution enhancement features to output the final features.

4. The method for detecting the wearing of safety helmets on small targets in industrial settings according to claim 1, characterized in that, The following steps are performed during the neck feature fusion stage: Construct a feature pyramid with multiple scales, and determine upsampling nodes and fusion nodes of the same resolution in the feature fusion path from top to bottom of the feature pyramid; At each upsampling node, a location-related recombination kernel is predicted based on the input feature content; The input features are reconstructed pixel by pixel using a reconstructing kernel, and then content-aware reconstructing and upsampling operations are performed. The upsampled features are fused with fusion nodes of the same resolution and then smoothed by convolution to generate pyramid feature maps at various scales.

5. The method for detecting the wearing of safety helmets on small targets in industrial settings according to claim 1, characterized in that, In the head detection stage, a dynamic detection head with a uniform structure is set at the output of each level of the feature pyramid that contains multiple scales; The dynamic detection head contains a hierarchical perception attention unit, a spatial perception attention unit, and a task perception attention unit stacked sequentially. The hierarchical perception attention unit is used to generate hierarchical response weights related to scale content; The spatial awareness attention unit is used to perform cross-layer feature aggregation at the same spatial location through sparse sampling; The task-aware attention unit is used to dynamically generate feature representation channels that are adapted to classification and regression tasks respectively.

6. The method for detecting the wearing of safety helmets on small targets in industrial settings according to claim 5, characterized in that, The dynamic detection head performs the following steps: For any scale of input features, generate query vector, key vector, and value vector; Calculate the similarity weights between different scales at the same spatial location, and aggregate multi-scale features based on these weights; Predict the sampling offset and corresponding weights for the aggregated features; Sparse sampling and aggregation of each spatial location are performed using deformable convolution based on the sampling offset and the corresponding weights; The sparsely sampled and aggregated features are used to generate dynamic feature representations for classification branches and regression branches through classification mapping functions and regression mapping functions, respectively.

7. The method for detecting the wearing of safety helmets on small targets in industrial settings according to claim 1, characterized in that, The expression for the multi-objective loss function is: ,in, For multi-objective loss functions, For classifying losses, The weights for the classification loss, For distributed regression loss, The weights for the distributed regression loss, For bounding box regression loss, These are the weights for the bounding box regression loss; in, , (·) represents the intersection-union function, b is the predicted bounding box, and g is the label bounding box. To predict the Euclidean distance between the center point of the bounding box and the center point of the label box, This is a penalty term for the angle perception between the center point of the predicted bounding box and the center point of the labeled bounding box. This represents the shape difference between the predicted bounding box and the labeled bounding box.

8. The method for detecting the wearing of safety helmets on small targets in industrial settings according to claim 1, characterized in that, During the training of the auxiliary classification model using the binary classification validation dataset, the following steps are performed: Construct a binary classification network; The binary classification validation dataset is divided into a training set and a validation set. The binary classification network is trained using a training set and then optimized using the cross-entropy loss function. The trained binary classification network is validated using a validation set, and the binary classification network with the best validation results is used as the auxiliary classification model.

9. The method for detecting the wearing of safety helmets on small targets in industrial settings according to claim 1, characterized in that, The initial detection results include detection boxes and output categories. The detection boxes include personnel detection boxes and head area detection boxes. The head area detection boxes include detection boxes for not wearing safety helmets and detection boxes for wearing safety helmets. During the process of screening and verifying the initial test results, the following steps are performed: Remove head region detection boxes whose center point is not inside any person detection box, and filter out the head region detection boxes associated with the person detection boxes. The image region corresponding to the selected head region detection box is cropped and scaled, and then input into the auxiliary classification model to obtain its output category. Determine whether the output category of the auxiliary classification model is consistent with the output category of the improved detection network; In response to the output category of the auxiliary classification model being consistent with the output category of the improved detection network, the output category is taken as the final category, and the final category and the corresponding detection box are taken as the final detection result; In response to the discrepancy between the output category of the auxiliary classification model and the output category of the improved detection network, the output category of the auxiliary classification model is taken as the final category, and the corresponding detection box output by the improved detection network and the final category are taken as the final detection result.

10. A small-target safety helmet wearing detection system for industrial sites, characterized in that, The system employs the helmet-wearing detection method for small targets in industrial settings as described in any one of claims 1-9, wherein the system comprises: The image input and preprocessing module is used to construct a dataset containing targets in the industrial field, heads without safety helmets, and heads with safety helmets, and to form a detection dataset and a binary classification verification dataset. An improved detection network construction module is used to construct an improved detection network based on a single-stage detector. The improved detection network introduces a multi-dimensional fusion attention mechanism in the backbone feature extraction stage, constructs a feature pyramid with multiple scales and adopts a content-aware reorganization operator in the neck feature fusion stage, and adopts a dynamic detection head in the head detection stage. An improved detection network training module is used to train the improved detection network using the detection dataset, optimize the network weights using a multi-objective loss function, and obtain the optimal detection model. A training model for the auxiliary classification model is used to train the auxiliary classification model using the binary classification validation dataset. The detection result output module is used to input the industrial site image to be tested into the optimal detection model to obtain the initial detection result, and to filter and verify the initial detection result in sequence, and output the final detection result. The verification process uses a trained auxiliary classification model.