Method for detecting working state of coal face based on YOLOv8
Through the improved YOLOv8-EST algorithm, combined with the Swin Transformer module and EMA attention mechanism, the problems of low detection accuracy and high cost in complex environments of traditional monitoring methods are solved, real-time, efficient and accurate working state of the coal mining face Testing improves safety and efficiency.
Patent Information
- Application Number
- CN202411445494.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-07
AI Technical Summary
The traditional coal mining working surface working condition monitoring method has low detection accuracy in complex environments, high false alarm rate, cannot meet the requirements of real-time monitoring, and has high deployment and maintenance costs.
The improved YOLOv8 object detection algorithm YOLOv8-EST is adopted, and the improved Swin Transformer module and EMA attention mechanism are integrated to improve feature extraction capabilities and detection accuracy, and real-time, efficient and accurate detection of the working state of the coal mining surface.
Real-time, efficient and accurate detection of the working status of the coal mining surface is achieved, production safety and efficiency are improved, deployment and maintenance costs are reduced, and dynamic changes in complex environments are adapted to.
Smart Images

Figure CN119399689A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of target detection and relates to a method for detecting the working state of a coal mining face, and specifically relates to a method for detecting the working state of a coal mining face based on YOLOv8. Background Art
[0002] With the gradual reduction of coal resources and the increase in energy demand, the safety and efficiency of coal mine production have become the focus of social attention. As a key link in coal mine production, the real-time monitoring and analysis of the working status of the coal mining face is of great significance to ensure the safety of workers and improve production efficiency. However, there are many shortcomings in traditional working status monitoring methods. For example, the coal mining face may have specific environmental conditions and challenges, such as uneven lighting, dust, mechanical devices, etc. The targets in the coal mining face may have different scales and may block each other. The problems of low efficiency of manual inspections and the inability of surveillance cameras to fully cover the entire area urgently require a more efficient and comprehensive monitoring method.
[0003] As an essential processing task in computer vision, target detection technology is a key step and core of computer vision research. Most traditional target detection algorithms based on sliding windows and manual extraction methods have problems such as low stability and robustness in complex scenes during the detection process. The emergence of deep learning methods that analyze and process data based on cognitive and imitation abilities has greatly improved the accuracy and reliability of target detection algorithms.
[0004] With the development of automation and intelligence in coal mines, real-time monitoring and management of the status of coal mining faces has become increasingly important. Traditional monitoring methods mainly rely on manual inspections and fixed camera monitoring, but these methods often fail to achieve ideal results in complex coal mining environments. In recent years, with the advancement of deep learning and computer vision technology, automated detection methods based on image processing have gradually become a research hotspot. In mining workplaces such as coal mines, monitoring the working status of coal mining faces is crucial for safety, efficiency, and production management. By monitoring the working status in real time, problems can be discovered in a timely manner and measures can be taken to ensure safe and efficient work.
[0005] At present, there are some coal mining face detection methods based on image processing and machine learning on the market. These methods are mainly divided into two technical solutions. One technical solution is a detection method based on traditional image processing and machine learning. Although this method has improved the detection efficiency to a certain extent, it still has certain shortcomings, such as: poor adaptability to the environment. In complex environments, the detection accuracy is not high, the false alarm rate is high, and the accuracy rate is not high; the detection speed is slow and cannot meet the requirements of real-time monitoring; high-performance computing equipment is required, which increases the burden of deployment and maintenance costs to a certain extent; insufficient detection accuracy, poor real-time performance, and weak adaptability. Another technical solution is a detection method based on deep learning. Although this method has improved the detection accuracy and robustness to a certain extent, there are still detection errors in extremely complex coal mining environments. In addition, the training process of the deep learning model is complex and requires a large amount of labeled data and high-performance computing resources. Summary of the invention
[0006] In order to solve the above problems, the present invention provides a method for detecting the working state of a coal mining face based on YOLOv8. The method adopts the YOLOv8 target detection algorithm, integrates the improved Swin Transformer module, and incorporates the EMA attention mechanism to construct an improved YOLOv8 target detection algorithm YOLOv8-EST to detect the working state of the coal mining face, improves the enhanced feature extraction capability and detection accuracy, realizes real-time, efficient and accurate detection of the working state of the coal mining face, improves production safety and efficiency, and has lower costs.
[0007] The objective of the present invention is achieved through the following technical solutions:
[0008] A method for detecting the working state of a coal mining face based on YOLOv8 comprises the following steps:
[0009] Step 1: Obtain a data set of all working conditions of the coal mining face;
[0010] Step 2: Improve the YOLOv8 model and build the YOLOv8-EST network:
[0011] Step 21: Add a SwinTransformer module that introduces the local window attention mechanism and the hierarchical grouping attention mechanism to the convolutional layer after the second C2F layer and the convolutional layer after the third C2F layer in the backbone network of the YOLOv8 model respectively;
[0012] Step 22: Change the activation function GELU based on the Gaussian error function in the MLP structure of the original Swin Transformer module and name it GELUS. When x is positive, In other cases, the calculation formula based on the Gaussian error function is retained;
[0013] Step 23: In the relative position encoding part of the Swin Transformer module, a relative position initialization network model is added with a fully connected layer using a convolutional neural network to generate relative encoding, replacing the simple linear encoding method of the original Swin Transformer module;
[0014] Step 24: Introduce the EMA attention mechanism module into the first two C2F layers in the YOLOv8 backbone network to form a C2F EMA module, replacing the original C2F module;
[0015] Step 3: Input the coal mining face working status data set into the YOLOv8-EST network for training to obtain a coal mining face working status detection model;
[0016] Step 4: Input the state picture of the coal mining face to be identified into the coal mining face working state detection model to obtain the detection result of the working state of the coal mining face to be identified.
[0017] Compared with the prior art, the present invention has the following advantages:
[0018] 1. Improved YOLOv8 model: Based on the traditional YOLOv8 model, the Swin Transformer module is integrated, which includes window multi-head self-attention (W-MSA) and moving window multi-head self-attention (SW-MSA) for feature fusion. The Swin Transformer Block is used to extract local features through the self-attention mechanism and capture important information in the image through local window calculation.
[0019] 2. Improved GELU activation function (GELUS): The improved GELU activation function (GELUS) is used in the MLP module. When the input value is positive, it is changed to exponential calculation, aiming to improve the model training performance and reduce the computational complexity.
[0020] 3. Relative position coding generation method: Relative position coding is generated through convolutional neural networks and fully connected layers, replacing traditional simple linear coding, improving the expression ability of coding, and better capturing complex spatial relationships.
[0021] 4. Efficient Multi-scale Attention Module (EMA): It introduces a channel dimension reduction and reshaping mechanism to group the channel dimension into multiple sub-features so that the spatial semantic features are evenly distributed in each feature group. It is combined with the C2F block to form a C2F EMA module to improve feature extraction capability and detection accuracy.
[0022] 5. Realize real-time, efficient and accurate coal mining face status detection: The present invention applies advanced visual algorithms to real-time monitoring and status detection in industrial production environments, especially real-time monitoring of coal mining faces. Through optimized algorithms and model architectures, efficient and accurate monitoring of the working face status is achieved, thereby improving the safety and efficiency of industrial production.
[0023] 6. Comprehensive effect of combining multi-module optimization: Comprehensive optimization effect. This invention achieves the comprehensive effect of multi-module optimization by integrating the improved SwinTransformer module and introducing the EMA attention mechanism, as well as the application in the YOLOv8 target detection framework. These optimizations include the enhancement of feature extraction capabilities, the stable optimization of attention weights, and the significant improvement of real-time monitoring performance, which brings new technological breakthroughs and application potential to target detection tasks in industrial production scenarios.
[0024] 7. Improve detection accuracy and efficiency: YOLOv8 can more quickly identify and locate various targets in coal mining faces, including equipment, personnel, and environmental changes. The introduction of the improved Swin Transformer module enhances the model's ability to capture long-distance dependencies and handle complex scenes. In a coal mining environment, there may be targets of various backgrounds and scales on the working face. The improved Swin Transformer effectively improves the model's adaptability and detection accuracy to these situations, improves model training performance and reduces computational complexity, and better captures complex spatial relationships. The EMA mechanism helps the model maintain stability during training and optimizes the model's focus on key information. This adaptive mechanism enables YOLOv8-EST to maintain efficient working conditions under environmental changes such as changes in lighting and weather conditions, ensuring long-term stable detection performance.
[0025] 8. Real-time monitoring and response capabilities: YOLOv8-EST significantly improves the real-time performance of the monitoring system by optimizing algorithms and structural designs. It can quickly process large amounts of video stream data, provide timely feedback on changes in the working face status, and help operators take necessary safety and production measures in a timely manner to achieve real-time performance optimization. In addition, combined with the advantages of the improved SwinTransformer and EMA, YOLOv8-EST can effectively adapt to dynamic changes in the coal mine environment, including factors such as lighting changes and smoke interference. This adaptability ensures stable operation under various complex working conditions, provides high-quality working face monitoring services, and improves the ability to adapt to dynamic environments.
[0026] 9. Cost-effectiveness and maintenance: YOLOv8-EST is designed to be simple and efficient, and can run on conventional computing devices, greatly reducing the cost of initial deployment. No additional dedicated hardware facilities are required, allowing coal mining companies to implement modern monitoring technologies more conveniently, reducing deployment costs to a certain extent. Due to its stability and self-optimization characteristics, YOLOv8-EST has low costs during operation and maintenance. For coal mining companies, this means less maintenance expenses and more sustainable system operation, achieving maintenance cost optimization.
[0027] 10. YOLOv8-EST, as a technical innovation that integrates the YOLOv8 target detection algorithm, the improved Swin Transformer module and the fusion EMA attention mechanism, has brought significant improvements to the monitoring of coal mining faces in coal mines. By optimizing detection accuracy and real-time response capabilities and reducing deployment and maintenance costs, YOLOv8-EST not only improves production safety and efficiency, but also provides reliable technical support and practical application value for the modernization and transformation of the coal mining industry. With its verification and promotion in practical applications, YOLOv8-EST is expected to become a new benchmark in the field of coal mine monitoring and drive the industry towards a safer and more efficient direction. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a flow chart of the working status detection method of coal mining face based on YOLOv8-EST;
[0029] Figure 2 It is the working status data set of the coal mining face;
[0030] Figure 3 It is the YOLOv8-EST network structure;
[0031] Figure 4 This is a comparison chart of Swin Transformer modules;
[0032] Figure 5 This is a comparison chart of MLP modules;
[0033] Figure 6 It is the relative position initialization network model;
[0034] Figure 7 It is the C2F EMA module;
[0035] Figure 8 is the detection result of the working state of the coal mining face to be identified;
[0036] Fig. 9 This is the Swin Tranformer structure diagram. DETAILED DESCRIPTION
[0037] The technical solution of the present invention is further described below in conjunction with the accompanying drawings, but is not limited thereto. Any modification or equivalent replacement of the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention should be included in the protection scope of the present invention.
[0038] Specific implementation method 1. This implementation method provides a method for detecting the working state of a coal mining face based on YOLOv8. Figure 1 As shown, the method comprises the following steps:
[0039] Step 1: Obtain a data set of all working conditions of the coal mining face, such as Figure 2 shown.
[0040] Step 2: Improve the YOLOv8 model and build the YOLOv8-EST network. The specific steps are as follows:
[0041] Step 21: Figure 3 As shown in the figure, a SwinTransformer module introducing a local window attention mechanism and a hierarchical grouping attention mechanism is added to the convolution layer after the second C2F layer and the convolution layer after the third C2F layer in the backbone network of the YOLOv8 model, respectively. By introducing the local window attention mechanism in the Swin Transformer module, the image is divided into multiple windows, and the hierarchical grouping attention mechanism is used in each window, thereby reducing the computational complexity while maintaining the ability to integrate global information.
[0042] YOLOv8 is mainly composed of several key parts: Backbone network, Neck part, and Head part. Among them: Backbone network is used to extract high-level features from the input image for subsequent target detection tasks. The Neck part is used for feature fusion and dimension reduction to enhance the representation ability of the network. The Head part is the core of its detection and prediction. This part includes multiple layers of convolution and pooling layers, which are used to generate detection boxes and category predictions. YOLOv8 improves the accuracy and stability of target detection by adjusting the depth and width of the network, and optimizes the depth and width of the network; in order to cope with targets of different scales, YOLOv8 introduces a multi-scale feature fusion mechanism, which enables the model to better detect objects of various sizes and shapes and realize multi-scale feature fusion; in order to improve the generalization ability and robustness of the model, YOLOv8 adopts more complex and effective data enhancement strategies, such as random cropping, color distortion, etc., to achieve enhanced data enhancement strategies. The present invention adds a Swin Transformer module to the convolutional layer after C2F in the YOLOv8 model backbone network, introduces a local window attention mechanism in the Swin Transformer module, divides the image into multiple windows, and uses a hierarchical grouping attention mechanism in each window, thereby reducing the computational complexity while maintaining the ability to integrate global information.
[0043] The design inspiration of Swin Transformer comes from the improvement and optimization of the traditional Transformer structure. The traditional Transformer structure faces limitations in video memory and computational efficiency when processing large-size images, because the global self-attention mechanism needs to deal with the relationship between all positions, resulting in high complexity. To solve this problem, Swin Transformer introduces a windowed attention mechanism, which divides the image into multiple windows and uses a self-attention mechanism inside each window, thereby reducing computational complexity while maintaining the ability to integrate global information.
[0044] like Fig. 9As shown in the figure, Swin Transformer is mainly composed of multiple stages, each of which contains several key components such as PatchEmbeddings, Transformer Encoder, local window attention mechanism, hierarchical group attention mechanism, etc. Among them, the role of Patch Embeddings is to divide the input image into multiple non-overlapping image blocks (patches), and then convert each image block into a vector form as the input of the model; each stage contains multiple Transformer Encoder layers, and the role of Transformer Encoder is to extract and transform the input image blocks. Each Transformer Encoder includes two main sublayers: Multi-Head Self-Attention and Feedforward Neural Network. The role of the local window attention mechanism is to introduce a windowed attention mechanism through Swin, that is, to use a local window for self-attention operations within each stage. In this way, each image block only needs to establish an attention connection with its nearby image blocks, which greatly reduces the computational complexity. Swin Transformer also adopts a hierarchical group attention mechanism to divide the attention operation into different levels and groups, thereby further improving the computational efficiency and model performance. This design can decompose the large-scale input image processing task into multiple smaller subtasks, each of which performs attention calculations in a local range, and then integrates the local information to achieve global perception and understanding. The design of Swin Transformer Block effectively reduces the computational complexity through local window self-attention mechanism and moving window self-attention mechanism, while maintaining the ability to model the global context. Combined with feedforward networks, residual connections, and layer normalization, these components work together to make Swin Transformer perform well when processing high-resolution images.
[0045] Step 22: Figure 5 As shown, in order to further reduce the computational complexity, the activation function GELU based on the Gaussian error function in the MLP structure of the original Swin Transformer module is changed to GELUS. When x is a positive value, In other cases, the calculation formula based on the Gaussian error function is still retained. In the negative region, the gradient is non-zero, thus avoiding the problem of dead neurons, ensuring that the convergence speed and performance of training are improved while reducing the consumption of computing resources.
[0046] MLP (Multi-LayerPerceptron) is mainly responsible for further nonlinear transformation of feature maps processed by the self-attention mechanism. Its structure includes fully connected layer Linear, activation function GELU, regularized Dropout, fully connected layer Linear, and regularized Dropout. Among them, GELU (Gaussian Error Linear Unit) is a commonly used activation function, which is widely used in deep learning models, especially in Transformer models (such as BERT and GPT). GELU combines the advantages of ReLU and Gaussian error function, and introduces smoother activation characteristics through nonlinear transformation. In order to improve computational efficiency, an approximate formula is usually used to implement it. The GELU formula is:
[0047]
[0048] Compared with ReLU, GELU has a smoother activation function, avoiding the "dead neuron" problem of ReLU (that is, some neurons always output zero during training), and can better retain input information. By compressing the part less than zero instead of completely discarding it (such as ReLU), the neural network can learn more complex features. The shape of GELU is related to the Gaussian distribution, which makes it perform well when processing data with Gaussian noise. However, its calculation is more complicated, so it needs to consume more computing resources. To solve the above problems, the present invention further improves the GELU activation function. When the value is in the positive range, It provides smooth activation, which enables the neural network to better learn and process positive inputs and avoid over-activation. By using GELU in the negative range, GELUS can better retain the input information. Compared with directly discarding negative values (such as ReLU), this method can better utilize negative input information and enhance the expressiveness of the model. Especially in deep learning and complex models, this activation function helps to improve the overall performance of the network. GELUS reduces the computational overhead in this part by using simpler exponential calculations in the positive area. In the negative area, the approximate calculation of GELU (instead of accurately calculating the error function) is used to further reduce the computational complexity. GELUS can achieve the effect of balancing the amount of computation and model performance by reducing the computational complexity in the positive input area while maintaining the advantages of GELU in the negative input area. This makes GELUS more efficient than pure GELU when processing large-scale data.
[0049] Step 23: Figure 6As shown in the figure, in the relative position encoding part of the Swin Transformer module, a convolutional neural network is used to add a fully connected layer of relative position initialization network model to generate relative encoding, which replaces the simple linear encoding method of the original Swin Transformer module, improves the expression ability of position encoding, and can better capture local and more complex spatial relationships, which helps to improve the performance of the model when processing complex spaces.
[0050] The present invention adds relative position encoding to the self-attention mechanism of Swin Transformer to enhance the model's ability to model the relationship between different positions. Relative position encoding is used to calculate attention weights, helping the model to consider their relative positions when processing information at different positions. Swin Transformer uses relative position encoding instead of absolute position encoding. Relative position encoding can capture the relative distance between elements in a sequence rather than their absolute positions. This method can introduce more detailed spatial relationship information into the model. The calculation of relative position encoding includes two parts. The first part is to generate a relative position bias, and the second part is that when calculating self-attention, the relative position encoding is added to the attention weight. This can be seen as an adjustment to the attention score, taking into account the relative relationship between different positions in the sequence. The formula is:
[0051]
[0052] In the formula, Q is the query matrix (Query), K is the key matrix (Key), V is the value matrix (Value), d k is the dimension of the key and B is the relative position offset.
[0053] In order to improve the expression ability of relative position coding and enable it to capture more complex spatial relationships, the present invention considers changing the generation method of the relative position table, using a deep learning network model to generate relative position coding, replacing simple linear coding, and generating relative position coding through a fully connected network, which can capture more complex spatial relationships. Figure 6 As shown, the present invention uses a convolutional neural network to add a fully connected layer to construct a relative position initialization network model, which can capture complex spatial and local relationships. The weights of the convolutional layer are optimized through training so that the generated position encoding can adapt to the needs of specific tasks. Combined with the nonlinear mapping of the fully connected layer, the expressive power of the position encoding is improved.
[0054] Step 24: Figure 7 As shown in the figure, the EMA attention mechanism module is introduced into the first two C2F layers in the backbone network of YOLOv8 to form a C2F EMA module, which replaces the original C2F module, improves the performance of the model on the training set, and improves its robustness in actual coal mining face status applications.
[0055] In the coal face state detection task based on deep learning, the attention mechanism is widely used to enhance the model's attention to the input data, thereby improving the model's performance on complex tasks. The traditional attention mechanism dynamically adjusts the importance of input features by learning weights, but during the training process, these weights may become unstable due to changes in data distribution or noise interference, resulting in a decrease in model performance. In order to solve this problem, the present invention proposes a C2F EMA attention mechanism module, which dynamically adjusts and stabilizes the attention weights through the EMA algorithm.
[0056] The EMA mechanism uses exponential moving average to smooth the attention weight. Let the current attention weight be At and the attention weight of the previous time step be A t-1 , the smoothing factor is (0<α<1), then the EMA update formula is:
[0057] A t EMA =αA t +(1-α)A t-1 EMA
[0058] The core structure of the EMA attention mechanism module includes the input feature layer, the attention calculation layer, the EMA update layer, and the output layer, where:
[0059] The input feature layer is responsible for receiving the input features from the previous layer as the input of the attention mechanism.
[0060] The attention calculation layer is responsible for calculating the attention weight according to the input features. The traditional calculation method can be based on the self-attention mechanism (Self-Attention), and the importance weight of each input position or channel is obtained through learning.
[0061] The EMA update layer is responsible for introducing the EMA algorithm to dynamically update the attention weight. The EMA algorithm combines the current attention weight with the historical EMA weight through exponential weighted average to calculate the new EMA weight.
[0062] The output layer is responsible for calculating the final attention output based on the updated EMA weights for feature integration or prediction tasks in subsequent layers.
[0063] In this step, the improved YOLOv8 model is based on the traditional YOLOv8 model, and the multi-head self-attention MSA is introduced to replace the window multi-head self-attention W-MSA and the moving window multi-head self-attention SW-MSA to form a SwinTransformer module, and feature fusion is performed in the backbone network. Swin Transformer Block is the core component in the SwinTransformer module, which extracts local features through the self-attention mechanism and calculates them by means of local windows to capture important information in the image. Among them, there is an MLP layer in each TransformerBlock, and the features of each position are mapped to a high-dimensional space and nonlinearly transformed. The MLP module contains a GELU activation function. The present invention obtains GELUS by improving the GELU activation function. When the value of x is positive, it is changed to exponential calculation to ensure that the computational complexity is reduced on the basis of improving the model training performance. The introduction of relative position coding can improve the accuracy of the model. The value of the initialization relative position table in Swin Transformer is normally distributed. The present invention uses a deep learning network to generate relative position coding, replaces simple linear coding, and improves the expression ability of relative position headings, so that it can capture more complex spatial relationships. A network model structure that uses a convolutional neural network model to add a fully connected layer generates relative position encoding, which has stronger expressive power and helps improve the relative performance of the model when dealing with complex spatial relationships. Channel dimensionality reduction to model cross-channel relationships may have side effects on extracting deep vision. The goal is to retain the information on each channel and reduce computational overhead. Some channels are reshaped into batch dimensions, and the channel dimensions are grouped into multiple sub-features so that spatial semantic features are evenly distributed in each feature group, forming an efficient multi-scale attention module EMA attention mechanism module based on cross-space learning. The present invention combines the EMA attention mechanism module with the C2F block in the backbone network to form a C2F EMA module. By introducing the exponential moving average method, the attention weights are stabilized and optimized to improve the performance and generalization ability of the model. Figure 3 As shown in the figure, the overall architecture of the YOLOv8-EST network mainly includes input layer, convolution layer, batch normalization layer, activation function layer, pooling layer, Swin Transformer module, EMA attention mechanism, full connection layer, etc., which significantly optimizes YOLOv8 (YouOnly Look Once version 8) in feature extraction. Among them:
[0064] The input layer is responsible for coal mining face image input and preprocessing. It receives coal mining face images as input and performs preprocessing, such as resizing and pixel normalization, to ensure that the input meets the network requirements.
[0065] The convolution layer is responsible for extracting local features of the coal mining face image and gradually increasing the receptive field through multiple layers of convolution kernels to capture feature information of different scales.
[0066] The batch normalization layer is responsible for standardizing the convolution output and stabilizing the training process. Applying batch normalization after the convolution layer output helps speed up the training process and improve the stability of the model.
[0067] The activation function layer is responsible for introducing nonlinearity and enhancing the expressive power of the network.
[0068] The pooling layer is responsible for reducing the size of the feature map and reducing the amount of calculation. By performing maximum pooling or average pooling operations, the spatial dimension of the feature map is reduced, reducing the computational complexity.
[0069] The Swin Transformer module is responsible for capturing global features using sliding windows and self-attention mechanisms. The Swin Transformer module is introduced to capture global features and long-distance dependencies using sliding windows and self-attention mechanisms, thereby improving feature extraction capabilities. The activation function of the MLP in the Swin Transformer Block module is changed so that it is an exponential calculation when the independent variable takes a positive value, which ensures the learning ability of the nonlinear mapping while solving the problem of complex calculations and consuming more computing resources. In addition, a network model with a Linear fully connected layer added to a convolutional neural network is used to generate relative position encodings, generating relative position encodings with stronger expressive power, which helps to improve the performance of the model in processing complex spatial relationships and can better capture local spatial features.
[0070] The EMA attention mechanism is responsible for dynamically adjusting feature weights to improve the accuracy of feature expression. Dynamically adjusting the weights of feature maps improves the accuracy of feature expression based on their importance, thereby enhancing the accuracy of target detection.
[0071] The fully connected layer is responsible for integrating the extracted features and generating the final feature vector. The high-level features that have been extracted and processed are mapped into the final feature vector to prepare for the subsequent target detection task.
[0072] The backbone network of YOLOv8 improves the efficiency and accuracy of feature extraction through the integration of Swin Transformer modules. The improved Swin Transformer uses its advanced self-attention mechanism to optimize feature representation at different levels and scales, enhancing the model's adaptability to target detection tasks. The fused EMA attention mechanism optimizes the training process and generalization ability of the model by dynamically adjusting the attention weights. Its stability and long-term statistical characteristics reflect the stability and robustness of the model in practical applications. Under the combined effect, the present invention not only maintains the original high speed and accuracy advantages of YOLOv8, but also significantly improves the model's real-time, efficient and accurate detection capabilities in complex industrial environments. This combined effect enables the model to cope with the changing needs of production scenarios, thereby effectively improving industrial production efficiency and safety.
[0073] Step 3: Input the coal mining face working status dataset into the improved YOLOv8 model for training to obtain the coal mining face working status detection model.
[0074] Step 4: Input the state picture of the coal mining face to be identified into the coal mining face working state detection model to obtain the detection result of the working state of the coal mining face to be identified.
[0075] Figure 8 The visualization results of the test recognition and the PR curve of the training results of the overall model are given in Figure 8 It can be seen that the present invention can accurately identify different working conditions of the coal mining face, with an average accuracy mAp of 98.9%. It has high detection accuracy and can meet the requirements for effective identification of the state of the coal mining face in complex scenarios.
[0076] In the above technical solution of the present invention, the synergy between the YOLOv8 target detection algorithm, the improved Swin Transformer module and the fusion EMA attention mechanism provides a useful technical idea and practical application value for the further development of target detection technology in the coal mine field. With the continuous evolution and optimization of technology, the technical solution of the present invention is expected to play an important role in the field of industrial automation and intelligent monitoring, and promote the practical application and market development of related technologies.
[0077] Specific implementation method 2. This implementation method is different from specific implementation method 1 in that it is based on the integration of other target detection algorithms: other advanced target detection algorithms, such as Faster R-CNN, SSD (Single Shot MultiBox Detector) or RetinaNet, can be considered to be integrated to replace YOLOv8 as the basic framework. Its advantage is that in some cases, the above-mentioned other target detection algorithms may perform better in specific data sets or scenarios, providing higher detection accuracy. Some algorithms may have better performance when processing targets of different scales, especially for small or large-scale target detection tasks, to achieve better target scale adaptability. However, there are shortcomings, the computational complexity may be high, and some algorithms may require more computing resources or longer training time. The speed may be slow, and some algorithms may not be as fast as YOLOv8 in speed, especially in application scenarios that require real-time detection. When specific accuracy requirements or higher target scale adaptability are required, other target detection algorithms can be considered as alternatives.
[0078] Specific implementation method three. This implementation method is different from specific implementation method one in that different attention mechanisms are integrated: different types of attention mechanisms can be considered to be integrated, such as non-local self-attention mechanism (Non-local Self-Attention), multi-scale attention mechanism or hybrid attention mechanism, etc., to replace the EMA attention mechanism. The advantage is that different attention mechanisms may be able to better capture long-distance dependencies or local / global information in the input data. With higher generalization ability, some attention mechanisms may perform more stably when dealing with different data distributions or noise. However, there are certain shortcomings. The integration of different attention mechanisms may require more complex adjustments and optimizations to the model structure. The applicability and performance of different attention mechanisms may vary depending on the application scenario, and detailed experiments and evaluations are required. When more sophisticated feature expression or higher model generalization ability is required, the integration of different attention mechanisms can be considered as an alternative.
[0079] Specific implementation method 4. This implementation method is different from specific implementation method 1 in that the network structure is adjusted and optimized: it is possible to consider optimizing the performance of YOLOv8 by adjusting the network depth and width or introducing new feature fusion strategies, rather than completely replacing its basic framework. The speed and simplicity of YOLOv8 are retained, while improving performance by adjusting and optimizing the network structure. Customized adjustments can be made according to specific application scenarios to balance speed and accuracy requirements. Without changing the basic framework, the extent of improvement may be subject to certain restrictions. Adjusting and optimizing the network structure may require more experiments and verification work. When it is necessary to further optimize performance while retaining existing advantages, adjusting and optimizing the existing network structure can be considered as an alternative.
Claims
1. A method for detecting the working state of a coal mining face based on YOLOv8, characterized in that The method comprises the following steps: Step 1: Obtain a data set of all working conditions of the coal mining face; Step 2: Improve the YOLOv8 model and build the YOLOv8-EST network: Step 21: Add a Swin Transformer module that introduces the local window attention mechanism and the hierarchical group attention mechanism to the convolutional layer after the second C2F layer and the convolutional layer after the third C2F layer in the backbone network of the YOLOv8 model respectively; Step 22: Change the activation function GELU based on the Gaussian error function in the MLP structure of the original Swin Transformer module and name it GELUS. When x is positive, In other cases, the calculation formula based on the Gaussian error function is retained; Step 23: In the relative position encoding part of the Swin Transformer module, a relative position initialization network model with a fully connected layer is added using a convolutional neural network to generate relative encoding, replacing the simple linear encoding method of the original Swin Transformer module; Step 24: Introduce the EMA attention mechanism module into the first two C2F layers in the YOLOv8 backbone network to form a C2FEMA module, replacing the original C2F module; Step 3: Input the coal mining face working status data set into the YOLOv8-EST network for training to obtain a coal mining face working status detection model; Step 4: Input the state picture of the coal mining face to be identified into the coal mining face working state detection model to obtain the detection result of the working state of the coal mining face to be identified.
2. The method for detecting the working state of a coal mining face based on YOLOv8 according to claim 1 is characterized in that The overall architecture of the YOLOv8-EST network includes an input layer, a convolutional layer, a batch normalization layer, an activation function layer, a pooling layer, a SwinTransformer module, an EMA attention mechanism, and a fully connected layer, where: The input layer is responsible for coal mining face image input and preprocessing; The convolution layer is responsible for extracting local features of the coal mining face image, and gradually increases the receptive field through multiple layers of convolution kernels to capture feature information of different scales; The batch normalization layer is responsible for standardizing the convolution output and stabilizing the training process; The activation function layer is responsible for introducing nonlinearity and enhancing the expression ability of the network; The pooling layer is responsible for reducing the size of the feature map and reducing the amount of calculation; The Swin Transformer module is responsible for using sliding windows and self-attention mechanisms to capture global features and long-distance dependencies, thereby improving feature extraction capabilities, changing the activation function of the MLP in the Swin Transformer Block module to an exponential calculation when the independent variable is positive; using a convolutional neural network to add a linear fully connected layer to the network model to generate relative position encoding, thereby generating relative position encoding with stronger expression capabilities; The EMA attention mechanism is responsible for dynamically adjusting feature weights to improve the accuracy of feature expression; The fully connected layer is responsible for integrating the extracted features to generate the final feature vector.
Citation Information
Patent Citations
Conv-Transform-based flood forecasting method
CN114819386A
Model training method and device, target detection method and device and electronic equipment
CN118521856A
Corn leaf disease identification method based on unmanned aerial vehicle and improved YOLOv8
CN118522006A
Self-attention-based method for detecting defective area of color-textured fabric
WO2023070911A1
Cited By
Method for identifying coal flow blocking state of scraper conveyor on fully mechanized coal mining face of coal mine
CN119851093A
Method for detecting foreign matters on conveyor belt
CN121090549A