A sea scene target recognition method based on YOLOv8 improvement
Patent Information
- Application Number
- CN202410336097.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-22
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-03-22
AI Technical Summary
现有的YOLO算法经过多个版本的升级,基本实现了实时检测,但由于其原理限制,对于目标识别中的小目标仍有较大缺陷,不能满足实际需求,因此需要对以上问题提出一种新的解决方案
[0026] This invention offers the following beneficial technical effects: Addressing the significant shortcomings of existing YOLO algorithms in identifying small targets, this invention proposes an improved YOLOv8-based target recognition method for marine scenes. This method is implemented based on an improved YOLOv8 model. Specifically, in the backbone network of the improved YOLOv8 model, the global attention mechanism module can rationally allocate channel attention weights to effectively reduce information diffusion and amplify global cross-dimensional interactions; the ghost convolution module enables lightweight computation. In the neck network of the improved YOLOv8 model, the bidirectional weighted feature pyramid can integrate information of different sizes. Feature maps are fused, and cross-stage local networks can share feature parameters across different stages or network layers, thereby reducing unavoidable computational costs. Shuffling convolutional modules improves computational efficiency and effectively shortens the computation time that increases dramatically when recognizing small targets. Furthermore, an additional detection layer specifically for small target detection is added to the top network of the improved YOLOv8 model. This method, based on the improved YOLOv8 model, performs refined recognition of the image to be detected, significantly improving the accuracy of target recognition while saving computational power, especially improving the accuracy and efficiency of target recognition in small pixel regions. In addition, it exhibits better robustness in detection scenarios where the dataset is insufficient.
Smart Images

Figure CN118196381B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of target recognition technology, specifically relating to a target recognition method for marine scenes based on YOLOv8. Background Technology
[0002] The task of object recognition is to identify objects in an image and determine their location and category. In an image, the location of an object is represented by a bounding box, whose top-left and bottom-right corner coordinates determine the object's position. Object recognition can identify various objects, such as cats, dogs, vehicles, and pedestrians. In addition to location and category, object recognition can provide more information about the object, such as rotation angle, size, and shape. This additional information helps in a deeper understanding of image or video data.
[0003] Target recognition algorithms are mainly divided into two categories: two-stage and single-stage. Two-stage algorithms have relatively high accuracy but are slower, making them difficult to implement, especially in real-time applications. Conversely, single-stage algorithms are faster, with YOLO being a representative example. Existing YOLO algorithms have undergone several upgrades and have largely achieved real-time detection. However, due to limitations in its underlying principles, it still has significant shortcomings in identifying small targets and cannot meet practical needs. Therefore, a new solution is required to address these issues. Summary of the Invention
[0004] To address the aforementioned problems in related technologies, this invention provides a target recognition method for marine scenes based on an improved YOLOv8 approach. The technical problem to be solved by this invention is achieved through the following technical solution:
[0005] In a first aspect, the present invention provides a target recognition method for marine scenes based on an improved YOLOv8, comprising:
[0006] Acquire an image to be detected, wherein the image to be detected is a sea scene image;
[0007] The image to be detected is input into the trained improved YOLOv8 model, which outputs the target recognition result;
[0008] The improved YOLOv8 model's backbone network includes a global attention mechanism module and a ghost convolution module. The improved YOLOv8 model's neck network includes a cross-stage local network, a bidirectional weighted feature pyramid module, a group shuffle convolution module, and the ghost convolution module. The improved YOLOv8 model's top network includes a detection layer for detecting targets of a preset size; the preset size target is a small target.
[0009] In some embodiments, the backbone network of the improved YOLOv8 model includes:
[0010] The system comprises a first ghost convolution module, a second ghost convolution module, a first cross-stage partial network fusion module, a third ghost convolution module, a second cross-stage partial network fusion module, a fourth ghost convolution module, a third cross-stage partial network fusion module, a fifth ghost convolution module, a fourth cross-stage partial network fusion module, the global attention mechanism module, and a fast spatial pyramid pooling module; wherein,
[0011] The backbone network of the improved YOLOv8 model has its input terminal at the first ghost convolution module. The output terminal of the first ghost convolution module is connected to the input terminal of the second ghost convolution module. The output terminal of the second ghost convolution module is connected to the input terminal of the first cross-stage partial network fusion module. The output terminal of the first cross-stage partial network fusion module is connected to the input terminal of the third ghost convolution module. The output terminal of the third ghost convolution module is connected to the input terminal of the second cross-stage partial network fusion module. The output terminal of the second cross-stage partial network fusion module is connected to the input terminal of the fourth ghost convolution module. The output of the ghost convolution module is connected to the input of the third cross-stage partial network fusion module. The output of the third cross-stage partial network fusion module is connected to the input of the fifth ghost convolution module. The output of the fifth ghost convolution module is connected to the input of the fourth cross-stage partial network fusion module. The output of the fourth cross-stage partial network fusion module is connected to the input of the global attention mechanism module. The output of the global attention mechanism module is connected to the input of the fast spatial pyramid pooling module. The output of the fast spatial pyramid pooling module is connected to the input of the neck network of the improved YOLOv8 model.
[0012] In some embodiments, the output of the backbone network of the improved YOLOv8 model is connected to the input of the P3 layer and the input of the P5 layer in the neck network of the improved YOLOv8 model, respectively.
[0013] In the neck network of the improved YOLOv8 model, each of the cross-stage local networks is connected after each linking layer;
[0014] The bidirectional weighted feature pyramid module is connected between the first cross-stage local network and the second cross-stage local network, and the bidirectional weighted feature pyramid module is connected after the cross-stage partial network connected to the output of the P3 layer is fused.
[0015] A ghost convolution module is connected after the third cross-stage local network, a ghost convolution module is connected after the fourth cross-stage local network, and a group scrambled convolution module is connected after the fifth cross-stage local network; wherein, the third cross-stage local network is the cross-stage local network connected after the first linking layer, and the first linking layer is the linking layer connected to the output of the P5 layer after fusion of the cross-stage partial networks; the fifth cross-stage local network is the cross-stage local network connected after the second linking layer, and the second linking layer is the linking layer connected to the ghost convolution module connected after the third cross-stage local network; the fourth cross-stage local network is the cross-stage local network connected after the third linking layer, and the third linking layer is the linking layer connected to the group scrambled convolution module connected after the fifth cross-stage local network.
[0016] In some embodiments, the output of the backbone network of the improved YOLOv8 model is further connected to the inputs of the P2 layer and the P4 layer in the neck network of the improved YOLOv8 model, respectively; the neck network of the improved YOLOv8 model includes:
[0017] The output of the P5 layer is connected to a cross-stage partial network fusion module. The output of the cross-stage partial network fusion module is connected to the input of the first link layer. The input of the first link layer is also connected to the output of an upsampling module. The input of the upsampling module is connected to the output of the sixth cross-stage local network. The output of the sixth cross-stage local network is also connected to the input of the second link layer. The output of the first link layer is connected to the input of the third cross-stage local network. The output of the third cross-stage local network is connected to a ghost convolution module. The output of the ghost convolution module is connected to the input of the second link layer. The output of the second link layer is connected to the input of the fifth cross-stage local network. The output of the fifth cross-stage local network is connected to the group scrambled convolution module. The output of the group scrambled convolution module is connected to the input of the third link layer.
[0018] The output of the P4 layer is connected to a cross-stage partial network fusion module. The output of the cross-stage partial network fusion module is connected to the input of the fourth link layer. The output of the fourth link layer is connected to the input of the sixth cross-stage local network. The input of the fourth link layer is also connected to an upsampling module. The input of the upsampling module is connected to the output of the second cross-stage local network. The output of the second cross-stage local network is also connected to the input of the third link layer. The output of the third link layer is connected to the input of the fourth cross-stage local network. The output of the fourth cross-stage local network is connected to a ghost convolution module. The output of the ghost convolution module is connected to the input of the sixth link layer.
[0019] The output of the P3 layer is connected to a cross-stage partial network fusion module. The output of the cross-stage partial network fusion module is connected to the input of the bidirectional weighted feature pyramid module. The input of the bidirectional weighted feature pyramid module is also connected to the output of the first cross-stage local network. The output of the bidirectional weighted feature pyramid module is connected to the input of the top network of the improved YOLOv8 model. The output of the bidirectional weighted feature pyramid module is also connected to the input of the second cross-stage local network.
[0020] The output of the P2 layer is connected to a cross-stage partial network fusion module. The output of this cross-stage partial network fusion module is connected to the input of the fifth link layer. The input of the fifth link layer is also connected to an upsampling module. The input of this upsampling module is also connected to the output of the fast spatial pyramid pooling module in the backbone network of the improved YOLOv8 model. The output of the fast spatial pyramid pooling module is also connected to the input of the sixth link layer. The output of the sixth link layer is connected to a seventh cross-stage local network. The output of the seventh cross-stage local network is connected to the input of the top network of the improved YOLOv8 model. The output of the fifth link layer is connected to the input of the first cross-stage local network.
[0021] In some embodiments, the detection layer for detecting a target of a preset size includes: a first detection layer and a second detection layer; the first detection layer and the second detection layer are sequentially disposed on the P5 layer of the top network of the improved YOLOv8 model.
[0022] In some embodiments, before inputting the image to be detected into the trained improved YOLOv8 model and outputting the target recognition result, the method further includes:
[0023] Obtain a training dataset; the training dataset includes: multiple sea scene images and labels corresponding to each of the multiple sea scene images;
[0024] Using the aforementioned training dataset and loss function, the initial improved YOLOv8 model is trained to obtain the trained improved YOLOv8 model.
[0025] Secondly, the present invention also provides a marine scene target device based on YOLOv8, including a processor, a communication interface, a memory, and a communication bus. The processor, the communication interface, and the memory communicate with each other through the communication bus. The memory is used to store computer programs. When the processor executes the program stored in the memory, it implements the method steps provided in the first aspect.
[0026] This invention offers the following beneficial technical effects: Addressing the significant shortcomings of existing YOLO algorithms in identifying small targets, this invention proposes an improved YOLOv8-based target recognition method for marine scenes. This method is implemented based on an improved YOLOv8 model. Specifically, in the backbone network of the improved YOLOv8 model, the global attention mechanism module can rationally allocate channel attention weights to effectively reduce information diffusion and amplify global cross-dimensional interactions; the ghost convolution module enables lightweight computation. In the neck network of the improved YOLOv8 model, the bidirectional weighted feature pyramid can integrate information of different sizes. Feature maps are fused, and cross-stage local networks can share feature parameters across different stages or network layers, thereby reducing unavoidable computational costs. Shuffling convolutional modules improves computational efficiency and effectively shortens the computation time that increases dramatically when recognizing small targets. Furthermore, an additional detection layer specifically for small target detection is added to the top network of the improved YOLOv8 model. This method, based on the improved YOLOv8 model, performs refined recognition of the image to be detected, significantly improving the accuracy of target recognition while saving computational power, especially improving the accuracy and efficiency of target recognition in small pixel regions. In addition, it exhibits better robustness in detection scenarios where the dataset is insufficient.
[0027] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating the improved YOLOv8-based target recognition method for marine scenes provided in an embodiment of the present invention.
[0029] Figure 2 This is a schematic diagram of the backbone network of the improved YOLOv8 model provided in an embodiment of the present invention;
[0030] Figure 3This is a schematic diagram of the neck network of the improved YOLOv8 model provided in an embodiment of the present invention;
[0031] Figure 4 This is an example diagram of recognition using a conventional YOLOv8 model provided in an embodiment of the present invention;
[0032] Figure 5 This is an example diagram of recognition using the improved YOLOv8 model provided in an embodiment of the present invention;
[0033] Figure 6 This is an example image of recognition using a conventional YOLOv8 model in complex scenarios provided by an embodiment of the present invention;
[0034] Figure 7 This is an example diagram of recognition using the improved YOLOv8 model in complex scenarios provided by an embodiment of the present invention. Detailed Implementation
[0035] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.
[0036] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0037] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.
[0038] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art will understand and implement other variations of the disclosed embodiments by reviewing the accompanying drawings, disclosure, and appended claims in carrying out the claimed invention. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0039] To address the significant shortcomings of existing YOLO algorithms in identifying small targets, this invention proposes an improved YOLOv8-based method for target recognition in marine scenes. This method can save computing power while performing more detailed analysis of the image to be detected with high efficiency, accurately identifying multiple targets of different sizes in the image.
[0040] Now combined Figure 1 The technical solution proposed in this invention will be described in detail. Figure 1 This is a flowchart illustrating the improved YOLOv8-based target recognition method for marine scenes provided in this embodiment of the invention. Figure 1 As shown, the method includes:
[0041] Step 110: Obtain the image to be detected, which is a sea scene image.
[0042] Here, the image to be detected is an infrared marine scene image. Specifically, an infrared camera is used to capture images of targets appearing in the marine scene, such as ships, people, animals, etc.
[0043] Step 120: Input the image to be detected into the trained improved YOLOv8 model and output the target recognition result; wherein, the backbone network of the improved YOLOv8 model contains a global attention mechanism module and a ghost convolution module, the neck network of the improved YOLOv8 model contains a cross-stage local network, a bidirectional weighted feature pyramid module, a group shuffle convolution module and a ghost convolution module, and the top network of the improved YOLOv8 model contains a detector layer for detecting targets of a preset size; targets of the preset size are small targets.
[0044] Here, a small target can be understood as a target that occupies a small pixel area in the image to be detected. The preset size refers to a preset pixel size, which can be set according to actual needs. After acquiring the image to be detected, it is input into the trained improved YOLOv8 model. Based on the image information provided by the image to be detected, the improved YOLOv8 model annotates the identified target locations using bounding boxes and provides a type label, which includes: target type information, target size information, target rotation angle, and target shape information, etc.
[0045] The improved YOLOv8 model of this invention will now be described in detail. This improved YOLOv8 model is an improvement upon the original YOLOv8 model architecture and comprises three main parts: a backbone network, a neck network, and a top network. The backbone network extracts feature information from the image to be detected, generating multiple feature maps at different levels, such as high-level, higher-level, lower-level, and low-level feature maps. These feature maps generated by the backbone network are then input into the neck network for processing. Specifically, this processing includes fusing feature maps of different sizes and levels into a single feature map with multi-size information. Finally, this feature map with multi-size information is input into the top network, which performs target recognition on the feature map and outputs a feature map containing multiple label information, including the target size, the corresponding classification result, shape information, etc.
[0046] Now combined with Figures 2 to 3 The architecture and specific functions of the backbone network and neck network in the improved YOLOv8 model of this invention are explained. Figure 2 This is a schematic diagram of the backbone network of the improved YOLOv8 model provided in an embodiment of the present invention. Figure 2 As shown, the backbone network of the improved YOLOv8 model includes:
[0047] The improved YOLOv8 model comprises a first ghost convolution module, a second ghost convolution module, a first cross-stage partial network fusion module, a third ghost convolution module, a second cross-stage partial network fusion module, a fourth ghost convolution module, a third cross-stage partial network fusion module, a fifth ghost convolution module, a fourth cross-stage partial network fusion module, a global attention mechanism module, and a fast spatial pyramid pooling module. The input of the backbone network of the improved YOLOv8 model is the input of the first ghost convolution module. The output of the first ghost convolution module is connected to the input of the second ghost convolution module. The output of the second ghost convolution module is connected to the input of the first cross-stage partial network fusion module. The output of the first cross-stage partial network fusion module is connected to the input of the third ghost convolution module. The output of the third ghost convolution module... The output end is connected to the input end of the second cross-stage partial network fusion module. The output end of the second cross-stage partial network fusion module is connected to the input end of the fourth ghost convolution module. The output end of the fourth ghost convolution module is connected to the input end of the third cross-stage partial network fusion module. The output end of the third cross-stage partial network fusion module is connected to the input end of the fifth ghost convolution module. The output end of the fifth ghost convolution module is connected to the input end of the fourth cross-stage partial network fusion module. The output end of the fourth cross-stage partial network fusion module is connected to the input end of the global attention mechanism module. The output end of the global attention mechanism module is connected to the input end of the fast spatial pyramid pooling module. The output end of the fast spatial pyramid pooling module is connected to the input end of the neck network of the improved YOLOv8 model.
[0048] It should be noted that the first to fifth ghost convolution modules here are all the same ghost convolution modules, and the first to fifth are used to distinguish the five ghost convolution modules.
[0049] Here, the image to be detected includes multiple channels. A global attention mechanism module is used to determine the channel attention weights for different channels. These channel attention weights determine the weight of each channel in the channel attention map. By identifying the parts of the image to be detected that require attention in each channel and allocating limited information processing resources according to the different channel attention weights, important features are captured in all three dimensions, reducing information diffusion and amplifying global cross-dimensional interactions. Specifically, the global attention mechanism module includes a channel attention module and a spatial attention module. In practice, the channel attention module performs convolution processing on the feature map. First, the three-dimensional information of the image to be detected is forward-arranged to obtain forward-arranged three-dimensional information, which includes the number of channels, height, and width. Then, two layers of MLP (Multilayer Perceptron) are used to spatially amplify the forward-arranged three-dimensional information to obtain amplified three-dimensional information. The amplified three-dimensional information is then reverse-arranged to obtain reverse-arranged three-dimensional information. Finally, the sigmoid activation function in the channel attention module is used to process the reverse-arranged three-dimensional information to obtain the channel attention map. In the spatial attention module, the output of the channel attention module is used as input. A convolution with a kernel of 7 is performed to reduce the number of channels and decrease computation. Then, another convolution with a kernel of 7 is performed to increase the number of channels, maintaining consistency. The spatial attention module performs multiple convolution operations on the channel attention map to determine the convolutional channel attention map. The sigmoid activation function in the spatial attention module is used to process the convolutional channel attention map, obtaining multiple channel attention weights. The channel attention map and the multiple channel attention weights are multiplied to generate an intermediate feature map. Finally, pooling is performed on the intermediate feature map to obtain multiple feature maps at different levels.
[0050] Here, the conventional YOLOv8 model inevitably suffers from prolonged recognition time and exponentially increased computational load when identifying small targets. To address this slowdown, this invention replaces the convolutional modules in the conventional YOLOv8 model with ghost convolution modules. These ghost convolution modules significantly enhance the feature extraction capabilities of the backbone network. The specific working principle of the ghost convolution module is as follows: First, an intrinsic feature map, denoted as Y', is obtained through conventional convolution. The intrinsic feature map matrix Y' includes multiple channel feature map matrices y i '; Using a multi-channel feature map matrix y i The ghost feature map is determined, and the ghost feature map can be represented as: y ij =Φ i,j (y i '), j = 1, ..., s, where Φ i,jThis refers to performing a linear operation on the function, where i represents the feature map number; the resulting ghost feature map and intrinsic feature map are concatenated and then output. Here, in the ghost convolution module, Φ i,j It can handle low-cost linear operations such as affine transformations. Here, the cross-stage partial network fusion module can pass parameter information between different modules, avoiding a large amount of redundant calculations and improving computational efficiency.
[0051] It should be noted that the terms "first ghost convolution module," "second ghost convolution module," etc., introduced here are only for the purpose of illustrating the specific location of the modules. The "ghost convolution modules" appearing in this invention all have the same parameters. Similarly, the "cross-stage partial network fusion module" appearing in this invention also has the same parameters; the prefix numbers are only for distinguishing and clearly indicating the specific location of the modules.
[0052] Here, the fast spatial pyramid pooling module of the backbone network is connected to the input of the neck network, and the output of the backbone network is connected to the inputs of layers P2, P3, P4, and P5 in the neck network of the improved YOLOv8 model, respectively. Furthermore, these five parts are connected to the five inputs of the neck network.
[0053] Figure 3 This is a schematic diagram of the neck network of the improved YOLOv8 model provided in an embodiment of the present invention. Figure 3 As shown, in the neck network of the improved YOLOv8 model, each cross-stage local network is connected after each linked layer; a bidirectional weighted feature pyramid module is connected between the first and second cross-stage local networks, and is connected after the cross-stage partial network connected to the output of layer P3 is fused; a ghost convolution module is connected after the third cross-stage local network, a ghost convolution module is connected after the fourth cross-stage local network, and a group scrambled convolution module is connected after the fifth cross-stage local network; wherein, the third cross-stage local network is a cross-stage local network connected after the first linked layer, the first linked layer is a linked layer connected after the cross-stage partial network connected to the output of layer P5 is fused; the fifth cross-stage local network is a cross-stage local network connected after the second linked layer, the second linked layer is a linked layer connected to the ghost convolution module connected after the third cross-stage local network; the fourth cross-stage local network is a cross-stage local network connected after the third linked layer, the third linked layer is a linked layer connected to the group scrambled convolution module connected after the fifth cross-stage local network.
[0054] The above details the locations of the newly added modules in the neck network of the improved YOLOv8 model. In addition to these modules, the neck network of the improved YOLOv8 model includes:
[0055] The output of layer P5 is connected to a cross-stage partial network fusion module. The output of this module is connected to the input of the first link layer. The input of the first link layer is also connected to the output of an upsampling module. The input of this upsampling module is connected to the output of the sixth cross-stage local network. The output of the sixth cross-stage local network is also connected to the input of the second link layer. The output of the first link layer is connected to the input of the third cross-stage local network. The output of the third cross-stage local network is connected to a ghost convolution module. The output of this module is connected to the input of the second link layer. The output of the second link layer is connected to the input of the fifth cross-stage local network. The output of the fifth cross-stage local network is connected to a group scrambled convolution module. The output of the group scrambled convolution module is connected to the input of the third link layer.
[0056] The output of layer P4 is connected to a cross-stage partial network fusion module. The output of this module is connected to the input of the fourth link layer. The output of the fourth link layer is connected to the input of the sixth cross-stage local network. The input of the fourth link layer is also connected to an upsampling module. The input of this module is connected to the output of the second cross-stage local network. The output of the second cross-stage local network is also connected to the input of the third link layer. The output of the third link layer is connected to the input of the fourth cross-stage local network. The output of the fourth cross-stage local network is connected to a ghost convolution module. The output of this module is connected to the input of the sixth link layer.
[0057] The output of layer P3 is connected to a cross-stage partial network fusion module. The output of this cross-stage partial network fusion module is connected to the input of a bidirectional weighted feature pyramid module. The input of the bidirectional weighted feature pyramid module is also connected to the output of the first cross-stage local network. The output of the bidirectional weighted feature pyramid module is connected to the input of the top network of the improved YOLOv8 model. The output of the bidirectional weighted feature pyramid module is also connected to the input of the second cross-stage local network.
[0058] The output of layer P2 is connected to a cross-stage partial network fusion module. The output of this cross-stage partial network fusion module is connected to the input of the fifth link layer. The input of the fifth link layer is also connected to an upsampling module. The input of this upsampling module is also connected to the output of the fast spatial pyramid pooling module in the backbone network of the improved YOLOv8 model. The output of the fast spatial pyramid pooling module is also connected to the input of the sixth link layer. The output of the sixth link layer is connected to the seventh cross-stage local network. The output of the seventh cross-stage local network is connected to the input of the top network of the improved YOLOv8 model. The output of the fifth link layer is connected to the input of the first cross-stage local network.
[0059] It should be noted that the specific parameters of the multiple ghost convolutional modules appearing in the backbone network and the neck network are the same, as are the specific parameters of the multiple cross-stage partial network fusion modules appearing in the backbone network and the neck network, and the specific parameters of the multiple upsampling modules and cross-stage local networks appearing in the neck network. For the sake of brevity, these will not be elaborated on here.
[0060] To improve recognition efficiency, a lightweight design is implemented for the neck network. This is achieved by introducing a Group Shuffle Convolution (GSConv) module for downsampling. The downsampled result is then input into a depthwise convolution module within the GSConv module for depthwise convolution. Finally, the downsampled and depthwise convolution results are concatenated, and the final output is obtained through rearrangement. The GSConv module significantly reduces the number of parameters and computational cost while simultaneously improving output accuracy.
[0061] Here, the bidirectional weighted feature pyramid module fuses higher-level feature maps with lower-level feature maps through upsampling operations, achieving feature fusion across different levels. Specifically, a high-level feature map is selected as the starting layer, typically the top-level one. This high-level feature map is then upsampled to the same size as the next lower-level feature map. The upsampled high-level feature map is then fused with the next lower-level feature map. The fusion can be achieved through simple concatenation or deeper feature fusion via convolution. During the fusion process, input edges with only one line of input that is not fused are considered to have a small contribution to the feature network, simplifying the bidirectional network. Secondly, if the original input and output nodes are at the same level, an additional edge is added from the original input to the output node to fuse more features without significantly increasing cost. Finally, paths with only one top-down path are aggregated differently, treating each bidirectional path as a feature network layer (bidirectional being both top-down and bottom-up), and repeating the same layers multiple times to achieve higher-level feature fusion. These steps are repeated until all feature maps requiring fusion have been processed. In addition, a composite scaling method is introduced to uniformly scale the resolution, depth, and width of the backbone network, feature network, and prediction network. Through a bidirectional weighted feature pyramid module, the feature fusion capability for targets at different scales can be significantly improved, thereby increasing the efficiency of multi-scale feature fusion while simplifying computation. Furthermore, using the composite scaling method allows for the establishment of a scalable detection architecture with better accuracy within limited computational capabilities.
[0062] After generating a feature map with multi-size information in the neck network, this feature map is input into the top network for target recognition. To improve the accuracy of target detection and better identify small targets, the improved YOLOv8 model provided in this invention adds a detection layer for detecting targets of a preset size to the original three target detection layers in the top network. The detection layer for detecting targets of a preset size includes a first detection layer and a second detection layer; the first detection layer and the second detection layer are sequentially arranged on the P5 layer in the top network of the improved YOLOv8 model.
[0063] Here, since the application scenario of the technical solution provided by this invention is an infrared scene, targets smaller than 4*4 pixels may be due to detection failure caused by the performance of the infrared camera. Therefore, the preset target size can be a target of 4*4 pixels. Here, the input sizes of the first detection layer and the second detection layer may be different, but the outputs of the first detection layer and the second detection layer are both targets of the preset size.
[0064] Here, the top network of the original YOLOv8 model includes a P3 probe layer, a P4 probe layer, and a P5 probe layer.
[0065] Here, the first and second detection layers are mainly used to output targets of a preset size, while targets of other sizes are marked and output by the P3, P4 and P5 detection layers.
[0066] The training process of the improved YOLOv8 model is briefly described below. Before inputting the image to be detected into the trained improved YOLOv8 model and outputting the target recognition result, the method further includes: acquiring a training dataset; the training dataset includes: multiple sea scene images and corresponding labels for the multiple sea scene images; using the training dataset and a loss function, the initial improved YOLOv8 model is trained to obtain the trained improved YOLOv8 model.
[0067] To clearly illustrate the effectiveness of the improved YOLOv8-based target recognition method for marine scenes provided in this invention, Figure 4 This is an example diagram provided by an embodiment of the present invention for recognition using a conventional YOLOv8 model. For example... Figure 4As shown, the image to be detected is a sea scene image captured by an infrared camera. There should be four ships in the image, including two large ships (represented by the symbol "D") and two small ships (represented by the symbol "X"). The small ships next to the large ships occupy approximately 3*3 pixels in the image. Using the conventional YOLOv8 model to identify the image, it can be seen that only three targets are identified (the identified large ships are marked with red boxes, and the small ships are marked with pink boxes). The small ships between the two large ships are not identified.
[0068] Figure 5 This is an example diagram of recognition using the improved YOLOv8 model provided in an embodiment of the present invention. Figure 4 and Figure 5 The images to be detected are the same. For example... Figure 5 As shown, using the improved YOLOv8 model provided by this invention, four targets were detected. Among them, a small vessel between two large vessels was identified and marked with a pink box.
[0069] Figure 6 This is an example image provided by an embodiment of the present invention for recognition using a conventional YOLOv8 model in complex scenarios. Figure 6 As shown, the image to be detected was taken on an island terrain in a snowy climate. When using the conventional YOLOv8 model to identify the image, the protruding rocks in the island terrain or the snowflakes flying in the air were identified as large ships.
[0070] Figure 7 This is an example diagram of recognition using the improved YOLOv8 model in complex scenarios provided by an embodiment of the present invention. Figure 6 and Figure 7 The images to be detected are the same. For example... Figure 7 As shown, no misidentification occurred when using the improved YOLOv8 model provided by this invention for recognition.
[0071] To address the significant shortcomings of existing YOLO algorithms in identifying small targets, this invention proposes an improved YOLOv8-based target recognition method for marine scenes. This method is implemented based on an improved YOLOv8 model. Specifically, in the backbone network of the improved YOLOv8 model, a global attention mechanism module can rationally allocate channel attention weights to effectively reduce information diffusion and amplify global cross-dimensional interactions; the ghost convolution module enables lightweight computation. In the neck network of the improved YOLOv8 model, a bidirectional weighted feature pyramid can segment feature maps of different sizes. The method integrates cross-stage local networks, allowing feature parameters to be shared across different stages or network layers, thereby reducing unavoidable computational overhead. Shuffling convolutional modules improves computational efficiency, effectively shortening the computation time that increases dramatically when identifying small targets. Furthermore, an additional detection layer specifically for small target detection is added to the top network of the improved YOLOv8 model. This method refines the recognition of images based on the improved YOLOv8 model, significantly improving the accuracy of target recognition, especially for targets in small pixel regions, while saving computational resources. Moreover, it exhibits better robustness in situations where the dataset is insufficient.
[0072] This invention also provides a marine scene target recognition device based on YOLOv8, comprising a processor, a communication interface, a memory, and a communication bus. The processor, the communication interface, and the memory communicate with each other via the communication bus. The memory stores computer programs. When the processor executes the program stored in the memory, it implements the method steps corresponding to the marine scene target recognition method based on YOLOv8 provided by this invention. The technical effects achievable by this marine scene target recognition device based on YOLOv8 are the same as those achievable by the marine scene target recognition method based on YOLOv8 provided by this invention, and will not be elaborated further here.
[0073] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A target recognition method for marine scenes based on an improved YOLOv8, characterized in that, The method includes: Acquire an image to be detected, wherein the image to be detected is a sea scene image; The image to be detected is input into the trained improved YOLOv8 model, which outputs the target recognition result; The improved YOLOv8 model's backbone network includes a global attention mechanism module and a ghost convolution module. The improved YOLOv8 model's neck network includes a cross-stage local network, a bidirectional weighted feature pyramid module, a group shuffled convolution module, and the ghost convolution module. The improved YOLOv8 model's top network includes a detection layer for detecting targets of a preset size; the preset size target is a small target. The backbone network of the improved YOLOv8 model includes: The module consists of a first ghost convolution module, a second ghost convolution module, a first cross-stage partial network fusion module, a third ghost convolution module, a second cross-stage partial network fusion module, a fourth ghost convolution module, a third cross-stage partial network fusion module, a fifth ghost convolution module, a fourth cross-stage partial network fusion module, the global attention mechanism module, and a fast spatial pyramid pooling module. In this improved YOLOv8 model, the input of the backbone network is the input of the first ghost convolution module; the output of the first ghost convolution module is connected to the input of the second ghost convolution module; the output of the second ghost convolution module is connected to the input of the first cross-stage partial network fusion module; the output of the first cross-stage partial network fusion module is connected to the input of the third ghost convolution module; the output of the third ghost convolution module is connected to the input of the second cross-stage partial network fusion module; and the output of the second cross-stage partial network fusion module is connected to the input of the fourth ghost convolution module. The output of the four ghost convolution module is connected to the input of the third cross-stage partial network fusion module. The output of the third cross-stage partial network fusion module is connected to the input of the fifth ghost convolution module. The output of the fifth ghost convolution module is connected to the input of the fourth cross-stage partial network fusion module. The output of the fourth cross-stage partial network fusion module is connected to the input of the global attention mechanism module. The output of the global attention mechanism module is connected to the input of the fast spatial pyramid pooling module. The output of the fast spatial pyramid pooling module is connected to the input of the neck network of the improved YOLOv8 model. The output of the backbone network of the improved YOLOv8 model is connected to the inputs of the P2, P3, P4 and P5 layers in the neck network of the improved YOLOv8 model, respectively. In the neck network of the improved YOLOv8 model, each of the cross-stage local networks is connected after each linking layer; The bidirectional weighted feature pyramid module is connected between the first cross-stage local network and the second cross-stage local network, and the bidirectional weighted feature pyramid module is connected after the cross-stage partial network connected to the output of the P3 layer is fused. A ghost convolutional module is connected after the third cross-stage local network, a ghost convolutional module is connected after the fourth cross-stage local network, and a group scrambled convolutional module is connected after the fifth cross-stage local network; wherein, the third cross-stage local network is the cross-stage local network connected after the first linking layer, and the first linking layer is the linking layer connected to the output of the P5 layer after fusion of the cross-stage partial networks; the fifth cross-stage local network is the cross-stage local network connected after the second linking layer, and the second linking layer is the linking layer connected to the ghost convolutional module connected after the third cross-stage local network; the fourth cross-stage local network is the cross-stage local network connected after the third linking layer, and the third linking layer is the linking layer connected to the group scrambled convolutional module connected after the fifth cross-stage local network; The detection layer for detecting targets of a preset size includes a first detection layer and a second detection layer; the first detection layer and the second detection layer are sequentially disposed on the P5 layer of the top network of the improved YOLOv8 model.
2. The target recognition method for marine scenes based on YOLOv8 as described in claim 1, characterized in that, The neck network of the improved YOLOv8 model includes: The output of the P5 layer is connected to a cross-stage partial network fusion module. The output of the cross-stage partial network fusion module is connected to the input of the first link layer. The input of the first link layer is also connected to the output of an upsampling module. The input of the upsampling module is connected to the output of the sixth cross-stage local network. The output of the sixth cross-stage local network is also connected to the input of the second link layer. The output of the first link layer is connected to the input of the third cross-stage local network. The output of the third cross-stage local network is connected to a ghost convolution module. The output of the ghost convolution module is connected to the input of the second link layer. The output of the second link layer is connected to the input of the fifth cross-stage local network. The output of the fifth cross-stage local network is connected to the group scrambled convolution module. The output of the group scrambled convolution module is connected to the input of the third link layer. The output of the P4 layer is connected to a cross-stage partial network fusion module. The output of the cross-stage partial network fusion module is connected to the input of the fourth link layer. The output of the fourth link layer is connected to the input of the sixth cross-stage local network. The input of the fourth link layer is also connected to an upsampling module. The input of the upsampling module is connected to the output of the second cross-stage local network. The output of the second cross-stage local network is also connected to the input of the third link layer. The output of the third link layer is connected to the input of the fourth cross-stage local network. The output of the fourth cross-stage local network is connected to a ghost convolution module. The output of the ghost convolution module is connected to the input of the sixth link layer. The output of the P3 layer is connected to a cross-stage partial network fusion module. The output of the cross-stage partial network fusion module is connected to the input of the bidirectional weighted feature pyramid module. The input of the bidirectional weighted feature pyramid module is also connected to the output of the first cross-stage local network. The output of the bidirectional weighted feature pyramid module is connected to the input of the top network of the improved YOLOv8 model. The output of the bidirectional weighted feature pyramid module is also connected to the input of the second cross-stage local network. The output of the P2 layer is connected to a cross-stage partial network fusion module. The output of this cross-stage partial network fusion module is connected to the input of the fifth link layer. The input of the fifth link layer is also connected to an upsampling module. The input of this upsampling module is also connected to the output of the fast spatial pyramid pooling module in the backbone network of the improved YOLOv8 model. The output of the fast spatial pyramid pooling module is also connected to the input of the sixth link layer. The output of the sixth link layer is connected to a seventh cross-stage local network. The output of the seventh cross-stage local network is connected to the input of the top network of the improved YOLOv8 model. The output of the fifth link layer is connected to the input of the first cross-stage local network.
3. The target recognition method for marine scenes based on YOLOv8 as described in claim 1, characterized in that, Before outputting the target recognition result in the trained improved YOLOv8 model by inputting the image to be detected, the method further includes: Obtain a training dataset; the training dataset includes: multiple sea scene images and labels corresponding to each of the multiple sea scene images; Using the aforementioned training dataset and loss function, the initial improved YOLOv8 model is trained to obtain the trained improved YOLOv8 model.
4. A target device for marine scenes based on an improved version of YOLOv8, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, characterized in that the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the steps of the method described in any one of claims 1-3.
Citation Information
Patent Citations
Marine ship detection method based on improved YOLOv3 algorithm
CN113743322A