Target detection model based on improved YOLOv8
By improving the target detection model of YOLOv8, the alternately connected ECA-ShuffleNetV2 unit and multi-scale feature extraction mechanism are adopted to solve the delay and power consumption problems of flame detection in precision instrument factories, and the accuracy of flame detection and small target detection accuracy are improved.
Patent Information
- Application Number
- CN202510649329.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-29
AI Technical Summary
The existing deep learning-based object detection algorithms have large parameters and high computational complexity in precision instrument production plants, resulting in high inference delay and excessive power consumption, and the flame detection effect is poor under complex light conditions.
A target detection model based on improved YOLOv8 is designed, using the backbone network of the first ECA-ShuffleNetV2 unit and the second ECA-ShuffleNetV2 unit that is alternately connected, combining multi-scale feature extraction and attention mechanisms, feature fusion is performed through the neck network, and object detection is performed on the head network.
It effectively reduces the computational complexity, improves the accuracy of flame detection and small object detection accuracy, solves the problems of missed detection and missed detection under complex lighting conditions, and reduces calculation redundancy.
Smart Images

Figure CN120563804A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of computer vision, pattern recognition and artificial intelligence technology, and in particular relates to a target detection model based on improved YOLOv8. Background Art
[0002] With the rapid development of science and technology, the application of precision instruments in industrial production is becoming increasingly widespread. This equipment not only involves high-precision manufacturing processes but also carries extremely high economic value. Consequently, the production environment places extremely stringent safety requirements. Fire hazards, among other factors, have become a key factor affecting production safety and stable equipment operation. A fire can not only damage equipment and property, but can also endanger the lives of on-site workers.
[0003] In recent years, computer vision-based fire detection technology has garnered widespread attention. This approach utilizes deep learning object detection algorithms to analyze flame characteristics in video images, enabling intelligent fire identification. Compared to traditional sensor detection methods, computer vision technology offers advantages such as non-contact detection, fast response, and wide coverage. It can identify anomalies in the early stages of a fire, improving the timeliness and accuracy of early warnings.
[0004] Existing deep learning-based target detection algorithms have a large number of parameters and high computational complexity, resulting in high inference latency and excessive power consumption when deployed on computing equipment in precision instrument production plants. Summary of the Invention
[0005] In order to solve the problem of poor flame detection under complex lighting conditions and limited workshop computing power in intelligent safety supervision of precision instrument and equipment production plants, the present invention discloses a target detection model based on improved YOLOv8.
[0006] The present invention discloses an object detection model based on an improved YOLOv8, comprising a backbone network, a neck network and a head network connected in sequence;
[0007] The backbone network includes multiple layers of alternately connected first ECA-ShuffleNetV2 units and second ECA-ShuffleNetV2 units, wherein the step sizes of the first ECA-ShuffleNetV2 units and the second ECA-ShuffleNetV2 units are different;
[0008] The first ECA-ShuffleNetV2 unit in the bottom layer is used to receive and extract the first target feature map in the original image to obtain the original first target feature map; the second ECA-ShuffleNet V2 unit in the second layer is used to extract the second target feature map from the original first target feature map to obtain the original second target feature map;
[0009] The first ECA-ShuffleNetV2 unit of the remaining layers is used to extract the first target feature map in the second target feature map obtained by the second ECA-ShuffleNetV2 unit of the immediately previous layer, and the second ECA-ShuffleNetV2 unit of the remaining layers is used to extract the second target feature map in the first target feature map obtained by the first ECA-Shuffle NetV2 unit of the immediately previous layer;
[0010] The neck network is used to perform feature fusion at different levels based on the original image and the second target feature map obtained by the multi-layer second ECA-ShuffleNetV2 unit to obtain a fused image;
[0011] The head network is used to perform target detection based on the fused image.
[0012] Preferably, the bottom layer's first ECA-ShuffleNetV2 unit includes a first channel separation subunit, a first splicing subunit, a multi-scale extraction subunit, and a depth convolution subunit;
[0013] The multi-scale extraction subunit and the depth convolution subunit are connected side by side between the first channel separation subunit and the first splicing subunit;
[0014] The first channel separation subunit is used to divide the original image into a first image and a second image;
[0015] The multi-scale extraction subunit is used to perform multi-scale feature extraction on the first image to obtain a multi-scale feature map;
[0016] The depth convolution subunit is used to perform feature decoupling and fusion on the second image to obtain a depth feature map;
[0017] The first splicing subunit is used to splice the multi-scale feature map and the depth feature map to obtain an original first target feature map.
[0018] Preferably, the multi-scale extraction subunit includes a splicing layer, a parallel first-scale extraction layer and a second-scale extraction layer;
[0019] The first scale extraction layer is used to extract local features from the first image to obtain a first local feature map;
[0020] The second scale extraction layer is used to perform global feature extraction on the first image to obtain a global feature map;
[0021] The splicing layer is connected to the first scale extraction layer and the second scale extraction layer respectively, and is used to splice the first local feature map and the global feature map to obtain a multi-scale feature map.
[0022] Preferably, the first scale extraction layer includes an attention structure and a deep convolution structure connected in sequence,
[0023] The attention structure is used to perform channel enhancement on the first image;
[0024] The deep convolution structure is used to perform feature decoupling and fusion on the first image after channel enhancement to obtain a first local feature map.
[0025] Preferably, the second ECA-ShuffleNetV2 unit of the second layer includes a second channel separation subunit, a first scale extraction subunit, a second scale extraction subunit and a second splicing subunit;
[0026] The first scale extraction subunit and the second scale extraction subunit are connected side by side between the second channel separation subunit and the second splicing subunit;
[0027] The second channel separation subunit is used to divide the original first target feature map into a third image and a fourth image;
[0028] The first scale extraction subunit is used to extract local features from the third image to obtain a second local feature map;
[0029] The second scale extraction subunit is used to perform channel feature enhancement on the fourth image to obtain a channel feature map;
[0030] The second splicing subunit is used to splice the second local feature map and the channel feature map to obtain an original second target feature map.
[0031] Preferably, the first scale extraction subunit comprises an attention layer and a depth convolution layer connected in sequence;
[0032] The attention layer is used to perform channel enhancement on the third image;
[0033] The deep convolutional layer is used to perform feature decoupling and fusion on the channel-enhanced third image to obtain a second local feature map.
[0034] Preferably, the neck network comprises a first alignment module, a second alignment module and a third alignment module connected in sequence;
[0035] The first alignment module is used to perform feature fusion on the second target feature map obtained by the second ECA-ShuffleNetV2 unit of two preset adjacent layers to obtain a first fused image;
[0036] The second alignment module is used to perform feature fusion on the first fused image and a second target feature map obtained by a second ECA-ShuffleNetV2 unit of a preset number of layers to obtain a second fused image;
[0037] The third alignment module is used to perform feature fusion on the original image and the second fused image to obtain a third fused image;
[0038] The head network is used to perform target detection based on the first fused image, the second fused image and the third fused image.
[0039] Preferably, the first alignment module includes a recovery unit, a separation unit, a parallel convolution unit, a serial convolution unit and a splicing unit connected in sequence;
[0040] The restoration unit is used to perform resolution alignment and splicing between the second target feature maps obtained by the second ECA-ShuffleNetV2 units of two preset adjacent layers to obtain an alignment map;
[0041] The separation unit is used to perform channel separation on the alignment image to obtain a separation image;
[0042] The parallel convolution unit is used to decouple the separation graph;
[0043] The serial convolution unit is used to perform detail enhancement on the decoupled separation image to obtain an enhanced image;
[0044] The splicing unit is further connected to the restoration unit, the separation unit and the parallel convolution unit respectively, and is used to perform feature fusion on the alignment image, the separation image, the decoupled separation image and the enhancement image to obtain a first fused image.
[0045] Preferably, the stitching unit is further connected to the separation unit and the parallel convolution unit respectively, and is used to perform feature fusion on the output results of the separation unit and the parallel convolution unit with the first enhancement image and the second enhancement image to obtain a fourth fused image;
[0046] The head network is used to perform target detection based on the fourth fused image, the second fused image and the third fused image.
[0047] Preferably, the connection method between the serial convolution unit and the parallel convolution unit also includes residual connection.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] (1) The present invention designs a backbone network consisting of ECA-ShuffleNetV2 units with cross-stacked steps, alternately connecting lightweight first / second ECA-ShuffleNetV2 units to construct a regular feature extraction rhythm with decreasing resolution through step size differences, which not only avoids the loss of details caused by excessive downsampling of shallow features, enhances the ability to capture local details, but also prevents redundant calculation of deep features;
[0050] (2) The present invention significantly enhances the ability to express flame features under complex lighting conditions by embedding a multi-scale feature extraction mechanism and an attention mechanism;
[0051] (3) The present invention introduces parallel convolution and serial convolution with residual connection into the neck network, which effectively improves the detection accuracy of small target flames, solves the problems of missed detection and false detection of traditional models in complex lighting scenes of precision instrument factories, and reduces redundant calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a diagram of the overall model architecture of the present invention in Example 1;
[0053] Figure 2 This is a diagram of the backbone network architecture of the present invention in Example 1;
[0054] Figure 3 (a) is a diagram of the neck network architecture of the present invention in Example 1;
[0055] Figure 3 (b) is a schematic structural diagram of the parallel convolution unit of the present invention;
[0056] Figure 3 (c) is a schematic structural diagram of the serial convolution unit of the present invention. DETAILED DESCRIPTION
[0057] In the following description, specific details such as particular system structures and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
[0058] like Figure 1 As shown, the present invention discloses a target detection model based on improved YOLOv8, including a backbone network, a neck network and a head network connected in sequence;
[0059] The backbone network includes multiple layers of alternately connected first ECA-ShuffleNetV2 units and second ECA-ShuffleNetV2 units, and the step sizes of the first ECA-ShuffleNetV2 unit and the second ECA-ShuffleNetV2 unit are different; the full name of ECA in English is Efficient Channel Attention. The ECA-ShuffleNetV2 unit of the present invention specifically refers to the addition of the ECA mechanism to the existing ShuffleNetV2. The specific location where the ECA mechanism is added can be specified by those skilled in the art. The specific addition location of the present invention is described in detail later.
[0060] Preferably, in this embodiment, the step size of the first ECA-ShuffleNetV2 unit is 2, and the step size of the second ECA-ShuffleNetV2 unit is 1.
[0061] The first ECA-ShuffleNetV2 unit in the bottom layer is used to receive and extract the first target feature map in the original image to obtain the original first target feature map; the second ECA-ShuffleNetV2 unit in the second layer is used to extract the second target feature map in the original first target feature map to obtain the original second target feature map;
[0062] like Figure 2 As shown, the first ECA-ShuffleNetV2 unit in the bottom layer includes the first channel separation subunit, the first splicing subunit, the multi-scale extraction subunit and the depth convolution subunit;
[0063] The multi-scale extraction subunit and the depth convolution subunit are connected side by side between the first channel separation subunit and the first splicing subunit;
[0064] The first channel separation subunit is used to divide the original image into a first image and a second image;
[0065] The multi-scale extraction subunit is used to perform multi-scale feature extraction on the first image to obtain a multi-scale feature map;
[0066] The depth convolution subunit is used to decouple and fuse the features of the second image to obtain a depth feature map;
[0067] The first splicing subunit is used to splice the multi-scale feature map and the depth feature map to obtain an original first target feature map.
[0068] The multi-scale extraction subunit includes a splicing layer, a parallel first-scale extraction layer and a second-scale extraction layer;
[0069] The first scale extraction layer is used to extract local features of the first image to obtain a first local feature map;
[0070] The second scale extraction layer is used to extract global features from the first image to obtain a global feature map;
[0071] The splicing layer is connected to the first scale extraction layer and the second scale extraction layer respectively, and is used to splice the first local feature map and the global feature map to obtain a multi-scale feature map.
[0072] The first scale extraction layer includes the attention structure and the deep convolution structure connected in sequence.
[0073] The attention structure is used to perform channel enhancement on the first image;
[0074] The deep convolution structure is used to perform feature decoupling and fusion on the first image after channel enhancement to obtain a first local feature map.
[0075] The following is based on Figure 2 The structure of the first ECA-ShuffleNetV2 unit in Example 1 is described. In the figure, DWConv represents depthwise separable convolution, ECA represents attention, Conv represents normal convolution, Concat represents concatenation, and SPPF represents pooling.
[0076] Preferably, in this embodiment, the step size of the depthwise separable convolution is 3×3.
[0077] Specifically, such as Figure 2 As shown, when the step size is set to 2, the first target feature map output by the original image or the second ECA-ShuffleNetV2 unit in the upper layer immediately above is divided into a parallel lower branch and an upper branch after the channel separation layer. The lower branch only includes a deep convolution structure and an ordinary convolution layer, and the upper branch is divided into two sub-branches, recorded as a first sub-branch and a second sub-branch; the first sub-branch and the second sub-branch are both arranged between two ordinary convolution layers; wherein the first sub-branch includes an ECA attention structure and a deep convolution structure, and the second sub-branch includes only an ECA attention structure; the parallel connection structure adopted by the upper branch retains the upstream feature information during feature extraction, which is helpful for extracting more detailed features, and the higher computational efficiency is helpful for dynamic weighting of features; and the configuration method of dynamically weighting the features of the first sub-branch and the second sub-branch in the channel dimension emphasizes the importance of related features, while reducing the influence of redundant features. Therefore, the first ECA-ShuffleNetV2 unit of the present invention improves the representation of local features and enriches the detail extraction process.
[0078] In the present invention, the first ECA-ShuffleNetV2 unit is based on an improved channel separation and multi-scale feature fusion mechanism, and achieves feature decoupling and enhancement while reducing the number of parameters through the coordinated optimization of deep convolution and attention mechanism.
[0079] like Figure 2 As shown, the second ECA-ShuffleNetV2 unit (S=2) of the second layer includes a second channel separation subunit, a first scale extraction subunit, a second scale extraction subunit, and a second splicing subunit;
[0080] The first scale extraction subunit and the second scale extraction subunit are connected side by side between the second channel separation subunit and the second splicing subunit;
[0081] The second channel separation subunit is used to divide the original first target feature map into a third image and a fourth image;
[0082] The first scale extraction subunit is used to extract local features from the third image to obtain a second local feature map;
[0083] The second scale extraction subunit is used to perform global channel feature enhancement on the fourth image to obtain a global channel feature map;
[0084] The second splicing subunit is used to splice the second local feature map and the global channel feature map to obtain an original second target feature map.
[0085] The first scale extraction subunit consists of an attention layer and a depthwise convolutional layer connected sequentially;
[0086] The attention layer is used to perform channel enhancement on the third image;
[0087] The deep convolutional layer is used to perform feature decoupling and fusion on the channel-enhanced third image to obtain the second local feature map.
[0088] The first ECA-ShuffleNetV2 unit of the remaining layers is used to extract the first target feature map in the second target feature map obtained by the second ECA-ShuffleNetV2 unit of the immediately previous layer, and the second ECA-ShuffleNetV2 unit of the remaining layers is used to extract the second target feature map in the first target feature map obtained by the first ECA-ShuffleNetV2 unit of the immediately previous layer;
[0089] In Example 1, the first ECA-ShuffleNetV2 unit in each layer and the second ECA-ShuffleNetV2 units in multiple layers have the same structure.
[0090] The following is based on Figure 2 The structure of the second ECA-ShuffleNetV2 unit (S=1) of Example 1 is described;
[0091] Preferably, the stride of the depthwise separable convolution is 3×3.
[0092] When the stride is set to 1, the second target feature map output by the first ECA-ShuffleNetV2 unit enters the second ECA-ShuffleNetV2 unit in the next layer. It is then first channel-separated to form two parallel branches, denoted as the first branch and the second branch. The first branch consists of two ordinary convolutional layers, followed by an ECA attention layer and a depthwise separable convolutional layer, each connected in sequence. The second branch consists of only one ECA attention layer. The second ECA-ShuffleNetV2 unit dynamically weights the ECA attention layers of the first and second branches along the channel dimension, and then dynamically weights the outputs of the two branches to increase the importance of each branch.
[0093] Furthermore, in Example 1, it is assumed that the feature map size of each ECA-ShuffleNetV2 unit is X∈R H×W×C , where H and W are the height and width of the feature map respectively, and C is the number of channels.
[0094] When the stride is 2, the output of the first ECA-ShuffleNetV2 unit is shown in formula (1). Indicates concatenation of feature maps.
[0095]
[0096] In the formula, Conv represents ordinary convolution, DepthwiseConv represents depth-wise separable convolution, and Channel Split represents channel separation.
[0097] As shown in formula (2), this is the output result of the second ECA-ShuffleNetV2 unit.
[0098]
[0099] Where, Channel Shuffle means channel rearrangement.
[0100] The first / second ECA-ShuffleNetV2 unit of the present invention adds a deep separation convolution mechanism and an attention mechanism to the original ShuffleNetV2 architecture. The deep separation convolution mechanism decomposes the standard convolution into a cascade operation of channel-by-channel convolution and point-by-point convolution. This design significantly reduces the computational complexity by decoupling the learning process of spatial features and channel features, while retaining the expressive power of multi-scale features, so that the model can still effectively capture the local details and global morphological features of the flame on a lightweight basis; further, the ECA (Efficient Channel Attention) mechanism is embedded in the feature transfer path, and through the adaptive channel weight distribution mechanism, the channel features that are strongly related to flame detection (such as brightness changes in high-temperature areas, smoke edge textures, etc.) are enhanced, and invalid channel responses caused by light interference or background noise are suppressed. This mechanism achieves self-focusing of key features without increasing the branch structure, thereby improving the feature discriminability under complex lighting conditions.
[0101] The second ECA-ShuffleNetV2 unit, with a stride of 1, preserves high-resolution feature maps and refines small object details such as flame edges and spark splashes through depthwise separable convolution. The first ECA-ShuffleNetV2 unit, with a stride of 2, compresses the feature map size and uses an attention mechanism to focus on high-level semantic features in the flame core. The synergistic effect of these two units reduces redundant computation while achieving a dynamic balance between detail preservation and semantic abstraction, avoiding the problem of small object feature loss caused by single-source downsampling.
[0102] For the convenience of description, every two adjacent first ECA-ShuffleNetV2 units and second ECA-ShuffleNetV2 units are regarded as a feature extraction module, such as Figure 1 As shown, in Example 1, the backbone network of the present invention includes three feature extraction modules.
[0103] To further enhance the backbone network's feature extraction capabilities, Example 1 also adds a Convolutional Block Attention Module (CBAM) attention unit to the second ECA-ShuffleNetV2 unit in the second feature extraction module. This unit, sized 1 / 16 of the original image, is used to enhance the key regions of the second target feature map fed into this unit, generating a key region feature map. The addition of the CBAM attention unit helps improve detection performance, enabling the backbone network to more effectively focus on key regions and features.
[0104] The channel attention mechanism formula in the CBAM attention unit is shown in (3), where GAP represents global average pooling and MLP is a multi-layer perceptron.
[0105] Y channel =Sigmoid(MLP(GAP(X)))·X (3)
[0106] The spatial attention mechanism in the CBAM attention unit is shown in formula (4).
[0107] Y spatial =Sigmoid(Conv(Y channel ))·Y channel (4)
[0108] Further, such as Figure 1 As shown, the last feature extraction module of Example 1 also includes a pooling unit, which is connected to the second ECA-ShuffleNetV2 unit of the last layer, and is used to perform dimensionality reduction processing on the second target feature map extracted by the ECA-ShuffleNetV2 unit to obtain a reduced dimensionality feature map. Correspondingly, the subsequent neck network is used to perform feature fusion based on the original image, the reduced dimensionality feature map output by the pooling unit, the key area feature map output by the CBAM attention unit, and the second target feature map output by the underlying feature extraction module.
[0109] For ease of understanding, Figure 1 The network architecture operation order in the figure is introduced as follows: the first column (backbone network) runs from bottom to top, the long color block composed of Upsample, Concat and C2f_PCDC is regarded as the second column, the second column runs from top to bottom, the long color block composed of Conv, Concat and C2f_PCDC is regarded as the third column, the third column runs from bottom to top, and each row of the fourth column (head network) is an independent structure with no order.
[0110] The neck network is used to perform feature fusion at different levels based on the original image and the second target feature map obtained by the multi-layer second ECA-ShuffleNetV2 unit to obtain a fused image. Specifically, the multi-layer second ECA-ShuffleNetV2 unit can include each layer of the second ECA-ShuffleNetV2 unit, and the specific number of layers can also be specified by those skilled in the art.
[0111] The neck network includes a first alignment module, a second alignment module and a third alignment module connected in sequence, corresponding to Figure 1 The long color block in the second column;
[0112] The first alignment module is used to perform feature fusion on the second target feature map obtained by the second ECA-ShuffleNetV2 unit of two preset adjacent layers to obtain a first fused image;
[0113] Preferably, the second ECA-ShuffleNetV2 units of the two adjacent layers are two layers of second ECA-ShuffleNetV2 units located at the end;
[0114] Specifically, the first alignment module includes a recovery unit, a separation unit, a parallel convolution unit, a serial convolution unit and a splicing unit connected in sequence. The first alignment module is located at Figure 1 The first row of the second column;
[0115] Recovery unit such as Figure 1 As shown, it includes an upsampling mechanism and a concatenation mechanism connected in sequence, which is used to align the resolutions of the second target feature maps obtained by the second ECA-ShuffleNetV2 units of two preset adjacent layers and then concatenate them to obtain an alignment map.
[0116] like Figure 3 As shown in (a), the separation unit (Split) is used to perform channel separation on the alignment image to obtain a separation image;
[0117] The parallel convolution unit PDC (Parallel Depthwise Separable Convolution Concatenation) is used to decouple the separation graph. The decoupled separation graph is sent to the CDC and Concat modules for processing in turn. Figure 3 As shown in (b), the parallel convolution unit (PDC) consists of two parallel ordinary convolution subunits and one splicing subunit;
[0118] The serial convolution unit CDC (Cascaded Depthwise Separable Convolution Concatenation) is used to enhance the details of the separation image after decoupling and PDC processing to obtain an enhanced image, such as Figure 3 As shown in (c), the serial convolution unit (PDC) consists of two ordinary convolution sub-units connected in series;
[0119] Furthermore, in the present invention, the number of parallel convolution units and serial convolution units is multiple, each parallel convolution unit is used to process the separation graph, and each serial convolution unit is used to process the separation graph after PDC decoupling.
[0120] The concatenation unit (Concat) is used to perform feature concatenation and fusion on the alignment image, the separation image, the feature map after PDC decoupling, and the enhancement image to obtain a first fused image.
[0121] Preferably, the connection method between the serial convolution unit and the parallel convolution unit also includes residual connection.
[0122] like Figure 3 As shown, the present invention adopts parallel depthwise separable convolution and depthwise separable convolution serial mechanism with residual connection, which can achieve more efficient feature fusion with fewer parameters, while maintaining or even enhancing the feature representation capability and improving the overall performance of the neck network.
[0123] Furthermore, since Example 1 adds a pooling unit to the third feature extraction module, in Example 1, the first alignment module is used to perform feature fusion on the dimensionality reduction feature map output by the pooling unit and the key area feature map output by the CBAM attention unit to obtain a first fused image.
[0124] The structures of the second alignment module and the third alignment module are the same as the structure of the first alignment module. The second alignment module is used to perform feature fusion on the first fused image and the second target feature map obtained by the second ECA-ShuffleNetV2 unit of the preset number of layers to obtain a second fused image. In Example 1, the preset number of layers is the bottom layer.
[0125] The third alignment module is used to perform feature fusion on the original image and the second fused image to obtain a third fused image;
[0126] In one embodiment, the head network is connected to three alignment modules respectively for performing object detection based on the first fused image, the second fused image, and the third fused image.
[0127] Preferably, Figure 3 As shown in (a), in Example 1, the neck network also includes two ordinary convolution units, the separation unit, the parallel convolution unit, the serial convolution unit and the splicing unit are sequentially connected between the two ordinary convolution units, and the ordinary convolution unit connected to the separation unit is also connected to the recovery unit.
[0128] Preferably, in order to make the fused image features more accurate, the neck network of Example 1 further includes a first aggregation module, a second aggregation module and a third aggregation module, corresponding to Figure 1 The third column in;
[0129] The first aggregation module is used to perform detail enhancement on the second fused image and the third fused image to obtain a first aggregated image;
[0130] The second aggregation module is used to perform detail enhancement on the first fused image and the first aggregated image to obtain a second aggregated image;
[0131] The third aggregation module is used to enhance the details of the second aggregation map and the dimensionality reduction feature map to obtain a third aggregation map;
[0132] The head network is used to perform target detection based on the third fusion map, the first aggregate map, the second aggregate map, and the third aggregate map.
[0133] Specifically, such as Figure 1 As shown in the fourth column, the head network includes four parallel detection heads, which are respectively connected to the first aggregation module, the second aggregation module, the third aggregation module and the third alignment module to perform target detection on feature images fused at different levels.
[0134] In Example 1, the scale of the input feature map of each detection head is different. Figure 1 From bottom to top, the input sizes of the four detection heads decrease in size. The bottommost detection head has the largest input feature map size, which is suitable for detecting small targets and is recorded as the small target detection layer. From the bottom to the top of the detection head, the input feature map gradually decreases, gradually becoming suitable for detecting larger targets. Example 1 uses the newly added small target detection layer to increase the input feature map size, and has better detection capabilities for small targets.
[0135] In another embodiment, the head network uses a decoupled detection head to calculate regression and classification losses respectively through two parallel branches of convolution, and the loss function of the head network is a GIoU loss function to improve the detection capability of small target flames and enhance the overall performance.
[0136] Compared with the prior art, the present invention has the following beneficial effects:
[0137] (1) The present invention designs a backbone network consisting of ECA-ShuffleNetV2 units with cross-stacked steps, alternately connecting lightweight first / second ECA-ShuffleNetV2 units to construct a regular feature extraction rhythm with decreasing resolution through step size differences, which not only avoids the loss of details caused by excessive downsampling of shallow features, enhances the ability to capture local details, but also prevents redundant calculation of deep features;
[0138] (2) The present invention significantly enhances the ability to express flame features under complex lighting conditions by embedding a multi-scale feature extraction mechanism and an attention mechanism;
[0139] (3) The present invention introduces parallel convolution and serial convolution with residual connection into the neck network, which effectively improves the detection accuracy of small target flames, solves the problems of missed detection and false detection of traditional models in complex lighting scenes of precision instrument factories, and reduces redundant calculations.
[0140] The above descriptions are merely a few embodiments of the present application and do not constitute any form of limitation to the present application. Although the present application discloses the preferred embodiments as above, they are not intended to limit the present application. Any technical personnel familiar with the present profession, without departing from the scope of the technical solution of the present application, using the technical content disclosed above to make slight changes or modifications are equivalent to equivalent implementation cases and fall within the scope of the technical solution.
Claims
1. An object detection model based on improved YOLOv8, characterized in that: It includes a backbone network, a neck network, and a head network connected in sequence; The backbone network includes multiple layers of alternately connected first ECA-ShuffleNetV2 units and second ECA-ShuffleNetV2 units, wherein the step sizes of the first ECA-ShuffleNetV2 units and the second ECA-ShuffleNetV2 units are different; The first ECA-ShuffleNetV2 unit in the bottom layer is used to receive and extract the first target feature map in the original image to obtain the original first target feature map; the second ECA-ShuffleNet V2 unit in the second layer is used to extract the second target feature map from the original first target feature map to obtain the original second target feature map; The first ECA-ShuffleNetV2 unit of the remaining layers is used to extract the first target feature map in the second target feature map obtained by the second ECA-ShuffleNetV2 unit of the immediately previous layer, and the second ECA-ShuffleNetV2 unit of the remaining layers is used to extract the second target feature map in the first target feature map obtained by the first ECA-Shuffle NetV2 unit of the immediately previous layer; The neck network is used to perform feature fusion at different levels based on the original image and the second target feature map obtained by the multi-layer second ECA-ShuffleNetV2 unit to obtain a fused image; The head network is used to perform target detection based on the fused image.
2. The target detection model based on improved YOLOv8 according to claim 1, characterized in that The first ECA-ShuffleNetV2 unit of the bottom layer includes a first channel separation subunit, a first splicing subunit, a multi-scale extraction subunit and a depth convolution subunit; The multi-scale extraction subunit and the depth convolution subunit are connected side by side between the first channel separation subunit and the first splicing subunit; The first channel separation subunit is used to divide the original image into a first image and a second image; The multi-scale extraction subunit is used to perform multi-scale feature extraction on the first image to obtain a multi-scale feature map; The depth convolution subunit is used to perform feature decoupling and fusion on the second image to obtain a depth feature map; The first splicing subunit is used to splice the multi-scale feature map and the depth feature map to obtain an original first target feature map.
3. The target detection model based on improved YOLOv8 according to claim 2, characterized in that The multi-scale extraction subunit includes a splicing layer, a parallel first-scale extraction layer and a second-scale extraction layer; The first scale extraction layer is used to extract local features from the first image to obtain a first local feature map; The second scale extraction layer is used to perform global feature extraction on the first image to obtain a global feature map; The splicing layer is connected to the first scale extraction layer and the second scale extraction layer respectively, and is used to splice the first local feature map and the global feature map to obtain a multi-scale feature map.
4. The target detection model based on improved YOLOv8 according to claim 3, characterized in that The first scale extraction layer includes an attention structure and a depth convolution structure connected in sequence. The attention structure is used to perform channel enhancement on the first image; The deep convolution structure is used to perform feature decoupling and fusion on the first image after channel enhancement to obtain a first local feature map.
5. The target detection model based on improved YOLOv8 according to claim 1, characterized in that The second ECA-ShuffleNetV2 unit of the second layer includes a second channel separation subunit, a first scale extraction subunit, a second scale extraction subunit and a second splicing subunit; The first scale extraction subunit and the second scale extraction subunit are connected side by side between the second channel separation subunit and the second splicing subunit; The second channel separation subunit is used to divide the original first target feature map into a third image and a fourth image; The first scale extraction subunit is used to extract local features from the third image to obtain a second local feature map; The second scale extraction subunit is used to perform channel feature enhancement on the fourth image to obtain a channel feature map; The second splicing subunit is used to splice the second local feature map and the channel feature map to obtain an original second target feature map.
6. The target detection model based on improved YOLOv8 according to claim 5, characterized in that The first scale extraction subunit includes an attention layer and a depthwise convolution layer connected in sequence; The attention layer is used to perform channel enhancement on the third image; The deep convolutional layer is used to perform feature decoupling and fusion on the channel-enhanced third image to obtain a second local feature map.
7. The target detection model based on improved YOLOv8 according to any one of claims 1 to 6, characterized in that The neck network includes a first alignment module, a second alignment module, and a third alignment module connected in sequence; The first alignment module is used to perform feature fusion on the second target feature map obtained by the second ECA-ShuffleNetV2 unit of two preset adjacent layers to obtain a first fused image; The second alignment module is used to perform feature fusion on the first fused image and a second target feature map obtained by a second ECA-ShuffleNetV2 unit of a preset number of layers to obtain a second fused image; The third alignment module is used to perform feature fusion on the original image and the second fused image to obtain a third fused image; The head network is used to perform target detection based on the first fused image, the second fused image and the third fused image.
8. The target detection model based on improved YOLOv8 according to claim 7, characterized in that The first alignment module includes a recovery unit, a separation unit, a parallel convolution unit, a serial convolution unit and a splicing unit connected in sequence; The restoration unit is used to perform resolution alignment and splicing between the second target feature maps obtained by the second ECA-ShuffleNetV2 units of two preset adjacent layers to obtain an alignment map; The separation unit is used to perform channel separation on the alignment image to obtain a separation image; The parallel convolution unit is used to decouple the separation graph; The serial convolution unit is used to perform detail enhancement on the decoupled separation image to obtain an enhanced image; The splicing unit is further connected to the restoration unit, the separation unit and the parallel convolution unit respectively, and is used to perform feature fusion on the alignment image, the separation image, the decoupled separation image and the enhancement image to obtain a first fused image.
9. The target detection model based on improved YOLOv8 according to claim 8, characterized in that The connection method between the serial convolution unit and the parallel convolution unit also includes residual connection.