Lightweight Swinin-YOLO intelligent construction site safety real-time monitoring method

By combining the lightweight Swin-YOLO model with GAM, SIoU, and Soft-NMS, the real-time detection problem of smoke, flames, safety helmets, and reflective clothing in smart construction sites was solved, achieving efficient and accurate construction site safety monitoring and promoting the intelligent and efficient safety management of smart construction sites.

CN120673324APending Publication Date: 2025-09-19CHINA CONSTRUCTION SIXTH ENGINEERING DIVISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510536675.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies for monitoring smoke, flames, safety helmets, and reflective clothing at construction sites in smart construction sites rely on traditional manual patrols, making it difficult to achieve comprehensive, continuous, and real-time monitoring. Furthermore, the complex environment limits detection accuracy and efficiency.

Method used

A lightweight Swin-YOLO (Swin Transformer-YOLOv5s.60) model is used, combined with the GAM attention mechanism, SIoU loss function, and Soft-NMS, to build a multi-target real-time detection network. By building a rich construction site dataset, model training is optimized to achieve efficient and accurate detection of smoke, flames, safety helmets, and reflective clothing.

Benefits of technology

It achieves comprehensive and continuous safety monitoring of construction sites, improves detection accuracy and efficiency, reduces manual intervention, reduces management costs, and enhances the safety prevention and control capabilities of construction sites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673324A_ABST
    Figure CN120673324A_ABST
Patent Text Reader

Abstract

The invention provides a lightweight Swin-YOLOs (SwinTransform-YOLOv5s.60) intelligent construction site safety real-time monitoring method. A multi-element intelligent construction site safety data set containing safety helmets, reflective vests, smog, flames and constructors is constructed. In the pre-training stage, YOLOv5s.60 is adopted to carry out small sample iteration training so as to improve the initial precision; the model fusion stage is optimized through the following steps: 1, fusing a lightweight Swin Transform with a YOLOv5s.60 target detection algorithm, and enhancing small target feature extraction; 2, introducing a GAM attention module, and improving multi-scale feature fusion; and 3, SIoU and Soft-NMS are adopted, so that the prediction precision is improved. And the Swin Transformer-YOLOv5s.60 is finally formed through verification of an ablation experiment, so that the Swin Transformer-YOLOv5s.60 is formed. The method has the real-time advantage of the YOLO algorithm and the lightweight high-precision characteristic of Swin Transform, multi-target real-time monitoring of safety equipment wearing, dangerous environment (smoke / flame) and constructors is achieved in an intelligent construction site scene, the average model precision mAP at 50 reaches 92.4%, the edge equipment reasoning speed is larger than or equal to 30 FPS, the generalization ability is high, potential safety hazards can be effectively reduced, and the method is suitable for popularization and application. And construction site safety management intelligence is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart construction site safety monitoring technology, specifically a lightweight Swin-YOLO (SwinTransformer-YOLOv5s.60) smart construction site safety real-time monitoring method. This method utilizes the GAM attention mechanism, SIoU, and Soft-NMS optimization model to achieve real-time detection of multiple targets, including construction personnel, safety equipment, and hazardous environments. Background Art

[0002] In the field of smart construction sites, ensuring the safety of the construction site environment and personnel has become a key focus of core technology applications. Real-time monitoring of smoke and flames around construction workers, as well as verifying whether workers are properly wearing helmets and reflective vests, are key measures for preventing fire accidents, ensuring orderly construction production, and ensuring the safety of personnel. Promptly identifying and responding to alarms indicating smoke, flames, and improperly worn safety equipment within the construction area allows for swift action in the early stages of an incident, controlling the escalation of the situation and effectively protecting personnel and property. However, most construction sites currently rely primarily on traditional patrols and manual inspections for monitoring smoke, flames, helmets, and reflective vests. This model is not only slow to respond, making it difficult to promptly identify and address potential safety hazards, but also limited by manpower, making it impossible to achieve comprehensive and continuous monitoring. The limitations of manual monitoring are particularly pronounced in large or complex construction environments, easily leading to blind spots and omissions in safety supervision. Therefore, it is necessary to closely integrate intelligent safety monitoring technology with construction site management processes, using data analysis, early warning alerts, and other means to achieve comprehensive control and optimization of construction site safety.

[0003] To address these safety challenges, the smart construction site sector urgently needs more advanced and efficient technical solutions. The application and optimization of datasets on construction worker behavior, smoke, flames, hard hats, and reflective vests are particularly critical. Leveraging deep learning AI technology, we can instantly process surveillance video to automatically detect the presence of smoke and flames within the construction area, while also monitoring whether construction workers are wearing hard hats and reflective vests, thereby enabling intelligent safety monitoring. To achieve this goal, we need to address multiple challenges. Primarily, the diverse and ever-changing nature of construction site environments, such as fluctuating light intensity and obstructions to vision, pose significant challenges to detection accuracy. Facing such complex environments, algorithms must be highly flexible and robust, adapting to and accurately recognizing a wide range of scenarios. This requires incorporating advanced adaptive mechanisms into the algorithm design to ensure stable and accurate detection of smoke, flames, and whether construction workers are properly wearing hard hats and reflective vests, even in the presence of drastic lighting changes or obstructions. Furthermore, the completeness and accuracy of the dataset are invaluable for improving the model's learning efficiency and generalization capabilities. In order to train a model with excellent performance, we must carefully construct a dataset that should not only cover a wide range of construction scenarios, including different time periods (to reflect changes in lighting), weather conditions, types of construction activities, and a rich set of behavioral patterns of construction workers, but also place special emphasis on the detailed depiction of flames and smoke. In addition, the dataset needs to pay special attention to the wearing of safety helmets and reflective clothing, and provide the model with sufficient and diverse learning materials by collecting a large number of relevant examples. In this way, the model can not only accurately identify safety equipment that is not worn or worn improperly, but also quickly and accurately detect the presence of flames and smoke in complex and changing construction environments, thereby effectively enhancing safety supervision on the construction site and preventing the occurrence of fire accidents. Therefore, promoting the deep integration of technology and actual construction processes is also the key to achieving full-chain safety supervision and optimization of smart construction sites.

[0004] In recent years, the rapid development of deep learning technology, particularly breakthroughs in convolutional neural networks (CNNs) and Transformer architectures in computer vision, has brought unprecedented opportunities for intelligent analysis in smart construction site safety monitoring. These technologies have not only advanced the theoretical frontiers of artificial intelligence but also demonstrated tremendous potential and value in practical applications, particularly in construction site safety monitoring, which requires high precision and real-time response. While early models such as R-CNN (Regions with Convolutional Neural Networks), SPP-Net (Spatial Pyramid Pooling Networks), and Fast R-CNN have achieved significant success in improving object recognition accuracy, they still face challenges in practical application. In particular, limitations in detection speed make these models inadequate for the urgent need for real-time monitoring on construction sites. Construction sites are often complex environments with rapidly changing safety hazards, making efficient and real-time safety monitoring technology crucial. It is against this backdrop that the YOLO (You Only Look Once) family of algorithms emerged, revolutionizing smart construction site safety monitoring. YOLOv1, the pioneering work in the YOLO series, embodies the core concept of transforming object detection into a single forward propagation process, enabling real-time, dynamic safety monitoring. This innovation not only significantly improves detection efficiency but also enables the model to respond to safety risks at construction sites in real time while maintaining high recognition accuracy. With the continuous development of the YOLO series, subsequent versions such as YOLOv2, YOLOv3, and YOLOv4 have further improved recognition accuracy and robustness while maintaining efficient detection. However, with the continuous advancement of technology, we also need to explore more advanced network architectures. The Swin Transformer, an emerging lightweight deep learning architecture, has demonstrated strong performance in image recognition. It divides the image into multiple non-overlapping windows and performs self-attention calculations within these windows, accurately capturing local image features. Furthermore, the Swin Transformer integrates global image information through interactions between windows. This local-to-global modeling approach enables the Swin Transformer to maintain high recognition accuracy while also demonstrating strong generalization capabilities. These algorithms continuously break through technical bottlenecks by introducing more advanced network structures, optimizing training strategies, and utilizing richer data sets, providing more reliable and efficient solutions for smart construction site safety monitoring.

[0005] In the field of smart construction site safety monitoring, this invention combines the Swin Transformer and YOLO models to detect construction workers, smoke, flames, safety helmets, and reflective clothing. By building a deep learning model based on Swin Transformer-YOLOv5s.60, we can achieve real-time processing of surveillance video, automatically detecting the presence of smoke and flames in the construction area, and simultaneously monitoring whether construction workers are wearing safety helmets and reflective clothing. This intelligent safety monitoring method not only balances detection accuracy and speed, but also enables comprehensive and continuous monitoring, effectively ensuring construction site safety. Summary of the Invention

[0006] Based on the above problems, the purpose of the present invention is to provide a lightweight Swin-YOLO (Swin Transformer-YOLOv5s.60) smart construction site safety real-time monitoring method, which can accurately and efficiently identify detection targets and achieve the purpose of real-time dynamic monitoring.

[0007] A lightweight Swin-YOLO smart construction site safety real-time monitoring method, including:

[0008] Step 1: Collect image data of construction workers, smoke, flames, safety helmets, and reflective clothing in different scenes in the construction area, accumulating 23,944 images;

[0009] Step 2: For the collected image data of various categories, select 20% representative images of each category, perform preprocessing, and then manually label the data;

[0010] Step 3: Place the image and the annotated labels into the YOLOv5s.60 ​​model and perform parameter training to retain the optimal accuracy, weight parameters and corresponding training parameters after training;

[0011] Step 4: Use the weight parameter with the highest accuracy to reverse-label 20% of the remaining 80% of the images in each category to obtain the labeled labels. Then, the entire image is fed into the YOLOv5s.60 ​​model and trained using the optimal training parameters to obtain the post-training accuracy.

[0012] Step 5: If the accuracy index increases, repeat step 4 until all images are reverse-labeled. If the accuracy index decreases, increase the percentage of initial manual data annotation in step 2, and then repeat steps 3 and 4 to finally obtain the labels of the dataset.

[0013] Step 6: Improve the target detection algorithm model of YOLOv5s.60 ​​based on the lightweight adaptive attention network model Swin Transformer, the attention mechanism GAM, the SCYLLA-IoU loss function, and the flexible non-maximum suppression Soft-NMS, and build a new target detection network model Swin Transformer-YOLOv5s.60;

[0014] Step 7: Send all images and the dataset labels obtained in step 5 to the Swin Transformer-YOLOv5s.60 ​​network model for parameter training, and retain the highest accuracy index and corresponding training parameters after training;

[0015] Step 8: Use the optimal training parameters to conduct a GAM ablation experiment, compare the model prediction accuracy indicators, and select the model with the highest accuracy as the final model;

[0016] Step 9: Deploy the model on the monitoring end to perform real-time testing to see if the target is detected.

[0017] The pre-processing in step 2 includes rotation, scaling, cropping, occlusion, and color brightness change.

[0018] In step 3, YOLOv5s.60 ​​is used for pre-training, which includes the following steps:

[0019] Step 3.1: Input: Mosaic data enhancement, adaptive anchor box calculation, and adaptive image scaling are performed in sequence;

[0020] Step 3.2: Extract features in the feature extraction backbone network;

[0021] Step 3.3: In the neck network Neck module, a combination of feature pyramid FPN and path aggregation network PAN is used to perform multi-scale fusion of different feature maps;

[0022] Step 3.4: In the prediction module, CIoU is used to calculate the score of the target proposal box;

[0023] Step 3.5: Use NMS in the prediction module to suppress the suggestion boxes smaller than the threshold and retain the suggestion boxes larger than the threshold;

[0024] Step 3.6: When the maximum number of training rounds is reached, the above steps are automatically stopped and the results are output;

[0025] Step 3.7: Re-adjust the training parameters, and then repeat steps 3.1-3.6. After comparison, select the one with the highest accuracy and the corresponding training parameters.

[0026] The specific structure of the target monitoring network model SwinTransformer-YOLOv5s.60 ​​in step 6 is: the feature extraction backbone network Backbone in the YOLOv5s.60 ​​model is replaced with the PatchEmbed, SwinStage, {PatchMerging, SwinStage}*3 modules in the lightweight adaptive attention network model SwinTransformer, and the attention mechanism GAM is connected between the neck network Neck and the large, medium and small targets at the prediction end (Prediction), and the complete loss function CIoU and non-maximum suppression NMS at the prediction end in YOLOv5s.60 ​​are replaced with SIoU and Soft-NMS.

[0027] The step 7 comprises:

[0028] Step 7.1: Use the image and the dataset labels obtained in step 5 as input to the improved Swin Transformer-YOLOv5s.60 ​​model. Mosaic data augmentation, adaptive anchor box calculation, and adaptive image scaling are performed on the input side.

[0029] Step 7.2: In the feature extraction backbone network Backbone, extract features through PatchEmbed, SwinStage, {PatchMerging, SwinStage}*3 modules in sequence;

[0030] Step 7.3: In the neck network module, a combination of feature pyramid FPN and path aggregation network PAN is used to perform multi-scale fusion of different feature maps;

[0031] Step 7.4: In the GAM module, the multi-scale fused features are sequentially passed through the channel attention submodule and the spatial attention submodule to extract image semantics and locate feature information;

[0032] Step 7.5: In the prediction module, SIoU is used to calculate the score of the target proposal box;

[0033] Step 7.6: Use Soft-NMS in the prediction module to suppress the suggestion boxes smaller than the threshold and retain the suggestion boxes larger than the threshold.

[0034] Step 7.7: When the maximum number of training rounds is reached, the above steps are automatically stopped and the results are output;

[0035] Step 7.8: Re-adjust the training parameters, and then repeat steps 7.1-7.7. After comparison, select the one with the highest accuracy and the corresponding training parameters.

[0036] The step 8 comprises:

[0037] Step 8.1: In the Swin Transformer model, keep the GAM between the Neck module and the output of the predicted large target (Prediction), delete the GAM between the predicted medium and small targets, and repeat step 7;

[0038] Step 8.2: In the Swin Transformer model, keep the GAM between the Neck module and the output of the predicted target (Prediction), and delete the GAM between the predicted large and small targets.

[0039] Repeat step 7;

[0040] Step 8.3: In the Swin Transformer model, keep the GAM between the Neck module and the output of the prediction of the small target (Prediction), delete the GAM between the prediction of the large and medium targets, and repeat step 7.

[0041] The beneficial effects of the present invention are:

[0042] 1: This paper constructs a construction safety dataset for smart construction sites, which includes detection of construction workers, smoke, flames, safety helmets, and reflective clothing, covering a total of five categories and accumulating 23,944 images.

[0043] 2: The lightweight model Swin Transformer, attention mechanism GAM, Scylla loss function SIoU, flexible non-maximum suppression Soft-NMS and YOLOv5s.60 ​​are organically integrated, greatly improving the model's lightweight, adaptive features and model prediction accuracy.

[0044] 3: The present invention realizes automatic detection of construction area safety. This innovation not only strengthens the safety control system of smart construction sites, but also greatly reduces manual intervention, eliminates the influence of subjective judgment, improves detection efficiency, and effectively reduces management costs. It demonstrates wide applicability, injects new impetus into the safe construction and development of smart construction sites, and promotes construction safety management towards intelligence and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A lightweight Swin-YOLO (Swin Transformer-YOLOv5s.60) smart construction site safety real-time monitoring method;

[0046] Figure 2 The target detection data in the present invention includes (a) personnel, safety helmets, and reflective clothing in complex construction scenes; (b) personnel, reflective clothing, and safety helmets in simple construction scenes; and (c) smoke and flames.

[0047] Figure 3 This is the target detection data preprocessing in the present invention; among them, (a) rotation, (b) scaling, (c) cropping, (d) occlusion and (ad) accessory color change;

[0048] Figure 4 The data set annotations in the present invention; (a) is a screenshot of the initial interface, (b) is a screenshot of a new project, (c) is a screenshot of the data set annotations, and (d) is a screenshot of the saved export;

[0049] Figure 5 This is the YOLOv5s.60 ​​network structure diagram in the present invention;

[0050] Figure 6 This is the network structure diagram of the lightweight network Swin Transformer in the present invention:

[0051] Figure 7 Schematic diagram of the GAM structure of the attention mechanism in the present invention;

[0052] Figure 8 This is the improved network structure diagram of the present invention;

[0053] Figure 9 The network structure diagram of the ablation experiment in the present invention, (a) the network structure diagram of the predicted large target output end, (b) the network structure diagram of the predicted medium target output end, (c) the network structure diagram of the predicted small target output end (d);

[0054] Figure 10 This is the final network structure diagram after the ablation experiment in the present invention;

[0055] Figure 11 The final network model training results of the present invention; including (a) confusion matrix (b) label information (c) the relationship between the horizontal and vertical coordinates of the center point and the height and width of the box (d) visualization of the training results analysis (e) mAP values ​​of each category (f) precision P value;

[0056] Figure 12 This is the interface design of the monitoring terminal in the present invention, including (a) the image recognition function interface and (b) the camera / video monitoring function interface;

[0057] Figure 13The real-time monitoring effect of construction safety in the present invention is shown in Figure 1. (a) is a schematic diagram of automatic image detection, (b) is a schematic diagram of real-time monitoring by a camera during the day, and (c) is a schematic diagram of real-time monitoring by a camera at night. DETAILED DESCRIPTION

[0058] The invention will be further described below with reference to the accompanying drawings and specific implementation examples.

[0059] like Figure 1 As shown in FIG, a lightweight Swin-YOLO (Swin Transformer-YOLOv5s.60) smart construction site safety real-time monitoring method includes the following steps:

[0060] Step 1: Collect image data of construction workers, smoke, flames, safety helmets, and reflective clothing in different scenes in the construction area, accumulating 23,944 images;

[0061] In this embodiment, the data includes five parts: smoke, flame, safety helmet, reflective clothing, and construction personnel. Figure 2 .

[0062] Step 2: For the collected image data of various categories, select 20% representative images of each category, perform preprocessing, and then manually label the data;

[0063] The following four random combination operations are performed on smoke, flame, safety helmet, reflective clothing, and construction workers, respectively, through rotation, scaling, cropping, and blocking. Figure 3 ; Dataset annotation: labelimg is an open source image annotation tool, see Figure 4 (a), click Open Dir (open picture), see Figure 4 (b) Select SaveDir, Pascal VOC (label format), click Create RectBox, select the appropriate annotation shape on the left, and fill in the category on the right. Figure 4 (c), click Save, see Figure 4 (d) and proceed to the next one in sequence until all the annotations are completed.

[0064] Step 3: Place the image and the annotated labels into the YOLOv5s.60 ​​model and perform parameter training to retain the optimal accuracy, weight parameters, and corresponding training parameters after training. This includes the following steps:

[0065] Step 3.1: Input: See Figure 5 Mosaic data enhancement, adaptive anchor box calculation and adaptive image scaling are performed in sequence;

[0066] Step 3.2: In the feature extraction backbone network, see Figure 5 Extract features in

[0067] Step 3.3: In the Neck module, see Figure 5 The combination of feature pyramid FPN and path aggregation network PAN is used to perform multi-scale fusion of different feature maps;

[0068] Step 3.4: In the Prediction module, see Figure 5 Use CIoU to calculate the score of the target proposal box;

[0069] Step 3.5: In the Prediction module, see Figure 5 Use NMS to suppress suggestion boxes smaller than the threshold and retain suggestion boxes larger than the threshold;

[0070] Step 3.6: When the maximum number of training rounds is reached, the above steps are automatically stopped and the results are output;

[0071] Step 3.7: Re-adjust the training parameters, and then repeat steps 3.1-3.6. After comparison, select the one with the highest accuracy and the corresponding training parameters.

[0072] Step 4: Use the weight parameter with the highest accuracy to select 20% of the remaining 80% of the images in each category for reverse annotation to obtain the annotation labels. Then, the whole is fed into the YOLOv5s.60 ​​model. Figure 5 , use the optimal training parameters for training and obtain the accuracy after training;

[0073] Step 5: If the accuracy index increases, repeat step 4 until all images are reversed; if the accuracy index decreases, it is necessary to increase the initial manual data annotation in step 2 ( Figure 4 ), and then repeat steps 3 and 4 above to finally obtain the label of the dataset;

[0074] Step 6: Improve the target detection algorithm model of YOLOv5s.60 ​​based on the lightweight adaptive attention network model Swin Transformer, the attention mechanism GAM, the SCYLLA-IoU loss function, and the flexible non-maximum suppression Soft-NMS, and build a new target detection network model Swin Transformer-YOLOv5s.60;

[0075] YOLOv5s.60 ​​model, including input, feature extraction backbone network (Backbone), neck module, prediction output (Prediction), see Figure 5 . Use PatchEmbed, SwinStage, {PatchMerging, SwinStage}*3 structure in SwinTransformer network, see Figure 6 Replace the feature extraction backbone network (Backbone) in the YOLOv5s.60 ​​model and the attention mechanism GAM, see Figure 7 Connect the neck network (Neck) in the YOLOv5s.60 ​​model to the output terminal (Prediction) for predicting small, medium, and large targets to improve the target prediction accuracy. Finally, replace CIoU and NMS in the YOLOv5s.60 ​​prediction terminal with SIoU and Soft-NMS. The improved network structure is shown in the figure. Figure 8 .

[0076] Step 7: All images and the dataset labels obtained in step 5 are fed into the Swin Transformer-YOLOv5s.60 ​​network model ( Figure 8 ) to perform parameter adjustment training, retaining the highest accuracy index after training and the corresponding training parameters, including:

[0077] Step 7.1: Use the image and the dataset labels obtained in step 5 as input to the improved Swin Transformer-YOLOv5s.60 ​​model. At the input end (Input), perform Mosaic data enhancement, adaptive anchor box calculation, and adaptive image scaling processing in sequence. Figure 8 ;

[0078] Step 7.2: Extract features in the feature extraction backbone network Backbone through PatchEmbed, SwinStage, {PatchMerging, SwinStage}*3 modules in sequence, see Figure 8 ;

[0079] Step 7.3: In the neck network Neck module, the combination of feature pyramid FPN and path aggregation network PAN is used to perform multi-scale fusion of different feature maps, see Figure 8 ;

[0080] Step 7.4: In the GAM module, the multi-scale fused features are sequentially processed through the channel attention submodule and the spatial attention submodule to extract image semantics and locate feature information. Figure 8 ;

[0081] Step 7.5: In the prediction module, SIoU is used to calculate the score of the target proposal box, see Figure 8 ;

[0082] Step 7.6: Use Soft-NMS in the prediction module to suppress the suggestion boxes smaller than the threshold and retain the suggestion boxes larger than the threshold, see Figure 8 ;

[0083] Step 7.7: When the maximum number of training rounds is reached, the above steps are automatically stopped and the results are output;

[0084] Step 7.8: Re-adjust the training parameters, and then repeat steps 7.1-7.7. After comparison, select the one with the highest accuracy and the corresponding training parameters.

[0085] Step 8: Use the optimal training parameters to conduct GAM ablation experiments, compare the model prediction accuracy indicators, and select the model with the highest accuracy as the final model, including;

[0086] Step 8.1: In the Swin Transformer model, keep the GAM between the Neck module and the output of the predicted large target (Prediction), and delete the GAM between the predicted medium and small targets, see Figure 9 (a), repeat step 7;

[0087] Step 8.2: In the Swin Transformer model, keep the GAM between the Neck module and the output of the predicted target (Prediction), and delete the GAM between the predicted large and small targets.

[0088] See Figure 9 (b) Repeat step 7;

[0089] Step 8.3: In the Swin Transformer model, keep the GAM between the Neck module and the output of the prediction of the small target (Prediction), and delete the GAM between the prediction of the large and medium targets, see Figure 9 (c) Repeat step 7.

[0090] Step 9: Deploy the final model on the monitoring end to conduct real-time testing to see if the target is detected.

[0091] The final model is shown in Figure 10 The training results are shown in Figure 11 , see the monitoring interface Figure 12 , pictures and camera real-time monitoring see Figure 13 , where (a) image automatic detection, (b / c) day / night camera real-time monitoring.

Claims

1. A lightweight Swin-YOLO (Swin Transformer-YOLOv5s.60) smart construction site safety real-time monitoring method, characterized by: include: Step 1: Collect image data of construction workers, smoke, flames, safety helmets, and reflective clothing in different scenes in the construction area, accumulating 23,944 images; Step 2: For the collected image data of various categories, select 20% representative images of each category, perform preprocessing, and then manually label the data; Step 3: Place the image and the annotated labels into the YOLOv5s.60 ​​model and perform parameter training to retain the optimal accuracy, weight parameters and corresponding training parameters after training; Step 4: Use the weight parameter with the highest accuracy to reverse-label 20% of the remaining 80% of the images in each category to obtain the labeled labels. Then, the entire image is fed into the YOLOv5s.60 ​​model and trained using the optimal training parameters to obtain the post-training accuracy. Step 5: If the accuracy index increases, repeat step 4 until all images are reverse-labeled. If the accuracy index decreases, increase the percentage of initial manual data annotation in step 2, and then repeat steps 3 and 4 to finally obtain the labels of the dataset. Step 6: Improve the target detection algorithm model of YOLOv5s.60 ​​based on the lightweight adaptive attention network model Swin Transformer, the attention mechanism GAM, the SCYLLA-IoU loss function, and the flexible non-maximum suppression Soft-NMS, and build a new target detection network model Swin Transformer-YOLOv5s.60; Step 7: Send all images and the dataset labels obtained in step 5 to the Swin Transformer-YOLOv5s.60 ​​network model for parameter training, and retain the highest accuracy index and corresponding training parameters after training; Step 8: Use the optimal training parameters to conduct a GAM ablation experiment, compare the model prediction accuracy indicators, and select the model with the highest accuracy as the final model; Step 9: Deploy the model on the monitoring end to perform real-time testing to see if the target is detected.

2. A lightweight Swin-YOLO smart construction site safety real-time monitoring method according to claim 1, characterized in that: The pre-processing in step 2 includes rotation, scaling, cropping, occlusion, and color brightness change.

3. A lightweight Swin-YOLO smart construction site safety real-time monitoring method according to claim 1, characterized in that: The step 3 includes: Step 3.1: Place the image and manually annotated labels into the YOLOv5s.60 ​​model. The input is processed sequentially with mosaic data augmentation, adaptive anchor box calculation, and adaptive image scaling. Step 3.2: Extract features in the feature extraction backbone network; Step 3.3: In the neck network Neck module, a combination of feature pyramid FPN and path aggregation network PAN is used to perform multi-scale fusion of different feature maps; Step 3.4: In the prediction module, CIoU is used to calculate the score of the target proposal box; Step 3.5: Use NMS in the prediction module to suppress the suggestion boxes smaller than the threshold and retain the suggestion boxes larger than the threshold; Step 3.6: When the maximum number of training rounds is reached, the above steps are automatically stopped and the results are output; Step 3.7: Re-adjust the training parameters, and then repeat steps 3.1-3.

6. After comparison, select the one with the highest accuracy and the corresponding training parameters.

4. A lightweight Swin-YOLO smart construction site safety real-time monitoring method according to claim 1, characterized in that: The target monitoring network model Swin in step 6 The specific structure of Transformer-YOLOv5s.60 ​​is as follows: the feature extraction backbone network Backbone in the YOLOv5s.60 ​​model is replaced with the PatchEmbed, SwinStage, {PatchMerging, SwinStage}*3 modules in the lightweight adaptive attention network model SwinTransformer, and the attention mechanism GAM is connected between the neck network Neck and the large, medium and small targets on the prediction end (Prediction). The complete loss function CIoU and non-maximum suppression NMS on the prediction end in YOLOv5s.60 ​​are replaced with SIoU and Soft-NMS.

5. A lightweight Swin-YOLO smart construction site safety real-time monitoring method according to claim 1, characterized in that: The step 7 comprises: Step 7.1: Use the image and the dataset labels obtained in step 5 as input to the improved Swin Transformer-YOLOv5s.60 ​​model. Mosaic data augmentation, adaptive anchor box calculation, and adaptive image scaling are performed on the input side. Step 7.2: In the feature extraction backbone network Backbone, extract features through PatchEmbed, SwinStage, {PatchMerging, SwinStage}*3 modules in sequence; Step 7.3: In the neck network module, a combination of feature pyramid FPN and path aggregation network PAN is used to perform multi-scale fusion of different feature maps; Step 7.4: In the GAM module, the multi-scale fused features are sequentially passed through the channel attention submodule and the spatial attention submodule to extract image semantics and locate feature information; Step 7.5: In the prediction module, SIoU is used to calculate the score of the target proposal box; Step 7.6: Use Soft-NMS in the prediction module to suppress the suggestion boxes smaller than the threshold and retain the suggestion boxes larger than the threshold. Step 7.7: When the maximum number of training rounds is reached, the above steps are automatically stopped and the results are output; Step 7.8: Re-adjust the training parameters, and then repeat steps 7.1-7.

7. After comparison, select the one with the highest accuracy and the corresponding training parameters.

6. A lightweight Swin-YOLO smart construction site safety real-time monitoring method according to claim 1, characterized in that: The step 8 comprises: Step 8.1: In the Swin Transformer model, keep the GAM between the Neck module and the output of the predicted large target (Prediction), delete the GAM between the predicted medium and small targets, and repeat step 7; Step 8.2: In the Swin Transformer model, keep the GAM between the Neck module and the output of the predicted target (Prediction), delete the GAM between the predicted large and small targets, and repeat step 7; Step 8.3: In the Swin Transformer model, keep the GAM between the Neck module and the output of the prediction of the small target (Prediction), delete the GAM between the prediction of the large and medium targets, and repeat step 7.