Potential safety hazard detection method based on yov8 improved model
Through the potential safety hazard detection method based on yolov8-based improved model, the Ghost module, GSConv and SimAM algorithms are used to solve the problem of inaccurate and unstable data in complex environments in traditional monitoring and early warning systems, and image detection and real-time analysis are realized, improving The degree of intelligence and application effect of the monitoring system are achieved.
Patent Information
- Application Number
- CN202411371820.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-07
AI Technical Summary
Traditional monitoring and early warning systems have problems of data inaccuracy and instability in complex environments, and cannot conduct in-depth analysis and intelligent early warning, lack adaptability, and it is difficult to meet the needs of complex monitoring scenarios.
The potential safety hazard detection method based on the improved model of yolov8 is adopted, and the GGSnet model is constructed by introducing the Ghost module, GSConv and SimAM algorithms, and image detection and real-time analysis are realized to improve computing efficiency and accuracy.
It has realized the intelligent upgrade of the traditional monitoring and early warning system, which can provide more accurate and stable detection results and alarm information in complex environments, and improves the intelligence and application effect of the monitoring system.
Smart Images

Figure CN119274137A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology in artificial intelligence, and more specifically, to a potential safety hazard detection method based on an improved YOLOv8 model. Background Art
[0002] At present, with the continuous development of science and technology and the widespread application of intelligent technology, monitoring and early warning systems play an increasingly important role in various fields. However, traditional monitoring and early warning systems have many problems and challenges, which affect their effectiveness and performance in practical applications.
[0003] Traditional monitoring and early warning systems usually rely on sensor data collection and processing, which requires a lot of manpower and material resources, and is easily affected by some external environments, resulting in inaccurate and unstable monitoring data. For example, in some complex environments, sensors may produce errors due to interference, which affects the accuracy and reliability of the monitoring system.
[0004] Traditional monitoring and early warning systems can only provide simple monitoring results and alarm information, but cannot conduct in-depth analysis and mining of monitoring data, nor can they make intelligent early warnings and decisions based on the changing trends of monitoring data. In some complex monitoring scenarios, the monitoring and early warning system needs to have a higher level of intelligence and adaptability to better meet actual monitoring needs and application scenarios. Summary of the invention
[0005] Technical issues to be solved:
[0006] This paper will focus on how to use video intelligent analysis technology to realize real-time collection and analysis of monitoring data, build the core technology and algorithm of embedded monitoring and early warning system, improve the intelligence level and application effect of monitoring system, and provide new ideas and methods for the research and development and application of actual monitoring and early warning system.
[0007] Technical solution:
[0008] According to the present invention, a potential safety hazard detection method based on the improved yolov8 model is provided, which solves the disadvantage that the traditional monitoring and early warning system can only simply provide detection results and alarm information, and realizes real-time analysis through graphical detection.
[0009] To achieve the above object, the present invention adopts the following technical solutions:
[0010] A potential safety hazard detection method based on the improved yolov8 model, the specific steps are as follows:
[0011] Step 1: Collect data to build a safety hazard image dataset library, and use Labelme to annotate the images in the dataset.
[0012] Step 2: Use the Pytorch architecture to build the yolov8 model on the PyCharm software.
[0013] Step 3: Improve the yolov8 model training algorithm. The improvements include: (1) Introducing the Ghost module to maintain high computational performance and lightweight, (2) Using GSConv to improve the traditional convolution operation to reduce complexity and improve computational efficiency, and (3) Adding the SimAM algorithm to improve accuracy.
[0014] Step 4: The new model algorithm generated by the improved yolov8 model algorithm is called GGSnet, and the best model parameters obtained after training the GGSnet model algorithm are passed to the inference function for image or video inference.
[0015] Step 5: Run the inference function to verify the performance of the improved GGSnet model algorithm.
[0016] Furthermore, in step 1, the safety hazard image data set library includes: dangerous driving behavior, smoking behavior, and violent behavior. Part of the data in the data set library comes from the open source data set library, and part of the data is collected by itself.
[0017] Furthermore, in step three, the yolov8 model training algorithm is improved, and the specific steps are as follows:
[0018] Introduce the Ghost module, the implementation formula of the Ghost module,
[0019] In the formula, Indicates the first feature map, express The sequence number in the intrinsic feature map group, Indicates that the feature map in each intrinsic feature map group is Sublinear transformation.
[0020] For input size The feature map and output size are Feature map, using Ghost convolution, because it has an identity mapping part and The required linear operation part Specifically, it can be calculated as:
[0021] In the formula, is the width of the input feature map, is the height of the input feature map, is the number of channels of the input feature map, is the width of the output feature map, is the height of the output feature map, is the number of channels of the output feature map, is the convolution kernel size of the identity mapping part, To linearly operate the convolution kernel size, GhostConv is applied in Bottleneck to obtain the GhostBottleneck structure. The Ghost bottleneck is mainly composed of two stacked Ghostmodules. The first Ghost module is used as an expansion layer to increase the number of channels, and the second Ghost module reduces the number of channels to match the shortcut path. And replace the Bottleneck in the Conv module with Ghost Bottleneck to obtain a lightweight feature extraction module C3Ghost module.
[0022] Use GSConv to improve traditional convolution. GSConv includes different computing modules such as Conv, DWConv, Concat, and shuffle. Use GSConv to replace the Conv of the feature fusion network in the original model.
[0023] The SimAM algorithm is added to the original yolov8 model. The key to SimAM is that its attention weight is derived by optimizing the energy function, which is defined as follows:
[0024] In the formula, It is The attention weight of pixels, is the normalization constant, It is The set of adjacent pixels of a pixel, It is pixels and The similarity between pixels. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is the GGSnet network structure diagram.
[0026] Figure 2 This is the structure diagram of Ghost Bottleneck.
[0027] Figure 3 This is the C3Ghost structure diagram. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. The following embodiments are only a part of the embodiments of the present invention and are used to more clearly illustrate the technical solutions of the present invention. It can be understood that the specific embodiments are only used to explain the present invention, but the implementation methods of the present invention are not limited to this.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] According to the present invention, a potential safety hazard detection method based on the improved yolov8 model is provided, which solves the disadvantage that the traditional monitoring and early warning system can only simply provide detection results and alarm information, and realizes real-time analysis through graphical detection.
[0031] To achieve the above object, the present invention adopts the following technical solutions:
[0032] A potential safety hazard detection method based on the improved yolov8 model, the specific steps are as follows:
[0033] Step 1: Collect data to build a safety hazard image dataset library, and use Labelme to annotate the images in the dataset.
[0034] Step 2: Use the Pytorch architecture to build the yolov8 model on the PyCharm software.
[0035] Step 3: Improve the yolov8 model training algorithm. The improvements include: (1) Introducing the Ghost module to maintain high computational performance and lightweight, (2) Using GSConv to improve the traditional convolution operation to reduce complexity and improve computational efficiency, and (3) Adding the SimAM algorithm to improve accuracy.
[0036] Step 4: The new model algorithm generated by the improved yolov8 model algorithm is called GGSnet, and the best model parameters obtained after training the GGSnet model algorithm are passed to the inference function for image or video inference.
[0037] Step 5: Run the inference function to verify the performance of the improved GGSnet model algorithm.
[0038] Furthermore, in step 1, the safety hazard image data set library includes: dangerous driving behavior, smoking behavior, and violent behavior. Part of the data in the data set library comes from the open source data set library, and part of the data is collected by itself.
[0039] Furthermore, in step three, the yolov8 model training algorithm is improved, and the specific steps are as follows:
[0040] Introduce the Ghost module, the implementation formula of the Ghost module,
[0041] In the formula, Indicates the first feature map, express The sequence number in the intrinsic feature map group, Indicates that the feature map in each intrinsic feature map group is Sublinear transformation.
[0042] For input size The feature map and output size are Feature map, using Ghost convolution, because it has an identity mapping part and The required linear operation part Specifically, it can be calculated as:
[0043] In the formula, is the width of the input feature map, is the height of the input feature map, is the number of channels of the input feature map, is the width of the output feature map, is the height of the output feature map, is the number of channels of the output feature map, is the convolution kernel size of the identity mapping part, To linearly operate the convolution kernel size, GhostConv is applied in Bottleneck to obtain the GhostBottleneck structure. The Ghost bottleneck is mainly composed of two stacked Ghostmodules. The first Ghost module is used as an expansion layer to increase the number of channels, and the second Ghost module reduces the number of channels to match the shortcut path. And replace the Bottleneck in the Conv module with Ghost Bottleneck to obtain a lightweight feature extraction module C3Ghost module.
[0044] Use GSConv to improve traditional convolution. GSConv includes different computing modules such as Conv, DWConv, Concat, and shuffle. Use GSConv to replace the Conv of the feature fusion network in the original model.
[0045] The SimAM algorithm is added to the original yolov8 model. The key to SimAM is that its attention weight is derived by optimizing the energy function, which is defined as follows:
[0046] In the formula, It is The attention weight of pixels, is the normalization constant, It is The set of adjacent pixels of a pixel, It is pixels and The similarity between pixels.
Claims
1. A potential safety hazard detection method based on the improved yolov8 model, characterized in that: The specific steps include: Step 1: Collect data to establish a safety hazard image dataset library; Step 2: Establish a training algorithm based on the yolov8 model; Step 3: Improve the yolov8 model training algorithm. The improvements include: (1) introducing the Ghost module to maintain high computational efficiency and light weight, (2) using GSConv to improve the traditional convolution operation to reduce complexity and improve computational efficiency, and (3) adding the SimAM algorithm to improve accuracy. Step 4: The new model algorithm generated by the improved yolov8 model algorithm is called GGSnet, and the best model parameters obtained after the GGSnet model algorithm training are passed to the inference function for image or video inference; Step 5: Run the inference function to verify the performance of the improved GGSnet model algorithm.
2. A potential safety hazard detection method based on the improved yolov8 model according to claim 1, characterized in that: In the step 1, the safety hazard image data set library includes: dangerous driving behavior, smoking behavior, and violent behavior. Part of the data in the data set library comes from the open source data set library, and part of the data is collected by itself.
3. A potential safety hazard detection method based on the improved yolov8 model according to claim 1, characterized in that: In step 3, the yolov8 model training algorithm is improved, and the specific steps are as follows: Step 1, introduce the Ghost module, the implementation formula of the Ghost module, In formula (1), Indicates the first feature map, express The sequence number in the intrinsic feature map group, Indicates that the feature map in each intrinsic feature map group is Sublinear transformations; For input size The feature map and output size are Feature map, using Ghost convolution, because it has an identity mapping part and The required linear operation part Specifically, it can be calculated as: In formula (2), is the width of the input feature map, is the height of the input feature map, is the number of channels of the input feature map, is the width of the output feature map, is the height of the output feature map, is the number of channels of the output feature map, is the convolution kernel size of the identity mapping part, To linearly operate the convolution kernel size, GhostConv is applied in Bottleneck to obtain the GhostBottleneck structure. The Ghost bottleneck is mainly composed of two stacked Ghostmodules. The first Ghost module is used as an expansion layer to increase the number of channels, and the second Ghost module reduces the number of channels to match the shortcut path. And replace the Bottleneck in the Conv module with Ghost Bottleneck to obtain a lightweight feature extraction module C3Ghost module; Step 2: Use GSConv to improve traditional convolution. GSConv includes different computing modules such as Conv, DWConv, Concat, and shuffle. Use GSConv to replace the Conv of the feature fusion network in the original model. Step 3. Add the SimAM algorithm to the original yolov8 model. The key to SimAM is that its attention weight is derived by optimizing the energy function, which is defined as follows: In formula (3), It is The attention weight of pixels, is the normalization constant, It is The set of adjacent pixels of a pixel, It is pixels and The similarity between pixels.