Operating personnel target detection method, system and equipment based on pruning and medium
By pruning the YOLOv11 model, a lightweight target detection model was constructed, which solved the problem of low efficiency in high-altitude operation safety monitoring on edge devices, achieving a balance between high accuracy and low computational load, and is suitable for real-time monitoring in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-03-27
AI Technical Summary
Traditional high-altitude operation safety monitoring methods are difficult to meet the safety management and control needs in complex environments, and deep learning models have high computational complexity on edge devices, resulting in low operating efficiency.
Based on the YOLOv11 model, pruning is performed. By analyzing the weight parameters of the convolutional layers and their contribution to the model performance, redundant computational units are removed, and a lightweight object detection model is constructed.
It improves the applicability of edge devices, achieves a balance between lightweight and high precision, and can process the classification results of high-altitude or ground operations in real time, meeting the real-time monitoring needs in complex scenarios.
Smart Images

Figure CN121747148A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition, and in particular to a method, system, device, and medium for detecting workers based on pruning. Background Technology
[0002] In scenarios such as power infrastructure construction, high-altitude operations are frequently required. Real-time and accurate detection of the position and status of personnel working at height is crucial for ensuring construction safety and preventing fall accidents. Traditional high-altitude operation safety monitoring relies on manual inspections or fixed camera surveillance, but these methods are insufficient to meet the safety management needs in complex environments.
[0003] With the development of artificial intelligence technology and the diversification of detection technology, deep learning models such as YOLO and Faster R-CNN are gradually being applied to complex scenarios such as high-altitude operations, which are complex and ever-changing. However, these models have high computational complexity and high requirements for equipment performance, making them difficult to apply to edge devices such as drones or embedded cameras. If deployed on edge devices, they will have problems with low operating efficiency. Summary of the Invention
[0004] This invention provides a pruning-based method, system, device, and medium for detecting workers as targets, in order to solve the technical problem of how to improve the operating efficiency of worker target detection methods, enhance applicability to edge devices, and reduce the performance requirements of the devices.
[0005] To address the aforementioned technical problems, embodiments of the present invention provide a method for detecting worker targets based on pruning, comprising: Collect images of workers operating in the target scene area; The image of the worker is input into a pre-trained target detection model, and based on the output of the target detection model, the worker in the target scene area is determined to be a high-altitude worker or a ground worker. The target detection model is trained by pruning the YOLOv11 model, taking into account the weight parameters of each convolutional layer of the YOLOv11 model and the contribution of each convolutional layer weight to the performance of the YOLOv11 model.
[0006] As a preferred embodiment, the method for constructing the target detection model includes: Extract the first weight of each convolutional layer in the YOLOv11 model; Based on the magnitude of each first weight and the contribution of each first weight to the performance of the YOLOv11 model, the importance score corresponding to each first weight is calculated. The first weight, whose importance score is lower than the preset importance threshold, is reset to zero to obtain the second weight; The YOLOv11 model is trained based on the second weight, and the target detection model is obtained when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity.
[0007] As a preferred embodiment, before the first weight reset to zero for importance scores below a preset importance threshold, the method further includes: A labeled sample image is acquired to obtain a basic model. The basic model includes a feature extraction module, a feature fusion module, and a prediction module. The feature extraction module is used to extract features based on the sample image to obtain feature information of each worker. The feature fusion module is used to integrate the feature information to obtain an integrated result. The prediction module performs identification based on the integrated result to obtain the identification result of the worker. The basic model is iteratively optimized using the recognition results and the sample images. During the iterative optimization process, the loss value of the basic model is calculated. When the loss value is less than a preset loss threshold, the YOLOv11 model is obtained.
[0008] As a preferred embodiment, obtaining the target detection model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity includes: When the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity, a pruned model is obtained. The pruning model is initialized based on the first weight, and the initialized pruning model is trained using the sample images to obtain the target detection model.
[0009] As a preferred embodiment, obtaining the labeled sample image includes: Obtain multiple initial samples, and filter them based on their image quality to obtain filtered samples; The selected samples were subjected to brightness and saturation adjustments, and salt-and-pepper noise was added to obtain enhanced samples. The enhanced samples are labeled to obtain labeled sample images.
[0010] As a preferred embodiment, the feature extraction module includes a convolutional kernel and a C3k2 module; the feature fusion module includes an SPPF module; and the prediction module includes a C2PSA module and an aggregation attention module.
[0011] As a preferred embodiment, calculating the loss value of the base model during the iterative optimization process includes: The backpropagation strategy is used in the iterative optimization process, and the loss value of the base model is calculated using the SIOU loss function.
[0012] Accordingly, this invention application also provides a worker target detection system based on pruning, including an image acquisition module and a target detection module; wherein, The image acquisition module is used to acquire images of workers in the target scene area; The target detection module is used to input the image of the worker into a pre-trained target detection model, and based on the output of the target detection model, determine whether the worker in the target scene area is a high-altitude worker or a ground worker. The target detection model is trained by pruning the YOLOv11 model, taking into account the weight parameters of each convolutional layer of the YOLOv11 model and the contribution of each convolutional layer weight to the performance of the YOLOv11 model.
[0013] As a preferred embodiment, the worker target detection system further includes a model building module, which is used for: Extract the first weight of each convolutional layer in the YOLOv11 model; Based on the magnitude of each first weight and the contribution of each first weight to the performance of the YOLOv11 model, the importance score corresponding to each first weight is calculated. The first weight, whose importance score is lower than the preset importance threshold, is reset to zero to obtain the second weight; The YOLOv11 model is trained based on the second weight, and the target detection model is obtained when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity.
[0014] As a preferred embodiment, the model building module is used before the first weights with importance scores below a preset importance threshold are reset to zero: A labeled sample image is acquired to obtain a basic model. The basic model includes a feature extraction module, a feature fusion module, and a prediction module. The feature extraction module is used to extract features based on the sample image to obtain feature information of each worker. The feature fusion module is used to integrate the feature information to obtain an integrated result. The prediction module performs identification based on the integrated result to obtain the identification result of the worker. The basic model is iteratively optimized using the recognition results and the sample images. During the iterative optimization process, the loss value of the basic model is calculated. When the loss value is less than a preset loss threshold, the YOLOv11 model is obtained.
[0015] As a preferred embodiment, the model building module obtains the object detection model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity, including: The model building module obtains a pruned model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity. The pruning model is initialized based on the first weight, and the initialized pruning model is trained using the sample images to obtain the target detection model.
[0016] As a preferred embodiment, the model building module acquires labeled sample images, including: The model building module acquires multiple initial samples, filters them based on their image quality, and obtains filtered samples. The selected samples were subjected to brightness and saturation adjustments, and salt-and-pepper noise was added to obtain enhanced samples. The enhanced samples are labeled to obtain labeled sample images.
[0017] As a preferred embodiment, the feature extraction module includes a convolutional kernel and a C3k2 module; the feature fusion module includes an SPPF module; and the prediction module includes a C2PSA module and an aggregation attention module.
[0018] As a preferred embodiment, the model building module calculates the loss value of the base model during the iterative optimization process, including: The model building module employs a backpropagation strategy during the iterative optimization process and uses the SIOU loss function to calculate the loss value of the base model.
[0019] Accordingly, this application also provides a terminal device, characterized in that it includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the pruning-based worker target detection method.
[0020] Accordingly, this application also provides a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the pruning-based worker target detection method.
[0021] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This invention provides a pruning-based method, system, device, and medium for detecting workers in a work environment. The method includes: acquiring images of workers in a target scene area; inputting the worker images into a pre-trained target detection model; and determining, based on the output of the target detection model, whether the workers in the target scene area are high-altitude workers or ground workers. The target detection model is trained by pruning the YOLOv11 model, taking into account the weight parameters of each convolutional layer and the contribution of each convolutional layer weight to the performance of the YOLOv11 model. This invention prunes the YOLOv11 model by combining convolutional layer weight parameters and their contribution to model performance, removing redundant computational units and effectively reducing the overall computational load of the model. This solves the problem of low running efficiency of traditional deep learning models on edge devices such as drones and embedded cameras, improving the applicability to low-performance devices. In addition, the pruning process is based on the contribution of convolutional layer weights to model performance, avoiding indiscriminate deletion of key weights. While simplifying the model structure, it ensures the core performance of object detection, achieving a balance between lightweight design and high accuracy. Furthermore, the lightweight model has improved inference speed, enabling real-time processing of collected images of workers and rapid output of high-altitude or ground operation classification results, providing timely responses for construction safety management and meeting the real-time monitoring needs in complex operation scenarios. Attached Figure Description
[0022] Figure 1 : A flowchart illustrating an embodiment of the worker target detection method based on pruning provided in this invention application.
[0023] Figure 2 : A schematic diagram of the structure of one embodiment of the basic model provided in this application.
[0024] Figure 3 : A flowchart illustrating one embodiment of the pruning-based worker target detection method provided in this invention application.
[0025] Figure 4 : A schematic diagram of an embodiment of the worker target detection system based on pruning provided in this application of the present invention. Detailed Implementation
[0026] 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.
[0027] Example 1: Please refer to Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the worker target detection method based on pruning provided in this invention application. Figure 1 The illustrated embodiment includes steps S101 to S102; each step is described in detail below: Step S101: Collect images of workers in the target scene area.
[0028] In this implementation, images of workers in the target area can be captured using a smartphone or a camera installed on-site. The target area can refer to a power infrastructure construction site. The camera can be an A10Pro 10x zoom pod from a specific brand.
[0029] Furthermore, to ensure accurate identification in the subsequent step S102, the acquired images can be preprocessed to some extent before step S102. For example, images of poor quality can be removed, or brightness, saturation, and / or salt-and-pepper noise can be added to enhance the images and improve the accuracy of target detection in subsequent steps.
[0030] Step S102: Input the image of the worker into a pre-trained target detection model, and determine whether the worker in the target scene area is a high-altitude worker or a ground worker based on the output of the target detection model.
[0031] The target detection model is trained by pruning the YOLOv11 model, taking into account the weight parameters of each convolutional layer of the YOLOv11 model and the contribution of each convolutional layer weight to the performance of the YOLOv11 model.
[0032] The YOLOv11 model mentioned above refers to a model that uses the YOLOv11 architecture. This YOLOv11 model can be trained based on a base model that also uses the YOLOv11 architecture, and it can serve as a baseline model before pruning.
[0033] In some preferred embodiments, the YOLOv11 model described above can be trained from a base model. For example: A labeled sample image is acquired, and a basic model is obtained. The basic model includes a feature extraction module, a feature fusion module, and a prediction module. The feature extraction module is used to extract features based on the sample image to obtain feature information of each worker. The feature fusion module is used to integrate the feature information to obtain an integrated result. The prediction module performs identification based on the integrated result to obtain the identification result of the worker. The basic model is iteratively optimized using the recognition results and the sample images. During the iterative optimization process, the loss value of the basic model is calculated. When the loss value is less than a preset loss threshold, the YOLOv11 model is obtained.
[0034] In this embodiment, obtaining the labeled sample image includes: Obtain multiple initial samples, and filter them based on their image quality to obtain filtered samples; The selected samples were subjected to brightness and saturation adjustments, and salt-and-pepper noise was added to obtain enhanced samples. The enhanced samples are labeled to obtain labeled sample images.
[0035] The aforementioned enhancement processing of the selected samples can be achieved through the Export Version data augmentation website. Enhancement operations can include image translation, image flipping, random brightness adjustment, and Mosaic data augmentation, where multiple different images are stitched together to create a composite image. The enhanced samples can be labeled using the LabelImg tool as "offground_worker" (high-altitude workers) and "ground_worker" (ground workers). After image labeling, the labeled images can be divided into training and test sets according to a preset ratio, such as 8:2 or 7:3.
[0036] In some preferred embodiments, the feature extraction module of the above-mentioned basic model can be composed of a backbone network, which includes convolutional kernels, C3k2 modules, SPPF modules, C2PSA modules, and attention aggregation modules (AA).
[0037] One example is as follows Figure 2 As shown. Specifically, the above convolutional kernel is the basic module of the Backbone network. Through the convolutional kernel, sliding convolution can be performed on local regions of the input image to extract the basic features of the image and provide low-level information for subsequent deep feature extraction.
[0038] Figure 2The basic model shown adopts an improved YOLOv11 architecture, which consists of three parts: Backbone, Neck, and Head. The Backbone extracts features from the input image, obtaining multi-scale semantic features layer by layer from low to high levels. The Neck fuses the features from different levels output by the Backbone to enhance feature representation. The Head receives the feature map fused by the Neck and outputs the target's class probability, bounding box location information (x, y, w, h), and confidence score based on this feature map.
[0039] The C3k2 module processes the input features in two parts: one part is extracted for deep features through convolution stacking, and the other part is directly connected across layers, and finally the output is fused by concat (concatenation).
[0040] The SPPF module is a multi-scale feature fusion module. It captures information from different receptive fields by performing multi-scale pooling operations on feature maps and fusing contextual features, thereby enhancing the network's ability to perceive large and small targets and improving detection accuracy and robustness.
[0041] The C2PSA module introduces a spatial attention mechanism (SA) on top of the CSP module. It can automatically learn the importance of key regions in the feature map, strengthen the focus on the target region, and improve the semantic expressive power of the features.
[0042] Attention Aggregation (AA) integrates multiple attention mechanisms and enhances extrapolation capabilities for multi-scale inputs. By mimicking foveal vision and continuous eye movements, it enables the network to achieve global perception on each feature map. Through a dual-path design, combining query-centric sliding window attention and pooling attention, it achieves pixel-level translational equivariance, simulating the characteristics of eye movements. This design leads to competition between fine-grained and coarse-grained features, transforming pixel-focused attention into a multi-scale attention mechanism. This module is particularly effective in handling complex backgrounds or targets with varying scales in power infrastructure scenarios, helping the model to more accurately locate and identify targets.
[0043] Furthermore, the feature fusion module fuses feature maps of different scales output by the feature extraction module, integrating the multi-level information extracted by the network at various stages to enhance feature representation and expand the network's receptive field. The prediction module, based on feature fusion, generates multi-scale feature maps through upsampling and layer-by-layer propagation, and then performs target prediction based on these maps. During prediction, each feature map generates multiple prior boxes, each containing category information to distinguish between high-altitude and ground-based workers; it also outputs position coordinates for precise localization. Subsequently, the prior boxes are filtered and optimized using non-maximum suppression (NMS) to obtain the final target detection result. The prediction module ultimately outputs three feature maps of different scales: 144*20*20, 144*40*40, and 144*80*80, corresponding to large, medium, and small target detection tasks, thus achieving effective identification of workers of different sizes.
[0044] Preferably, the step of calculating the loss value of the base model during the iterative optimization process can be: using a backpropagation strategy and the SIOU loss function to calculate the loss value of the base model during the iterative optimization process; when the loss value meets the preset requirements, obtaining the YOLOv11 model and using the YOLOv11 model as the baseline model before pruning.
[0045] In some preferred embodiments, such as Figure 3 As shown, the method for constructing the target detection model includes steps S301 to S304; each step is described in detail below: Step S301: Extract the first weights of each convolutional layer of the YOLOv11 model; Step S302: Based on the magnitude of each first weight and the contribution of each first weight to the performance of the YOLOv11 model, calculate the importance score corresponding to each first weight. Step S303: The first weight with an importance score lower than the preset importance threshold is reset to zero to obtain the second weight; Step S304: Train the YOLOv11 model based on the second weight, and obtain the target detection model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity.
[0046] In this preferred embodiment, the importance score can be calculated using Layer-Adaptive Magnitude-based Pruning (LAMP). After calculating the importance score, this preferred embodiment can perform channel pruning layer by layer, removing channels with lower importance, i.e., resetting the first weight to zero, and finally obtaining the pruned lightweight YOLOv11 model structure, i.e., the object detection model, and saving the corresponding network configuration.
[0047] Further, obtaining the target detection model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity includes: obtaining a pruning model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity; initializing the pruning model based on the first weight, and training the initialized pruning model using the sample images to obtain the target detection model.
[0048] For example, the pruned YOLOv11 model can be loaded with pre-trained weights (the parameters before pruning, i.e., the first weights) to initialize the weights of the remaining channels. Fine-tuning training can then be performed on the original training set to restore model accuracy. Appropriate learning rate scheduling (such as segmented decay of the learning rate) and data augmentation strategies can be employed to recover the accuracy loss caused by pruning and improve generalization ability. The final object detection model maintains high detection accuracy and robustness while reducing computational cost and parameter size.
[0049] Accordingly, this invention application also provides an application example of a worker target detection method based on component pruning. Specifically: From March 13, 2024 to January 6, 2025, using a brand-name A10 Pro 10x zoom pod camera and a smartphone, images and video data of workers at height and on the ground were collected at a power infrastructure construction site in Guangzhou. The collected data covered a variety of background scenes, which helped improve the generalization performance of the network model. During the collection process, weather conditions included sunny, cloudy, and overcast days, and the collection period was from 10:00 to 17:00 daily, covering various lighting environments such as strong light and low light. The collected data also included complex situations such as personnel occlusion, target overlap, and small target detection. Due to the diversity of the natural environment, some images also suffered from low resolution. These factors collectively constituted a significant challenge in the target detection task for workers at height.
[0050] The acquired raw images were first preprocessed, including removing blurry, underexposed, and other low-quality images, and uniformly adjusting image sizes to ensure consistency and standardization of the input data. After screening, 2546 valid images were obtained as sample images. Subsequently, to further improve the robustness and generalization ability of the model, data augmentation was performed on the screened images. Specifically, using the ExportVersion data augmentation platform, the brightness (range -15% to 15%) and saturation (range -15% to 15%) of the images were randomly adjusted, and salt-and-pepper noise (0.3% of total pixels) was added to some images to enhance the model's adaptability under different lighting, color deviation, and noise interference environments.
[0051] The sample images were divided into two categories: ground workers and high-altitude workers. The LabelImg software was used to annotate each preprocessed image, assigning them the category labels "ground_worker" and "offground_worker". After annotation, the dataset contained 3548 target instances, including 1861 ground workers and 1687 high-altitude workers.
[0052] After the images are labeled, the operators and the corresponding .txt label files are divided into training and test sets in an 8:2 ratio, with 2036 images in the training set and 510 images in the test set.
[0053] The training set is used to train the base model. The structure and training process of the base model are the same as described above. Figure 1 The illustrated embodiments and their preferred implementations are basically the same. It should be noted that this application example is consistent with the above... Figure 1 The difference between the illustrated embodiment and its preferred embodiment lies in that the steps performed by the aggregation attention mechanism specifically include: Sliding window attention performs local self-attention computation on the input feature map. Sliding window attention can capture fine-grained dependencies between adjacent regions in the spatial dimension, enabling the network to maintain local awareness while having stronger context modeling capabilities, thereby better extracting the edge, pose, and local action features of high-altitude workers; Subsequently, pooling attention is introduced. This method obtains global contextual information by performing global pooling on the feature map, and then weights different regions based on global features. Pooling attention can highlight key region features and suppress irrelevant background interference, thereby improving the detection capability of small and distant targets in complex construction environments. The convergent attention mechanism integrates two approaches. Firstly, it leverages sliding window attention to provide pixel-level local sensitivity, ensuring accurate capture of details in the movements of workers at height (such as whether safety belts are worn correctly). Secondly, it utilizes pooling attention to provide global contextual constraints, guaranteeing robust detection performance even in situations with large background areas, varying lighting, or occlusion. Through this fusion, the convergent attention mechanism achieves pixel-level translational equivariance and multi-scale adaptive feature enhancement, effectively mitigating the detection difficulties caused by the significant size variations and dynamic postures of workers at height in monitoring footage. Furthermore, this mechanism improves detection accuracy without significantly increasing network computational complexity, making it suitable for real-time video monitoring scenarios at power construction sites.
[0054] After training the above basic model, the YOLOv11 model is obtained. The YOLOv11 model is then pruned to obtain the object detection model.
[0055] This application example is based on the Ubuntu 20.04 operating system, with Python 3.9 and CUDA 12.2 as the experimental environment. Training was performed on an NVIDIA GeForce RTX 3080 11GB graphics card. YOLOv11n was used as the network architecture for the model. The input image size was 3×640×640, and images were scaled to a uniform size to improve speed. The batch size was set to 32, allowing the device's GPU to run at full power. The initial learning rate was 0.01, the minimum learning rate was 0.0001, and the initial number of training epochs was 300. After 2 hours of training, the optimal network model, namely the YOLOv11 model, was obtained. The experimental results are detailed below: Based on the final detection results of the network, the accuracy and speed of the network are evaluated using metrics such as precision (P), recall (R), mean average precision (mAP), model size, and computational cost (GFLOPs). The YOLOv11 model is compared with other algorithms using ablation experiments, and the results are shown in Table 1 below.
[0056] Table 1. Performance comparison of the YOLOv11 model in this example with other algorithms. The results in the table above show that, compared with other algorithms, this method achieves the best balance in terms of accuracy (P), recall (R), mean average precision (mAP), model size, and computational cost (GFLOPs).
[0057] Furthermore, LAMP pruning was performed on the YOLOv11 model. First, the YOLOv11 model and related parameters were initialized, including setting a target sparsity to provide a clear quantitative standard for the subsequent pruning process. Then, each layer of the network was traversed, focusing on extracting the weight parameters of the convolutional layers, and the absolute values of these weights were sorted in ascending order to lay the foundation for identifying low-importance weights.
[0058] The importance of each (first) weight is evaluated using the LAMP metric. LAMP generates a score for each weight by combining its magnitude with its contribution to model performance; a lower score indicates that the weight is less important to the model and therefore more suitable for pruning. Based on the calculated scores, low-importance weights in the current layer are selected and set to zero, achieving sparsity. During this process, the weight matrix needs to be updated to preserve the pruned structure while simultaneously adjusting network parameters to ensure that pruning does not disrupt the overall structure and functionality of the model.
[0059] Finally, it is determined whether the sparsity of the network as a whole or in each layer has reached the preset target. If the target sparsity has not been reached, the previous steps are returned, the ranking of the remaining weights and the LAMP score are recalculated, and pruning is performed iteratively. After multiple iterations, when the sparsity meets the set requirements, the pruned model is initialized based on the first weight, and the initialized pruned model is trained using the sample images to obtain the object detection model.
[0060] The YOLOv11 model (object detection model) after pruning and further training, and the metrics of the high-altitude worker target detection model, including accuracy (P), recall (R), mean average precision (mAP), model size, and computational cost (GFLOPs), are shown in Table 2 below. Table 2 Comparison of YOLOv11 model before and after pruning As shown in the table above, compared with the YOLOv11 model, the object detection model has improved accuracy (P), recall (R), and mean average precision (mAP) while significantly reducing the model parameter size and computational cost (GFLOPs), making this method more suitable for deployment and application on edge devices.
[0061] Accordingly, such as Figure 4 As shown, this invention application also provides a worker target detection system 400 based on pruning, including an image acquisition module 401 and a target detection module 402; wherein, The image acquisition module 401 is used to acquire images of workers in the target scene area; The target detection module 402 is used to input the image of the worker into a pre-trained target detection model, and based on the output of the target detection model, determine whether the worker in the target scene area is a high-altitude worker or a ground worker. The target detection model is trained by pruning the YOLOv11 model, taking into account the weight parameters of each convolutional layer of the YOLOv11 model and the contribution of each convolutional layer weight to the performance of the YOLOv11 model.
[0062] As a preferred embodiment, the worker target detection system 400 further includes a model building module, which is used for: Extract the first weight of each convolutional layer in the YOLOv11 model; Based on the magnitude of each first weight and the contribution of each first weight to the performance of the YOLOv11 model, the importance score corresponding to each first weight is calculated. The first weight, whose importance score is lower than the preset importance threshold, is reset to zero to obtain the second weight; The YOLOv11 model is trained based on the second weight, and the target detection model is obtained when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity.
[0063] As a preferred embodiment, the model building module is used before the first weights with importance scores below a preset importance threshold are reset to zero: A labeled sample image is acquired to obtain a basic model. The basic model includes a feature extraction module, a feature fusion module, and a prediction module. The feature extraction module is used to extract features based on the sample image to obtain feature information of each worker. The feature fusion module is used to integrate the feature information to obtain an integrated result. The prediction module performs identification based on the integrated result to obtain the identification result of the worker. The basic model is iteratively optimized using the recognition results and the sample images. During the iterative optimization process, the loss value of the basic model is calculated. When the loss value is less than a preset loss threshold, the YOLOv11 model is obtained.
[0064] As a preferred embodiment, the model building module obtains the object detection model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity, including: The model building module obtains a pruned model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity. The pruning model is initialized based on the first weight, and the initialized pruning model is trained using the sample images to obtain the target detection model.
[0065] As a preferred embodiment, the model building module acquires labeled sample images, including: The model building module acquires multiple initial samples, filters them based on their image quality, and obtains filtered samples. The selected samples were subjected to brightness and saturation adjustments, and salt-and-pepper noise was added to obtain enhanced samples. The enhanced samples are labeled to obtain labeled sample images.
[0066] As a preferred embodiment, the feature extraction module includes a convolutional kernel and a C3k2 module; the feature fusion module includes an SPPF module; and the prediction module includes a C2PSA module and an aggregation attention module.
[0067] As a preferred embodiment, the model building module calculates the loss value of the base model during the iterative optimization process, including: The model building module employs a backpropagation strategy during the iterative optimization process and uses the SIOU loss function to calculate the loss value of the base model.
[0068] Accordingly, this application also provides a terminal device, characterized in that it includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the pruning-based worker target detection method.
[0069] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal, connecting various parts of the terminal via various interfaces and lines.
[0070] The memory can be used to store the computer program. The processor implements various functions of the terminal by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0071] Accordingly, this application also provides a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the pruning-based worker target detection method.
[0072] The modules integrated into the pruning-based worker target detection system, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0073] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This invention provides a pruning-based method, system, device, and medium for detecting workers in a work environment. The method includes: acquiring images of workers in a target scene area; inputting the worker images into a pre-trained target detection model; and determining, based on the output of the target detection model, whether the workers in the target scene area are high-altitude workers or ground workers. The target detection model is trained by pruning the YOLOv11 model, taking into account the weight parameters of each convolutional layer and the contribution of each convolutional layer weight to the performance of the YOLOv11 model. This invention prunes the YOLOv11 model by combining convolutional layer weight parameters and their contribution to model performance, removing redundant computational units and effectively reducing the overall computational load of the model. This solves the problem of low running efficiency of traditional deep learning models on edge devices such as drones and embedded cameras, improving the applicability to low-performance devices. In addition, the pruning process is based on the contribution of convolutional layer weights to model performance, avoiding indiscriminate deletion of key weights. While simplifying the model structure, it ensures the core performance of object detection, achieving a balance between lightweight design and high accuracy. Furthermore, the lightweight model has improved inference speed, enabling real-time processing of collected images of workers and rapid output of high-altitude or ground operation classification results, providing timely responses for construction safety management and meeting the real-time monitoring needs in complex operation scenarios.
[0074] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for detecting workers based on pruning, characterized in that, include: Collect images of workers operating in the target scene area; The images of the workers are input into a pre-trained target detection model, and based on the output of the target detection model, the workers in the target scene area are determined to be either high-altitude workers or ground workers. The target detection model is based on the YOLOv11 model, and is trained by pruning the YOLOv11 model by combining the weight parameters of each convolutional layer of the YOLOv11 model and the contribution of each convolutional layer weight to the performance of the YOLOv11 model.
2. The method for detecting workers based on pruning as described in claim 1, characterized in that, The method for constructing the target detection model includes: Extract the first weight of each convolutional layer in the YOLOv11 model; Based on the magnitude of each first weight and the contribution of each first weight to the performance of the YOLOv11 model, the importance score corresponding to each first weight is calculated. The first weight, whose importance score is lower than the preset importance threshold, is reset to zero to obtain the second weight; The YOLOv11 model is trained based on the second weight, and the target detection model is obtained when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity.
3. The method for detecting workers based on pruning as described in claim 2, characterized in that, Before the first weighting process of resetting importance scores below a preset importance threshold to zero, the method further includes: A labeled sample image is acquired to obtain a basic model. The basic model includes a feature extraction module, a feature fusion module, and a prediction module. The feature extraction module is used to extract features based on the sample image to obtain feature information of each worker. The feature fusion module is used to integrate the feature information to obtain an integrated result. The prediction module performs identification based on the integrated result to obtain the identification result of the worker. The basic model is iteratively optimized using the recognition results and the sample images. During the iterative optimization process, the loss value of the basic model is calculated. When the loss value is less than a preset loss threshold, the YOLOv11 model is obtained.
4. The method for detecting workers based on pruning as described in claim 2, characterized in that, The process of obtaining the target detection model when the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity includes: When the sparsity of the YOLOv11 model and each convolutional layer of the YOLOv11 model reaches the target sparsity, a pruned model is obtained. The pruning model is initialized based on the first weight, and the initialized pruning model is trained using the sample images to obtain the target detection model.
5. The method for detecting workers based on pruning as described in claim 3, characterized in that, The process of obtaining labeled sample images includes: Obtain multiple initial samples, and filter them based on their image quality to obtain filtered samples; The selected samples were subjected to brightness and saturation adjustments, and salt-and-pepper noise was added to obtain enhanced samples. The enhanced samples are labeled to obtain labeled sample images.
6. The method for detecting workers based on pruning as described in claim 3, characterized in that, The feature extraction module includes a convolution kernel, a C3k2 module, an SPPF module, a C2PSA module, and a convergent attention module.
7. A method for detecting worker targets based on pruning as described in any one of claims 3 to 6, characterized in that, The calculation of the loss value of the base model during the iterative optimization process includes: The backpropagation strategy is used in the iterative optimization process, and the loss value of the base model is calculated using the SIOU loss function.
8. A worker target detection system based on pruning, characterized in that, It includes an image acquisition module and a target detection module; among which, The image acquisition module is used to acquire images of workers in the target scene area; The target detection module is used to input the image of the worker into a pre-trained target detection model, and based on the output of the target detection model, determine whether the worker in the target scene area is a high-altitude worker or a ground worker. The target detection model is trained by pruning the YOLOv11 model, taking into account the weight parameters of each convolutional layer of the YOLOv11 model and the contribution of each convolutional layer weight to the performance of the YOLOv11 model.
9. A terminal device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the pruning-based worker target detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the pruning-based worker target detection method as described in any one of claims 1 to 7.