Method for detecting personnel on driving face based on improved YOLOv8s
By improving the YOLOv8s model, using PP-HGNET2 and DualConv modules, and combining with the CGA attention mechanism, the accuracy and speed problems of personnel detection on the excavation working face are solved, and more efficient detection of personnel on the excavation working face is achieved.
Patent Information
- Application Number
- CN202410723820.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-24
AI Technical Summary
The existing YOLOv8s model is not very accurate in detecting people in excavation working face pictures. The lack of attention mechanism leads to slow detection speed, and the computational complexity of feature extraction and information processing is large.
By improving the YOLOv8s model, replacing the backbone with PP-HGNET2 neural network, designing the lightweight convolution module DualConv and adding the CGA attention module, the amount of annotated data is increased and preprocessed to improve the model's processing power and computing efficiency.
The accuracy and robustness of personnel detection on the excavation working face are improved, the amount of calculation is reduced, and the detection speed and model calculation efficiency are improved.
Smart Images

Figure CN118692104A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of target detection, and specifically is a method for detecting personnel in an excavation working face based on improved YOLOv8s. Background Art
[0002] Ensuring safe production in coal mines is the primary task of the coal industry. As an important area of coal mine production, the safety of personnel in the excavation face is particularly important. However, with the continuous improvement of the mechanization and automation level of excavation face construction, the previous personnel safety monitoring method can no longer meet the needs of existing safety monitoring and early warning. It is urgent to study an intelligent monitoring and safety early warning technology for excavation face personnel.
[0003] The YOLO series of algorithms have been widely used in industry, but there is still little research on personnel detection in coal mine excavation working faces. Due to the complex scenes in the excavation working face pictures, the existing YOLOv8s model is difficult to accurately detect the target personnel from the excavation working face pictures, resulting in low accuracy in personnel detection in the excavation working face. In addition, the existing technology lacks an attention mechanism, and the attention mechanism can guide the YOLOv8s model to focus on the key parts of the input data, resulting in a low detection speed. In addition, the existing technology still has the problem of high computational complexity in feature extraction and information processing.
[0004] The present invention proposes a personnel detection method for an excavation working face based on improved YOLOv8s to solve the above technical problems. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a method for detecting personnel in an excavation working face based on an improved YOLOv8s, which is used to solve the problem that due to the complexity of the scene in the excavation working face picture, the existing YOLOv8s model is difficult to accurately detect the target personnel from the excavation working face picture, resulting in low accuracy of personnel detection in the excavation working face; in addition, the prior art lacks an attention mechanism, and the attention mechanism can guide the YOLOv8s model to focus on the key parts of the input data, thus resulting in a low detection speed; in addition, the prior art also has the technical problem of large amount of calculation in feature extraction and information processing.
[0006] To achieve the above objectives, a first aspect of the present invention provides a method for detecting personnel in a tunneling working face based on an improved YOLOv8s, comprising:
[0007] S1: Obtain a number of personnel image data of the excavation working face through an image acquisition device and mark them as sample image data;
[0008] S2: pre-process the sample image data and randomly generate a number of new images, and integrate the sample image data and the new images into standard image data;
[0009] S3: The staff annotates the standard image data using the image annotation tool to obtain the annotated data set;
[0010] S4: Improve the YOLOv8s model to obtain an improved YOLOv8s model;
[0011] S5: Improve the YOLOv8s model based on the labeled dataset training to obtain the person detection model;
[0012] S6: Input the personnel image data of the excavation working face to be detected into the personnel detection model for recognition, and obtain the recognition result and performance index; wherein the recognition result includes the personnel information and the non-personnel information, and the performance index includes the average accuracy and the floating-point operation amount.
[0013] Preferably, the step of obtaining a plurality of personnel picture data of the excavation working face by means of an image acquisition device includes:
[0014] The video of personnel at the underground excavation working face is collected by image acquisition equipment, and the video is divided into frames to obtain original image data, and it is determined whether there is an identification target in the original image data; if yes, the corresponding original image data is marked as sample image data; if not, the corresponding original image data is deleted.
[0015] Preferably, the preprocessing of the sample image data and randomly generating a number of new images includes:
[0016] Extract sample image data, obtain a number of original images from the sample image data, and mark the original images as i; wherein i=1, 2, ..., n, and n is a positive integer;
[0017] Select several preprocessing methods to preprocess the original image i at random, and randomly generate several new images; integrate the sample image data and several new images into standard image data; the preprocessing methods include: rotating FJ° with the center of the original image as the rotation point; adding XS to the pixel values of the three channels of R, G, and B of the original image; adjusting the saturation of the original image to BD; adjusting the brightness of the original image by LD times; adjusting the contrast of the original image by DD times; wherein -90 <FJ<90,-50<XS<50,0%<BD<30%,0<LD<4,0<DD<2。
[0018] The present invention randomly generates a number of corresponding new pictures after preprocessing the sample picture data, thereby increasing the amount of picture data in the standard picture data, which is beneficial to provide sufficient picture data for subsequent annotation data sets, thereby helping to improve the accuracy and robustness of the person detection model.
[0019] Preferably, the staff annotates the standard image data using an image annotation tool, including:
[0020] Extract standard image data and import the standard image data into an image annotation tool; the staff annotates the personnel boundaries in the standard image data through the image annotation tool to obtain an annotation data set; wherein the image annotation tool is LabelImg.
[0021] Preferably, the improvement of the YOLOv8s model includes:
[0022] Z1: Use the backbone PP-HGNET of the RT-DETR model to replace the backbone of the YOLOv8s model; PP-HGNET is composed of several HG-Block modules. PP-HGNET includes the Stem layer, HG block, LDS layer, CAP layer, and the final convolution and connection layer;
[0023] Z2: DualBottleneck and DualC2f are designed based on the lightweight convolution module DualConv, and DualConv is used to replace the traditional convolution module Conv, and DualC2f is used to replace the C2f module. The structure of DualBottleneck is input layer, Conv, DualConv, connection layer and output layer in sequence.
[0024] Z3: Add the CGA attention module before the last DualC2f module in the Neck layer of the YOLOv8s model, and connect the CGA attention module to the Concat layer.
[0025] The present invention replaces the backbone of YOLOv8s with a PP-HGNET2 neural network. Since the PP-HGNET2 neural network can learn complex patterns at different scales and abstract levels, it is beneficial to improve the ability of the YOLOv8s model to process complex image data; DualBottleneck and DualC2f are designed based on a lightweight convolution module DualConv, and DualConv is used to replace the traditional convolution module Conv in the YOLOv8s model, and DualC2f is used to replace the C2f module in the YOLOv8s model, which is beneficial to reducing the calculation amount of the YOLOv8s model; a CGA attention module is added to the YOLOv8s model. Since the CGA attention mechanism can guide the YOLOv8s model to focus on the key parts of the input data and ignore irrelevant information, the information processing speed is improved, which is beneficial to improving the calculation efficiency of the YOLOv8s model.
[0026] Preferably, the training and improving the YOLOv8s model based on the labeled data set includes:
[0027] Extract the labeled data set and integrate the labeled data set into several sets of training data sets, verification data sets and test data sets;
[0028] Set the hyperparameters of the improved YOLOv8s model, including the number of trainings, batch size, optimization algorithm, initial learning rate, and final learning rate.
[0029] Use the training data set to train the improved YOLOv8s model; use the verification data set to adjust the improved YOLOv8s model; use the test data set to test the improved YOLOv8s model; and finally obtain a personnel detection model whose input is the personnel image data of the excavation working face and whose output is the personnel recognition result.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] 1. The present invention replaces the backbone of YOLOv8s with the PP-HGNET2 neural network. Since the PP-HGNET2 neural network can learn complex patterns at different scales and abstract levels, the ability of the YOLOv8s model to process complex image data is improved, which is beneficial to improving the accuracy of the YOLOv8s model in detecting personnel at the excavation working face.
[0032] 2. The present invention replaces the traditional convolution module Conv in the YOLOv8s model with DualConv, and replaces the C2f module in the YOLOv8s model with DualC2f. Since DualConv combines 3×3 and 1×1 convolution kernels to simultaneously process the same input feature mapping channel, it optimizes information processing and feature extraction, which is beneficial to reducing the computational complexity of the YOLOv8s model.
[0033] 3. The present invention adds the CGA attention module to the YOLOv8s model. Since the CGA attention mechanism guides the YOLOv8s model to focus on the key parts of the input data and ignore irrelevant information, the information processing speed is improved, which is beneficial to improving the computational efficiency of the YOLOv8s model.
[0034] 4. The present invention randomly generates a number of corresponding new images after preprocessing the sample image data, thereby increasing the amount of image data in the standard image data, which is beneficial to provide sufficient image data for subsequent annotation data sets, thereby helping to improve the accuracy and robustness of the personnel detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 It is a flow chart of the personnel detection method of the excavation working face based on the improved YOLOv8s of the present invention;
[0037] Figure 2 It is a schematic diagram of the PP-HGNET neural network structure of the present invention;
[0038] Figure 3 Schematic diagram of the structure of the DualConv convolutional layer in the present invention;
[0039] Figure 4 It is a schematic diagram of the structure of DualC2f in the present invention;
[0040] Figure 5 It is a schematic diagram of the structure of CGA attention in the present invention;
[0041] Figure 6 It is a schematic diagram of the overall network structure of the present invention. DETAILED DESCRIPTION
[0042] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] See also Figure 1-Figure 6 The first aspect of the present invention provides a method for detecting personnel in a tunneling working face based on an improved YOLOv8s, comprising:
[0044] S1: Obtain a number of personnel image data of the excavation working face through an image acquisition device and mark them as sample image data;
[0045] S2: pre-process the sample image data and randomly generate a number of new images, and integrate the sample image data and the new images into standard image data;
[0046] S3: The staff annotates the standard image data using the image annotation tool to obtain the annotated data set;
[0047] S4: Improve the YOLOv8s model to obtain an improved YOLOv8s model;
[0048] S5: Improve the YOLOv8s model based on the labeled dataset training to obtain the person detection model;
[0049] S6: Input the personnel image data of the excavation working face to be detected into the personnel detection model for recognition, and obtain the recognition result and performance index; wherein the recognition result includes the personnel information and the non-personnel information, and the performance index includes the average accuracy and the floating-point operation amount.
[0050] Exemplarily, the image data of personnel at a tunneling working face are obtained by an image acquisition device, including:
[0051] The video of personnel at the underground excavation working face is collected through a mining explosion-proof camera. The video frame rate is 30FPS. The video is divided into frames at intervals of 60FPS to obtain 10076 original image data. The images without identification targets in the 10076 original image data are deleted to obtain 986 original image data and marked as sample image data.
[0052] In this embodiment, the sample image data is preprocessed and a number of new images are randomly generated, including:
[0053] Extract sample image data, obtain a number of original images from the sample image data, and mark the original images as i; wherein i=1, 2, ..., n, and n is a positive integer;
[0054] Select several preprocessing methods to preprocess the original image i at random, and randomly generate several new images; integrate the sample image data and several new images into standard image data; the preprocessing methods include: rotating FJ° with the center of the original image as the rotation point; adding XS to the pixel values of the three channels of R, G, and B of the original image; adjusting the saturation of the original image to BD; adjusting the brightness of the original image by LD times; adjusting the contrast of the original image by DD times; wherein -90 <FJ<90,-50<XS<50,0%<BD<30%,0<LD<4,0<DD<2。
[0055] Exemplarily, an original image 1 is obtained from the sample image data, the original image 1 is flipped at an angle of FJ=60°, and a corresponding new image is randomly generated;
[0056] Get the original image 2 from the sample image data, add XS=30 to the pixel values of the three channels of R, G, and B of the original image 2, and randomly generate the corresponding new image;
[0057] Obtain the original image 3 from the sample image data, adjust the saturation of the original image 3 to BD=25%, and randomly generate a corresponding new image;
[0058] Get the original image 4 from the sample image data, adjust the brightness of the original image 4 by LD=3 times, and randomly generate a corresponding new image;
[0059] Get the original image 5 from the sample image data, adjust the contrast of the original image 5 by DD=1.5 times, and randomly generate a corresponding new image;
[0060] Obtain the original image 6 from the sample image data, adjust the saturation of the original image 6 to BD=17%, and adjust the brightness of the original image 6 to LD=2 times, and randomly generate a corresponding new image;
[0061] The sample image data and several corresponding new images are integrated into standard image data, which contains 4400 images.
[0062] The present invention randomly generates a number of corresponding new pictures after preprocessing the sample picture data, thereby increasing the amount of picture data in the standard picture data, which is beneficial to provide sufficient picture data for subsequent annotation data sets, thereby helping to improve the accuracy and robustness of the person detection model.
[0063] In this example, the staff member annotates the standard image data using an image annotation tool, including:
[0064] Extract standard image data, import the standard image data into the image annotation tool LabelImg, set the data label storage format to .yolo format, and use it directly to train the YOLOv8s model; the staff uses the image annotation tool LabelImg to annotate the personnel boundaries in the standard image data to obtain an annotated data set, which includes.
[0065] In this embodiment, the YOLOv8s model is improved, including:
[0066] Z1: Use the backbone PP-HGNET of the RT-DETR model to replace the backbone of the YOLOv8s model; PP-HGNET is composed of several HG-Block modules. PP-HGNET includes the Stem layer, HG block, LDS layer, CAP layer, and the final convolution and connection layer;
[0067] Z2: DualBottleneck and DualC2f are designed based on the lightweight convolution module DualConv, and DualConv is used to replace the traditional convolution module Conv, and DualC2f is used to replace the C2f module. The structure of DualBottleneck is input layer, Conv, DualConv, connection layer and output layer in sequence.
[0068] Z3: Add the CGA attention module before the last DualC2f module in the Neck layer of the YOLOv8s model, and connect the CGA attention module to the Concat layer.
[0069] Specifically, the codes involved in designing DualBottleneck and DualC2f based on the lightweight convolution module DualConv are as follows:
[0070]
[0071]
[0072]
[0073]
[0074]
[0075] In this embodiment, the YOLOv8s model is improved based on the labeled data set training, including:
[0076] Extract the annotated data set and randomly divide it into a training data set, a validation data set, and a test data set in a ratio of 8:1:1; the training data set includes 3520 images, the validation data set includes 440 images, and the test data set includes 440 images;
[0077] Set the hyperparameters of the improved YOLOv8s model: set the number of training times to 300, the batch size to 16, the optimization algorithm to the SGD optimizer, and the initial learning rate to 1×10 -2 The final learning rate is 1×10 -4 ;
[0078] Use the training data set to train the improved YOLOv8s model; use the verification data set to adjust the improved YOLOv8s model; use the test data set to test the improved YOLOv8s model; and finally obtain a personnel detection model whose input is the personnel image data of the excavation working face and whose output is the personnel recognition result.
[0079] Furthermore, the image data of personnel at the excavation working face to be detected was input into the personnel detection model for identification, and the identification results and performance indicators were obtained; the average accuracy of the performance indicators of the improved YOLOv8s model was 90.8%, which was 1.9% higher than that of the unimproved YOLOv8s model, and the floating-point computing capacity was 27.9GFlops, which was 1.7% lower than that of the unimproved YOLOv8s model.
[0080] Part of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is a formula closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.
[0081] Working principle of the present invention:
[0082] The present invention obtains a number of personnel picture data of an excavation working face through an image acquisition device, and marks them as sample picture data; pre-processes the sample picture data and randomly generates a number of corresponding new pictures, and integrates the sample picture data and the number of corresponding new pictures into standard picture data; the staff annotates the standard picture data through a picture annotation tool to obtain an annotated data set; improves the YOLOv8s model to obtain an improved YOLOv8s model; trains the improved YOLOv8s model based on the annotated data set to obtain a personnel detection model; inputs the personnel picture data of the excavation working face to be detected into the personnel detection model for recognition, and obtains recognition results and performance indicators.
[0083] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A method for detecting personnel in a tunneling working face based on improved YOLOv8s, characterized in that: include: S1: Obtain a number of personnel image data of the excavation working face through an image acquisition device and mark them as sample image data; S2: pre-process the sample image data and randomly generate a number of new images, and integrate the sample image data and the new images into standard image data; S3: The staff annotates the standard image data using the image annotation tool to obtain the annotated data set; S4: Improve the YOLOv8s model to obtain an improved YOLOv8s model; S5: Improve the YOLOv8s model based on the labeled dataset training to obtain the person detection model; S6: Input the personnel image data of the excavation working face to be detected into the personnel detection model for recognition, and obtain the recognition result and performance index; wherein the recognition result includes the personnel information and the non-personnel information, and the performance index includes the average accuracy and the floating-point operation amount.
2. According to the method of detecting personnel in the excavation working face based on improved YOLOv8s in claim 1, it is characterized in that: The method of obtaining a plurality of personnel picture data of the excavation working face by using an image acquisition device includes: The video of personnel at the underground excavation working face is collected by image acquisition equipment, and the video is divided into frames to obtain original image data, and it is determined whether there is an identification target in the original image data; if yes, the corresponding original image data is marked as sample image data; if not, the corresponding original image data is deleted.
3. The method for detecting personnel in a tunneling working face based on improved YOLOv8s according to claim 1, characterized in that: The preprocessing of the sample image data and randomly generating a number of new images includes: Extract sample image data, obtain a number of original images from the sample image data, and mark the original images as i; wherein i=1, 2, ..., n, and n is a positive integer; Select several preprocessing methods to preprocess the original image i at random, and randomly generate several new images; integrate the sample image data and several new images into standard image data; the preprocessing methods include: rotating FJ° with the center of the original image as the rotation point; adding XS to the pixel values of the three channels of R, G, and B of the original image; adjusting the saturation of the original image to BD; adjusting the brightness of the original image by LD times; adjusting the contrast of the original image by DD times; wherein -90 <FJ<90,-50<XS<50,0%<BD<30%,0<LD<4,0<DD<2。 4. The method for detecting personnel in a tunneling working face based on improved YOLOv8s according to claim 1, characterized in that: The staff member annotates the standard image data using an image annotation tool, including: Extract standard image data and import the standard image data into an image annotation tool; the staff annotates the personnel boundaries in the standard image data through the image annotation tool to obtain an annotation data set; wherein the image annotation tool is LabelImg.
5. The method for detecting personnel in a tunneling working face based on improved YOLOv8s according to claim 1, characterized in that: The improvements to the YOLOv8s model include: Z1: Use the backbone PP-HGNET of the RT-DETR model to replace the backbone of the YOLOv8s model; PP-HGNET is composed of several HG-Block modules. PP-HGNET includes the Stem layer, HG block, LDS layer, CAP layer, and the final convolution and connection layer; Z2: DualBottleneck and DualC2f are designed based on the lightweight convolution module DualConv, and DualConv is used to replace the traditional convolution module Conv, and DualC2f is used to replace the C2f module. The structure of DualBottleneck is input layer, Conv, DualConv, connection layer and output layer in sequence. Z3: Add the CGA attention module before the last DualC2f module in the Neck layer of the YOLOv8s model, and connect the CGA attention module to the Concat layer.
6. The method for detecting personnel in a tunneling working face based on improved YOLOv8s according to claim 1, characterized in that: The improved YOLOv8s model based on the labeled data set training includes: Extract the labeled data set and integrate the labeled data set into several sets of training data sets, verification data sets and test data sets; Set the hyperparameters of the improved YOLOv8s model, including the number of trainings, batch size, optimization algorithm, initial learning rate, and final learning rate. Use the training data set to train the improved YOLOv8s model; use the verification data set to adjust the improved YOLOv8s model; use the test data set to test the improved YOLOv8s model; and finally obtain a personnel detection model whose input is the personnel image data of the excavation working face and whose output is the personnel recognition result.
