Complex scene multi-scale ship detection method and system
Through the improved YOLOv8 network model, combining deep semantic information and shallow spatial position information, multi-scale feature fusion and structural re-parameterization technology are used to solve the problems of low resolution, noise interference and sample imbalance in small object detection, and the detection accuracy and robustness are significantly improved.
Patent Information
- Application Number
- CN202411898340.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-15
AI Technical Summary
In the detection of small objects, the prior art has insufficient detection accuracy and robustness due to problems such as low resolution, noise interference and sample imbalance, especially in complex backgrounds, it is difficult to effectively detect dense small objects.
A multi-scale ship detection method for complex scenarios is proposed. Through the improved YOLOv8 network model, combined with the deep semantic information of small targets and shallow spatial position information, multi-scale feature fusion and structural re-parameterization technology are used to improve the computing efficiency and inference speed of the model.
It significantly improves the accuracy and robustness of small-object detection, solves the problem of sample imbalance, is suitable for marine ship detection in complex environments, and reduces the number of parameters and calculation amount of the model.
Smart Images

Figure CN119832377A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship detection, and in particular to a method and system for multi-scale ship detection in complex scenes. Background Art
[0002] Synthetic aperture radar (SAR) has the characteristics of all-day, all-weather and high resolution, and has been widely used in civil and military fields. Compared with common passive imaging sensors such as infrared and optical sensors, SAR can penetrate complex weather environments such as clouds and dense fog, and obtain observation images under meteorological conditions with extremely poor visibility. The imaging process is more stable and less affected by background factors. In addition, SAR has high resolution and wide field of view, which enables it to detect smaller ships and effectively monitor ship detection in larger areas. Moreover, SAR can work in any weather and lighting conditions, unaffected by the environment, so that real-time ship positions can be quickly obtained. These advantages make SAR an important technical support for maritime safety monitoring and maritime transportation management. The emergence of deep learning in recent years has greatly promoted the development of SAR ship detection. It is widely used in marine, military, agricultural, environmental and other fields. SAR ship detection is an important tool for marine monitoring such as illegal fishing, oil spill detection, and maritime traffic management.
[0003] One of the challenges of SAR image detection is small target detection. Due to the low resolution, small targets cover fewer pixels in the image, making it difficult to extract resolvable features. At the same time, due to the low resolution, small targets may be disturbed by the surrounding noise and background in the image, further increasing the difficulty of detection; due to the small size of small targets, the positioning accuracy of the detection model is very high. In practical applications, even a small error may cause the detection frame to deviate from the target, thus affecting the detection effect. During the training process, there is often a serious imbalance in the number of large and small targets, which will cause the model to be biased towards the detection of large targets, while the detection effect of small targets is poor. In addition, small targets often need to be combined with surrounding contextual information to be accurately detected. However, existing target detection models often only focus on a single target itself, while ignoring its connection with the surrounding environment.
[0004] In recent years, deep learning-based target detection methods have made significant progress in detection efficiency and accuracy. Therefore, researchers have introduced deep learning-based methods into the study of SAR ship detection. At present, deep learning-based SAR ship detection methods can be roughly divided into anchor-based methods and anchor-free methods. However, anchor-based methods rely on fixed, manually designed anchors, which leads to a significant decrease in detection accuracy when the scale of ship targets varies greatly. In order to adapt to the wide scale changes of ships in SAR images, anchor-free methods are introduced to detect ships. Anchor-free methods overcome the challenges of ship detection at different scales and improve detection accuracy. However, their high computational complexity makes effective ship detection difficult. SAR ship detection methods based on deep learning significantly improve detection performance. Therefore, research on SAR ship detection methods based on deep learning has important practical significance and application value. Summary of the invention
[0005] In order to solve the problems existing in the current small target detection process, such as the small target covers fewer pixels in the image due to low resolution, it is difficult to extract discriminative features, and the detection frame deviates from the target due to the interference of surrounding noise and background, thereby affecting the detection effect and sample imbalance, the present invention provides a complex scene multi-scale ship detection method, which can more effectively combine the deep semantic information and shallow spatial position information of the small target, thereby significantly improving the detection performance of the small target, so that the model can maintain higher accuracy and robustness when facing dense small targets in complex backgrounds; and can realize structural re-parameterization, reduce the number of parameters and calculation amount of the model, improve the calculation efficiency and reasoning speed of the model, and is suitable for marine ship detection in complex environments. The present invention also relates to a complex scene multi-scale ship detection system.
[0006] The technical solution of the present invention is as follows:
[0007] A multi-scale ship detection method for complex scenes, characterized by comprising the following steps:
[0008] Image acquisition and size adjustment step: obtaining a ship SAR image dataset to be predicted, dividing the SAR image dataset into a training set and a test set according to a preset ratio, and adjusting the pixel sizes of all SAR images in the training set and the test set to a preset size;
[0009] Model construction step: construct an improved YOLOv8 network model, the improved YOLOv8 network model is a convolutional neural network structure improved on the basis of YOLOv8, including an improved Neck network, the improved Neck network includes a first feature fusion structure, a second feature fusion structure, a third feature fusion structure, a fourth feature fusion structure, a fifth feature fusion structure and a sixth feature fusion structure connected in series in sequence, the first feature fusion structure, the second feature fusion structure and the third feature fusion structure all include upsampling layers, splicing layers and C2f structures connected in sequence, the C2f structure of the first feature fusion structure is connected to the upsampling layer of the second feature fusion structure, and the C2f structure of the second feature fusion structure is connected to the upsampling layer of the third feature fusion structure; the fourth feature fusion structure, the fifth feature fusion structure and the sixth feature fusion structure are respectively based on different downsampling multiples and all include Conv convolution layers, splicing layers and RGBlock structures connected in sequence, the RGBl of the fourth feature fusion structure The ock structure is connected to the Conv convolution layer of the fifth feature fusion structure, the RGBlock structure of the fifth feature fusion structure is connected to the Conv convolution layer of the sixth feature fusion structure, and the C2f structure of the third feature fusion structure is connected to the Conv convolution layer of the fourth feature fusion structure to downsample the feature map output by the C2f structure of the third feature fusion structure through the Conv convolution layer of the fourth feature fusion structure; the splicing layer of each feature fusion structure is used to splice feature maps of several different scales, and the C2f structure of the third feature fusion structure and each RGBlock structure of the fourth, fifth and sixth feature fusion structures are output to the Prediction network of the improved YOLOv8 network model; the RGBlock structure includes a plurality of RGConv modules connected in series in sequence, and the RGConv module includes a plurality of parallel convolution layer branches, and the convolution layer branches include a first Ghost convolution layer slave branch, a second Ghost convolution layer main branch and a Conv convolution layer slave branch;
[0010] Image detection step: inputting a training set adjusted to a preset size into an improved YOLOv8 network model, and training using a positive and negative sample matching strategy and a composite loss function to obtain a trained improved YOLOv8 network model, and testing and analyzing the test set adjusted to a preset size to obtain a final trained and tested improved YOLOv8 network model, using the trained and tested improved YOLOv8 network model to detect a SAR image to be detected, obtaining a SAR image target detection result, and optimizing the SAR image target detection result using a non-maximum suppression algorithm to obtain an optimal SAR image target detection result.
[0011] Preferably, in the image detection step, during the training process using the positive and negative sample matching strategy and the composite loss function, each convolutional layer branch of the RGConv module independently learns and extracts features, and optimizes the feature parameters of the convolutional layer in each branch through the back propagation algorithm to learn different abstract representations or features of the input feature map;
[0012] When the trained and tested improved YOLOv8 network model is used to detect the SAR image to be detected, the RGConv module adopts a re-parameterization strategy to merge the feature parameters of each slave branch into the main branch, and then only performs the convolution operation on the main branch to reduce the amount of calculation and memory consumption.
[0013] Preferably, in the model building step, the improved YOLOv8 network model also includes a Backbone network and a Prediction network, the Prediction network includes multiple Head detection heads, the C2f structure of the third feature fusion structure is output to the first Head detection head of the Prediction network, the RGBlock structure of the fourth feature fusion structure is output to the second Head detection head of the Prediction network, the RGBlock structure of the fifth feature fusion structure is output to the third Head detection head of the Prediction network, and the RGBlock structure of the sixth feature fusion structure is output to the Prediction network. The fourth Head detection head of the on network; each Head detection head includes a classification branch and a regression branch, the Backbone network performs feature extraction on the input image and generates feature maps of different levels; the improved Neck network performs multi-scale feature fusion on the image features in the feature map generated by the Backbone network, and outputs a feature map with complete feature information, the classification branch performs classification and recognition on the feature map with complete feature information to predict the category of the object in each detection frame on the feature map, and generates a corresponding classification score; the regression branch performs regression and recognition on the feature map with complete feature information to predict the position of each detection frame on the feature map, and generates a corresponding regression score.
[0014] Preferably, in the image detection step, the positive and negative sample matching strategy selects positive samples based on the classification score, the intersection-over-union ratio between the predicted box and the true target box, and a preset weight hyperparameter; the composite loss function includes a classification loss function and a regression loss function, and the classification loss function and the regression loss function are calculated based on the positive sample respectively.
[0015] Preferably, in the image detection step, a pre-divided validation set is used to perform hyperparameter adjustment and model selection during the YOLO8 network model training process to obtain a trained and adjusted YOLOv8 network model, and the divided test set is used to evaluate the performance of the trained and adjusted YOLOv8 network model.
[0016] A complex scene multi-scale ship detection system, characterized by comprising an image acquisition and size adjustment module, a model building module and an image detection module connected in sequence,
[0017] The image acquisition and size adjustment module acquires a ship SAR image dataset to be predicted, divides the SAR image dataset into a training set and a test set according to a preset ratio, and adjusts the pixel sizes of all SAR images in the training set and the test set to a preset size;
[0018] The model construction module constructs an improved YOLOv8 network model, which is a convolutional neural network structure improved on the basis of YOLOv8, including an improved Neck network, and the improved Neck network includes a first feature fusion structure, a second feature fusion structure, a third feature fusion structure, a fourth feature fusion structure, a fifth feature fusion structure and a sixth feature fusion structure connected in series in sequence, the first feature fusion structure, the second feature fusion structure and the third feature fusion structure all include an upsampling layer, a splicing layer and a C2f structure connected in sequence, the C2f structure of the first feature fusion structure is connected to the upsampling layer of the second feature fusion structure, and the C2f structure of the second feature fusion structure is connected to the upsampling layer of the third feature fusion structure; the fourth feature fusion structure, the fifth feature fusion structure and the sixth feature fusion structure are respectively based on different downsampling multiples and all include a Conv convolution layer, a splicing layer and an RGBlock structure connected in sequence, and the RGB of the fourth feature fusion structure The lock structure is connected to the Conv convolution layer of the fifth feature fusion structure, the RGBlock structure of the fifth feature fusion structure is connected to the Conv convolution layer of the sixth feature fusion structure, and the C2f structure of the third feature fusion structure is connected to the Conv convolution layer of the fourth feature fusion structure to downsample the feature map output by the C2f structure of the third feature fusion structure through the Conv convolution layer of the fourth feature fusion structure; the splicing layer of each feature fusion structure is used to splice feature maps of several different scales, the C2f structure of the third feature fusion structure and each RGBlock structure of the fourth, fifth and sixth feature fusion structures are output to the Prediction network of the improved YOLOv8 network model, the RGBlock structure includes a plurality of RGConv modules connected in series in sequence, the RGConv module includes a plurality of parallel convolution layer branches, and the convolution layer branches include a first Ghost convolution layer slave branch, a second Ghost convolution layer main branch and a Conv convolution layer slave branch;
[0019] The image detection module inputs a training set adjusted to a preset size into an improved YOLOv8 network model, and uses a positive and negative sample matching strategy and a composite loss function for training to obtain a trained improved YOLOv8 network model, and performs test analysis on a test set adjusted to a preset size to obtain a finally trained and tested improved YOLOv8 network model, uses the trained and tested improved YOLOv8 network model to detect a SAR image to be detected to obtain a SAR image target detection result, and uses a non-maximum suppression algorithm to optimize the SAR image target detection result to obtain an optimal SAR image target detection result.
[0020] Preferably, in the image detection module, during the training process using the positive and negative sample matching strategy and the composite loss function, each convolutional layer branch of the RGConv module independently learns and extracts features, and optimizes the feature parameters of the convolutional layer in each branch through the back propagation algorithm to learn different abstract representations or features of the input feature map;
[0021] When the trained and tested improved YOLOv8 network model is used to detect the SAR image to be detected, the RGConv module adopts a re-parameterization strategy to merge the feature parameters of each slave branch into the main branch, and then only performs the convolution operation on the main branch to reduce the amount of calculation and memory consumption.
[0022] Preferably, in the model building module, the improved YOLOv8 network model also includes a Backbone network and a Prediction network, the Prediction network includes multiple Head detection heads, the C2f structure of the third feature fusion structure is output to the first Head detection head of the Prediction network, the RGBlock structure of the fourth feature fusion structure is output to the second Head detection head of the Prediction network, the RGBlock structure of the fifth feature fusion structure is output to the third Head detection head of the Prediction network, and the RGBlock structure of the sixth feature fusion structure is output to the Prediction network. The fourth Head detection head of the on network; each Head detection head includes a classification branch and a regression branch, the Backbone network performs feature extraction on the input image and generates feature maps of different levels; the improved Neck network performs multi-scale feature fusion on the image features in the feature map generated by the Backbone network, and outputs a feature map with complete feature information, the classification branch performs classification and recognition on the feature map with complete feature information to predict the category of the object in each detection frame on the feature map, and generates a corresponding classification score; the regression branch performs regression and recognition on the feature map with complete feature information to predict the position of each detection frame on the feature map, and generates a corresponding regression score.
[0023] Preferably, in the image detection module, the positive and negative sample matching strategy selects positive samples based on the classification score, the intersection-over-union ratio between the predicted box and the true target box, and a preset weight hyperparameter; the composite loss function includes a classification loss function and a regression loss function, and the classification loss function and the regression loss function are calculated based on the positive sample respectively.
[0024] Preferably, in the image detection module, a pre-divided validation set is used to perform hyperparameter adjustment and model selection during the YOLO8 network model training process to obtain a trained and adjusted YOLOv8 network model, and a pre-divided test set is used to evaluate the performance of the trained and adjusted YOLOv8 network model.
[0025] The beneficial effects of the present invention are:
[0026] The present invention provides a complex scene multi-scale ship detection method, firstly obtains a SAR image data set to be predicted, and divides the SAR image data set into a training set and a test set according to a preset ratio, and adjusts the pixel size of all traffic images in the training set and the test set to a preset size, so that the test is more fair. And construct an improved YOLOv8 network model, the improved YOLOv8 network model includes an improved Neck network, the improved Neck network includes a first feature fusion structure, a second feature fusion structure, a third feature fusion structure, a fourth feature fusion structure, a fifth feature fusion structure and a sixth feature fusion structure connected in series in sequence, the first feature fusion structure, the second feature fusion structure and the third feature fusion structure all include sequentially connected upsampling layers, splicing layers and C2f structures, the fourth feature fusion structure, the fifth feature fusion structure and the sixth feature fusion structure are respectively based on different downsampling multiples and all include sequentially connected Conv convolution layers, splicing layers and RGBlock structures; the splicing layers of each feature fusion structure are used to splice feature maps of several different scales, the C2f structure of the third feature fusion structure and each RGBloc structure of the fourth, fifth and sixth feature fusion structures The k structures are all output to the Prediction network of the improved YOLOv8 network model. The interconnection of several feature fusion structures with different downsampling multiples, the splicing of several feature maps of different scales and at least four specific outputs for different scales can be used to predict targets of four scales, namely, tiny, small, medium and large. It can more effectively combine the deep semantic information and shallow spatial position information of small targets, thereby significantly improving the detection performance of small targets, so that the model can significantly improve the accuracy and robustness of target detection when facing dense small targets in complex backgrounds, and effectively solve the problem of sample imbalance; in addition, this multi-scale feature fusion method enables the model to better adapt to ship images of different sizes and resolutions, improve generalization ability, and effectively solve the problem that the low image resolution makes it difficult to extract discriminative features because the small targets cover fewer pixels in the image. The RGBlock structure includes multiple RGConv modules connected in series, and the RGConv module includes multiple parallel convolutional layer branches. The convolutional layer branches include the first Ghost convolutional layer slave branch, the second Ghost convolutional layer main branch, and the Conv convolutional layer slave branch; each branch can independently process different parts or channels of the input feature map, and in the training phase, these branches can learn different feature representations and optimize their respective parameters through the back propagation algorithm. During inference, the parameters of the slave branches (the first Ghost convolutional layer and the Conv convolutional layer) are reparameterized to the main branch (the second Ghost convolutional layer), thereby reducing the amount of computation and memory consumption, and obtaining rich key detail information while reducing the complexity of the model.Finally, the training set adjusted to a preset size is input into the improved YOLOv8 network model, and the positive and negative sample matching strategy and the composite loss function are used for training to obtain a trained improved YOLOv8 network model. The positive and negative sample matching strategy can focus on high-quality positive samples, and the composite loss function can enable the model to perform better and converge faster. Then, the test set adjusted to the preset size is tested and analyzed to obtain the final trained and tested improved YOLOv8 network model. The trained and tested improved YOLOv8 network model is used to detect the traffic image to be detected to obtain the traffic image target detection result, and the non-maximum suppression algorithm is used to optimize the traffic image target detection result to screen out the most likely bounding box, thereby reducing redundant detection results, improving the detection accuracy, and finally obtaining the optimal traffic image target detection result.
[0027] The present invention takes into account that in complex sea areas, SAR images are deployed on edge platforms, the computing resources and storage space of the processor are limited, and coherent noise will reduce the contrast and resolvability of SAR images. Therefore, multiple lightweight RGBlock modules connected in series are designed in the improved Neck network, which can realize structural re-parameterization, reduce the number of parameters and calculation amount of the model, improve the computing efficiency and reasoning speed of the model, and effectively solve the problem that small targets in complex backgrounds may be interfered by the surrounding noise and background in the image, further increasing the detection difficulty.
[0028] The present invention also relates to a complex scene multi-scale ship detection system, which corresponds to the above-mentioned complex scene multi-scale ship detection method, and can be understood as a system for realizing the above-mentioned complex scene multi-scale ship detection method, comprising an image acquisition and size adjustment module, a model construction module and an image detection module connected in sequence, wherein the modules work in coordination with each other, and based on a ship SAR image data set, the ship SAR image is detected by an improved YOLOv8 network model constructed by an improved Neck network on the basis of YOLOv8, so as to obtain a SAR image target detection result, which can more effectively combine the deep semantic information and shallow spatial position information of small targets, thereby significantly improving the detection performance of small targets, so that the model can maintain higher accuracy and robustness when facing dense small targets in complex backgrounds; and can realize structural re-parameterization, reduce the number of parameters and the amount of calculation of the model, improve the calculation efficiency and reasoning speed of the model, and is suitable for marine ship detection in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a flow chart of the complex scene multi-scale ship detection method of the present invention.
[0030] Figure 2It is a structural block diagram of the improved YOLOv8 network model of the present invention.
[0031] Figure 3 It is a structural block diagram of the RGBlock module of the present invention. DETAILED DESCRIPTION
[0032] The present invention will be described below in conjunction with the accompanying drawings.
[0033] The present invention relates to a method for detecting multi-scale ships in complex scenes. The flowchart of the method is as follows: Figure 1 As shown, the following steps are included in sequence:
[0034] 1. Image acquisition and size adjustment steps: obtain the ship SAR image dataset to be predicted, and divide the SAR image dataset into a training set and a test set according to a preset ratio, and adjust the pixel size of all traffic images in the training set and the test set to a preset size.
[0035] Specifically, firstly, the SAR images to be detected in the shipping monitoring and camera videos are collected regularly to obtain the SSDD (SARShip Detection Dataset) data set, wherein the SSDD data set includes the SAR images, categories, and sizes of ships in various scenes such as offshore, ports, and islands. Then the SSDD data set is preprocessed. Before the experiment begins, it is necessary to prepare the folders for storing the names, image files, label files, and xml files of the target detection categories. Therefore, a new folder structure is created to ensure that all files are organized according to the correct directory structure, and appropriate tools or scripts are used to convert the data into txt format files, so that the xml files do not need to be converted into txt files for subsequent processing. Then all SAR images in the SSDD data set are divided into training set, verification set, and test set according to the ratio of 7:2:1. The above ratio is only an exemplary description, not a unique limitation, and can also be divided into training set, verification set, and test set according to other ratios. The SSDD dataset has targets with rich scale variations and targets in complex backgrounds, which can represent most application scenarios in ship scene detection tasks. The pixel sizes of all SAR images in the training set and test set are uniformly adjusted to 640×640×3 to make the test more fair.
[0036] 2. Model construction step: construct an improved YOLOv8 network model, which is a convolutional neural network structure improved on the basis of YOLOv8, including an improved Neck network, which includes a first feature fusion structure, a second feature fusion structure, a third feature fusion structure, a fourth feature fusion structure, a fifth feature fusion structure and a sixth feature fusion structure connected in series in sequence, wherein the first feature fusion structure, the second feature fusion structure and the third feature fusion structure all include an upsampling layer, a splicing layer and a C2f structure connected in sequence, the C2f structure of the first feature fusion structure is connected to the upsampling layer of the second feature fusion structure, and the C2f structure of the second feature fusion structure is connected to the upsampling layer of the third feature fusion structure; the fourth feature fusion structure, the fifth feature fusion structure and the sixth feature fusion structure are respectively based on different downsampling multiples and all include a sequentially connected upsampling layer, a splicing layer and a C2f structure. The Conv convolution layer, splicing layer and RGBlock structure of the fourth feature fusion structure are connected, the RGBlock structure of the fourth feature fusion structure is connected to the Conv convolution layer of the fifth feature fusion structure, the RGBlock structure of the fifth feature fusion structure is connected to the Conv convolution layer of the sixth feature fusion structure, the C2f structure of the third feature fusion structure is connected to the Conv convolution layer of the fourth feature fusion structure to downsample the feature map output by the C2f structure of the third feature fusion structure through the Conv convolution layer of the fourth feature fusion structure; the splicing layer of each feature fusion structure is used to splice feature maps of several different scales; the RGBlock structure includes a plurality of RGConv modules connected in series in sequence, the RGConv module includes a plurality of parallel convolution layer branches, and the convolution layer branches include a first Ghost convolution layer slave branch, a second Ghost convolution layer main branch and a Conv convolution layer slave branch.
[0037] Specifically, the classic YOLOv8 model includes three main components, namely the backbone network layer (Backbone layer, or Backbone network), the feature fusion layer (Neck layer, or Neck network), and the prediction layer (Prediction layer, or Prediction network, also known as the output layer). Among them, the Backbone layer / network is a convolutional neural network that aggregates and forms image features at different image granularities. The Neck layer / network is a series of network layers that mix and combine image features, which can be used to pass image features to the prediction layer. The Prediction layer / network is used to predict image features, generate bounding boxes and prediction categories. The present invention constructs an improved YOLOv8 network model, such as Figure 2As shown in the figure, the improved YOLOv8 network model includes a Backbone network, an improved Neck network and a Prediction network. The Backbone network is used to extract features from the input SAR image and generate feature maps of different levels. For example, when the size of the input image is 640×640×3, a conv convolution layer with a convolution kernel size of 3×3 and a step size of 1 is first used to downsample the channel space and detect simple features in the input image, such as edges and textures, to concentrate information and reduce the amount of calculation. Next, a conv convolution layer with a convolution kernel size of 3×3 and a step size of 2 is used for further feature extraction and downsampling to generate a new feature map, that is, a higher level of feature extraction is performed on the basis of the output of the first layer of convolution, such as shape, partial objects, complex textures, etc. A step size of 2 will cause each convolution kernel to skip one pixel on the input feature map, so that the spatial resolution of the output feature map is halved, but the depth (number of channels) is increased, which enhances the abstraction and expression capabilities of the features.
[0038] In the Backbone network, the new feature map of 320×320×3 then enters a C2f module. This module first performs a 1×1 convolution to reduce the number of channels of the new feature map by half, thereby reducing the amount of calculation, and then performs feature extraction through a 3×3 convolution, and doubles the number of channels, so the number of channels of the final output does not change, and outputs a 320×320×3 feature map. In addition, the C2f module also fuses feature maps of different scales to improve detection performance. After several repetitions of the Conv and C2f modules, it enters the SPPF module. The SPPF module first uses a standard convolution module to halve the input feature map channels, and then uses three 5×5 maximum pooling (MaxPooling) to perform a pooling operation on the feature map, and splices or fuses the results of the three maximum pooling (MaxPooling), and finally outputs a feature map that integrates multi-scale information. The SPPF module aims to fuse feature maps of different resolutions, and then extract richer target information for subsequent network layers to process. The addition of SPPF effectively solves the problem of reduced training speed and reasoning efficiency due to different input image sizes. In addition, during the maximum pooling process, the network can adaptively adjust the convolution kernel parameters to adapt to various feature maps, which not only enhances the flexibility of the backbone network to the input size, but also helps to more accurately separate the image background and target, and extract more discriminative contextual features.
[0039] The improved Neck network performs multi-scale feature fusion on the image features in the feature map generated by the Backbone network, and outputs a feature map with complete feature information, such as Figure 2As shown, it includes a first feature fusion structure, a second feature fusion structure, a third feature fusion structure, a fourth feature fusion structure, a fifth feature fusion structure and a sixth feature fusion structure connected in series in sequence, the first feature fusion structure, the second feature fusion structure and the third feature fusion structure all include an upsample layer upsample, a concatenation layer Concat and a C2f structure connected in sequence, the C2f structure of the first feature fusion structure is connected to the upsample layer upsample of the second feature fusion structure, and the C2f structure of the second feature fusion structure is connected to the upsample layer upsample of the third feature fusion structure. The upsample layer upsample of the first feature fusion structure first performs an interpolation operation or a padding operation on the feature map output from the Backbone network to expand its size; then a transposed convolution (deconvolution) operation is used to perform a convolution operation on the enlarged feature map, thereby obtaining an upsampled feature map. The concatenation layer Concat is used to concatenate multiple feature maps of different sizes or sources. It is usually used between different layers in a neural network. The feature maps to be concatenated are connected in the direction of the channel to generate a larger feature map. Information from different layers can be integrated to improve the network's expressiveness. The concatenation layer Concat can be used to transfer shallow feature information in the Backbone network to deep feature maps to enhance feature richness. The C2f structure of the first feature fusion structure is connected to the upsample layer of the second feature fusion structure, and is also connected to the concatenation layer Concat of the fifth feature fusion structure; the C2f structure of the second feature fusion structure is connected to the upsample layer of the third feature fusion structure, and is also connected to the concatenation layer Concat of the fourth feature fusion structure; the C2f structure of the third feature fusion structure is connected to the Conv convolution layer of the fourth feature fusion structure, and is also directly output to the Prediction layer. In other words, the C2f structure can divide the output features of the backbone network into two parts. One part of the features is passed directly to the next layer without being processed, and the other part is subjected to a series of convolution operations to obtain a new feature representation. The new feature representation is then concatenated with the features of the unprocessed part and passed to the next layer of the network. This can make the network deeper and better capture the correlation between features, thereby improving the performance and generalization ability of the network.
[0040] The fourth feature fusion structure, the fifth feature fusion structure and the sixth feature fusion structure all include sequentially connected Conv convolution layers, concatenation layers Concat and RGBlock structures. The RGBlock structure of the fourth feature fusion structure is connected to the Conv convolution layer of the fifth feature fusion structure. The RGBlock structure of the fifth feature fusion structure is connected to the Conv convolution layer of the sixth feature fusion structure. The C2f structure of the third feature fusion structure is connected to the Conv convolution layer of the fourth feature fusion structure. The RGBlock structures of the fourth, fifth and sixth feature fusion structures are all output to the Prediction layer. The Conv convolution layer downsamples the feature map finally output by the C2f structure to reduce the spatial size of the feature map and increase the depth (number of channels) of the feature map. Then the concatenation layer Concat is used to concatenate multiple feature maps of different sizes or sources, and the feature maps to be concatenated are connected in the direction of the channels to generate a larger feature map.
[0041] Considering that SAR images are deployed on edge platforms in complex sea areas, the computing resources and storage space of the processor are limited. In addition, coherent noise will reduce the contrast and resolution of SAR images. Therefore, a lightweight RGBlock module is designed in the neck network to reduce the amount of calculation and model complexity while obtaining rich key detail information. Figure 3 As shown in (b), the RGBlock structure includes multiple RGConv modules connected in series, which can achieve structural reparameterization, reduce the number of model parameters and the amount of calculation, and improve the model's calculation efficiency and reasoning speed. In addition, the traditional convolution structure is fixed and cannot adapt to the deformation of the shape and angle of the ship in the SAR image under complex scenes. For this reason, the Ghost convolution layer is introduced to replace the traditional convolution kernel to construct the RGConv module, as shown in Figure 3As shown in (a), the RGConv module includes multiple parallel convolutional layer branches, including the first Ghost convolutional layer slave branch (1×1 convolution), the second Ghost convolutional layer main branch (3×3 convolution) and the Conv convolutional layer slave branch; the input feature map is first generated by 1×1 convolution to generate a feature map with a smaller number of channels to reduce the amount of calculation, and then the 3×3 convolution is further used to reduce the amount of calculation on the basis of the generated feature map to generate a new feature map, and finally the ReLU activation function is applied to each numerical element (width W, height H and number of channels C) in the new feature map to ensure that nonlinearity is introduced into the network. It should be noted that each branch can independently process different parts (different spatial positions or regions of the input feature map) or channels; in the training stage, these branches can learn different feature representations and optimize the parameters of their respective convolutional layers through the back-propagation algorithm. Each branch can learn different abstract representations or features of the input feature map, thereby enhancing the expression and generalization capabilities of the model. When testing the SAR image to be detected, in order to reduce the amount of calculation and memory consumption, the RGConv module uses a re-parameterization strategy to merge the parameters of multiple slave branches into the main branch, thereby obtaining a more compact network structure, effectively reducing the amount of calculation and memory consumption, and improving the efficiency of neural networks in resource-constrained environments. By carefully designing and adjusting the re-parameterization strategy, it is possible to ensure that the RGConv module maintains efficient computing performance and memory utilization during inference, which is very beneficial for deploying neural network models on resource-constrained devices, especially in scenarios that require real-time processing or low-power applications.
[0042] The C2f structure of the third feature fusion structure is output to a Head detection head of the Prediction layer, the RGBlock structure of the fourth feature fusion structure is output to another Head detection head of the Prediction layer, the RGBlock structure of the fifth feature fusion structure is output to the third Head detection head of the Prediction layer, and the RGBlock structure of the sixth feature fusion structure is output to the fourth Head detection head of the Prediction layer, so that the model has multiple (for example, four) outputs after feature fusion with different downsampling multiples. That is, the improved Neck network of the present invention has 80×80 (indicating 8-fold downsampling, i.e. 640 / 80=8), 40×40 (indicating 16-fold downsampling, i.e. 640 / 40=16) and 20×20 (indicating 32-fold downsampling, i.e. 640 / 20=32) feature fusion structures (corresponding to the fourth feature fusion structure, the fifth feature fusion structure, and the sixth feature fusion structure, respectively), and can also have a 4-fold upsampling (160×160) feature fusion structure (i.e. the third feature fusion structure, including the upsampling layer, the concatenation layer Concat and the C2f structure), so that the sampling multiples of the model are 32 times, 16 times, 8 times and 4 times, respectively, which are used to predict targets of four scales, namely, tiny, small, medium and large; through this setting, the model can more effectively combine the deep semantic information and shallow spatial position information of small targets, thereby significantly improving the detection performance of small targets, so that the model can maintain higher accuracy and robustness when facing dense small targets in complex backgrounds.
[0043] The prediction network includes multiple Head detection heads, each of which includes a classification branch and a regression branch. The classification branch classifies and identifies the feature map with complete feature information to predict the category of the object in each detection box on the feature map and generate a corresponding classification score; the regression branch regresses the feature map with complete feature information to predict the position of each detection box on the feature map and generate a corresponding regression score.
[0044] 3. Image detection step: input the training set adjusted to a preset size into the improved YOLOv8 network model, and use the positive and negative sample matching strategy and the composite loss function for training to obtain the trained improved YOLOv8 network model, and test and analyze the test set adjusted to the preset size to obtain the final trained and tested improved YOLOv8 network model, use the trained and tested improved YOLOv8 network model to detect the traffic image to be detected, and obtain the traffic image target detection result, and use the non-maximum suppression algorithm to optimize the traffic image target detection result to obtain the optimal traffic image target detection result.
[0045] Specifically, the training set adjusted to a preset size is first input into the improved YOLOv8 network model for training, and during the training process, the positive sample is selected using the positive and negative sample matching strategy, wherein the positive and negative sample matching strategy adopts the Task-AlignedAssigner strategy (i.e., the task alignment assignment strategy), and the positive sample is selected according to the classification score, the intersection-over-union ratio between the predicted box and the true target box, and the preset weight hyperparameters, and the selection is performed according to the following formula:
[0046] t=s α ×u β (1)
[0047] In the above formula, s is the classification score, u is the IOU between the predicted box and the true target box, α and β are weight hyperparameters, and the multiplication of the two can measure the degree of alignment. When the classification score is higher and the IOU is higher, the value of t is closer to 1. By training t, we can focus on high-quality positive samples.
[0048] After selecting the positive samples, the classification loss function and regression loss function in the composite loss function can be calculated based on the positive samples. The classification loss function uses the binary cross-entropy loss, which enables the model to perform better and converge faster. The regression loss function is divided into two parts, the complete intersection-over-union loss CIou_Loss and the distribution focal loss Distribution Focal Loss, which help the model locate the target object more accurately.
[0049] Then, during the model training process, the divided validation set is used to perform hyperparameter adjustment and model selection to obtain the trained and adjusted improved YOLOv8 network model, and the divided test set is used to evaluate the performance of the trained and adjusted improved YOLOv8 network model to evaluate its generalization ability. Finally, the trained improved YOLOv8 network model is obtained, and the trained improved YOLOv8 network model is used to detect the SAR image to be detected to obtain the SAR image target detection result, and the non-maximum suppression algorithm is used to optimize the traffic image target detection result, for example, screening out detection results with higher confidence, and using the non-maximum suppression algorithm (NMS) to eliminate overlapping bounding boxes, etc., to obtain the optimal SAR image target detection result.
[0050] The present invention also relates to a complex scene multi-scale ship detection system, which corresponds to the complex scene multi-scale ship detection method and can be understood as a system for implementing the method. The system includes an image acquisition and size adjustment module, a model building module and an image detection module connected in sequence. Specifically,
[0051] The image acquisition and size adjustment module acquires a ship SAR image dataset to be predicted, divides the SAR image dataset into a training set and a test set according to a preset ratio, and adjusts the pixel sizes of all SAR images in the training set and the test set to a preset size;
[0052] The model construction module constructs an improved YOLOv8 network model, which is a convolutional neural network structure improved on the basis of YOLOv8, including an improved Neck network, and the improved Neck network includes a first feature fusion structure, a second feature fusion structure, a third feature fusion structure, a fourth feature fusion structure, a fifth feature fusion structure and a sixth feature fusion structure connected in series in sequence, the first feature fusion structure, the second feature fusion structure and the third feature fusion structure all include an upsampling layer, a splicing layer and a C2f structure connected in sequence, the C2f structure of the first feature fusion structure is connected to the upsampling layer of the second feature fusion structure, and the C2f structure of the second feature fusion structure is connected to the upsampling layer of the third feature fusion structure; the fourth feature fusion structure, the fifth feature fusion structure and the sixth feature fusion structure are respectively based on different downsampling multiples and all include a Conv convolution layer, a splicing layer and an RGBlock structure connected in sequence, and the RGB of the fourth feature fusion structure The lock structure is connected to the Conv convolution layer of the fifth feature fusion structure, the RGBlock structure of the fifth feature fusion structure is connected to the Conv convolution layer of the sixth feature fusion structure, and the C2f structure of the third feature fusion structure is connected to the Conv convolution layer of the fourth feature fusion structure to downsample the feature map output by the C2f structure of the third feature fusion structure through the Conv convolution layer of the fourth feature fusion structure; the splicing layer of each feature fusion structure is used to splice feature maps of several different scales, and the C2f structure of the third feature fusion structure and each RGBlock structure of the fourth, fifth and sixth feature fusion structures are output to the Prediction network of the improved YOLOv8 network model; the RGBlock structure includes a plurality of RGConv modules connected in series in sequence, and the RGConv module includes a plurality of parallel convolution layer branches, and the convolution layer branches include a first Ghost convolution layer slave branch, a second Ghost convolution layer main branch and a Conv convolution layer slave branch;
[0053] The image detection module inputs a training set adjusted to a preset size into an improved YOLOv8 network model, and uses a positive and negative sample matching strategy and a composite loss function for training to obtain a trained improved YOLOv8 network model, and performs test analysis on a test set adjusted to a preset size to obtain a finally trained and tested improved YOLOv8 network model, uses the trained and tested improved YOLOv8 network model to detect a SAR image to be detected to obtain a SAR image target detection result, and uses a non-maximum suppression algorithm to optimize the SAR image target detection result to obtain an optimal SAR image target detection result.
[0054] Preferably, in the image detection module, during the training process using the positive and negative sample matching strategy and the composite loss function, each convolutional layer branch of the RGConv module independently learns and extracts features, and optimizes the feature parameters of the convolutional layer in each branch through the back propagation algorithm to learn different abstract representations or features of the input feature map;
[0055] When the trained and tested improved YOLOv8 network model is used to detect the SAR image to be detected, the RGConv module adopts a re-parameterization strategy to merge the feature parameters of each slave branch into the main branch, and then only performs the convolution operation on the main branch to reduce the amount of calculation and memory consumption.
[0056] Preferably, in the model building module, the improved YOLOv8 network model also includes a Backbone network and a Prediction network, the Prediction network includes multiple Head detection heads, the C2f structure of the third feature fusion structure is output to the first Head detection head of the Prediction network, the RGBlock structure of the fourth feature fusion structure is output to the second Head detection head of the Prediction network, the RGBlock structure of the fifth feature fusion structure is output to the third Head detection head of the Prediction network, and the RGBlock structure of the sixth feature fusion structure is output to the Prediction network. n the fourth Head detection head of the network; each Head detection head includes a classification branch and a regression branch, the Backbone network performs feature extraction on the input image to generate feature maps of different levels; the improved Neck network performs multi-scale feature fusion on the image features in the feature map generated by the Backbone network, and outputs a feature map with complete feature information, the classification branch performs classification and recognition on the feature map with complete feature information to predict the category of the object in each detection frame on the feature map, and generates a corresponding classification score; the regression branch performs regression and recognition on the feature map with complete feature information to predict the position of each detection frame on the feature map, and generates a corresponding regression score.
[0057] Preferably, in the image detection module, the positive and negative sample matching strategy selects positive samples based on the classification score, the intersection-over-union ratio between the predicted box and the true target box, and a preset weight hyperparameter; the composite loss function includes a classification loss function and a regression loss function, and the classification loss function and the regression loss function are calculated based on the positive sample respectively.
[0058] Preferably, in the image detection module, during the YOLO8 network model training process, a pre-divided validation set is used to perform hyperparameter adjustment and model selection to obtain a trained and adjusted YOLOv8 network model, and a pre-divided test set is used to evaluate the performance of the trained and adjusted YOLOv8 network model.
[0059] The present invention provides an objective and scientific multi-scale ship detection method and system for complex scenes. Based on a ship SAR image dataset, the ship SAR images are detected by using an improved YOLOv8 network model constructed by an improved Neck network on the basis of YOLOv8, and SAR image target detection results are obtained. The method and system can fully obtain information on the shallow and deep layers of the image, effectively improve the detection accuracy, and are suitable for marine ship detection in complex environments.
[0060] It should be noted that the above-described specific implementations can enable those skilled in the art to more fully understand the invention, but do not limit the invention in any way. Therefore, although this specification has described the invention in detail with reference to the drawings and embodiments, those skilled in the art should understand that the invention can still be modified or replaced by equivalents. In short, all technical solutions and improvements that do not deviate from the spirit and scope of the invention should be included in the protection scope of the patent for the invention.
Claims
1. A multi-scale ship detection method for complex scenes, characterized in that: The following steps are involved: Image acquisition and size adjustment step: obtaining a ship SAR image dataset to be predicted, dividing the SAR image dataset into a training set and a test set according to a preset ratio, and adjusting the pixel sizes of all SAR images in the training set and the test set to a preset size; Model construction step: construct an improved YOLOv8 network model, the improved YOLOv8 network model is a convolutional neural network structure improved on the basis of YOLOv8, including an improved Neck network, the improved Neck network includes a first feature fusion structure, a second feature fusion structure, a third feature fusion structure, a fourth feature fusion structure, a fifth feature fusion structure and a sixth feature fusion structure connected in series in sequence, the first feature fusion structure, the second feature fusion structure and the third feature fusion structure all include upsampling layers, splicing layers and C2f structures connected in sequence, the C2f structure of the first feature fusion structure is connected to the upsampling layer of the second feature fusion structure, and the C2f structure of the second feature fusion structure is connected to the upsampling layer of the third feature fusion structure; the fourth feature fusion structure, the fifth feature fusion structure and the sixth feature fusion structure are respectively based on different downsampling multiples and all include Conv convolution layers, splicing layers and RGBlock structures connected in sequence, the RGBl of the fourth feature fusion structure The ock structure is connected to the Conv convolution layer of the fifth feature fusion structure, the RGBlock structure of the fifth feature fusion structure is connected to the Conv convolution layer of the sixth feature fusion structure, and the C2f structure of the third feature fusion structure is connected to the Conv convolution layer of the fourth feature fusion structure to downsample the feature map output by the C2f structure of the third feature fusion structure through the Conv convolution layer of the fourth feature fusion structure; the splicing layer of each feature fusion structure is used to splice feature maps of several different scales, and the C2f structure of the third feature fusion structure and each RGBlock structure of the fourth, fifth and sixth feature fusion structures are output to the Prediction network of the improved YOLOv8 network model; the RGBlock structure includes a plurality of RGConv modules connected in series in sequence, and the RGConv module includes a plurality of parallel convolution layer branches, and the convolution layer branches include a first Ghost convolution layer slave branch, a second Ghost convolution layer main branch and a Conv convolution layer slave branch; Image detection step: inputting a training set adjusted to a preset size into an improved YOLOv8 network model, and training using a positive and negative sample matching strategy and a composite loss function to obtain a trained improved YOLOv8 network model, and testing and analyzing the test set adjusted to a preset size to obtain a final trained and tested improved YOLOv8 network model, using the trained and tested improved YOLOv8 network model to detect a SAR image to be detected, obtaining a SAR image target detection result, and optimizing the SAR image target detection result using a non-maximum suppression algorithm to obtain an optimal SAR image target detection result.
2. The complex scene multi-scale ship detection method according to claim 1 is characterized in that: In the image detection step, during the training process using the positive and negative sample matching strategy and the composite loss function, each convolutional layer branch of the RGConv module independently learns and extracts features, and optimizes the feature parameters of the convolutional layer in each branch through the back propagation algorithm to learn different abstract representations or features of the input feature map; When the trained and tested improved YOLOv8 network model is used to detect the SAR image to be detected, the RGConv module adopts a re-parameterization strategy to merge the feature parameters of each slave branch into the main branch, and then only performs the convolution operation on the main branch to reduce the amount of calculation and memory consumption.
3. The complex scene multi-scale ship detection method according to claim 1 is characterized in that: In the model construction step, the improved YOLOv8 network model also includes a Backbone network and a Prediction network, the Prediction network includes multiple Head detection heads, the C2f structure of the third feature fusion structure is output to the first Head detection head of the Prediction network, the RGBlock structure of the fourth feature fusion structure is output to the second Head detection head of the Prediction network, the RGBlock structure of the fifth feature fusion structure is output to the third Head detection head of the Prediction network, and the RGBlock structure of the sixth feature fusion structure is output to the fourth Head detection head of the Prediction network; each Head detection head includes a classification branch and a regression branch, and the Backbone network extracts features from the input image to generate feature maps of different levels; The improved Neck network performs multi-scale feature fusion on the image features in the feature map generated by the Backbone network, and outputs a feature map with complete feature information. The classification branch performs classification and recognition on the feature map with complete feature information to predict the category of the object in each detection frame on the feature map and generate a corresponding classification score; the regression branch performs regression and recognition on the feature map with complete feature information to predict the position of each detection frame on the feature map and generate a corresponding regression score.
4. The complex scene multi-scale ship detection method according to claim 3 is characterized in that: In the image detection step, the positive and negative sample matching strategy selects positive samples according to the classification score, the intersection-over-union ratio between the predicted box and the true target box, and the preset weight hyperparameters; the composite loss function includes a classification loss function and a regression loss function, and the classification loss function and the regression loss function are calculated based on the positive samples respectively.
5. The complex scene multi-scale ship detection method according to claim 1, characterized in that: In the image detection step, a pre-divided validation set is used to perform hyperparameter adjustment and model selection during the YOLO8 network model training process to obtain a trained and adjusted YOLOv8 network model, and the divided test set is used to evaluate the performance of the trained and adjusted YOLOv8 network model.
6. A complex scene multi-scale ship detection system, characterized in that: It includes an image acquisition and size adjustment module, a model building module and an image detection module connected in sequence. The image acquisition and size adjustment module acquires a ship SAR image dataset to be predicted, divides the SAR image dataset into a training set and a test set according to a preset ratio, and adjusts the pixel sizes of all SAR images in the training set and the test set to a preset size; The model construction module constructs an improved YOLOv8 network model, which is a convolutional neural network structure improved on the basis of YOLOv8, including an improved Neck network, and the improved Neck network includes a first feature fusion structure, a second feature fusion structure, a third feature fusion structure, a fourth feature fusion structure, a fifth feature fusion structure and a sixth feature fusion structure connected in series in sequence, the first feature fusion structure, the second feature fusion structure and the third feature fusion structure all include an upsampling layer, a splicing layer and a C2f structure connected in sequence, the C2f structure of the first feature fusion structure is connected to the upsampling layer of the second feature fusion structure, and the C2f structure of the second feature fusion structure is connected to the upsampling layer of the third feature fusion structure; the fourth feature fusion structure, the fifth feature fusion structure and the sixth feature fusion structure are respectively based on different downsampling multiples and all include a Conv convolution layer, a splicing layer and an RGBlock structure connected in sequence, and the RGB of the fourth feature fusion structure The lock structure is connected to the Conv convolution layer of the fifth feature fusion structure, the RGBlock structure of the fifth feature fusion structure is connected to the Conv convolution layer of the sixth feature fusion structure, and the C2f structure of the third feature fusion structure is connected to the Conv convolution layer of the fourth feature fusion structure to downsample the feature map output by the C2f structure of the third feature fusion structure through the Conv convolution layer of the fourth feature fusion structure; the splicing layer of each feature fusion structure is used to splice feature maps of several different scales, the C2f structure of the third feature fusion structure and each RGBlock structure of the fourth, fifth and sixth feature fusion structures are output to the Prediction network of the improved YOLOv8 network model, the RGBlock structure includes a plurality of RGConv modules connected in series in sequence, the RGConv module includes a plurality of parallel convolution layer branches, and the convolution layer branches include a first Ghost convolution layer slave branch, a second Ghost convolution layer main branch and a Conv convolution layer slave branch; The image detection module inputs a training set adjusted to a preset size into an improved YOLOv8 network model, and uses a positive and negative sample matching strategy and a composite loss function for training to obtain a trained improved YOLOv8 network model, and performs test analysis on a test set adjusted to a preset size to obtain a finally trained and tested improved YOLOv8 network model, uses the trained and tested improved YOLOv8 network model to detect a SAR image to be detected to obtain a SAR image target detection result, and uses a non-maximum suppression algorithm to optimize the SAR image target detection result to obtain an optimal SAR image target detection result.
7. The complex scene multi-scale ship detection system according to claim 6, characterized in that: In the image detection module, during the training process using the positive and negative sample matching strategy and the composite loss function, each convolutional layer branch of the RGConv module independently learns and extracts features, and optimizes the feature parameters of the convolutional layer in each branch through the back propagation algorithm to learn different abstract representations or features of the input feature map; When the trained and tested improved YOLOv8 network model is used to detect the SAR image to be detected, the RGConv module adopts a re-parameterization strategy to merge the feature parameters of each slave branch into the main branch, and then only performs the convolution operation on the main branch to reduce the amount of calculation and memory consumption.
8. The complex scene multi-scale ship detection system according to claim 6, characterized in that: In the model building module, the improved YOLOv8 network model also includes a Backbone network and a Prediction network, the Prediction network includes multiple Head detection heads, the C2f structure of the third feature fusion structure is output to the first Head detection head of the Prediction network, the RGBlock structure of the fourth feature fusion structure is output to the second Head detection head of the Prediction network, the RGBlock structure of the fifth feature fusion structure is output to the third Head detection head of the Prediction network, and the RGBlock structure of the sixth feature fusion structure is output to the fourth Head detection head of the Prediction network; each Head detection head includes a classification branch and a regression branch, and the Backbone network extracts features from the input image to generate feature maps of different levels; The improved Neck network performs multi-scale feature fusion on the image features in the feature map generated by the Backbone network, and outputs a feature map with complete feature information. The classification branch performs classification and recognition on the feature map with complete feature information to predict the category of the object in each detection frame on the feature map and generate a corresponding classification score; the regression branch performs regression and recognition on the feature map with complete feature information to predict the position of each detection frame on the feature map and generate a corresponding regression score.
9. The complex scene multi-scale ship detection system according to claim 8, characterized in that: In the image detection module, the positive and negative sample matching strategy selects positive samples according to the classification score, the intersection-and-union ratio between the predicted box and the true target box, and the preset weight hyperparameters; the composite loss function includes a classification loss function and a regression loss function, and the classification loss function and the regression loss function are calculated based on the positive samples respectively.
10. The complex scene multi-scale ship detection system according to claim 6, characterized in that: In the image detection module, during the YOLO8 network model training process, a pre-divided validation set is used to perform hyperparameter adjustment and model selection to obtain a trained and adjusted YOLOv8 network model, and a pre-divided test set is used to evaluate the performance of the trained and adjusted YOLOv8 network model.
Citation Information
Patent Citations
Traffic scene target detection method and system based on improved YOLOv5s
CN118314320A
SAR (Synthetic Aperture Radar) target detection method based on fine-grained feature fusion attention mechanism
CN118736403A
Light-weight YOLOv8-pose fatigue driving detection method
CN118865336A