A method for detecting the wearing of a single-soldier helmet based on position matching
Through the single soldier helmet wear detection method based on position matching, using attention mechanism and random weight average target detection model, automatic identification of single soldier helmet wear is achieved, solving manual management difficulties and missed detection problems in the existing technology, and improving detection accuracy and automation level.
Patent Information
- Application Number
- CN202210068539.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-01-20
AI Technical Summary
The prior art is difficult to realize the automatic identification of individual helmets, and manual management has problems of mis-checking and missed inspections, especially when the mobility of personnel at the combat field is high.
Using the individual soldier helmet wear detection method based on position matching, a data set is established by collecting samples, and an object detection model based on attention mechanism and random weight average is constructed. The YOLO v5l network structure is used, combined with SENet and random weight average theory, efficient detection of the individual soldier helmet and the human body is carried out, and the position information of the detection frame is matched and calculated to determine the wear condition, and finally the identification border is discolored.
It improves the accuracy and automation of individual helmet wear inspection, reduces missed inspections, and ensures the accuracy of site safety management.
Smart Images

Figure CN114511623B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video content recognition using artificial intelligence, and in particular to the technical field of a method for detecting individual helmet wearing based on position matching. Background Art
[0002] Individual helmets are a type of personal protective gear. Head protection is a crucial component of individual protection, making them a crucial component of a wide range of protective equipment. With the advancement of technology, bulletproof helmets in my country go beyond simple defenses and are now equipped with advanced technology such as sight assist, night vision goggles, and radio intercoms, significantly improving soldiers' combat effectiveness. The durability of bulletproof helmets has also been significantly improved, making them essential for soldiers. However, due to a lack of safety awareness and emergency situations, personnel often neglect wearing basic protective measures like helmets, significantly increasing safety risks. Furthermore, due to the frequent turnover and high mobility of personnel on battlefields, manual management of helmet wear is difficult. Furthermore, while monitoring helmet wear can be achieved through on-site surveillance footage, this still requires manual back-office monitoring to detect any issues. Furthermore, the subjective mental state of back-office managers can easily influence management, leading to false or missed detections. Therefore, developing automatic helmet recognition technology is crucial. Summary of the Invention
[0003] The present invention proposes a method for detecting individual helmet wearing based on position matching, which aims to perform real-time monitoring of the site or scanning and analyzing local images to detect people wearing individual helmets and those not wearing individual helmets, so as to improve site safety management and ensure the safety of soldiers.
[0004] The technical solution of the present invention is a method for detecting the wearing of a soldier's helmet based on position matching, which comprises the following steps:
[0005] Step 1: Collect and label individual helmet samples to build a dataset;
[0006] Step 2: Build an object detection model based on attention mechanism and random weight averaging to achieve efficient detection of individual helmets and human samples;
[0007] Step 3: Perform matching calculation based on the position information of the detection frame of the individual soldier's helmet and the human body to determine whether the person is wearing the individual soldier's helmet;
[0008] Step 4: Change the color of the identified border according to the discrimination result.
[0009] Compared with the prior art, the present invention has the following beneficial effects:
[0010] 1) YOLO v5l is used as the basic network structure, and the SENet attention mechanism is added. SENet focuses on the amount of key information contained in each channel in the convolution block, adds a weight to each channel, and focuses on the key semantic features of the required person and individual helmet categories based on the importance of each channel, while suppressing other irrelevant background features, thereby enhancing "attention" and improving detection accuracy.
[0011] 2) Combining the random weight averaging theory with the improved YOLO v5l based on the attention mechanism, a target detection method based on visual attention mechanism and random weight averaging is proposed, which further improves the detection accuracy. This weight is used as the final model for the detection of people and individual helmets. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Attachment Figure 1 This is a flowchart of a method for detecting individual helmet wearing based on position matching according to the present invention.
[0013] Attachment Figure 2 This is a network structure diagram of the improved YOLO v5l based on the attention mechanism in the method of the present invention. DETAILED DESCRIPTION
[0014] A method for detecting a soldier's helmet wearing based on position matching, the method comprising the following steps:
[0015] Step 1: Collect and annotate image samples to build a dataset;
[0016] Step 2: Build an object detection model based on attention mechanism and random weight averaging to achieve efficient detection of individual helmets and human samples;
[0017] Step 3: Perform matching calculation based on the position information of the detection frame of the individual helmet and the human body to determine whether the person is wearing the individual helmet;
[0018] Step 4: Change the color of the identified border according to the discrimination result.
[0019] Step 1 collects and annotates image samples to establish a dataset, which specifically includes the following steps:
[0020] Step 1-1: Collect pictures of individual helmets, people wearing individual helmets, and people not wearing individual helmets;
[0021] Step 1-2: Use the open source software Labelimg to manually label each soldier's helmet and person in each image. The label category of the soldier's helmet is helmet, and the label category of the person is person.
[0022] Steps 1-3: Match the labeled files to the images one by one, perform unified numbering, and ultimately establish a dataset containing 3,000 images, providing a strong sample basis for the detection of individual helmets.
[0023] The construction of the target detection model based on the attention mechanism and random weight averaging specifically includes the following steps:
[0024] Step 2-1: Based on the YOLO v5l network model, add the attention mechanism SENet to build an improved YOLO v5l model based on the attention mechanism;
[0025] Step 2-2: Perform multiple training iterations on the improved YOLO v5l model based on the attention mechanism, and the model accuracy fluctuates within 0.1%;
[0026] Step 2-3: After the improved YOLO v5l model based on the attention mechanism is trained until the model accuracy is stable, the learning rate type is adjusted to cyclic cosine annealing, multiple weight models are additionally trained, and random weight averaging is performed on these weight models to obtain the final stable target detection model based on the attention mechanism and random weight averaging, which can achieve efficient detection of individual helmets and human samples.
[0027] The specific process of adding the attention mechanism SENet to the YOLO v5l network model in step 2-1 to build an improved YOLO v5l model based on the attention mechanism is as follows:
[0028] Based on YOLO v5l, SENet is added to the network structure. The specific location of the addition is after the first CSP2_3 component in the neck of the original network. The improved YOLO v5l model based on the attention mechanism is obtained. The network structure of the improved YOLO v5l model is shown in the attached manual. Figure 2 As shown;
[0029] The network structure of the improved YOLO v5l model can be summarized as the input end, backbone network, neck, and output. At the input end, YOLO v5 uses Mosaic data enhancement at the input end, just like v4, and embeds adaptive anchor box calculation in the YOLO v5 code. The backbone network adds a Focus structure at the front end, and the remaining part consists of a CBL component and a CSP1_X component alternating three times, followed by a CBL, an SPP, and a CSP2_X component with a Res unit. The neck structure is summarized as an FPN combined with a modified PAN structure, with an Att module added. The output end uses GIOU_Loss as the loss function.
[0030] The CBL component consists of a convolutional layer, batch normalization, and a Leaky relu activation function;
[0031] The Res unit draws on the residual structure in the ResNet network;
[0032] The CSP1_X draws on the CSPNet network and is composed of one CBL component, X residual blocks, and two convolutional layers spliced together, followed by batch normalization, the Leaky_relu activation function, and one CBL component;
[0033] The CSP2_X is composed of 2*X + 1 CBL components and two convolutional layers spliced together, followed by batch normalization, the Leakyrelu activation function, and one CBL component;
[0034] The Focus is composed of 4 slices spliced together and then added with a CBL component; SPP performs multi-scale fusion on the feature map using max pooling; the add refers to the tensor addition operation; the Concat refers to the tensor splicing operation; the Att module is composed of a CSP2_3 component and SENet.
[0035] In the official v2.0 version code, YOLO v5 has a total of 4 versions of structures, including YOLO v5s, YOLO v5m, YOLO v5l, and YOLOv5x; the four structures have different depths and widths, where the depth and width of the network are YOLOv5s < YOLO v5m < YOLO v5l < YOLO v5x; the network of YOLO v5s is the smallest and the speed is the fastest, but the accuracy is relatively low; as the network deepens and widens, the accuracy of the network gradually improves, but at the same time the network becomes larger, the speed becomes slower, the consumption becomes larger, and the requirements for hardware devices become higher; the present invention comprehensively considers factors such as model accuracy, speed, size, number of parameters, and the video memory performance of actual devices, and selects the YOLO v5l model which is good in all aspects.
[0036] Step 2-2 performs multiple training iterations on the improved YOLO v5l model based on the attention mechanism, and the specific process is as follows:
[0037] 1) Randomly divide the dataset established in step 1 into training set, test set, and validation set in a ratio of 8:1:1 for the training of the improved YOLOv5l model based on the attention mechanism;
[0038] 2) During the training process, first load the pre-trained weights, set the image size to 608*608, set the batchsize to 8, and train for 800 epochs in total. After more than 2 validations, the model accuracy fluctuates within 0.1%; a so-called epoch means that all the images in the training set have been propagated forward and backward once in the network model.
[0039] The improved YOLOv5l model based on the attention mechanism is trained multiple times, the calculation parameters are continuously updated, and the model accuracy fluctuates within 0.1 to achieve convergence.
[0040] In step 2-3, after the improved YOLOv5l model based on the attention mechanism is trained to a stable model accuracy, the learning rate type is adjusted to cyclic cosine annealing, and multiple weight models are additionally trained. The specific working process is as follows: after the improved YOLOv5l model based on the attention mechanism is trained to a stable model accuracy, the learning rate type is adjusted to cyclic cosine annealing, and the learning rate parameters are set to lrmax=0.02, lrmin=0.0002, and an additional 24 epochs are trained to obtain an additional 24 weight models; the cyclic cosine annealing learning rate refers to a cosine function as a period, and when the maximum value of each period is reached, the learning rate is reset to the maximum value lrmax, and then the learning rate begins to decay until the end of each period, at which time the learning rate is the minimum value lrmin.
[0041] In the steps 2-3, random weight averaging is performed on these weight models to obtain the final stable target detection model based on attention mechanism and random weight averaging. The specific working process is as follows: the first 12 of the additional 24 weight models are randomly averaged. That is, random weight is the weight w from m to n i Take the average and perform random weight averaging on the first 12 weights to obtain the final stable target detection model based on attention mechanism and random weight averaging, which can achieve efficient detection of individual helmets and human body samples.
[0042] The random averaging of the first 12 of the additional 24 weight models can also be replaced by the following two methods: (1) random averaging of the first 6 of the additional 24 weight models; (2) random averaging of the additional 24 weight models; by comparing and recording the accuracy of the models obtained after random averaging of different numbers of weights, the one with the highest accuracy is used as the final weight model. Experiments have shown that when the first 12 of the additional 24 weight models are randomly averaged, the new model obtained has better generalization performance and improves the detection accuracy of individual helmets and people. It is recorded as a target detection model based on attention mechanism and random weight averaging, which is used for efficient detection of human bodies and individual helmets.
[0043] Step 3 performs matching calculation based on the position information of the detection frame of the individual soldier's helmet and the human body to determine whether the person is wearing the individual soldier's helmet, and specifically includes the following steps:
[0044] Step 3-1: Detect the soldier's helmet and the human body in the image using an object detection algorithm based on the attention mechanism and random weight averaging.
[0045] Step 3-2: Based on the detection results, first determine whether the target detection model recognizes both the individual helmet and the person. If the person is recognized but the individual helmet is not, record the number of people not wearing individual helmets and output it. If the individual helmet is recognized but the person is not, ignore the current state. If both the individual helmet and the person are recognized, record the position of the individual helmet and the area S1 of the individual helmet detection frame, as well as the position of the person and the area S2 of the upper 1 / 3 of the person detection frame, i.e., the area where the head is located. Then calculate the overlapping shadow area S3.
[0046] Step 3-3: After calculating the area of all individual helmets and human detection frames, calculate the judgment weight Weight = S3 / S1, that is, the proportion of the overlapping area to the entire individual helmet;
[0047] Step 3-4: Compare the Weight with the set threshold. When the Weight and the threshold are equal, the person at that location is considered to be wearing a helmet. Otherwise, it is considered not to be wearing one. The threshold is preferably set to 0.2. In actual testing, it was found that setting the threshold to 0.2 is more suitable for test videos. In addition, if a person does not have a matching helmet, it is also considered that the celebrity is not wearing a helmet correctly.
[0048] Step 4: Change the color of the recognition border according to the discrimination result. The specific process is as follows:
[0049] Based on the discrimination results, the recognition border is color-changed. People wearing individual helmets are marked with green borders, and people not wearing individual helmets are marked with red borders, so that the recognition results are clearly displayed. Finally, the real-time monitoring video of the site or local video (picture) is scanned and analyzed to detect people wearing individual helmets and those not wearing individual helmets.
[0050] Example 1
[0051] The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be interpreted as limiting the present invention.
[0052] like Figure 1 The figure shows a flowchart of the method for detecting individual helmet wearing based on position matching of the present invention. The method includes the following steps:
[0053] 1. Collect and annotate individual soldier helmet images to build a dataset; this provides a strong sample basis for subsequent individual helmet wearing detection. This includes three small steps:
[0054] (1) Collect a large number of pictures including individual helmets, people wearing individual helmets, and people not wearing individual helmets;
[0055] (2) Manually annotate each individual helmet and human body in each picture using the open-source software Labelimg, and record the annotation categories as helmet and person respectively;
[0056] (3) Correlate the annotated files with the pictures one by one, perform unified numbering processing, and finally establish a dataset containing 3000 pictures, providing a strong sample basis for the detection of individual helmets.
[0057] 2. Construct an object detection model based on the attention mechanism and stochastic weight averaging to achieve efficient detection of individual helmet and human body samples. The specific steps are as follows:
[0058] (1) Based on the YOLO v5l network model, add the attention mechanism SENet to construct an improved YOLO v5l model based on the attention mechanism
[0059] In the official v2.0 version code, YOLO v5 has a total of 4 versions of structures including YOLO v5s, YOLO v5m, YOLO v5l, and YOLOv5x; the four structures have different depths and widths, and the depth and width of the network are YOLOv5s < YOLO v5m < YOLO v5l < YOLO v5x. The network of YOLO v5s is the smallest and the speed is the fastest, but the accuracy is relatively low. As the network deepens and widens, the accuracy of the network gradually improves, but at the same time the network becomes larger, the speed becomes slower, the consumption becomes larger, and the requirements for hardware devices become higher; in this embodiment, considering factors such as model accuracy, speed, size, number of parameters, and the video memory performance of actual devices, the YOLO v5l model with good performance in all aspects is selected.
[0060] Taking YOLO v5l as the basis, add SENet to the network structure. The specific position to add is after the first CSP2_3 component in the original network neck, and an improved YOLO v5 model based on the attention mechanism is obtained. Its network structure is as shown in the accompanying drawings of the specification Figure 2As shown in the figure, the CBL component consists of a convolutional layer, batch normalization, and a Leaky relu activation function; the Res unit is a residual structure borrowed from the ResNet network; CSP1_X draws on the CSPNet network and consists of a CBL component, X residual blocks, and two convolutional layers, plus batch normalization, a Leaky_relu activation function, and a CBL component; CSP2_X is composed of 2*X+1 CBL components and two convolutional layers, plus batch normalization, a Leaky relu activation function, and a CBL component; Focus is composed of 4 slices spliced together and a CBL component; SPP uses maximum pooling for multi-scale fusion of feature maps; add refers to tensor addition operation; Concat refers to tensor concatenation operation; and the Att module consists of a CSP2_3 component and SENet;
[0061] (2) Perform multiple training iterations on the improved YOLO v5l model based on the attention mechanism until the model accuracy is stable;
[0062] Before the experiment began, the dataset was randomly split into a training, test, and validation set with a ratio of 8:1:1. This was used to train the improved YOLO v5L model based on the attention mechanism. The specific experimental settings were as follows: During training, pre-trained weights were loaded, the image size was set to 608*608, the batch size was set to 8, and 800 epochs were trained (an epoch means that all images in the training set were propagated through the network model once in both the forward and reverse directions). After multiple verifications, the model accuracy was stable.
[0063] (3) After the improved YOLO v5l model based on the attention mechanism is trained until the model accuracy is stable, the learning rate type is adjusted to cyclic cosine annealing, and multiple weight models are additionally trained. These weights are randomly averaged to obtain the final stable target detection model based on the attention mechanism and random weight averaging, which achieves efficient detection of individual helmets and human samples;
[0064] Specifically, after the improved YOLO v5l model based on the attention mechanism is trained until the model accuracy is stable, the learning rate type is adjusted to cyclic cosine annealing (where the cyclic cosine annealing learning rate refers to the cosine function as the period, and the learning rate is reset to the maximum value lrmax when the maximum value of each period is reached, and then the learning rate begins to decay until the end of each period, at which time the learning rate is the minimum value lrmin), and the learning rate parameters are set to lrmax = 0.02, lrmin = 0.0002, and an additional 24 epochs are trained; then three groups of experiments are performed: (1) the first 6 of the additional 24 weight models are randomly averaged; (2) the first 12 of the additional 24 weight models are randomly averaged; (3) the additional 24 weight models are randomly averaged; and the accuracy of the models obtained after random averaging of different numbers of weights is recorded, and the highest accuracy is taken as the final weight model. Experiments have shown that when the first 12 of the additional 24 weight models are randomly averaged, the resulting new model has better generalization performance and improves the detection accuracy of individual helmets and people. It is denoted as a target detection model based on attention mechanism and random weight averaging, which is used for efficient detection of human bodies and individual helmets.
[0065] 3. Perform matching calculation based on the position information of the individual helmet and the detection frame of the human body to determine whether the person is wearing an individual helmet. The specific steps are as follows:
[0066] Based on an attention mechanism and random weighted averaging, the object detection algorithm detects individual helmets and people in images. Based on the detection results, the model first determines whether both the helmet and the person are recognized. If the person is recognized but the helmet is not, the number of people not wearing helmets is recorded and output. If the helmet is recognized but the person is not, the current state is ignored. If both the helmet and the person are recognized, the position of the helmet and the area of the detection frame S1, as well as the position of the person and the area of the upper one-third of the detection frame (the head) S2, are recorded. The overlapping shadow area S3 is then calculated. After calculating the area of all helmets and person detection frames, a weight is calculated: Weight = S3 / S1, which is the proportion of the overlapping area to the entire helmet. Weight is then compared with a set threshold (in actual testing, a threshold of 0.2 was found to be more suitable for test videos). If the two are equal, the person at that location is considered to be wearing a helmet; otherwise, it is considered not to be wearing one. In addition, if a person appears without a matching individual helmet, it is also considered that the celebrity is not wearing the individual helmet correctly.
[0067] 4. Based on the recognition results, change the color of the recognition border to clearly display the recognition results. The specific steps are as follows:
[0068] Based on the identification results, the recognition border changes color. People wearing helmets are marked with a green border, while those not wearing helmets are marked with a red border, making the recognition results clear. Ultimately, the system can scan and analyze real-time surveillance video or local video (images) to detect those wearing and not wearing helmets.
[0069] The above embodiments are only for illustrating the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for detecting individual helmet wearing based on position matching, characterized in that The steps include: Step 1: Collect and annotate image samples to build a dataset; Step 2: Build an object detection model based on attention mechanism and random weight averaging; specifically, the following steps are included: Step 2-1: Based on the YOLO v5l network model, add the attention mechanism SENet to build an improved YOLO v5l model based on the attention mechanism; the specific process is as follows: Based on YOLO v5l, SENet was added to the network structure. The specific location of the addition was after the first CSP2_3 component in the neck of the original network, resulting in an improved YOLO v5l model based on the attention mechanism. The network structure of the improved YOLO v5l model can be summarized as the input end, backbone network, neck, and output. At the input end, YOLO v5 uses Mosaic data enhancement at the input end, just like v4, and embeds adaptive anchor box calculation in the YOLO v5 code. The backbone network adds a Focus structure at the front end, and the remaining part consists of a CBL component and a CSP1_X component alternating three times, followed by a CBL, an SPP, and a CSP2_X component with a Res unit. The neck structure is summarized as an FPN combined with a modified PAN structure, with an Att module added. The output end uses GIOU_Loss as the loss function. The CBL component consists of a convolutional layer, batch normalization, and a Leaky relu activation function; the Res unit is used to refer to the residual structure in the ResNet network; the CSP1_X refers to the CSPNet network, and is composed of a CBL component, X residual blocks, and two convolutional layers, followed by batch normalization, a Leaky_relu activation function, and a CBL component; the CSP2_X is composed of 2*X+1 CBL components and two convolutional layers, followed by batch normalization, a Leaky relu activation function, and a CBL component; the Focus is composed of 4 slices spliced together and a CBL component; SPP uses maximum pooling to perform multi-scale fusion on the feature map; set the tensor addition operation to add; set the tensor splicing operation to Concat; set a CSP2_3 component and SENet to form the Att module; Step 2-2: Perform multiple training iterations on the improved YOLO v5l model based on the attention mechanism, and the model accuracy fluctuates within 0.1%; Step 2-3: After the improved YOLO v5l model based on the attention mechanism is trained until the model accuracy is stable, the learning rate type is adjusted to cyclic cosine annealing, several additional weight models are trained, and random weight averaging is performed on these weight models to obtain the final stable object detection model based on the attention mechanism and random weight averaging. The specific working process is as follows: After the improved YOLO v5l model based on the attention mechanism is trained until the model accuracy is stable, the learning rate type is adjusted to cyclic cosine annealing, and the learning rate parameters are set to lrmax = 0.02, lrmin = 0.0002. An additional 24 epochs are trained to obtain an additional 24 weight models; the cyclic cosine annealing learning rate means that the cosine function is used as the cycle, and the learning rate is reset to the maximum value lrmax when the maximum value of each cycle is reached, and then the learning rate begins to decay until the end of each cycle, at which time the learning rate is the minimum value lrmin; Randomly average the first 12 of the additional 24 weight models That is, random weight is the weight w from m to n i Take the average and perform random weight averaging on the first 12 weights to obtain the final stable target detection model based on attention mechanism and random weight averaging; Step 3, performing matching calculation based on the position information of the individual helmet and the detection frame of the human body to determine whether the person is wearing the individual helmet; specifically, the following steps are included: Step 3-1: Detect the soldier's helmet and the human body in the image using an object detection algorithm based on the attention mechanism and random weight averaging. Step 3-2: Based on the detection results, first determine whether the target detection model recognizes both the individual helmet and the person. If the person is recognized but the individual helmet is not, record the number of people not wearing individual helmets and output it. If the individual helmet is recognized but the person is not, ignore the current state. If both the individual helmet and the person are recognized, record the position of the individual helmet and the area S1 of the individual helmet detection frame, as well as the position of the person and the area S2 of the upper 1 / 3 of the person detection frame, i.e., the area where the head is located. Then calculate the overlapping shadow area S3. Step 3-3: After calculating the area of all individual helmets and human detection frames, calculate the judgment weight Weight = S3 / S1, that is, the proportion of the overlapping area to the entire individual helmet; Step 3-4: Compare the Weight with the set threshold. If the two are equal, it is determined that the person at that location is wearing a soldier's helmet. Otherwise, it is considered that the person is not wearing one. In addition, if the person does not have a matching soldier's helmet, it is also considered that the person is not wearing the soldier's helmet correctly. Step 4: Change the color of the identified border according to the discrimination result.
2. A method for detecting a soldier's helmet wearing based on position matching according to claim 1, characterized in that Step 1 collects and annotates image samples to establish a dataset, which specifically includes the following steps: Step 1-1: Collect pictures of individual helmets, people wearing individual helmets, and people not wearing individual helmets; Step 1-2: Use the open source software Labelimg to manually label each soldier's helmet and person in each image. The label category of the soldier's helmet is helmet, and the label category of the person is person. Steps 1-3: Match the labeled files to the images one by one, perform unified numbering, and establish a data set containing 3,000 images to provide sample basis for the detection of individual helmets.
3. A method for detecting a soldier's helmet wearing based on position matching according to claim 2, characterized in that Step 2-2 performs multiple training iterations on the improved YOLO v5l model based on the attention mechanism. The specific process includes the following: 1) The dataset created in step 1 is randomly divided into training set, test set, and validation set in a ratio of 8:1:1 for training the improved YOLO v5l model based on the attention mechanism; 2) During training, we first loaded the pre-trained weights, set the image size to 608*608, and the batch size to 8. We trained for 800 epochs. After at least two validations, the model accuracy was stable, fluctuating within 0.1%. One epoch means that all images in the training set have been propagated through the network model once in both the forward and reverse directions. The improved YOLO v5l model based on the attention mechanism is trained multiple times, the calculation parameters are continuously updated, and the model accuracy fluctuates within 0.1%, reaching convergence.
4. The method for detecting a soldier's helmet wearing based on position matching according to claim 1 is characterized in that The step 4 changes the color of the identification frame according to the discrimination result. The specific process is as follows: According to the discrimination results, the recognition border is changed in color. People wearing individual helmets are marked with a green border, and people not wearing individual helmets are marked with a red border, so that the recognition results are clearly displayed.
Citation Information
Patent Citations
Safety helmet identification method and device in complex scene
CN113408365A
Lightweight YOLO v4 security protection detection method based on attention mechanism improvement
CN113516076A