Coal mine underground safety helmet detection method and device based on YOLOv8

By grouping and dividing network channels in the YOLOv8 framework and setting a dynamic pruning rate, combined with contribution, response, and sparsity parameters, the problem of slow detection speed of safety helmets in underground coal mines was solved, and the detection speed and accuracy were improved, meeting the needs of real-time monitoring underground.

CN120877209BActive Publication Date: 2026-06-09陕西小保当矿业有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
陕西小保当矿业有限公司
Filing Date
2025-07-30
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In the underground environment of coal mines, existing safety helmet detection algorithms involve large amounts of computation, resulting in reduced processing speed and failing to meet the real-time requirements of the underground environment, thus affecting miners' safety.

Method used

The detection network is constructed using the YOLOv8 framework. By grouping network channels and setting a dynamic pruning rate, redundant channels are accurately identified by combining contribution, response, and sparse parameters. After pruning, the detection capability is maintained through feature reconstruction, and a visual report is output.

Benefits of technology

While compressing the model size, it improves the detection speed and accuracy, ensuring the real-time and accurate detection of safety helmets in complex underground scenarios, and providing an efficient and reliable intelligent supervision solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877209B_ABST
    Figure CN120877209B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image processing, and provides a coal mine underground safety helmet detection method and device based on YOLOv8. The scale of each network channel in a detection network constructed based on machine learning is determined, the network channels are divided into a preset number of channel groups, the reduction rate of the channel groups and the network channel parameters of the network channels in the channel groups are determined, the network channel parameters and image data are used to determine the contribution parameters, response parameters and sparse parameters of the network channels to a detection task, so as to determine task parameters, the network channels of each channel group in the detection network are reduced based on the task parameters and the reduction rate, a detection result is generated, and the detection result is output to a management terminal. The balance between model lightweight and precision guarantee is realized through hierarchical reduction and multi-parameter fusion. While the model volume is compressed and the inference speed is improved, the accuracy of safety helmet detection in a complex underground scene is guaranteed, and an efficient and reliable technical solution is provided for intelligent supervision of coal mines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to a method and apparatus for detecting safety helmets in coal mines based on YOLOv8. Background Technology

[0002] The underground environment of coal mines is complex and fraught with multiple hazards. As the last line of defense for miners' heads, the correct wearing of safety helmets is crucial. Current technologies utilize various artificial intelligence, deep learning, and machine learning algorithms to detect safety helmets. However, this increases the computational load during detection, leading to slower processing speeds. The unique characteristics of the underground coal mine environment exacerbate this problem. In underground coal mines, resource allocation is constrained by space, power, and network connectivity, and the performance of computing equipment is far inferior to that in surface environments. Furthermore, the working environment in coal mines demands extremely high safety standards; real-time monitoring is paramount. Any delay can affect the monitoring system's response speed to potential hazards, thereby endangering the lives of miners. Summary of the Invention

[0003] This application provides a method and apparatus for detecting safety helmets in underground coal mines based on YOLOv8, which can at least partially solve the problem of low detection efficiency of safety helmets in underground coal mines.

[0004] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0005] According to one aspect of this application, a method for detecting safety helmets in coal mines based on YOLOv8 is provided, comprising: acquiring image data from underground coal mines using a camera device; constructing a detection network using machine learning, dividing the network channels into a preset number of channel groups based on the scale of each network channel in the detection network, determining the reduction rate of the channel groups and the network channel parameters of the network channels therein; determining the contribution parameters, response parameters, and sparsity parameters of the network channels for the safety helmet detection task based on the network channel parameters and the image data; determining task parameters based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters; reducing the network channels of each channel group in the detection network based on the task parameters of the network channels and the reduction rate of the channel groups, generating detection results, and outputting the detection results to a management terminal.

[0006] In this application, based on the aforementioned scheme, the step of constructing a detection network through machine learning, dividing the network channels into a preset number of channel groups based on the scale of each network channel in the detection network, and determining the reduction rate of the channel groups and the network channel parameters of the network channels therein, includes: constructing a detection network through machine learning; dividing the network channels into a preset number of channel groups based on the scale of each network channel in the detection network; determining the network channel parameters of the network channels in the channel groups according to preset factors of the network channels in the channel groups; and determining the reduction rate of the channel groups according to the number of network channels in the channel groups and a preset base rate.

[0007] In this application, based on the aforementioned scheme, determining the contribution parameters, response parameters, and sparsity parameters of the network channel for the safety helmet detection task based on the network channel parameters and the image data includes: determining the contribution parameters of the network channel for the safety helmet detection task based on preset network channel parameters of the network channel; determining the corresponding response parameters based on the response state of the network channel to the image data; and determining the sparsity parameters of the network channel in the detection network based on the feature map of the network channel and a preset second threshold.

[0008] In this application, based on the aforementioned scheme, determining the task parameters based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters includes: based on the network channel parameters I g,c The contribution parameter ω c The response parameter S c and the sparse parameter R c Determine the task parameter r l for:

[0009]

[0010] Where n represents the number of all network channels in the detection network.

[0011] In this application, based on the aforementioned scheme, the step of reducing network channels in each channel group of the detection network based on the task parameters of the network channel and the reduction rate of the channel group to generate detection results includes: determining the number of network channels to be reduced in the channel group based on the reduction rate of the channel group; determining the target network channels to be reduced based on the comparison result between the task parameters and a preset first threshold, combined with the number of network channels to be reduced; reducing the target network channels to generate detection results.

[0012] In this application, based on the aforementioned scheme, the step of deleting the target network channels to generate detection results includes: deleting the target network channels to generate feature maps of different scales; reconstructing and stitching the feature maps to obtain reconstructed feature maps; and combining the reconstructed feature maps to generate detection results.

[0013] In this application, based on the aforementioned scheme, the step of outputting the test results to the management terminal includes: performing graphical processing on the test results to generate a test report; and outputting the test report to the management terminal.

[0014] According to one aspect of this application, a YOLOv8-based underground safety helmet detection device for coal mines is provided, comprising:

[0015] The acquisition unit is used to acquire image data from underground coal mines via a camera device;

[0016] The construction unit is used to construct a detection network through machine learning, divide the network channels into a preset number of channel groups based on the scale of each network channel in the detection network, and determine the reduction rate of the channel group and the network channel parameters of the network channels therein;

[0017] The parameter unit is used to determine the contribution parameters, response parameters, and sparsity parameters of the network channel to the safety helmet detection task based on the network channel parameters and the image data.

[0018] The task unit is used to determine task parameters based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters.

[0019] The output unit is used to reduce the network channels of each channel group in the detection network based on the task parameters of the network channel and the reduction rate of the channel group, generate detection results, and output the detection results to the management terminal.

[0020] In this application, based on the aforementioned scheme, the step of constructing a detection network through machine learning, dividing the network channels into a preset number of channel groups based on the scale of each network channel in the detection network, and determining the reduction rate of the channel groups and the network channel parameters of the network channels therein, includes: constructing a detection network through machine learning; dividing the network channels into a preset number of channel groups based on the scale of each network channel in the detection network; determining the network channel parameters of the network channels in the channel groups according to preset factors of the network channels in the channel groups; and determining the reduction rate of the channel groups according to the number of network channels in the channel groups and a preset base rate.

[0021] In this application, based on the aforementioned scheme, determining the contribution parameters, response parameters, and sparsity parameters of the network channel for the safety helmet detection task based on the network channel parameters and the image data includes: determining the contribution parameters of the network channel for the safety helmet detection task based on preset network channel parameters of the network channel; determining the corresponding response parameters based on the response state of the network channel to the image data; and determining the sparsity parameters of the network channel in the detection network based on the feature map of the network channel and a preset second threshold.

[0022] In this application, based on the aforementioned scheme, determining the task parameters based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters includes: based on the network channel parameters I g,c The contribution parameter ω c The response parameter S c and the sparse parameter R c Determine the task parameter r l for:

[0023]

[0024] Where n represents the number of all network channels in the detection network.

[0025] In this application, based on the aforementioned scheme, the step of reducing network channels in each channel group of the detection network based on the task parameters of the network channel and the reduction rate of the channel group to generate detection results includes: determining the number of network channels to be reduced in the channel group based on the reduction rate of the channel group; determining the target network channels to be reduced based on the comparison result between the task parameters and a preset first threshold, combined with the number of network channels to be reduced; reducing the target network channels to generate detection results.

[0026] In this application, based on the aforementioned scheme, the step of deleting the target network channels to generate detection results includes: deleting the target network channels to generate feature maps of different scales; reconstructing and stitching the feature maps to obtain reconstructed feature maps; and combining the reconstructed feature maps to generate detection results.

[0027] In this application, based on the aforementioned scheme, the step of outputting the test results to the management terminal includes: performing graphical processing on the test results to generate a test report; and outputting the test report to the management terminal.

[0028] According to one aspect of this application, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the YOLOv8-based method for detecting safety helmets in underground coal mines as described in the above embodiments.

[0029] According to one aspect of this application, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the YOLOv8-based coal mine safety helmet detection method as described in the above embodiments.

[0030] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the YOLOv8-based coal mine safety helmet detection method provided in the various optional implementations described above.

[0031] In the technical solution of this application, the detection network is grouped according to the channel scale and the reduction rate is dynamically set to avoid the loss of key features. The redundant channels are accurately identified by combining the three parameters of contribution, response and sparsity to ensure the scientific nature of the reduction decision. After reduction, the detection capability is maintained by feature reconstruction. Finally, a visual report is output to the management terminal. While compressing the model size and improving the inference speed, the accuracy of safety helmet detection in complex underground scenarios is guaranteed, providing an efficient and reliable technical solution for intelligent supervision of coal mines.

[0032] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0033] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0034] Figure 1 The flowchart illustrating a method for detecting safety helmets in underground coal mines based on YOLOv8 is shown in one embodiment of this application.

[0035] Figure 2 A flowchart illustrating the determination of network channel parameters is shown in one embodiment of this application.

[0036] Figure 3 The illustration shows a schematic diagram of a coal mine underground safety helmet detection device based on YOLOv8 in one embodiment of this application.

[0037] Figure 4 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation

[0038] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.

[0039] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0040] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0041] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0042] The implementation details of the technical solution of this application are described below:

[0043] Figure 1 A flowchart illustrating a YOLOv8-based method for detecting safety helmets in underground coal mines according to an embodiment of this application is shown. (Refer to...) Figure 1 As shown, the YOLOv8-based method for detecting safety helmets in coal mines includes at least steps S110 to S150, which are described in detail below:

[0044] S110 acquires image data from underground coal mines via a camera device.

[0045] In one embodiment of this application, an explosion-proof binocular camera device is deployed in a key area underground in a coal mine. This device integrates infrared and visible light imaging functions and is designed with intrinsically safe circuitry to withstand explosive gas environments. The device employs a high-protection-level housing and supports hybrid fiber optic and wireless transmission, ensuring stable acquisition of high-definition image data under low-light and high-dust conditions, covering key monitoring areas such as roadway intersections and working faces.

[0046] In one embodiment of this application, for complex underground environments, the camera device is equipped with automatic exposure control and wide dynamic range technology to dynamically adjust the intensity of infrared supplementary light to adapt to changes in lighting. The data transmission network adopts a redundant design, combining fiber optic ring network and wireless mesh technology to improve anti-interference capabilities while ensuring real-time performance. The device casing is treated with anti-static agents, and the circuit design complies with coal mine safety certification standards, ensuring safe operation in environments with flammable gases such as methane.

[0047] Optionally, the acquired images first undergo multimodal fusion processing, combining infrared thermal images and visible light information to highlight the human body contour. Subsequently, an adaptive filtering algorithm removes dust and fog interference, wavelet transform is used to suppress high-frequency noise, and local contrast enhancement is implemented to improve target visibility. Finally, a multi-channel feature map suitable for the detection algorithm is generated, providing clear and structured input data for subsequent helmet recognition.

[0048] S120, a detection network is constructed through machine learning. Based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups, and the reduction rate of the channel groups and the network channel parameters of the network channels therein are determined.

[0049] In this embodiment, a coal mine safety helmet detection network is constructed based on the improved YOLOv8 framework. An attention-based mechanism is embedded in the backbone network to improve feature extraction capabilities, and an adaptive feature fusion layer is used in the neck area to achieve multi-scale information aggregation.

[0050] For example, the network channels are dynamically divided into 4 groups based on the receptive field scale of the feature maps. The group boundaries are determined by clustering, and the reduction rate decreases linearly from 10% for group G1 to 30% for group G4. The channel parameters can be scored by weighting importance indicators (product of weight norm and gradient), activation intensity (average absolute value of feature maps), and redundancy (Pearson correlation coefficient between channels). A dynamic sparsity training strategy is adopted to retain channels, ensuring that the model maintains high-precision detection capability in complex downhole scenarios after reduction.

[0051] like Figure 2 As shown, in one embodiment of this application, a detection network is constructed using machine learning. Based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups. The pruning rate of each channel group and the network channel parameters of the network channels within it are determined, including:

[0052] S210, which constructs a detection network through machine learning;

[0053] S220, based on the scale of each network channel in the detection network, divide the network channels into a preset number of channel groups;

[0054] S230, determine the network channel parameters of the network channels in the channel group according to the preset factor of the network channels in the channel group;

[0055] S240, determine the reduction rate of the channel group based on the number of network channels in the channel group and the preset base rate.

[0056] In one embodiment of this application, a detection network is constructed based on the improved machine learning YOLOv8 framework. Network channels and spatial attention mechanisms are embedded in the backbone network structure to enhance the feature extraction capability for small targets. An adaptive feature fusion layer is introduced into the neck network, achieving seamless fusion of multi-scale features through dynamic weight allocation. The detection head adopts a decoupled head design, separating the classification and regression branches to improve localization accuracy.

[0057] In practical applications, when there are significant differences in target scale, a fixed pruning rate can lead to excessive reduction of feature information at certain scales, thus affecting the final detection accuracy. Traditional pruning methods often ignore the scale differences of targets. For large-scale targets, the network can preserve their features well, but for small-scale targets, pruning leads to the loss of detailed information. Since targets of different scales occupy different areas and exhibit different features in an image, using a uniform pruning strategy can result in the loss of some important information, especially when processing multi-scale targets. To overcome this problem, grouping of network channels is used for pruning, and pruning is performed according to the characteristics of each group of network channels, ensuring that targets of different scales can still be effectively represented in the pruned network.

[0058] In one embodiment of this application, the network channels in the detection network are divided into a preset number of channel groups based on the scale of each channel. By dividing the network channels into several groups according to scale, the network channels within each group share the same reduction rate during the reduction process. The network can perform more refined reduction operations based on the characteristics and importance of different groups, rather than uniformly reducing all network channels. The division of channel groups and the allocation of reduction rates can more accurately preserve features related to the target detection task and avoid the loss of important information. The importance of a network channel usually depends on the degree of contribution of that network channel to the task.

[0059] In one embodiment of this application, the network channel parameter I of the network channel in the channel group is determined according to a preset factor of the network channel in the channel group.g,c for:

[0060]

[0061] Among them, I g,c K is the network channel parameter for network channel c. g It is the set of channel groups g, W c,k It is the preset factor for network channel c and other network channels in channel group k.

[0062] In one embodiment of this application, the reduction rate r of the channel group is determined based on the number of network channels in the channel group and a preset base rate. s for:

[0063] r s =r base ·(1-γ·r scale )

[0064] Where, r base The base rate is represented by γ, the reduction parameter is represented by r. scale This indicates the number of network channels in a channel group.

[0065] In this way, the pruning rate allocation can be flexibly adjusted according to the characteristics of each channel group, ensuring that the features of both large-scale and small-scale targets can be effectively represented. A higher pruning rate is applied to large-scale targets because their features are more defined and contribute more to the network, while a lower pruning rate is applied to small-scale targets to preserve detailed information.

[0066] S130, based on the network channel parameters and the image data, determine the contribution parameters, response parameters, and sparsity parameters of the network channel to the helmet detection task.

[0067] In one embodiment of this application, based on the network channel parameters and the image data, the contribution parameters, response parameters, and sparsity parameters of the network channel to the helmet detection task are determined, including:

[0068] Based on the preset network channel parameters of the network channel, the contribution parameters of the network channel to the safety helmet detection task are determined;

[0069] Based on the response status of the network channel to the image data, determine the corresponding response parameters;

[0070] Based on the feature map of the network channel and a preset second threshold, the sparsity parameters of the network channel in the detection network are determined.

[0071] In one embodiment of this application, the contribution parameter ω of the network channel to the safety helmet detection task is determined based on the preset network channel parameters of the network channel. c for:

[0072]

[0073] Where H and W represent the total height and total width of the spatial dimension, respectively, and h and w represent the height and width identifiers of network channel c in the spatial dimension, respectively. c It is the weight of network channel c, |W c | represents the absolute value of the weights of network channels c, where C is the set of all network channels, L represents the loss function, and F... c,h,w This represents the feature map output through network channel c.

[0074] The impact of a network channel on the network output is evaluated by calculating the absolute value of its weight. Network channels with higher importance are subject to lower pruning rates to ensure their preservation during the pruning process.

[0075] In one embodiment of this application, the corresponding response parameter S is determined based on the response state of the network channel to the image data. c for:

[0076]

[0077] In the above formula, C represents the number of network channels; Activation sma (c) represents the activation value, or response state, of small target pixels in network channel c that are less than a set pixel threshold; lar (c) represents the activation value of large target pixels in network channel c that exceed a set pixel threshold. The response parameter allows for a more appropriate reduction ratio in areas with larger targets, while reducing the reduction ratio for smaller targets to better preserve key information of smaller targets.

[0078] In one embodiment of this application, the sparsity parameter R of the network channels in the detection network is determined based on the feature map of the network channels and a preset second threshold. c for:

[0079]

[0080] Among them, F c This is the feature map of network channel c, where δ is a threshold used to filter out the parts of the feature map with larger activation values, and size(F cδ represents the size of the feature map for network channel c (i.e., the total number of elements in the feature map). The sparsity of a network channel is evaluated by calculating the proportion of elements with activation values ​​greater than a threshold δ in the feature map relative to the total size of the feature map. Network channels with higher sparsity (i.e., fewer activation features) can be preferentially removed to reduce computational complexity.

[0081] S140, determine the task parameters based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters.

[0082] In one embodiment of this application, the dynamic pruning rate can optimize the pruning strategy based on factors such as the characteristics of different tasks, differences in target scale, and the sparsity of network channel features. This reduces computational complexity while maximizing the retention of key information and improving model performance. An importance factor is introduced, which dynamically calculates the importance of each network channel, the target's scale response, and feature sparsity to adjust the pruning rate of each layer, making the pruning process more flexible and precise.

[0083] To smooth the pruning rate, in one embodiment of this application, task parameters are determined based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters, including:

[0084] Based on the network channel parameter I g,c The contribution parameter ω c The response parameter S c and the sparse parameter R c Determine the task parameter r c for:

[0085]

[0086] Where c represents the identifier of the network channel, n represents the number of all network channels in the detection network, and g represents the identifier of the channel group.

[0087] By introducing these factors, a dynamic pruning rate can be generated, allowing for flexible pruning based on the different characteristics of each network channel. This improves computational efficiency while preserving the most crucial features for the task. The specific formulas for these factors ensure that the pruning strategy can adapt to the needs of different tasks and input features, effectively enhancing network performance.

[0088] S150, based on the task parameters of the network channel and the reduction rate of the channel group, the network channels of each channel group in the detection network are reduced, detection results are generated, and the detection results are output to the management terminal.

[0089] In one embodiment of this application, based on the task parameters of the network channel and the reduction rate of the channel group, the network channels of each channel group in the detection network are reduced to generate detection results, including:

[0090] Based on the reduction rate of the channel group, determine the number of network channels to be streamlined in the channel group;

[0091] Based on the comparison between the task parameters and the preset first threshold, and combined with the number of network channels to be streamlined, the target network channels to be deleted are determined.

[0092] The target network channels were deleted, and the detection results were generated.

[0093] Based on the channel group partitioning results, for example, groups G1-G4, the pruning rate is 10%-30%. The number of network channels to be reduced in a channel group is determined by multiplying the pruning rate of the channel group by the total number of network channels in that group. For example, group G1 (8×8 scale) contains 128 network channels, and with a pruning rate of 10%, it needs to be reduced to 13 channels. In principle, shallow groups (small scale) retain more channels to capture helmet edge details, while deep groups (large scale) allow for higher pruning rates to remove redundant global features. A linear decay strategy is used to balance the pruning intensity of each group, ensuring that key features (such as the helmet outline) are not over-clipped, while compressing the model volume, thus balancing model compression and feature preservation capabilities.

[0094] Based on the comparison between the task parameters and the preset first threshold, and combined with the number of network channels to be streamlined, the target network channels to be removed are determined, and the removal strategy is adjusted to prioritize removing channels whose task parameters are less than the set first threshold. Through dual constraints (parameter scoring + quantity control), redundant channels are accurately identified, while retaining the feature extraction capability most critical to the detection task.

[0095] A masking mechanism is used to hard-delete low-resolution channels, generating a lightweight network structure. Subsequent short-term fine-tuning, such as 10 iterations, restores the accuracy loss caused by the deletion. The final model achieves efficient detection of safety helmets in downhole real-world data. Detection results are encapsulated in bounding boxes and confidence scores, and pushed to the management platform in real-time via an encrypted transmission protocol, supporting real-time alerts and historical data backtracking. This step completes the entire closed-loop process from model optimization to actual deployment, ensuring that the compressed model still meets the real-time and accuracy requirements of downhole monitoring.

[0096] In one embodiment of this application, the target network channel is deleted, and the detection result is generated, including:

[0097] The target network channels are reduced to generate feature maps of different scales;

[0098] The feature maps are reconstructed and stitched together to obtain a reconstructed feature map;

[0099] Combine the reconstructed feature maps to generate detection results.

[0100] After grouping and pruning, the pruning process results in the loss of feature information from targets at different scales. To compensate for these losses, a multi-scale reconstruction strategy is used to fuse the feature maps from different scales after pruning, thereby restoring the detailed information lost during the pruning operation. Through reconstruction, the pruned feature maps are stitched together, ensuring that information from different scales is preserved, especially for small-scale targets, ensuring that their features are effectively preserved in the network. Even if some detailed information is lost during the pruning process, multi-scale reconstruction can effectively compensate for these losses and improve the detection capability of multi-scale targets.

[0101] Multi-scale reconstruction involves concatenating the pruned feature maps to enhance the representation of feature information. Specifically, the formula for multi-scale feature reconstruction is shown below:

[0102] F recon =Concat(F1,F2,F3,...,F s )

[0103] Among them, F1, F2, F3, ..., F s These are feature maps at different scales after deletion. Concat means to concatenate these feature maps into a new feature map.

[0104] Through this concatenation operation, the removed features at different scales can be re-integrated in the network, enhancing the feature representation ability of targets at various scales. Especially in small target detection, multi-scale reconstruction ensures that even if the features of small targets are partially removed, the concatenated feature map can still retain enough information for accurate detection.

[0105] The above process, by combining grouped pruning with pruning rate allocation and multi-scale reconstruction, ensures the effective preservation of features of targets at different scales by grouping network channels and assigning a pruning rate to each channel group. Simultaneously, through multi-scale reconstruction, the network can recover the detailed information lost during pruning, enhancing the detection capability of multi-scale targets. This not only improves the accuracy of target detection but also significantly optimizes the network's computational efficiency, especially when processing multi-scale targets, effectively avoiding information loss and improving detection accuracy and robustness.

[0106] In one embodiment of this application, outputting the detection result to a management terminal includes:

[0107] The test results are graphically processed to generate a test report;

[0108] The test report is then output to the management terminal.

[0109] The results of safety helmet inspections are automatically converted into intuitive charts, including heat maps (showing the distribution of violations in different areas underground), time trend charts (recording the frequency of violations over 24 hours), and statistical tables (summarizing daily / weekly / monthly inspection data). The charts use red, yellow, and green to indicate risk levels: red for high risk (not wearing a safety helmet), yellow for medium risk (improper wearing), and green for normal. The report includes the inspection time, location, characteristics of the violating personnel (such as employee ID), and recommended corrective measures.

[0110] Optionally, the inspection report is simultaneously pushed to management terminals via an encrypted channel, including a PC monitoring platform, a mobile app, and an underground explosion-proof display screen. The PC supports historical report queries and big data analysis, such as identifying patterns of violations. The mobile app pushes real-time warning messages, including screenshots and locations of violations. The underground display screen shows the inspection results of key areas in a carousel format. If a high-risk violation is detected, such as multiple people not wearing safety helmets simultaneously, the system automatically triggers an audible and visual alarm and locks the screen, ensuring that surface management personnel intervene immediately, forming a closed-loop management mechanism of detection-reporting-warning-intervention.

[0111] In this application's technical solution, image data is acquired from underground coal mines using a camera device; a detection network is constructed using machine learning; based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups, and the reduction rate of each channel group and the network channel parameters of the network channels within it are determined; based on the network channel parameters and the image data, the contribution parameters, response parameters, and sparsity parameters of each network channel for the safety helmet detection task are determined; based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters, task parameters are determined; based on the task parameters of the network channels and the reduction rate of the channel groups, the network channels in each channel group of the detection network are reduced, generating detection results, and the detection results are output to a management terminal. A balance between model lightweighting and accuracy assurance is achieved through hierarchical reduction and multi-parameter fusion. When constructing the detection network, the system groups channels by channel scale and dynamically sets the pruning rate to avoid losing key features. It accurately identifies redundant channels by combining contribution, response, and sparsity parameters to ensure the scientific nature of pruning decisions. After pruning, the detection capability is maintained through feature reconstruction. Finally, a visual report is output to the management terminal. While compressing the model size and improving the inference speed, it ensures the accuracy of safety helmet detection in complex underground scenarios, providing an efficient and reliable technical solution for intelligent supervision of coal mines.

[0112] The following describes embodiments of the YOLOv8-based underground safety helmet detection device for coal mines, which can be used to execute the YOLOv8-based underground safety helmet detection method in the above embodiments of this application. It is understood that the YOLOv8-based underground safety helmet detection device can be a computer program (including program code) running on a computer device; for example, the YOLOv8-based underground safety helmet detection device is an application software. This YOLOv8-based underground safety helmet detection device can be used to execute the corresponding steps in the method provided in the embodiments of this application. For details not disclosed in the embodiments of the YOLOv8-based underground safety helmet detection device of this application, please refer to the embodiments of the YOLOv8-based underground safety helmet detection method for coal mines described above.

[0113] Figure 3 A block diagram of a YOLOv8-based underground safety helmet detection device for coal mines according to an embodiment of this application is shown.

[0114] Reference Figure 3 As shown, a coal mine underground safety helmet detection device based on YOLOv8 according to an embodiment of this application includes:

[0115] Acquisition unit 310 is used to acquire image data from underground coal mine via a camera device;

[0116] The construction unit 320 is used to construct a detection network through machine learning, divide the network channels into a preset number of channel groups based on the scale of each network channel in the detection network, and determine the reduction rate of the channel groups and the network channel parameters of the network channels therein;

[0117] The parameter unit 330 is used to determine the contribution parameters, response parameters, and sparsity parameters of the network channel to the safety helmet detection task based on the network channel parameters and the image data.

[0118] Task unit 340 is used to determine task parameters based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters;

[0119] The output unit 350 is used to reduce the network channels of each channel group in the detection network based on the task parameters of the network channel and the reduction rate of the channel group, generate detection results, and output the detection results to the management terminal.

[0120] In this application, based on the aforementioned scheme, the step of constructing a detection network through machine learning, dividing the network channels into a preset number of channel groups based on the scale of each network channel in the detection network, and determining the reduction rate of the channel groups and the network channel parameters of the network channels therein, includes: constructing a detection network through machine learning; dividing the network channels into a preset number of channel groups based on the scale of each network channel in the detection network; determining the network channel parameters of the network channels in the channel groups according to preset factors of the network channels in the channel groups; and determining the reduction rate of the channel groups according to the number of network channels in the channel groups and a preset base rate.

[0121] In this application, based on the aforementioned scheme, determining the contribution parameters, response parameters, and sparsity parameters of the network channel for the safety helmet detection task based on the network channel parameters and the image data includes: determining the contribution parameters of the network channel for the safety helmet detection task based on preset network channel parameters of the network channel; determining the corresponding response parameters based on the response state of the network channel to the image data; and determining the sparsity parameters of the network channel in the detection network based on the feature map of the network channel and a preset second threshold.

[0122] In this application, based on the aforementioned scheme, determining the task parameters based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters includes: based on the network channel parameters I g,c The contribution parameter ω c The response parameter S c and the sparse parameter R c Determine the task parameter r l for:

[0123]

[0124] Where n represents the number of all network channels in the detection network.

[0125] In this application, based on the aforementioned scheme, the step of reducing network channels in each channel group of the detection network based on the task parameters of the network channel and the reduction rate of the channel group to generate detection results includes: determining the number of network channels to be reduced in the channel group based on the reduction rate of the channel group; determining the target network channels to be reduced based on the comparison result between the task parameters and a preset first threshold, combined with the number of network channels to be reduced; reducing the target network channels to generate detection results.

[0126] In this application, based on the aforementioned scheme, the step of deleting the target network channels to generate detection results includes: deleting the target network channels to generate feature maps of different scales; reconstructing and stitching the feature maps to obtain reconstructed feature maps; and combining the reconstructed feature maps to generate detection results.

[0127] In this application, based on the aforementioned scheme, the step of outputting the test results to the management terminal includes: performing graphical processing on the test results to generate a test report; and outputting the test report to the management terminal.

[0128] In this application's technical solution, image data is acquired from underground coal mines using a camera device; a detection network is constructed using machine learning; based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups, and the reduction rate of each channel group and the network channel parameters of the network channels within it are determined; based on the network channel parameters and the image data, the contribution parameters, response parameters, and sparsity parameters of each network channel for the safety helmet detection task are determined; based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters, task parameters are determined; based on the task parameters of the network channels and the reduction rate of the channel groups, the network channels in each channel group of the detection network are reduced, generating detection results, and the detection results are output to a management terminal. A balance between model lightweighting and accuracy assurance is achieved through hierarchical reduction and multi-parameter fusion. When constructing the detection network, the system groups channels by channel scale and dynamically sets the pruning rate to avoid losing key features. It accurately identifies redundant channels by combining contribution, response, and sparsity parameters to ensure the scientific nature of pruning decisions. After pruning, the detection capability is maintained through feature reconstruction. Finally, a visual report is output to the management terminal. While compressing the model size and improving the inference speed, it ensures the accuracy of safety helmet detection in complex underground scenarios, providing an efficient and reliable technical solution for intelligent supervision of coal mines.

[0129] Figure 4 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.

[0130] It should be noted that the computer system of the electronic device in this embodiment is only an example and should not impose any limitations on the function and scope of use of the embodiments of this application.

[0131] In this embodiment, the computer system includes a central processing unit 401, which can perform various appropriate actions and processes based on a program stored in the read-only memory 402 or a program loaded from the storage section 408 into the random access memory 403, such as executing the YOLOv8-based coal mine safety helmet detection method described in the above embodiment. The random access memory 403 also stores various programs and data required for system operation. The central processing unit 401, the read-only memory 402, and the random access memory 403 are interconnected via a bus 404. An input / output interface 405 is also connected to the bus 404.

[0132] The following components are connected to the input / output interface 405: an input section 406 including a keyboard, mouse, etc.; an output section 407 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the input / output interface 405 as needed. A removable medium 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 410 as needed so that computer programs read from it can be installed into the storage section 408 as needed.

[0133] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit 401, it performs various functions defined in the system of this application.

[0134] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0136] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0137] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.

[0138] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement the YOLOv8-based coal mine safety helmet detection method described in the above embodiments.

[0139] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0140] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.

[0141] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0142] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for detecting safety helmets in coal mines based on YOLOv8, characterized in that, include: Image data is acquired from underground coal mines using video recording devices; A detection network is constructed using machine learning. Based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups. The reduction rate of each channel group and the network channel parameters of the network channels within it are then determined. Based on the network channel parameters and the image data, the contribution parameters, response parameters, and sparsity parameters of the network channel for the safety helmet detection task are determined. Based on the network channel parameters, contribution parameters, response parameters, and sparsity parameters, the task parameters are determined. Based on the task parameters of the network channel and the reduction rate of the channel group, the network channels of each channel group in the detection network are reduced to generate detection results, and the detection results are output to the management terminal. Specifically, based on the network channel parameters and the image data, the contribution parameters, response parameters, and sparsity parameters of the network channel for the helmet detection task are determined, including: Based on the preset network channel parameters of the network channel, the contribution parameters of the network channel to the safety helmet detection task are determined; Based on the response status of the network channel to the image data, determine the corresponding response parameters; Based on the feature map of the network channel and the preset second threshold, the sparsity parameters of the network channel in the detection network are determined; Specifically, based on the preset network channel parameters, the contribution parameters of the network channel to the safety helmet detection task are determined. for: in, H, W These represent the total height and total width in spatial dimensions, respectively. h, w These represent network channels. c Height and width indicators in spatial dimensions It is a network channel c The weight, It is a network channel c The absolute value of the weight, C It is the collection of all network channels. L Represents the loss function. Indicates via network channel c Output feature map.

2. The method for detecting safety helmets in underground coal mines based on YOLOv8 according to claim 1, characterized in that, A detection network is constructed using machine learning. Based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups. The reduction rate of each channel group and the network channel parameters of the network channels within it are determined, including: Detection networks are built using machine learning; Based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups; Based on the preset factors of the network channels in the channel group, determine the network channel parameters of the network channels in the channel group; The reduction rate of the channel group is determined based on the number of network channels in the channel group and the preset base rate.

3. The method for detecting underground safety helmets in coal mines based on YOLOv8 according to claim 1, characterized in that, Based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters, task parameters are determined, including: Based on the network channel parameters The contribution parameters The response parameters and the sparse parameters Determine the task parameters of the network channel. for: in, c Identifier for network channel, n This indicates the number of all network channels in the detected network. g This indicates the identifier for the channel group.

4. The method for detecting underground safety helmets in coal mines based on YOLOv8 according to claim 1, characterized in that, Based on the task parameters of the network channels and the reduction rate of the channel groups, the network channels of each channel group in the detection network are reduced to generate detection results, including: Based on the reduction rate of the channel group, determine the number of network channels to be streamlined in the channel group; Based on the comparison between the task parameters and the preset first threshold, and combined with the number of network channels to be streamlined, the target network channels to be deleted are determined. The target network channels were deleted, and the detection results were generated.

5. The method for detecting underground safety helmets in coal mines based on YOLOv8 according to claim 4, characterized in that, The target network channel was deleted, and the detection results included: The target network channels are reduced to generate feature maps of different scales; The feature maps are reconstructed and stitched together to obtain a reconstructed feature map; Combine the reconstructed feature maps to generate detection results.

6. The method for detecting underground safety helmets in coal mines based on YOLOv8 according to claim 1, characterized in that, The detection results are output to the management terminal, including: The test results are graphically processed to generate a test report; The test report is then output to the management terminal.

7. A coal mine underground safety helmet detection device based on YOLOv8, characterized in that, include: The acquisition unit is used to acquire image data from underground coal mines via a camera device; The construction unit is used to construct a detection network through machine learning, divide the network channels into a preset number of channel groups based on the scale of each network channel in the detection network, and determine the reduction rate of the channel group and the network channel parameters of the network channels therein; The parameter unit is used to determine the contribution parameters, response parameters, and sparsity parameters of the network channel to the safety helmet detection task based on the network channel parameters and the image data. The task unit is used to determine task parameters based on the network channel parameters, the contribution parameters, the response parameters, and the sparsity parameters. The output unit is used to reduce the network channels of each channel group in the detection network based on the task parameters of the network channel and the reduction rate of the channel group, generate detection results, and output the detection results to the management terminal. Specifically, based on the network channel parameters and the image data, the contribution parameters, response parameters, and sparsity parameters of the network channel for the helmet detection task are determined, including: Based on the preset network channel parameters of the network channel, the contribution parameters of the network channel to the safety helmet detection task are determined; Based on the response status of the network channel to the image data, determine the corresponding response parameters; Based on the feature map of the network channel and the preset second threshold, the sparsity parameters of the network channel in the detection network are determined; Specifically, based on the preset network channel parameters, the contribution parameters of the network channel to the safety helmet detection task are determined. for: in, H, W These represent the total height and total width in spatial dimensions, respectively. h, w These represent network channels. c Height and width indicators in spatial dimensions It is a network channel c The weight, It is a network channel c The absolute value of the weight. C It is the collection of all network channels. L Represents the loss function. Indicates via network channel c Output feature map.

8. The coal mine underground safety helmet detection device based on YOLOv8 according to claim 7, characterized in that, A detection network is constructed using machine learning. Based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups. The reduction rate of each channel group and the network channel parameters of the network channels within it are determined, including: A detection network is constructed using machine learning; based on the scale of each network channel in the detection network, the network channels are divided into a preset number of channel groups; Based on the preset factors of the network channels in the channel group, determine the network channel parameters of the network channels in the channel group; The reduction rate of the channel group is determined based on the number of network channels in the channel group and the preset base rate.