Underwater moving target detection method and system based on lightweight improved Yolov8

By adopting the lightweight and improved Yolov8 model in underwater target detection, combining cross-scale feature fusion and dynamic detection heads, the problem of insufficient detection accuracy and lightweight in traditional methods is solved, and high-precision and real-time underwater can be achieved Mobile target detection, suitable for underwater robot applications.

CN118968274APending Publication Date: 2024-11-15HAINAN UNIV

Patent Information

Application Number
CN202410974914.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Traditional underwater target detection methods have shortcomings in small target detection accuracy and system lightweighting, especially in underwater environments, which are difficult to meet the needs of high precision and real-time.

Method used

The Yolov8 model based on lightweight improvement is adopted, combining backbone network, lightweight cross-scale feature fusion module and new dynamic detection heads, and gradually integrating multi-scale features and local global features to improve detection accuracy and lightweight.

Benefits of technology

It improves the accuracy of small target detection and the degree of system lightweighting, reduces the amount of model parameters and calculation, is suitable for underwater robot deployment, and realizes real-time detection and automatic monitoring functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968274A_ABST
    Figure CN118968274A_ABST
Patent Text Reader

Abstract

The invention relates to an underwater moving target detection method and system based on lightweight improved Yov8, and the method comprises the steps: obtaining an underwater image in real time, inputting the underwater image into a pre-trained lightweight target detection model, carrying out the underwater moving target detection, and outputting a detection result, the lightweight target detection model is trained through an improved Yov8 model, and the detection result is obtained through the improved Yov8 model. The lightweight target detection model comprises a backbone network, a lightweight cross-scale feature fusion module and a novel dynamic detection head; the execution steps of the lightweight target detection model are as follows: inputting an underwater image into a backbone network to obtain feature maps of different scales; inputting the feature maps of different scales into a lightweight cross-scale feature fusion module for gradual fusion, and generating global and local fusion features; and inputting the fusion feature rich in global and local features into a novel dynamic detection head for detection, and outputting a detection result. Compared with the prior art, the method has the advantages of improving the detection precision and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of underwater moving target detection, and in particular to an underwater moving target detection method and system based on lightweight improved Yolov8. Background Art

[0002] With the continuous development and utilization of marine resources, the demand for exploration and supervision of underwater mobile targets is increasing. Traditional underwater target detection methods still have shortcomings in small target detection accuracy and system lightweight. Therefore, it is of great practical application value to develop an underwater mobile target detection and supervision system that can ensure high accuracy, lightweight and excellent small target detection capabilities.

[0003] Considering the particularity of the underwater environment and the limited computing resources of underwater robots, strict requirements are put forward for underwater target detection technology, such as lightweight, high precision and real-time performance. In this context, the single-stage target detection algorithm is particularly suitable for underwater target detection tasks due to its high efficiency and real-time performance.

[0004] Patent application CN117746226A discloses a lightweight underwater small target detection method based on YOLOv8. This method uses YOLOv8 as a benchmark to build an underwater small target detection network model to meet the lightweight requirements of embedded devices deploying target detectors in real environments, but the local and global features of the image are not fully expressed. Patent application CN118334703A discloses a target detection method, device, equipment and storage medium for underwater fish. This method uses YOLOv8 as a benchmark model and improves the backbone network of YOLOv8 to construct a target detection model. Although the Yolov8 algorithm performs well in lightweight, real-time and overall detection accuracy, when applied to underwater target detection, especially when dealing with small targets, its detection accuracy and lightweight degree still have room for further improvement. Summary of the invention

[0005] The purpose of the present invention is to provide an underwater moving target detection method and system based on a lightweight improved Yolov8, which is lightweight and improves the detection accuracy of small targets.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] A method for underwater moving target detection based on lightweight improved Yolov8, comprising the following steps:

[0008] Acquire underwater images in real time and input them into a pre-trained lightweight target detection model to perform underwater moving target detection and output detection results, wherein the lightweight target detection model is trained using an improved Yolov8 model and includes a backbone network, a lightweight cross-scale feature fusion module and a new dynamic detection head;

[0009] The execution steps of the lightweight target detection model include:

[0010] Inputting the underwater image into a backbone network to obtain feature maps of different scales;

[0011] Inputting the feature maps of different scales into a lightweight cross-scale feature fusion module for gradual fusion to generate fusion features rich in global and local features;

[0012] The fusion features rich in global and local features are input into the novel dynamic detection head for detection, and the detection results are output.

[0013] Furthermore, the backbone network includes a convolutional layer, a C2f layer and an SPPF layer, and the step of obtaining feature maps of different scales includes:

[0014] The underwater image is processed sequentially through two convolutional layers, a C2f layer, a convolutional layer, and a C2f layer to obtain a feature map of a first scale;

[0015] The feature map of the first scale is sequentially passed through a convolutional layer and a C2f layer to obtain a feature map of the second scale;

[0016] The feature map of the second scale is processed in sequence by a convolution layer, a C2f layer and a SPPF layer to obtain a feature map of the third scale.

[0017] Furthermore, the lightweight cross-scale feature fusion module includes a multi-scale feature fusion submodule and a hybrid local channel attention submodule, and the step of generating a fusion feature rich in global and local includes:

[0018] Based on the feature maps of different scales, the multi-scale feature fusion submodule is used to perform cross-scale splicing from bottom to top to generate fusion features rich in semantic information;

[0019] Based on the fusion features rich in semantic information, a hybrid local channel attention submodule is used to integrate channel information and spatial information, and local and global features are combined to output fusion features rich in global and local information.

[0020] Furthermore, the multi-scale feature fusion submodule includes a convolution layer, an upsampling layer and a connection layer, and the step of generating a fusion feature rich in semantic information includes:

[0021] The feature maps of different scales are respectively input into different convolutional layers for convolution processing, and the feature maps of different scales are unified to the same size through the upsampling layer, and then connected through the connection layer to obtain the fusion features rich in semantic information.

[0022] Further, the hybrid local channel attention submodule includes a local average pooling layer, a first branch, a second branch, a summation layer, a de-pooling layer and a product layer, the first branch includes a global average pooling layer, a feature rearrangement layer, a one-dimensional convolution layer and a de-pooling layer, the second branch includes a feature rearrangement layer, a one-dimensional convolution layer, and the step of outputting a fusion feature rich in global and local includes:

[0023] Inputting the fusion features rich in semantic information into the local average pooling layer to aggregate local area features, thereby obtaining fusion features of the local feature set;

[0024] Input the fusion features of the local feature set into the global average pooling layer of the first branch for global average pooling, obtain spatial information, generate a compact feature representation, and input it into the feature rearrangement layer for feature rearrangement, and then sequentially pass through the one-dimensional convolution layer and the anti-pooling layer to perform one-dimensional convolution compression feature channel and anti-pooling operation respectively, to obtain a globally rich fusion feature;

[0025] Inputting the fused features of the local feature set into the feature rearrangement layer of the second branch for feature rearrangement, performing one-dimensional convolution compression on the feature channel through a one-dimensional convolution layer, and then performing feature rearrangement again using the feature rearrangement layer to obtain a fused feature rich in local features;

[0026] The globally rich fusion features and the locally rich fusion features are input into the summation layer for summation operation to fuse the global context information, and then the spatial dimension is restored through the depooling layer. Finally, they are multiplied with the semantically rich fusion features in the product layer to obtain the final globally and locally rich fusion features.

[0027] Furthermore, the novel dynamic detection head includes a scale-aware attention mechanism module, a space-aware attention mechanism module, a task-aware attention mechanism module and a branch structure, and the step of outputting the detection result includes:

[0028] Inputting the fused features rich in strong semantic information into a scale-aware attention mechanism module to dynamically fuse features of different scales according to the importance of semantic information at each scale to obtain scale-aware fused features;

[0029] Inputting the scale-aware fusion features into a spatial-aware attention mechanism module to focus attention on the distinguished regions that are consistent in spatial position and feature level, and using deformable convolution technology to sparse attention learning to obtain spatial-aware fusion features;

[0030] Inputting the spatially-aware fusion features into a task-aware attention mechanism module to select whether to learn the activation threshold, using a switch control mechanism to intelligently open or close the channel, and generating task-aware fusion features;

[0031] The fused features perceived by the task are input into the branch structure for detection, and the detection results are output.

[0032] Furthermore, the branch structure includes three branches, namely a target classification branch, a center point regression branch and a bounding box regression branch.

[0033] Furthermore, during the underwater moving target detection process, a frame skipping detection method is used for detection.

[0034] The present invention also provides an underwater moving target detection system based on a lightweight improved Yolov8, comprising:

[0035] The underwater robot includes an image acquisition unit and a detection unit. The image acquisition unit is used to acquire underwater images. The detection unit is used to detect underwater moving targets using a trained lightweight target detection model according to the underwater images and output detection results.

[0036] UI display unit: used to display the detection results and the acquired underwater images on the UI interface.

[0037] Furthermore, it also includes a monitoring unit, which is used to determine whether a mobile target appears based on the detection results. If so, the detection results containing the mobile target are automatically saved locally and an email is automatically sent to the administrator's mailbox. If not, no operation is performed.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] (1) The present invention makes lightweight improvements based on the standard Yolov8 model, adopts a lightweight cross-scale feature fusion module to gradually fuse multi-scale features, and can combine local features and global features. When applied to underwater target detection, it can well balance the detection effects of targets of different scales and effectively improve the small target detection capability.

[0040] (2) The hybrid local channel attention submodule of the present invention adopts a lightweight attention mechanism, which can improve the detection accuracy and integrate channel information and spatial information while maintaining the basic unchanged parameter amount and computational complexity. It also combines local and global features, effectively enhancing the network's expression ability and thus improving the network's expression effect.

[0041] (3) The novel dynamic detection head of the present invention adopts multiple attention mechanisms, which respectively enhance feature expression from the aspects of scale, space and task perception. Each attention mechanism only focuses on one dimension, making the feature map clearer and more focused.

[0042] (4) Compared with the original Yolov8 model, the lightweight improvement made by the present invention reduces the number of parameters, the amount of calculation and the model size. The computing resources required to run the improved target detection model are reduced, the difficulty of deploying it on an underwater robot is reduced, and the computing power requirements of the underwater robot are significantly reduced.

[0043] (5) After the present invention detects a moving target, in addition to real-time display through the UI interface, the supervisor can also be automatically notified via email. The target can be observed on a variety of devices or platforms, making it convenient for supervisors to complete observation and monitoring tasks in real time, and also convenient for taking corresponding protective measures for the moving target in real time. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0045] Figure 2 This is the improved Yolov8 network structure diagram of the present invention;

[0046] Figure 3 It is a structural diagram of the novel dynamic detection head of the present invention;

[0047] Figure 4 It is a structural diagram of the hybrid local channel attention submodule of the present invention;

[0048] Figure 5 The detection result diagram of the embodiment of the present invention is

[0049] Figure 6 This is a comparison chart of the results of the embodiment of the present invention and other methods. DETAILED DESCRIPTION

[0050] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0051] This embodiment provides a method and system for underwater moving target detection based on lightweight improved Yolov8. Figure 1 As shown, the method comprises the following steps:

[0052] Step 1: Collect the dataset.

[0053] Obtain image data: Collect underwater images through underwater robots / cameras, annotate the targets to be detected using annotation software, and then use scripts to divide the data set into training and test sets.

[0054] Step 2: Train the improved lightweight Yolov8 to obtain a lightweight model.

[0055] In order to make the target detection algorithm suitable for underwater robots, the Yolov8 model is improved to obtain the improved Yolov8. The network structure is shown in Figure 2 The improved Yolov8 model includes a backbone network (Backbone), a lightweight cross-scale feature fusion module (CCFM) and a new dynamic detection head (Dynamic Detection Head). By training the improved Yolov8 model with a training set, a lightweight target detection model is obtained, referred to as a lightweight model.

[0056] The execution steps of the lightweight target detection model include:

[0057] The backbone network includes convolutional layers (Conv), C2f (CSPLayer_2Conv) layers and SPPF (SpatialPyramid Pooling Fast) layers, which extract feature maps of different degrees through different depth levels, specifically:

[0058] The underwater image is processed sequentially through two convolutional layers, a C2f layer, a convolutional layer, and a C2f layer to obtain the first-scale feature map F1;

[0059] F1 passes through a convolutional layer and a C2f layer in sequence to obtain the feature map F2 of the second scale;

[0060] F2 is processed in sequence by a convolutional layer, a C2f layer, and a SPPF layer to obtain a feature map F3 of the third scale.

[0061] Secondly, a lightweight cross-scale feature fusion module is used to cross-scale splice feature maps of different scales and combine local and global features to obtain fused features rich in global and local features. This module mainly includes a multi-scale feature fusion submodule and a mixed local channel attention (MLCA) submodule. The multi-scale feature fusion submodule is added to the neck of the network. By reducing the number of channels to reduce the number of parameters and calculations, a series of convolutional layers designed with lightweight technology are used to extract key information from the input feature map; a lightweight convolution operation is used to integrate the feature map, and a 1x1 convolution kernel is used to achieve horizontal fusion of feature maps of different scales. Therefore, this submodule includes a convolutional layer, an upsampling layer (Upsample) and a connection (Concat) layer. The feature maps of different scales are input into different convolutional layers for convolution processing, and the feature maps of different scales are unified to the same size through the upsampling layer, and then connected through the connection layer to obtain the fusion features rich in semantic information. As Figure 4 As shown in the figure, the hybrid local channel attention submodule includes a local average pooling layer (LAP), a first branch, a second branch, a summation layer, an unpooling layer (UNAP) and a product layer. The submodule adopts a hybrid local channel attention mechanism. The input feature map is first subjected to local average pooling (LAP) to collect local area features, and then the fusion features of the local feature set are obtained and divided into two branches for backward transmission processing; the two branches, wherein the first branch performs global average pooling (GAP) on the feature map, obtains the spatial information of the entire feature map, generates a compact feature representation, and then performs feature rearrangement (Reshape), and then compresses the feature channel through one-dimensional convolution (Conv1d), reduces the number of parameters and the amount of calculation, and finally completes the unpooling operation. The first branch is processed to obtain a fusion feature rich in global information; the second branch is first subjected to feature rearrangement, and then subjected to one-dimensional convolution to compress the feature channel to reduce the amount of parameters and calculations, and then the second branch is processed by feature rearrangement to obtain a fusion feature rich in local information; after the two branches are processed separately, the results after global pooling (obtaining a fusion feature rich in global information) and the results after local pooling (a fusion feature rich in local information) are summed to fuse the global context information; then the spatial dimension is restored to the previous dimension through the unpooling operation; finally, the result of the previous step is multiplied by the original fusion feature rich in semantic information. This process is essentially a feature screening mechanism, which strengthens the emphasis and attention on the key features of underwater targets. The hybrid local channel attention mechanism can improve the detection accuracy, integrate channel information and spatial information, and combine local and global features while maintaining the basic unchanged amount of parameters and calculations, effectively enhancing the network's expression ability, thereby improving the network's expression effect.

[0062] Finally, a new dynamic detection head is used for target detection. This detection head integrates multiple attention mechanisms into a unified framework and is applied to the detection head. Its structure diagram can be found in Figure 3 Therefore, the novel dynamic detection head of this embodiment includes a scale-aware attention mechanism module, a space-aware attention mechanism module, a task-aware attention mechanism module and a branch structure, and each attention mechanism module only focuses on one dimension, making the feature map clearer and more focused. First, the feature map is unified to a unified size (General View), and then each dimension is focused according to each attention mechanism.

[0063] The scale-aware attention module can dynamically fuse features of different scales according to the importance of semantic information at each scale to achieve more refined feature extraction and fusion operations. The feature map shows higher sensitivity to changes in different scales, and scale-aware fusion features are obtained. When applied to underwater target detection, it can take into account the detection effects of targets of different scales at the same time, and improve the detection effect of targets of different scales, especially small targets.

[0064] The spatial-aware attention module focuses on distinguished areas that are consistent in spatial position and feature level, and uses deformable convolution technology to sparse attention learning to obtain spatially perceived fusion features, so that the model can focus more on key areas, integrate feature information from different levels at the same spatial position, make full use of multi-scale features, and improve the detection efficiency of objects of different sizes.

[0065] The Task-Aware Attention module can automatically choose whether to learn the activation threshold according to task requirements, and use the switch control mechanism to generate task-aware fusion features. It can intelligently open or close channels to adapt to different task scenarios, so that the feature map can generate unique activation patterns according to different downstream tasks, thereby realizing targeted feature extraction and expression.

[0066] The branch structure includes three branches, namely, the object classification branch, the center regression branch and the bounding box regression branch, which output the category and two-dimensional coordinate information of the target object and frame the target on the output image.

[0067] Step 3: The camera acquires the head portrait in real time, uses the obtained lightweight model for real-time reasoning, detects the target in the underwater image and displays it on the UI interface.

[0068] The camera captures underwater images in real time, and the lightweight model performs frame skipping detection to obtain the category and two-dimensional coordinate information of the target object, and frames the target on the output image. Figure 5 The input image and the detected target image are displayed together on the UI interface, and the calculated real-time FPS (frames per second) is also displayed. In order to ensure real-time performance and avoid missed detection, the frame skipping detection here selects target detection every 5 frames, which nearly doubles the FPS.

[0069] Based on the targets detected in real time, determine whether a moving target appears. If a moving target appears, automatically save the detected moving target image locally, and automatically send the type and image of the moving target through the email administrator's mailbox.

[0070] In summary, the introduction of the lightweight cross-scale feature fusion module CCFM effectively reduces the amount of parameters and calculations, and slightly improves the reasoning speed. A new dynamic detection head Dynamic Detection Head is used to apply multiple attention mechanisms to the detection head. Ensure that the amount of calculation and the amount of parameters are within an acceptable range, while improving the image clarity and the detection accuracy of multi-scale targets. A lightweight hybrid local channel attention mechanism MLCA is introduced to further improve the small target detection capability. From the results, it can be seen that the real-time performance is also enhanced. The above modules are integrated into Yolov8, which significantly reduces the amount of parameters and calculations, and at the same time reduces the model size, making it easier to deploy the algorithm to underwater robots, and has a certain improvement in the detection effect of small targets and occluders. The improved algorithm improves both lightweight and accuracy. Compared with the original Yolov8, the improved algorithm in this paper is more suitable for underwater robots or underwater scenes.

[0071] In order to verify the effectiveness of the algorithm proposed in this paper, it is compared with Yolov5, Yolov6, Yolov7 and Yolov8. The results of the comparative experiments are shown in Table 1 and Figure 6 shown.

[0072] Table 1 Comparative experimental results

[0073]

[0074] While meeting the real-time detection requirements, the algorithm improves the detection accuracy by 0.8%, reduces the number of parameters by 21.6%, reduces the amount of calculation by 8.6%, and reduces the model size by 19.8% compared to the original model.

[0075] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0076] Example 2

[0077] This embodiment provides an underwater moving target detection system based on a lightweight improved Yolov8, including:

[0078] The underwater robot includes an image acquisition unit and a detection unit. The image acquisition unit is used to acquire underwater images. The detection unit is used to detect underwater moving targets using a trained lightweight target detection model according to the underwater images and output detection results.

[0079] UI display unit: used to display the detection results and the acquired underwater images on the UI interface;

[0080] The monitoring unit is used to determine whether a mobile target appears based on the detection results. If so, the detection results containing the mobile target are automatically saved locally and an email is automatically sent to the administrator's mailbox. If not, no operation is performed.

[0081] The UI interface used here is implemented with the help of a graphical interface framework PyQt5, and the user interface is created and edited with Qt Designer; to display the opencv image on the UI interface, it is necessary to first convert the opencv BGR graphic format to the RGB format required by QImage, and then use the QImage function to convert the opencv type image to the QImage type image, and then convert the QImage type image to the QPixmap type image. Finally, the QPixmap type image is displayed in the QLabel module in PyQt5.

[0082] The above automatic email sending is implemented through a mail server zmail supported by Python. When the detection algorithm detects the first appearance of a moving target, the detected image, the type of moving target, and the underwater robot / camera number are automatically sent to the supervisor through the mail server.

[0083] The rest is the same as in Example 1.

[0084] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0085] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1A step that specifies a function in one or more boxes.

[0088] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0089] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for underwater moving target detection based on lightweight improved Yolov8, characterized in that: The following steps are involved: Acquire underwater images in real time and input them into a pre-trained lightweight target detection model to perform underwater moving target detection and output detection results, wherein the lightweight target detection model is trained using an improved Yolov8 model and includes a backbone network, a lightweight cross-scale feature fusion module and a new dynamic detection head; The execution steps of the lightweight target detection model include: Inputting the underwater image into a backbone network to obtain feature maps of different scales; Inputting the feature maps of different scales into a lightweight cross-scale feature fusion module for gradual fusion to generate fusion features rich in global and local features; The fusion features rich in global and local features are input into the novel dynamic detection head for detection, and the detection results are output.

2. According to claim 1, a method for underwater moving target detection based on lightweight improved Yolov8 is characterized in that: The backbone network includes a convolutional layer, a C2f layer and an SPPF layer, and the step of obtaining feature maps of different scales includes: The underwater image is processed sequentially through two convolutional layers, a C2f layer, a convolutional layer, and a C2f layer to obtain a feature map of a first scale; The feature map of the first scale is sequentially passed through a convolutional layer and a C2f layer to obtain a feature map of the second scale; The feature map of the second scale is processed in sequence by a convolution layer, a C2f layer and a SPPF layer to obtain a feature map of the third scale.

3. According to claim 1, a method for underwater moving target detection based on lightweight improved Yolov8 is characterized in that: The lightweight cross-scale feature fusion module includes a multi-scale feature fusion submodule and a mixed local channel attention submodule, and the step of generating a fusion feature rich in global and local includes: Based on the feature maps of different scales, the multi-scale feature fusion submodule is used to perform cross-scale splicing from bottom to top to generate fusion features rich in semantic information; Based on the fusion features rich in semantic information, a hybrid local channel attention submodule is used to integrate channel information and spatial information, and local and global features are combined to output fusion features rich in global and local information.

4. According to claim 3, a method for underwater moving target detection based on lightweight improved Yolov8 is characterized in that: The multi-scale feature fusion submodule includes a convolution layer, an upsampling layer and a connection layer, and the step of generating a fusion feature rich in semantic information includes: The feature maps of different scales are respectively input into different convolutional layers for convolution processing, and the feature maps of different scales are unified to the same size through the upsampling layer, and then connected through the connection layer to obtain the fusion features rich in semantic information.

5. According to claim 3, a method and system for underwater moving target detection based on lightweight improved Yolov8 is characterized in that: The hybrid local channel attention submodule includes a local average pooling layer, a first branch, a second branch, a summation layer, a de-pooling layer and a product layer, the first branch includes a global average pooling layer, a feature rearrangement layer, a one-dimensional convolution layer and a de-pooling layer, the second branch includes a feature rearrangement layer and a one-dimensional convolution layer, and the step of outputting a fusion feature rich in global and local includes: Inputting the fusion features rich in semantic information into the local average pooling layer to aggregate local area features, thereby obtaining fusion features of the local feature set; Input the fusion features of the local feature set into the global average pooling layer of the first branch for global average pooling, obtain spatial information, generate a compact feature representation, and input it into the feature rearrangement layer for feature rearrangement, and then sequentially pass through the one-dimensional convolution layer and the anti-pooling layer to perform one-dimensional convolution compression feature channel and anti-pooling operation respectively, to obtain a globally rich fusion feature; Inputting the fused features of the local feature set into the feature rearrangement layer of the second branch for feature rearrangement, performing one-dimensional convolution compression on the feature channel through a one-dimensional convolution layer, and then performing feature rearrangement again using the feature rearrangement layer to obtain a fused feature rich in local features; The globally rich fusion features and the locally rich fusion features are input into the summation layer for summation operation to fuse the global context information, and then the spatial dimension is restored through the depooling layer. Finally, they are multiplied with the semantically rich fusion features in the product layer to obtain the final globally and locally rich fusion features.

6. According to claim 1, a method for underwater moving target detection based on lightweight improved Yolov8 is characterized in that: The novel dynamic detection head includes a scale-aware attention mechanism module, a space-aware attention mechanism module, a task-aware attention mechanism module and a branch structure, and the step of outputting the detection result includes: Inputting the fused features rich in strong semantic information into a scale-aware attention mechanism module to dynamically fuse features of different scales according to the importance of semantic information at each scale to obtain scale-aware fused features; Inputting the scale-aware fusion features into a spatial-aware attention mechanism module to focus attention on the distinguished regions that are consistent in spatial position and feature level, and using deformable convolution technology to sparse attention learning to obtain spatial-aware fusion features; Inputting the spatially-aware fusion features into a task-aware attention mechanism module to select whether to learn the activation threshold, using a switch control mechanism to intelligently open or close the channel, and generating task-aware fusion features; The fused features perceived by the task are input into the branch structure for detection, and the detection results are output.

7. The underwater moving target detection method based on lightweight improved Yolov8 according to claim 6 is characterized in that: The branch structure includes three branches, namely, a target classification branch, a center point regression branch and a bounding box regression branch.

8. The underwater moving target detection method based on lightweight improved Yolov8 according to claim 1 is characterized in that: In the process of underwater moving target detection, frame skipping detection is used.

9. An underwater moving target detection system based on lightweight improved Yolov8, characterized in that: include: The underwater robot includes an image acquisition unit and a detection unit. The image acquisition unit is used to acquire underwater images. The detection unit is used to detect underwater moving targets using a trained lightweight target detection model according to the underwater images and output detection results. UI display unit: used to display the detection results and the acquired underwater images on the UI interface.

10. The underwater moving target detection system based on the lightweight improved Yolov8 according to claim 9 is characterized in that: It also includes a monitoring unit, which is used to determine whether a mobile target appears based on the detection results. If so, the detection results containing the mobile target are automatically saved locally and an email is automatically sent to the administrator's mailbox. If not, no operation is performed.

Citation Information

Patent Citations

  • Automatic driving small target detection model based on YOLOv8

    CN117437407A

  • Commercial vehicle long-distance target detection perception network model based on improved YOLOv8 and detection method

    CN118155171A

  • Lightweight open set remote sensing target detection method based on LMSFA-YOLO

    CN118262090A

Cited By

  • Anti-unmanned aerial vehicle system and method based on air-to-air visual recognition

    CN119225426A

  • Infrared image defect identification method and system based on improved YOLOv11n

    CN119693654A

  • Substation weed detection method, device and equipment

    CN119723042A

  • Lightweight night target detection method and system based on deep learning

    CN119723045A

  • Underwater target detection method, system, equipment and medium

    CN120808131A