Lightweight YOLO model construction method for inland ship detection

By making lightweight improvements on YOLOv7, using PP-LCNet and GSConv modules, cutting features and redesigning the network structure, the problem of large computational load of YOLOv7 in inland ship detection has been solved, and efficient and accurate detection results have been achieved.

CN118747849APending Publication Date: 2024-10-08HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202410846463.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

The traditional YOLOv7 algorithm has a large amount of calculation and many model parameters in inland ship detection, making it difficult to run efficiently on lightweight equipment, especially in complex scenarios with low detection efficiency.

Method used

The lightweight YOLO model construction method is adopted, including using PP-LCNet as the backbone network, introducing a new attention-enhanced depth-separable convolution module, replacing the traditional convolution module with GSConv, performing cascade feature fusion, and cropping small receptive field features. The feature fusion network is redesigned and the anchor boxes are adaptively clustered through the k-means algorithm.

Benefits of technology

It significantly reduces model parameters and calculation volume, improves detection accuracy and efficiency, and achieves fast and accurate inland ship detection. It is suitable for lightweight equipment and complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747849A_ABST
    Figure CN118747849A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image target detection and recognition, in particular to a lightweight YOLO model construction method for inland ship detection. According to the technical scheme, the method comprises the following steps that a backbone network is lightened, wherein a PP-LCNet is used as the backbone network, and the backbone network is formed by overlapping a plurality of DepthSepConv basic modules; a brand-new attention enhancement depth separable convolution module is introduced into the PP-LCNet, and the attention enhancement depth separable convolution module comprises the step of introducing a lightweight attention mechanism based on a global average pooling layer and one-dimensional convolution; and the GSConv is used for replacing the traditional convolution module in the GS-ELAN module. According to the method, through lightweight of the backbone network, introduction of lightweight convolution and redesign of the network structure, reduction of the number of model parameters, reduction of the calculation amount, improvement of the detection precision and simplification of the implementation method are realized, and powerful support is provided for technical progress in related fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image target detection and recognition, and in particular to a lightweight YOLO model construction method for inland river ship detection. Background Art

[0002] Traditional inland ship monitoring methods usually rely on manual inspections or traditional computer vision technology, but they are inefficient and susceptible to environmental constraints. In recent years, the development of deep learning technology has provided new solutions for ship detection, especially the YOLO series of algorithms have attracted much attention due to their real-time performance and accuracy.

[0003] YOLOv7 is one of the most advanced algorithms in the YOLO series, and it has demonstrated excellent performance in the field of target detection. Compared with previous versions of the YOLO algorithm, YOLOv7 has achieved significant improvements in both accuracy and speed. In terms of accuracy, YOLOv7 adopts a multi-scale detection strategy, which can detect targets of different sizes on different feature maps. This design enables YOLOv7 to more accurately identify target objects when dealing with various complex scenarios. At the same time, by improving the backbone network and feature fusion method, YOLOv7 further improves the detection accuracy, allowing it to maintain a high detection accuracy while maintaining its speed advantage. In terms of speed, YOLOv7 also performs well. It uses a series of technical means to improve the detection speed. These optimizations enable YOLOv7 to achieve faster detection speeds while maintaining high detection accuracy. In addition, YOLOv7 also has better scalability and versatility. Its architecture is relatively simple and easy to expand and modify, allowing researchers to customize and optimize according to specific needs.

[0004] However, in certain application scenarios, the traditional YOLO algorithm faces some challenges in inland ship detection, one of the most prominent issues being the complexity of the algorithm. Inland waters are usually narrow, and the distance between ships and obstacles such as the shore and bridges is close. There is also insufficient light during detection in rainy weather, or the fusion of ships with the background on the opposite shore. These situations increase the complexity of the detection task. The traditional YOLO algorithm often requires large computing resources in such scenarios, making it difficult to run efficiently on lightweight devices.

[0005] In the inland ship detection task, based on the problems of large computational complexity and many model parameters of the YOLOv7 algorithm, a lightweight model ISD-YOLO for inland ship detection was proposed.

[0006] The traditional YOLOv7-based inland ship detection algorithm has high detection accuracy when dealing with ship detection tasks, but due to its complex model structure and a large number of parameters, it has a large amount of calculation and a slow operation speed, making it difficult to meet the requirements of real-time and efficiency in practical applications. This problem is particularly prominent when dealing with high-resolution images or a large number of ship targets.

[0007] Therefore, the present invention aims to optimize the inland ship detection algorithm based on YOLOv7 through a lightweight improvement strategy, reduce its calculation amount, reduce model parameters, and maintain high detection accuracy. By using the present invention, accurate and efficient inland ship detection tasks in natural scenes can be completed.

[0008] Therefore, it is necessary to propose a lightweight algorithm for inland ship detection to overcome the performance bottleneck of traditional algorithms in inland waters ship detection tasks. This application proposes a lightweight YOLO model construction method for inland ship detection. Summary of the invention

[0009] The purpose of the present invention is to propose a lightweight YOLO model construction method for inland ship detection in view of the problems of large computational complexity and many model parameters in the YOLOv7 algorithm in the inland ship detection task in the background technology.

[0010] The technical solution of the present invention is a method for constructing a lightweight YOLO model for inland ship detection, comprising the following steps:

[0011] S1. Lightweight backbone network:

[0012] Use PP-LCNet as the backbone network, which is composed of multiple DepthSepConv basic modules;

[0013] A new attention-enhanced deep separable convolutional module is introduced in PP-LCNet. The attention-enhanced deep separable convolutional module includes a lightweight attention mechanism based on global average pooling layer and one-dimensional convolution;

[0014] S2. Introducing lightweight convolution:

[0015] Use GSConv to replace the traditional convolution module in the GS-ELAN module;

[0016] The cascade feature fusion method is used to cascade the feature maps from different convolutional layers in the channel dimension to obtain the fused feature map;

[0017] S3. Network structure redesign:

[0018] According to the characteristics of the ship detection task, the strategy of cropping small receptive fields is adopted to remove the shallowest 80 pixel × 80 pixel scale output;

[0019] Reconstruct the feature fusion network to improve the feature weights in the deep network;

[0020] The output feature size is adjusted to 20pixel×20pixel and 40pixel×40pixel, and the feature fusion network is redesigned accordingly. The influence of deep feature maps in multi-scale detection is enhanced by increasing their weight, which is achieved by adjusting parameters in the program;

[0021] S4. Anchor box parameter re-clustering:

[0022] When the BPR between the model's preset prior frame and the target of the inland ship dataset is less than 0.98, it indicates that the prior frame is not applicable to the ship dataset;

[0023] According to the reconstructed feature map output, the anchor box adaptation mechanism of YOLOv7 calls the k-means algorithm to re-cluster the anchor boxes annotated in the data set, and obtains three anchor boxes of different sizes corresponding to medium and large receptive fields respectively;

[0024] When the BPR value is lower than a certain threshold (such as 0.98), it means that the prior box does not match the target in the dataset, resulting in unsatisfactory detection results.

[0025] Optionally, in step S1, the SE attention mechanism is an optional function of the DepthSepConv module, and whether to use SE attention is adjusted by parameters. If it is used, it is DepthSepConvSE.

[0026] Optionally, the SE attention in the DepthSepConvSE module performs global feature description on the input feature map through a global average pooling layer, and generates weights for each channel through two fully connected layers. Its parameter amount mainly comes from two 1×1 convolutional layers. When the input feature map of size H×W×C is operated by the SE attention module, the reduction factor between the two fully connected layers is r, and the number of parameters in the whole process is:

[0027]

[0028] The AEDSC module uses a global average pooling layer to describe the global features of the input feature map. Its attention weight is generated by a lightweight one-dimensional convolution layer. The number of parameters is the convolution kernel size k. The number of parameters in the entire process of the AEDSC module attention part is:

[0029] P ae =k

[0030] Combining the two steps, we get the ratio of the number of parameters of the attention part of the AEDSC module and the SE attention part in the DepthSepConv module:

[0031] The number of parameters of the self-developed AEDSC module is much smaller than that of DepthSepConvSE.

[0032] Optionally, in S2, the feature map after cascade feature fusion contains scale information, and comprehensive features are further extracted through fusion convolution.

[0033] Optionally, in S3, in the network structure, CBL consists of convolution, batch normalization and activation function, SPPCSPC is a spatial pyramid pooling cross-stage partial connection module, which uses spatial pyramid pooling operation to perform pooling at different scales, and splices multi-scale feature maps together through Concat operation.

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

[0035] The present invention improves the detection capability of the network model for inland river vessels, reduces the number of model parameters, improves the detection effect of the network model, reduces information redundancy in the feature processing process, ensures the reliability of inland river vessel identification, and achieves fast and accurate detection effect.

[0036] 1) Fewer model parameters: Through the lightweight design of the backbone network, the present invention successfully reduces the redundant parameters in the model, making the entire network more streamlined and efficient. This optimization not only reduces the complexity of the model, but also greatly reduces the required storage space, thereby improving the flexibility and efficiency of model deployment.

[0037] 2) Less computation: By introducing lightweight convolution technology, the present invention significantly reduces the amount of computation while maintaining performance. This improvement enables the model to complete calculations faster when processing the same task, further improving real-time performance and response speed.

[0038] 3) Higher detection accuracy: Although the model is lightweight and structurally optimized, the present invention has achieved improved detection accuracy while reducing parameters and computational complexity through network structure redesign. This achievement is due to our fine-tuned network architecture, which simplifies the model while maintaining excellent performance.

[0039] 4) The implementation method is simpler: The implementation method provided by the present invention is concise and clear, and is easy for engineers to understand and implement. By adopting an intuitive network structure and algorithm, we have lowered the threshold for technical implementation, allowing more developers to easily integrate and apply the technical achievements of the present invention.

[0040] In summary, the present invention reduces the number of model parameters, reduces the amount of calculation, improves detection accuracy and simplifies the implementation method by lightweighting the backbone network, introducing lightweight convolution and redesigning the network structure, providing strong support for technological progress in related fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is the overall structure diagram of ISD-YOLO;

[0042] Figure 2 This is the overall structure diagram of PP-LCNet;

[0043] Figure 3 This is the AEDSC module structure diagram;

[0044] Figure 4 It is the structure diagram of GSConv;

[0045] Figure 5 This is the GS-ELAN network structure diagram;

[0046] Figure 6 is the feature fusion network diagram;

[0047] Figure 7 This is a flowchart of the steps of the model training method;

[0048] Figure 8 The figure is a flow chart of the steps of the model detection method.

[0049] Fig. 9 This is a comparison chart of the detection effects. DETAILED DESCRIPTION

[0050] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and specific embodiments.

[0051] Example

[0052] like Figure 1As shown, the present invention uses the YOLOv7-tiny algorithm as the basic model, and through a series of improvements, it can improve the detection accuracy and significantly reduce the model parameters in the inland ship detection task. Specifically: the SeaShips dataset of 7,000 ship pictures open sourced by the team of Professor Shao Zhenfeng of Wuhan University is used as the inland ship dataset. The SeaShips dataset has 7,000 pictures and a total of 6 categories. The dataset is divided into a training set and a validation set at a ratio of 8:2; the YOLOv7-tiny network model is improved to obtain a lightweight model ISD-YOLO for inland ship detection; the SeaShips training set is used to train the improved algorithm model; the SeaShips validation set is passed into the trained model, the detection results are recorded and the model performance is evaluated. The present invention improves the detection ability of the network model for inland ships, reduces the number of parameters of the model, improves the detection effect of the network model, reduces the information redundancy in the feature processing process, ensures the reliability of inland ship identification, and achieves a fast and accurate detection effect.

[0053] 1. Lightweight backbone network

[0054] The backbone feature extraction network is very important in the target detection task, and a deep convolutional neural network with powerful characterization and feature extraction capabilities is usually used. As the network depth increases, the image features extracted by the object detection model will be richer and more advanced. Although models with complex structures perform better, on edge devices with limited computing resources, the number of parameters and the amount of calculation of complex models are large, which may cause reasoning delays and affect the real-time performance of target detection. In order to solve this problem, this embodiment studies and improves the backbone network to make it suitable for ship detection tasks.

[0055] PP-LCNet is a lightweight network composed of multiple DepthSepConv basic modules. Each DepthSepConv module contains two convolution operations. H-Swish is used as an activation function to limit the output value to a smaller range, reducing the computational complexity. The SE attention mechanism is an optional part of the module. Adding it to the module near the end of the network to form a DepthSepConvSE module will bring a better accuracy-speed balance. PP-LCNet adds a 1×1 convolution layer with a dimension of 1280 after the GAP layer. This improvement further fuses and processes the output features of the GAP layer, improving the model's fitting ability without affecting the model's inference speed. The overall structure of PP-LCNet is shown in the figure below. Figure 2 shown.

[0056] In order to improve the computational efficiency of PP-LCNet and further enhance its feature expression ability, we propose a new attention-enhanced depthwise separable convolution module (AEDSC). Figure 3 As shown in the figure. This module effectively enhances the information interaction and feature selection capabilities between channels by introducing a lightweight attention mechanism based on global average pooling layer and one-dimensional convolution, while greatly reducing the number of parameters. Specifically, the AEDSC module uses the global average pooling layer to describe the global features of each channel, and then generates the weight of each channel through one-dimensional convolution, thereby improving the performance of the model without significantly increasing the number of parameters and computational complexity. Compared with the SE module in DepthSepConvSE, the number of attention parameters of the AEDSC module is significantly reduced, further enhancing the application potential of the improved PP-LCNet in resource-constrained environments. The AEDSC module not only retains the computational efficiency of the DepthSepConv module, but also enhances the capture of important features through the channel attention mechanism.

[0057] The SE attention in the DepthSepConv module performs global feature description on the input feature map through the global average pooling layer, and generates the weight of each channel through two fully connected layers. Its parameter quantity mainly comes from two 1×1 convolutional layers (equivalent to fully connected layers). When the input feature map of size H×W×C is operated by the SE attention module, the reduction factor between the two fully connected layers is r, and the number of parameters in the whole process is:

[0058]

[0059] The AEDSC module uses a global average pooling layer to describe the global features of the input feature map, and its attention weight is generated by a lightweight one-dimensional convolution layer. The innovative AEDSC module greatly optimizes the number of parameters and computational complexity. The number of parameters of its attention module mainly comes from a one-dimensional convolution layer, and the number of parameters is the convolution kernel size k. Therefore, the number of parameters in the entire process of the attention part of the AEDSC module is:

[0060] P ae =k

[0061] Combining the two steps, we can get the ratio of the number of parameters of the attention part of the AEDSC module and the SE attention part in the DepthSepConv module:

[0062]

[0063] From the ratio of the number of parameters, it can be seen that the number of parameters of the self-developed AEDSC module is much smaller than that of DepthSepConvSE.

[0064] In summary, the AEDSC module introduces lightweight one-dimensional convolution to replace the fully connected layer in the SE module, while maintaining the effect of the attention mechanism and significantly reducing the number of parameters. This improvement not only improves the feature expression ability of the model, but also further enhances its practicality in resource-constrained devices and application scenarios, demonstrating its innovation in improving network efficiency.

[0065] 2. Introducing lightweight convolution

[0066] In order to design lightweight convolutional neural networks, the depthwise separable convolution (DSC) module is usually used to replace the traditional convolution module. The DSC module has efficient computing power because its number of parameters and computational complexity are only one-third of the traditional convolution module. However, during the feature extraction process, the channel information of the input image is separated during the calculation process, which may result in feature extraction and fusion capabilities that are inferior to the standard convolution module. In order to make full use of the computational advantages of DSC and ensure that its detection accuracy reaches the level of standard convolution (SC), a GSconv module based on SC, DSC and shuffle modules is proposed. The network structure is shown in Figure 2. Figure 4 As shown in the figure. First, the input feature map is divided into two parts, one part is used to extract high-level features through standard convolution, and the other part is used to extract fine-grained features through depthwise separable convolution. Then the two parts of the feature map are merged and the features are concatenated. The shuffle module transfers feature information between different channels, so that the features of standard convolution and depthwise separable convolution can be fully mixed, thereby realizing channel information interaction and enhancement.

[0067] In the construction of the GS-ELAN module, the standard convolution in the key component ELAN in YOLOv7-tiny is replaced with the GSConv module to form a new GS-ELAN module, which further improves the feature extraction and computational efficiency of the network. The structure of the GS-ELAN module is as follows: Figure 5 shown.

[0068] In order to maintain the high efficiency of calculation and the lightweight of the model, the GSconv module based on SC, DSC and shuffle modules is widely used in the GS-ELAN module. The depthwise separable convolution reduces the number of parameters and the amount of calculation. The shuffle module transfers information between different channels and realizes the full interaction of features, thus making up for the shortcomings of the depthwise separable convolution in feature extraction and fusion capabilities. In the feature fusion stage, GS-ELAN adopts the cascade feature fusion method to make full use of the multi-scale features extracted by different convolutional layers. Specifically, by cascading the feature maps from different convolutional layers in the channel dimension, a fused feature map is obtained. The cascaded feature map contains information at multiple scales, and the comprehensive features are further extracted through fused convolution. This cascade feature fusion method can not only effectively retain multi-scale features, but also further optimize the feature representation through convolution operations and improve the accuracy of feature extraction.

[0069] In general, compared with traditional convolutional networks, the GS-ELAN module can not only improve the diversity and accuracy of feature extraction, but also significantly reduce the computational complexity and ensure the lightweight characteristics of the model. Through these optimizations, the GS-ELAN module provides an effective way to build an efficient and lightweight target detection model, which has broad application prospects.

[0070] 3. Network structure redesign

[0071] Considering the characteristics of ship detection tasks, target ships are usually large, and the strategy of cropping small receptive fields may just fit the size, shape, and distribution characteristics of ship targets. ISD-YOLO redesigned the original model. YOLOv7 uses three scales to detect targets of different sizes, and the output feature map sizes are 20pixel×20pixel, 40pixel×40pixel, and 80pixel×80pixel, respectively. Among them, 80pixel×80pixel is used to detect small targets, and 20pixel×20pixel is used to detect large targets. This model eliminates the shallowest 80pixel×80pixel scale output according to actual needs.

[0072] In order to optimize the network structure, make the model better adapt to the ship detection task and improve its performance, we cropped the small receptive field features. The small receptive field captures the local and detailed information of the image, which may lead to overfitting during the training process, thus affecting the generalization ability of the model. By removing these features, the model can focus more on learning global features with stronger generalization ability. In addition, large receptive field features can capture richer contextual information, which is crucial for accurately identifying ship targets. Cropping small receptive fields can improve feature quality and thus improve detection accuracy. Finally, reducing unnecessary feature calculations also optimizes computational efficiency and reduces computational costs while maintaining high performance, allowing the model to converge faster.

[0073] Based on the above theory, ISD-YOLO reconstructs the feature fusion network, deletes the fusion of 80pixel×80pixel feature maps, and increases the feature weights in the deep network to improve the detection capability of larger targets.

[0074] The advantages of reconstructing the feature fusion network structure are as follows:

[0075] 1) A large number of inefficient modules are deleted, the weight of detailed features extracted by the deep network is improved, the model is greatly streamlined, and the convergence process of the model is accelerated.

[0076] 2) The overall complexity and computational complexity of the model are reduced, the model size is reduced, and the model efficiency is improved.

[0077] ISD-YOLO adjusts the output feature size to 20pixel×20pixel and 40pixel×40pixel. Corresponding to the adjustment of the feature extraction network, the feature fusion network has also been redesigned. In the network structure, CBL consists of convolution, batch normalization and activation functions. SPPCSPC is a spatial pyramid pooling cross-stage partial connection module. It uses spatial pyramid pooling operations to perform pooling at different scales, and uses the Concat operation to splice multi-scale feature maps together. The feature sizes obtained after fusion are 1 / 16 and 1 / 8 of the input image, which enhances the weight of deep semantic information and increases the attention to deep global features. The improved feature fusion network structure is shown below. Figure 6 shown.

[0078] 4. Anchor box parameter re-clustering

[0079] The BPR between the model's preset prior box and the target of the inland ship dataset is less than 0.98, indicating that the prior box is not suitable for the ship dataset. Based on the reconstructed feature map output, the anchor box adaptation mechanism of YOLOv7 calls the k-means algorithm to re-cluster the anchor boxes labeled in the dataset, and obtains three anchor boxes of different sizes corresponding to medium and large receptive fields. When the BPR value is lower than a certain threshold, such as 0.98, it means that the prior box does not match the target in the dataset, resulting in unsatisfactory detection results. The size of the prior box after re-clustering is shown in Table 1. After the anchor box is re-clustered, the target positioning ability of the model is effectively improved and the model convergence speed is accelerated.

[0080] Table 1 Preset anchor boxes for re-clustering

[0081]

[0082] like Figure 7 As shown, the model training method of the model includes data preparation, model initialization, data preprocessing and enhancement, model training cycle, verification and tuning, model preservation and testing.

[0083] like Figure 8 As shown, the model detection method includes the following steps: model loading, input image preprocessing, forward propagation, non-maximum suppression, and detection result post-processing.

[0084] In order to further compare the shortcomings of the existing technology and verify the superiority of the present invention, we conducted comparative experiments with the current mainstream target detection algorithm and the advanced ship target detection algorithm. The first group of experiments used the classic YOLO target detection algorithm since the release of YOLOv4 as the comparison object and evaluated it on the SeaShips dataset.

[0085] Table 2 Comparison of YOLO series target detection algorithms

[0086]

[0087] According to the experimental results in Table 2, although YOLOv4-Tiny has achieved a certain degree of model lightweighting, it has lost detection accuracy at the expense of detection accuracy. Due to its complex structure and large number of parameters, YOLOv5s makes it impractical to deploy on resource-constrained edge computing devices. Although the performance of YOLOv8n is similar to that of ISD-YOLO in this paper, its computational complexity is 35% more than that of ISD-YOLO, which to a certain extent limits its application in scenarios that pursue high performance-to-performance ratio. YOLOv9-t not only has 95% more computational complexity than ISD-YOLO, but also has a lower accuracy than ISD-YOLO, further highlighting the advantage of ISD-YOLO in balancing detection performance and computational efficiency. YOLOv10n, the latest product in the YOLO series, has failed to surpass ISD-YOLO in both computational complexity and performance. Considering the lightweight model and detection performance, the ISD-YOLO proposed in this paper has certain advantages.

[0088] Table 3 Comparison of advanced models

[0089]

[0090] The second group of experiments compares the present invention with advanced ship target detection algorithms. From the comparative experimental results in Table 3, the YOLO-FNC model is optimized for ship detection in complex scenes. By replacing the C3 module in YOLOv5 with a lightweight FasterNext module, the model parameters and calculation amount are significantly reduced, and the detection performance is improved by combining the NAM attention mechanism with a new boundary regression loss function. However, despite these improvements, the indicators of YOLO-FNC are still inferior to those of the method proposed in this paper. The SAF-YOLOX model proposes a ship detection method with a scale-adaptive receptive field, but its detection accuracy and average precision are not as good as those of the method proposed in this paper. The anchor-free nearshore ship detection algorithm developed by Zhang Liguo et al. improved YOLOX. Although the detection performance was improved, the experimental results showed that its detection accuracy and average precision were still inferior to those of the method proposed in this paper. Liu Xinbo et al. proposed a YOLOX lightweight method for ship target detection. Although the experimental results showed certain advantages, its detection accuracy and average precision were still lower than those of the method proposed in this paper. The improved algorithm for multi-scale ship target detection based on the YOLOv5 model proposed by Ma et al. not only has a much higher computational amount than the present invention, but also has lower detection performance than the present invention. The YOLO-FE proposed by Cheng et al. has slightly fewer parameters. However, from the perspective of detection performance, the present invention is relatively better, while the algorithm is slightly insufficient.

[0091] In recent years, although there are many methods to improve the YOLO series algorithms to improve the performance of ship target detection, overall, their detection indicators are not as good as the method proposed in this paper. In summary, the improved YOLOv7-tiny model in this paper performs well in many aspects. It not only outperforms the existing advanced models in detection accuracy and average precision, but also further proves its effectiveness and advantages in ship target detection tasks.

[0092] In order to test the detection performance of ISD-YOLO in a real environment, an experimental device was set up along the downstream of the Tongling Yangtze River Bridge to test ships sailing on the river. Fig. 9 The left column is the YOLOv7-tiny detection results, and the right column is the ISD-YOLO detection results.

[0093] From the pictures, we can see that ISD-YOLO shows obvious advantages over YOLOv7-tiny in various detection scenarios: in the first row, YOLOv7-tiny mistakenly detects the buoy boat on the river as a passenger ship, highlighting its limitations in small target detection, while ISD-YOLO can accurately distinguish these small targets; in the second row, YOLOv7-tiny missed some ships because the color of the ships was similar to the background color on the opposite bank, but ISD-YOLO can still reliably detect the targets under the same background conditions; in the third row, YOLOv7-tiny mistakenly identified the woods on the opposite bank as ore carriers, while ISD-YOLO showed a high resistance to background interference; in the fourth row, YOLOv7-tiny missed the ships at a long distance on the opposite bank, while ISD-YOLO can maintain stable detection capabilities at different distances.

[0094] Table 4. Ablation experiment results of SeaShips dataset

[0095]

[0096]

[0097] These comparative results clearly demonstrate the advantages of ISD-YOLO over YOLOv7-tiny in the inland vessel detection task, especially its superior performance in complex backgrounds, showing its practicality and accuracy as an improved model in real scenarios.

[0098] The above specific embodiments are only several optional embodiments of the present invention. Based on the technical solutions of the present invention and the relevant inspirations of the above embodiments, those skilled in the art can make various alternative improvements and combinations to the above specific embodiments.

Claims

1. A lightweight YOLO model construction method for inland ship detection, characterized in that: The following steps are involved: S1. Lightweight backbone network: Use PP-LCNet as the backbone network, which is composed of multiple DepthSepConv basic modules; A new attention-enhanced deep separable convolutional module is introduced in PP-LCNet. The attention-enhanced deep separable convolutional module includes a lightweight attention mechanism based on global average pooling layer and one-dimensional convolution; S2. Introducing lightweight convolution: Use GSConv to replace the traditional convolution module in the GS-ELAN module; The cascade feature fusion method is used to cascade the feature maps from different convolutional layers in the channel dimension to obtain the fused feature map; S3. Network structure redesign: According to the characteristics of the ship detection task, the strategy of cropping small receptive fields is adopted to remove the shallowest 80 pixel × 80 pixel scale output; Reconstruct the feature fusion network to improve the feature weights in the deep network; The output feature size is adjusted to 20pixel×20pixel and 40pixel×40pixel, and the feature fusion network is redesigned accordingly. The influence of deep feature maps in multi-scale detection is enhanced by increasing their weight, which is achieved by adjusting parameters in the program; S4. Anchor box parameter re-clustering: When the BPR between the model's preset prior frame and the target of the inland ship dataset is less than 0.98, it indicates that the prior frame is not applicable to the ship dataset; According to the reconstructed feature map output, the anchor box adaptation mechanism of YOLOv7 calls the k-means algorithm to re-cluster the anchor boxes annotated in the data set, and obtains three anchor boxes of different sizes corresponding to medium and large receptive fields respectively; When the BPR value is lower than a certain threshold, it means that the prior box does not match the target in the data set, resulting in unsatisfactory detection results.

2. A lightweight YOLO model construction method for inland ship detection according to claim 1, characterized in that: In step S1, the SE attention mechanism is an optional function of the DepthSepConv module. Whether to use SE attention is adjusted by parameters. If it is used, it is DepthSepConvSE.

3. A lightweight YOLO model construction method for inland ship detection according to claim 2, characterized in that: The SE attention in the DepthSepConvSE module describes the global features of the input feature map through the global average pooling layer, and generates the weight of each channel through two fully connected layers. Its parameters mainly come from two 1×1 convolutional layers. When the input feature map of size H×W×C is operated by the SE attention module, the reduction factor between the two fully connected layers is r, and the number of parameters in the whole process is: The AEDSC module uses a global average pooling layer to describe the global features of the input feature map. Its attention weight is generated by a lightweight one-dimensional convolution layer. The number of parameters is the convolution kernel size k. The number of parameters in the entire process of the AEDSC module attention part is: P ae =k Combining the two steps, we get the ratio of the number of parameters of the attention part of the AEDSC module and the SE attention part in the DepthSepConv module:

4. A lightweight YOLO model construction method for inland ship detection according to claim 1, characterized in that: In S2, the feature map after cascade feature fusion contains scale information, and comprehensive features are further extracted through fusion convolution.

5. A lightweight YOLO model construction method for inland ship detection according to claim 1, characterized in that: In S3, in the network structure, CBL consists of convolution, batch normalization and activation function, SPPCSPC is a spatial pyramid pooling cross-stage partial connection module, which uses spatial pyramid pooling operation to perform pooling at different scales, and splices multi-scale feature maps together through Concat operation.

Citation Information

Cited By

  • Lightweight underwater target detection method

    CN119418180A

  • A lightweight underwater target detection method

    CN119418180B

  • Ship target detection method

    CN119963874A

  • Target detection method and system based on LCSD-YOLO network

    CN120339695A

  • A target detection method and system based on LCSD-YOLO network

    CN120339695B