CN116343045B - Lightweight SAR image ship target detection method based on YOLO v5 - Google Patents

Lightweight SAR image ship target detection method based on YOLO v5 Download PDF

Info

Publication number
CN116343045B
CN116343045B CN202310342382.5A CN202310342382A CN116343045B CN 116343045 B CN116343045 B CN 116343045B CN 202310342382 A CN202310342382 A CN 202310342382A CN 116343045 B CN116343045 B CN 116343045B
Authority
CN
China
Prior art keywords
yolo
lightweight
convolution
model
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310342382.5A
Other languages
Chinese (zh)
Other versions
CN116343045A (en
Inventor
谷继红
丁大志
温媛媛
张佳琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Science and Technology
Original Assignee
Nanjing University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Science and Technology filed Critical Nanjing University of Science and Technology
Priority to CN202310342382.5A priority Critical patent/CN116343045B/en
Publication of CN116343045A publication Critical patent/CN116343045A/en
Application granted granted Critical
Publication of CN116343045B publication Critical patent/CN116343045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a lightweight SAR image ship target detection method based on YOLO v5, which comprises the following steps: acquiring an SAR image dataset, obtaining an SAR image ship target simulation dataset and a public SAR ship detection dataset through simulation imaging, preprocessing the dataset, and dividing the dataset into a training sample set and a test sample set; establishing an improved lightweight YOLO v5 model; inputting the training data set into an improved lightweight YOLO v5 model for training, and obtaining a trained improved lightweight YOLO v5 model; and inputting the test data set into a trained improved lightweight YOLO v5 model to obtain a detection and identification result. The improved lightweight YOLO v5 model provided by the invention can more accurately identify ships in SAR images, greatly reduce the model size and test time, and remarkably improve the detection precision.

Description

基于YOLO v5的轻量化SAR图像舰船目标检测方法Lightweight SAR image ship target detection method based on YOLO v5

技术领域Technical field

本发明属于雷达目标检测技术领域,具体涉及一种基于YOLO v5的轻量化SAR图像舰船目标检测方法。The invention belongs to the technical field of radar target detection, and specifically relates to a lightweight SAR image ship target detection method based on YOLO v5.

背景技术Background technique

雷达图像目标检测是近年来众多学者研究关注的领域,根据有无候选框生成的阶段,基于深度学习的主流目标检测算法有单阶段和两阶段两类。单阶段的目标检测算法检测速度更快,但检测精度相对较低。近来,随着一些改进方案的加入,其检测精度大幅提升甚至超越两阶段模型。Radar image target detection is an area of research concern for many scholars in recent years. According to the stage of generating candidate frames, mainstream target detection algorithms based on deep learning include single-stage and two-stage. The single-stage target detection algorithm has faster detection speed, but the detection accuracy is relatively low. Recently, with the addition of some improvement schemes, its detection accuracy has been greatly improved and even surpassed the two-stage model.

YOLO系列是单阶段检测模型的代表,仅通过端到端的训练即可完成模型的构建。因YOLO的实时性优点,已逐渐成为雷达图像目标检测领域的研究重点。YOLO系列的目标检测模型随着YOLO v5的引入变得越来越强大,YOLO v5拥有目前最高的推理速度,有非常轻量的模型大小,因此选择YOLO v5为检测框架。因此本发明基于YOLO v5算法进行改进,并将其应用于轻量化SAR图像目标检测中。The YOLO series is a representative of single-stage detection models, and the construction of the model can be completed only through end-to-end training. Due to its real-time advantages, YOLO has gradually become a research focus in the field of radar image target detection. The target detection model of the YOLO series has become more and more powerful with the introduction of YOLO v5. YOLO v5 has the highest inference speed and a very lightweight model size, so YOLO v5 was chosen as the detection framework. Therefore, this invention is improved based on the YOLO v5 algorithm and applied to lightweight SAR image target detection.

在实际应用中,SAR图像船舰检测经常面临复杂的海场景,舰船多样尺度不一,还存在近岸环境干扰,相干噪声与背景干扰严重。目标检测算法使用的深度学习网络大多非常复杂,参数量和计算量很大,生成的模型占较大内存,对海洋监测带来了困难。而轻量化模型往往会造成检测精度的大幅下降,因此需设计出更高效的目标检测算法满足实时性。In practical applications, ship detection from SAR images often faces complex sea scenes, with ships of various sizes, near-shore environmental interference, and serious coherent noise and background interference. Most of the deep learning networks used in target detection algorithms are very complex, with a large amount of parameters and calculations. The generated models occupy a large amount of memory, which brings difficulties to ocean monitoring. However, lightweight models often cause a significant drop in detection accuracy, so a more efficient target detection algorithm needs to be designed to meet real-time performance.

发明内容Contents of the invention

本发明的目的在于针对现有轻量化SAR图像检测识别方法在不同复杂海场景下,存在特征泛化能力差、舰船识别率大幅降低、海岸和舰船特征学习不足,导致无法有效区分海岸边信息和舰船目标信息的技术缺陷,提出一种基于YOLO v5的轻量化SAR图像舰船目标检测方法。The purpose of this invention is to solve the problems of existing lightweight SAR image detection and recognition methods in different complex sea scenes, such as poor feature generalization ability, greatly reduced ship recognition rate, and insufficient coast and ship feature learning, resulting in the inability to effectively distinguish the coast. In order to solve the technical shortcomings of information and ship target information, a lightweight SAR image ship target detection method based on YOLO v5 is proposed.

实现本发明目的的技术解决方案为:第一方面,本发明提供一种基于YOLO v5的轻量化SAR图像舰船目标检测方法,包括如下步骤:The technical solution to achieve the purpose of the present invention is: First, the present invention provides a lightweight SAR image ship target detection method based on YOLO v5, which includes the following steps:

步骤1、获取SAR图像数据集:通过仿真成像得到SAR图像舰船目标仿真数据集以及公共SAR船舶探测数据集,对SAR图像进行预处理并划分为训练数据集和测试数据集;Step 1. Obtain the SAR image data set: obtain the SAR image ship target simulation data set and the public SAR ship detection data set through simulation imaging, preprocess the SAR image and divide it into a training data set and a test data set;

步骤2、建立改进轻量化YOLO v5模型,即把YOLO v5的主干网络替换为RepVGG网络结构,并联合表征增强模块和特征注意模块对其进行改进,表征增强模块基于非对称卷积进行改进,特征注意模块基于SE注意力机制构成,将激活函数替换成SiLU激活函数;Step 2. Establish an improved lightweight YOLO v5 model, that is, replace the backbone network of YOLO v5 with the RepVGG network structure, and jointly improve it with the representation enhancement module and the feature attention module. The representation enhancement module is improved based on asymmetric convolution, and the features The attention module is based on the SE attention mechanism and replaces the activation function with the SiLU activation function;

步骤3、将训练数据集输入改进轻量化YOLO v5模型中进行训练,得到训练好的改进轻量化YOLO v5模型;Step 3. Input the training data set into the improved lightweight YOLO v5 model for training, and obtain the trained improved lightweight YOLO v5 model;

步骤4、将测试数据集输入到训练好的改进轻量化YOLO v5模型,得到检测识别结果。Step 4. Input the test data set into the trained improved lightweight YOLO v5 model to obtain the detection and recognition results.

第二方面,本发明提供一种基于YOLO v5的轻量化SAR图像舰船目标检测系统,包括:In the second aspect, the present invention provides a lightweight SAR image ship target detection system based on YOLO v5, including:

第一模块,通过仿真成像得到SAR图像舰船目标仿真数据集以及公共SAR船舶探测数据集,对SAR图像进行预处理并划分为训练数据集和测试数据集;The first module obtains the SAR image ship target simulation data set and the public SAR ship detection data set through simulation imaging, preprocesses the SAR images and divides them into training data sets and test data sets;

第二模块,用于建立改进轻量化YOLO v5模型,即把YOLO v5的主干网络替换为RepVGG网络结构,并联合表征增强模块和特征注意模块对其进行改进,表征增强模块基于非对称卷积进行改进,特征注意模块基于SE注意力机制构成,将激活函数替换成SiLU激活函数;The second module is used to establish an improved lightweight YOLO v5 model, that is, replace the backbone network of YOLO v5 with the RepVGG network structure, and jointly improve it with the representation enhancement module and the feature attention module. The representation enhancement module is based on asymmetric convolution. Improved, the feature attention module is based on the SE attention mechanism and replaces the activation function with the SiLU activation function;

第三模块,用于将训练数据集输入改进轻量化YOLO v5模型中进行训练,得到训练好的改进轻量化YOLO v5模型;The third module is used to input the training data set into the improved lightweight YOLO v5 model for training, and obtain the trained improved lightweight YOLO v5 model;

第四模块,用于将测试数据集输入到训练好的改进轻量化YOLO v5模型,得到检测识别结果。The fourth module is used to input the test data set into the trained improved lightweight YOLO v5 model to obtain detection and recognition results.

第三方面,本发明提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现第一方面所述的方法的步骤。In a third aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method described in the first aspect is implemented. A step of.

第四方面,本发明提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面所述的方法的步骤。In a fourth aspect, the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method described in the first aspect are implemented.

本发明与现有轻量化检测技术相比,其显著优点为:(1)所述方法应用在海岸边场景的识别舰船时,可有效地提取到海岸边和舰船的特征并能区分出海岸边和舰船信息,对复杂海场景下的舰船有较好的识别率;(2)所述方法可较为准确地识别出SAR图像中的小型、中型和大型舰船,与现有算法相比性能更优越,对舰船有更高的识别率,提升了对海探测目标识别效率。Compared with the existing lightweight detection technology, the significant advantages of this invention are: (1) When the method is applied to identify ships in coastal scenes, it can effectively extract the characteristics of the coast and ships and distinguish the characteristics of the ships at sea. Shore and ship information has a better recognition rate for ships in complex sea scenes; (2) The method described can more accurately identify small, medium and large ships in SAR images, which is consistent with existing algorithms. It has superior performance, has a higher recognition rate for ships, and improves the efficiency of sea detection target recognition.

附图说明Description of the drawings

图1是基于YOLO v5模型的改进轻量化目标检测方法原理图。Figure 1 is the schematic diagram of the improved lightweight target detection method based on the YOLO v5 model.

图2是联合表征增强模块与特征注意模块的改进轻量型网络示意图。Figure 2 is a schematic diagram of the improved lightweight network that jointly represents the enhancement module and the feature attention module.

具体实施方式Detailed ways

本发明提出一种复杂海场景下的SAR图像舰船轻量化目标检测方法,步骤如下:获取SAR图像数据集,通过仿真成像得到SAR图像舰船目标仿真数据集以及公共SAR船舶探测数据集(实测数据集),对数据集预处理之后划分为训练样本集和测试样本集;建立改进轻量化YOLO v5模型,即把YOLO v5的主干网络替换为RepVGG网络结构,并联合表征增强模块和特征注意模块对其进行改进,将激活函数替换成了SiLU激活函数;将训练数据集输入改进轻量化YOLO v5模型中进行训练,得到训练好的改进轻量化YOLO v5模型;将测试数据集输入到训练好的改进轻量化YOLO v5模型,得到检测识别结果。所述改进轻量化YOLO v5模型可以更为准确地识别出SAR图像中的舰船,具有更高的检测精度。The present invention proposes a SAR image ship lightweight target detection method under complex sea scenes. The steps are as follows: obtain a SAR image data set, and obtain a SAR image ship target simulation data set and a public SAR ship detection data set (actual measurement) through simulation imaging. Data set), divide the data set into a training sample set and a test sample set after preprocessing; establish an improved lightweight YOLO v5 model, that is, replace the backbone network of YOLO v5 with the RepVGG network structure, and jointly characterize the enhancement module and feature attention module Improve it and replace the activation function with the SiLU activation function; input the training data set into the improved lightweight YOLO v5 model for training, and obtain the trained improved lightweight YOLO v5 model; input the test data set into the trained Improve the lightweight YOLO v5 model to obtain detection and recognition results. The improved lightweight YOLO v5 model can more accurately identify ships in SAR images and has higher detection accuracy.

下面结合附图对本发明作进一步详细描述。The present invention will be described in further detail below in conjunction with the accompanying drawings.

步骤1、获取SAR图像数据集:通过仿真成像得到SAR图像舰船目标仿真数据集以及公共SAR船舶探测数据集(实测数据集),对SAR图像进行预处理并划分为训练数据集和测试数据集;Step 1. Obtain the SAR image data set: Obtain the SAR image ship target simulation data set and the public SAR ship detection data set (actual measurement data set) through simulation imaging, preprocess the SAR image and divide it into a training data set and a test data set. ;

步骤2、建立改进轻量化YOLO v5模型,即把YOLO v5的主干网络替换为RepVGG网络结构,并联合表征增强模块和特征注意模块对其进行改进,表征增强模块基于非对称卷积进行改进,特征注意模块基于SE(Squeeze-and-Excitation)注意力机制构成,将激活函数替换成了SiLU激活函数;Step 2. Establish an improved lightweight YOLO v5 model, that is, replace the backbone network of YOLO v5 with the RepVGG network structure, and jointly improve it with the representation enhancement module and the feature attention module. The representation enhancement module is improved based on asymmetric convolution, and the features The attention module is based on the SE (Squeeze-and-Excitation) attention mechanism and replaces the activation function with the SiLU activation function;

步骤3、将训练数据集输入改进轻量化YOLO v5模型中进行训练,得到训练好的改进轻量化YOLO v5模型;Step 3. Input the training data set into the improved lightweight YOLO v5 model for training, and obtain the trained improved lightweight YOLO v5 model;

步骤4、将测试数据集输入到训练好的改进轻量化YOLO v5模型,得到检测识别结果;Step 4. Input the test data set into the trained improved lightweight YOLO v5 model to obtain the detection and recognition results;

进一步的,步骤2中,建立基于多模块融合的多支RepVGG网络的轻量化YOLO v5模型。即把YOLO v5的主干网络替换为RepVGG网络结构,在RepVGG的轻量化模型基础上,将网络模型分为训练和推理双阶段,训练阶段结合残差分支的思想,添加了一条新残差分支,在该分支内融入了非对称卷积,与常规卷积组成了基于非对称卷积的表征增强模块,在SAR图像特征提取过程中拟合更丰富的特征信息,具有更好的鲁棒性,更好地专注舰船目标,显著提升了复杂海场景下的舰船轻量化检测精度。为了提升对舰船目标的注意程度,在训练阶段中每一层卷积与非对称卷积加入SE通道注意力,形成多个基于SE通道注意力的特征注意模块,具有更强的非线性,可以提升拟合不同通道间的复杂关联能力,在网络训练过程中更好地关注舰船目标,能显著地提升复杂环境下舰船检测的结果,相较于其他轻量型网络具有更好的效果,能够使得舰船目标检测精度优于其他轻量型网络,并且具有很强的泛用性。推理阶段仅包含3×3卷积和ReLU激活函数两种操作。该阶段通过参数融合方法将所有网络层卷积都转为3×3卷积。将双阶段的激活函数都替换成SiLU激活函数,SiLU激活函数的优势是无上界有下界、平滑、非单调,性能优于ReLU激活函数;Further, in step 2, a lightweight YOLO v5 model based on multiple RepVGG networks based on multi-module fusion is established. That is, the backbone network of YOLO v5 is replaced with the RepVGG network structure. Based on the lightweight model of RepVGG, the network model is divided into two phases: training and inference. The training phase combines the idea of the residual branch and adds a new residual branch. Asymmetric convolution is integrated into this branch, and combined with conventional convolution to form a representation enhancement module based on asymmetric convolution, which can fit richer feature information in the SAR image feature extraction process and has better robustness. It can better focus on ship targets and significantly improve the accuracy of lightweight ship detection in complex sea scenes. In order to improve the attention to ship targets, SE channel attention is added to each layer of convolution and asymmetric convolution in the training phase to form multiple feature attention modules based on SE channel attention, which have stronger nonlinearity. It can improve the ability to fit complex correlations between different channels, better focus on ship targets during the network training process, and can significantly improve the results of ship detection in complex environments. Compared with other lightweight networks, it has better The effect can make the ship target detection accuracy better than other lightweight networks, and it has strong versatility. The inference stage only contains two operations: 3×3 convolution and ReLU activation function. At this stage, all network layer convolutions are converted into 3×3 convolutions through parameter fusion method. Replace the two-stage activation function with the SiLU activation function. The advantage of the SiLU activation function is that it has no upper bound but a lower bound, smoothness, and non-monotone, and its performance is better than the ReLU activation function;

进一步的,通过残差方式混合常规卷积与非对称卷积,实现基于非对称卷积的表征增强模块。非对称卷积是将n×n的卷积核转变成n×n、1×n和n×1三个并行卷积核。同时,将1×n和n×1通过n×n卷积核的中心展开。模型训练结束,n×n卷积核直接与1×n和n×1卷积核融合,并在1×n和n×1卷积核之间添加了非线性激活函数,提高了模型的非线性。非对称卷积可以提升常规卷积的表达能力而不需要额外的耗时,能够提升模型对翻转SAR图像的鲁棒性,在复杂环境下的SAR图像海面舰船检测中,更好地提取到舰船目标的特征,降低了近岸复杂场景对舰船检测的影响,显著地提高了检测的精度。基于非对称卷积的表征增强模块将常规卷积和非对称卷积通过残差的形式构建而成,该模块可以增强对舰船的特征提取,提升模型的鲁棒性。训练推理双阶段中,推理阶段仍然由单支路组成,将表征增强模块应用到训练阶段,通过对舰船特征提取性能的改进从而提升检测的精度,提高模型的泛化性;Furthermore, conventional convolution and asymmetric convolution are mixed through the residual method to implement a representation enhancement module based on asymmetric convolution. Asymmetric convolution converts an n×n convolution kernel into three parallel convolution kernels of n×n, 1×n and n×1. At the same time, 1×n and n×1 are expanded through the center of the n×n convolution kernel. After the model training is completed, the n×n convolution kernel is directly fused with the 1×n and n×1 convolution kernels, and a nonlinear activation function is added between the 1×n and n×1 convolution kernels, which improves the non-linearity of the model. Linear. Asymmetric convolution can improve the expressive power of conventional convolution without requiring additional time-consuming, and can improve the robustness of the model to flipped SAR images, and better extract the SAR image sea surface ship detection in complex environments. The characteristics of the ship target reduce the impact of complex nearshore scenes on ship detection and significantly improve the detection accuracy. The representation enhancement module based on asymmetric convolution constructs conventional convolution and asymmetric convolution in the form of residuals. This module can enhance the feature extraction of ships and improve the robustness of the model. In the dual-stage training and inference, the inference stage still consists of a single branch. The representation enhancement module is applied to the training stage to improve the detection accuracy and improve the generalization of the model by improving the ship feature extraction performance;

进一步的,在每一层常规卷积和非对称卷积中加入SE通道注意力,构建基于通道注意力的特征注意模块。在复杂环境下SAR图像海面舰船目标检测中,SE通道注意力可以学习到不同通道的SAR图像特征,能有效地使得特征提取网络更加关注舰船的特征,从而使得检测精度得到提升。在复杂海场景下的SAR图像中,不是所有的区域对检测任务的贡献都是相同,只有与舰船相关的区域才是需要关注的。空间注意力是寻找网络中最重要的部位进行处理,而近岸复杂场景下,舰船往往与近岸干扰在一起,空间注意力会忽略到SAR图像中的部分重要信息,反而会使得舰船检测有所下降。基于SE通道注意力的特征注意模块是将SE通道注意力加到所有常规卷积和非对称卷积之中,使得每一次运算都增强了对不同舰船特征的关注程度,只略微增加了模型的复杂性和计算负担,有效地降低了近岸复杂环境对舰船检测的影响,提升了模型检测的精度。Furthermore, SE channel attention is added to each layer of conventional convolution and asymmetric convolution to construct a feature attention module based on channel attention. In the detection of sea surface ship targets in SAR images in complex environments, SE channel attention can learn the SAR image features of different channels, which can effectively make the feature extraction network pay more attention to the characteristics of the ship, thereby improving the detection accuracy. In SAR images under complex sea scenes, not all areas contribute equally to the detection task. Only areas related to ships need attention. Spatial attention is to find the most important parts of the network for processing. In complex near-shore scenarios, ships often interfere with the shore. Spatial attention will ignore some important information in the SAR image, which will cause the ship to Testing has declined. The feature attention module based on SE channel attention adds SE channel attention to all conventional convolutions and asymmetric convolutions, so that each operation increases the degree of attention to different ship characteristics, and only slightly increases the model The complexity and computational burden effectively reduce the impact of the complex near-shore environment on ship detection and improve the accuracy of model detection.

如图1所示,将SAR图像进行预处理后输入到检测网络,基于联合表征增强模块和特征注意模块的改进轻量型网络进行特征提取,经过特征聚合网络实现多尺度的特征融合,最后计算损失函数,预测舰船的最终结果。As shown in Figure 1, the SAR image is preprocessed and input into the detection network. Features are extracted based on the improved lightweight network of the joint representation enhancement module and the feature attention module. Multi-scale feature fusion is achieved through the feature aggregation network, and finally the calculation Loss function to predict the final outcome of the ship.

如图2所示,该轻量型网络联合了基于非对称卷积的表征增强模块和基于通道注意力的特征注意模块,构成了一个新的改进轻量型网络,并将其作为YOLO v5的特征提取模块加入到检测流程中。As shown in Figure 2, this lightweight network combines the representation enhancement module based on asymmetric convolution and the feature attention module based on channel attention to form a new improved lightweight network, which is used as the YOLO v5 The feature extraction module is added to the detection process.

基于同样的发明构思,本发明还提出一种基于YOLO v5的轻量化SAR图像舰船目标检测系统,包括:Based on the same inventive concept, the present invention also proposes a lightweight SAR image ship target detection system based on YOLO v5, including:

第一模块,通过仿真成像得到SAR图像舰船目标仿真数据集以及公共SAR船舶探测数据集,对SAR图像进行预处理并划分为训练数据集和测试数据集;The first module obtains the SAR image ship target simulation data set and the public SAR ship detection data set through simulation imaging, preprocesses the SAR images and divides them into training data sets and test data sets;

第二模块,用于建立改进轻量化YOLO v5模型,即把YOLO v5的主干网络替换为RepVGG网络结构,并联合表征增强模块和特征注意模块对其进行改进,表征增强模块基于非对称卷积进行改进,特征注意模块基于SE注意力机制构成,将激活函数替换成SiLU激活函数;The second module is used to establish an improved lightweight YOLO v5 model, that is, replace the backbone network of YOLO v5 with the RepVGG network structure, and jointly improve it with the representation enhancement module and the feature attention module. The representation enhancement module is based on asymmetric convolution. Improved, the feature attention module is based on the SE attention mechanism and replaces the activation function with the SiLU activation function;

第三模块,用于将训练数据集输入改进轻量化YOLO v5模型中进行训练,得到训练好的改进轻量化YOLO v5模型;The third module is used to input the training data set into the improved lightweight YOLO v5 model for training, and obtain the trained improved lightweight YOLO v5 model;

第四模块,用于将测试数据集输入到训练好的改进轻量化YOLO v5模型,得到检测识别结果。The fourth module is used to input the test data set into the trained improved lightweight YOLO v5 model to obtain detection and recognition results.

上述各模块的具体实现方法与前述的轻量化SAR图像舰船目标检测方法相同,此处不再赘述。The specific implementation method of each of the above modules is the same as the aforementioned lightweight SAR image ship target detection method, and will not be described again here.

下面结合附图和实施例对本发明所述的基于YOLO v5的轻量化SAR图像舰船目标检测方法进行详细阐述。The lightweight SAR image ship target detection method based on YOLO v5 according to the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

实施例1Example 1

本实施例进行了基于YOLO v5的轻量化SAR图像舰船目标检测,本实例实施的平台为CPU:Intel(R)Core(TM)i7-8700CPU@3.20GHz,GPU:NVIDIA GeForce RTX 2080,32g内存;操作系统window10;采用CUDA10.1加速。数据集为公共SAR船舶探测数据集。基于YOLO v5算法的复杂海场景下轻量化SAR图像目标检测结果对比如表1所示。This example performs lightweight SAR image ship target detection based on YOLO v5. The platform implemented in this example is CPU: Intel(R) Core(TM) i7-8700CPU@3.20GHz, GPU: NVIDIA GeForce RTX 2080, 32g memory ;Operating system window10; using CUDA10.1 acceleration. The data set is a public SAR ship detection data set. The comparison of lightweight SAR image target detection results based on the YOLO v5 algorithm in complex sea scenes is shown in Table 1.

表1本方法与其他轻量化方法在公共SAR船舶探测数据集上的对比Table 1 Comparison between this method and other lightweight methods on public SAR ship detection data sets

由表1可以发现所提出的基于YOLO v5的改进型轻量化模型在复杂环境下海面舰船目标的检测有着很好的性能,在指标上也有着显著的优势,SAR图像近岸舰船目标易受背景杂波以及临岸建筑等影响,导致SAR图像近岸舰船目标检测效果差,虚警率和漏检率高等问题,在轻量化模型中精度下降严重,而本章所提轻量化结构经实验证明,在复杂背景以及近岸场景下,也有着较高的检测率,优于其他轻量化结构。It can be found from Table 1 that the proposed improved lightweight model based on YOLO v5 has good performance in detecting sea surface ship targets in complex environments, and also has significant advantages in indicators. SAR images of coastal ship targets are easy to detect. Affected by background clutter and coastal buildings, the detection effect of coastal ship targets in SAR images is poor, and the false alarm rate and missed detection rate are high. The accuracy of the lightweight model is seriously reduced, and the lightweight structure proposed in this chapter has been successfully used. Experiments have proven that it also has a higher detection rate under complex backgrounds and near-shore scenes, which is better than other lightweight structures.

实施例2Example 2

本实施例进行了基于YOLO v5算法的复杂海场景下轻量化SAR图像目标检测,本实例实施的平台为CPU:Intel(R)Core(TM)i7-8700CPU@3.20GHz,GPU:NVIDIA GeForce RTX2080,32g内存;操作系统window10;采用CUDA10.1加速。数据集为SAR图像舰船目标仿真数据集。基于YOLO v5算法的复杂海场下轻量化SAR图像目标检测结果对比如表2所示。This example performs lightweight SAR image target detection in complex sea scenes based on the YOLO v5 algorithm. The platform implemented in this example is CPU: Intel(R) Core(TM) i7-8700CPU@3.20GHz, GPU: NVIDIA GeForce RTX2080, 32g memory; operating system window10; using CUDA10.1 acceleration. The data set is a SAR image ship target simulation data set. The comparison of lightweight SAR image target detection results based on YOLO v5 algorithm in complex sea fields is shown in Table 2.

表2本方法与其他轻量化方法在SAR图像舰船目标仿真数据集上的对比Table 2 Comparison between this method and other lightweight methods on the SAR image ship target simulation data set

由表2可知,相对于原始YOLO v5模型,所提出的模型以及所对比的轻量化模型,在测试时长上均提高了三倍左右,可以更好地满足海面舰船目标检测的实时性。由以上结果可以得到,所提新型轻量化模型,虽然模型大小较其他轻量化略有上升,但是在其他轻量化模型精度大幅下降的情况下,该模型展现出了在多类别舰船检测中的优势,无论是大型的航空母舰、小型渔船或者其他船只,均保持着较高的准确度,在复杂环境下近岸船只以及不同海况下的舰船都保持着较高的识别率,其各方面指标均优于原始模型。As can be seen from Table 2, compared with the original YOLO v5 model, the test duration of the proposed model and the compared lightweight model is increased by about three times, which can better meet the real-time performance of surface ship target detection. From the above results, it can be concluded that although the model size of the proposed new lightweight model is slightly higher than that of other lightweight models, the accuracy of other lightweight models has dropped significantly, and this model has demonstrated excellent performance in multi-category ship detection. Advantages: Whether it is a large aircraft carrier, a small fishing boat or other ships, it maintains a high accuracy. In complex environments, offshore ships and ships under different sea conditions maintain a high recognition rate. Its various indicators are better than the original model.

Claims (4)

1. A method for detecting a ship target of a lightweight SAR image based on YOLO v5 is characterized by comprising the following steps:
step 1, acquiring SAR image data sets: obtaining a SAR image ship target simulation data set and a public SAR ship detection data set through simulation imaging, preprocessing the SAR image and dividing the SAR image into a training data set and a test data set;
step 2, an improved lightweight YOLO v5 model is built, namely a backbone network of YOLO v5 is replaced by a RepVGG network structure, the model is improved by combining a characterization enhancement module and a feature attention module, the characterization enhancement module is improved based on asymmetric convolution, the feature attention module is formed based on an SE attention mechanism, and an activation function is replaced by a SiLU activation function;
a lightweight YOLO v5 model of a plurality of RepVGG networks based on multi-module fusion is established, namely a backbone network of the YOLO v5 is replaced by a RepVGG network structure, a new residual branch is newly added in a training stage on the basis of training reasoning double-stage lightweight of the RepVGG, and an asymmetric convolution-based characterization enhancement module, a SE channel attention-based feature attention module and a SiLU activation function are fused;
mixing conventional convolution and asymmetric convolution in a residual mode to realize a characterization enhancement module based on the asymmetric convolution; the asymmetric convolution is to transform an n×n convolution kernel into three parallel convolution kernels of n×n, 1×n, and n×1; and unwrapping 1 xn and n 1 through the center of the n xn convolution kernel; after training, directly fusing the n×n convolution kernels with the 1×n and n×1 convolution kernels, and adding a nonlinear activation function between the 1×n and n×1 convolution kernels;
adding SE channel attention to each layer of conventional convolution and asymmetric convolution to construct a characteristic attention module based on the channel attention;
step 3, inputting the training data set into an improved lightweight YOLO v5 model for training, and obtaining a trained improved lightweight YOLO v5 model;
and 4, inputting the test data set into a trained improved lightweight YOLO v5 model to obtain a detection and identification result.
2. A lightweight SAR image ship target detection system based on YOLO v5 is characterized by comprising:
the SAR image ship target simulation data set and the public SAR ship detection data set are obtained through simulation imaging, and the SAR image is preprocessed and divided into a training data set and a testing data set;
the second module is used for building an improved lightweight YOLO v5 model, namely replacing a backbone network of YOLO v5 with a RepVGG network structure, combining a characterization enhancement module and a feature attention module to improve the model, wherein the characterization enhancement module is improved based on asymmetric convolution, the feature attention module is formed based on an SE attention mechanism, and an activation function is replaced with a SiLU activation function;
a lightweight YOLO v5 model of a plurality of RepVGG networks based on multi-module fusion is established, namely a backbone network of the YOLO v5 is replaced by a RepVGG network structure, a new residual branch is newly added in a training stage on the basis of training reasoning double-stage lightweight of the RepVGG, and an asymmetric convolution-based characterization enhancement module, a SE channel attention-based feature attention module and a SiLU activation function are fused;
mixing conventional convolution and asymmetric convolution in a residual mode to realize a characterization enhancement module based on the asymmetric convolution; the asymmetric convolution is to transform an n×n convolution kernel into three parallel convolution kernels of n×n, 1×n, and n×1; and unwrapping 1 xn and n 1 through the center of the n xn convolution kernel; after training, directly fusing the n×n convolution kernels with the 1×n and n×1 convolution kernels, and adding a nonlinear activation function between the 1×n and n×1 convolution kernels;
adding SE channel attention to each layer of conventional convolution and asymmetric convolution to construct a characteristic attention module based on the channel attention;
the third module is used for inputting the training data set into the improved lightweight YOLO v5 model for training, and obtaining a trained improved lightweight YOLO v5 model;
and the fourth module is used for inputting the test data set into the trained improved lightweight YOLO v5 model to obtain a detection and identification result.
3. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method of claim 1 when the program is executed by the processor.
4. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to claim 1.
CN202310342382.5A 2023-03-30 2023-03-30 Lightweight SAR image ship target detection method based on YOLO v5 Active CN116343045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310342382.5A CN116343045B (en) 2023-03-30 2023-03-30 Lightweight SAR image ship target detection method based on YOLO v5

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310342382.5A CN116343045B (en) 2023-03-30 2023-03-30 Lightweight SAR image ship target detection method based on YOLO v5

Publications (2)

Publication Number Publication Date
CN116343045A CN116343045A (en) 2023-06-27
CN116343045B true CN116343045B (en) 2024-03-19

Family

ID=86883871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310342382.5A Active CN116343045B (en) 2023-03-30 2023-03-30 Lightweight SAR image ship target detection method based on YOLO v5

Country Status (1)

Country Link
CN (1) CN116343045B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116958907B (en) * 2023-09-18 2023-12-26 四川泓宝润业工程技术有限公司 Method and system for inspecting surrounding hidden danger targets of gas pipeline
CN117274192A (en) * 2023-09-20 2023-12-22 重庆市荣冠科技有限公司 Pipeline magnetic flux leakage defect detection method based on improved YOLOv5
CN117115170B (en) * 2023-10-25 2024-01-12 安徽大学 Self-adaptive SAR ship detection method and system in unsupervised domain

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB202113615D0 (en) * 2021-09-23 2021-11-10 Ucl Business Ltd Computer-implemented method of enhancing object detection in a digital image of known underlying structure,& corresponding module, data processing apparatus
CN114155445A (en) * 2021-11-23 2022-03-08 北京理工大学 SAR image target detection method based on improved YOLOv3
CN115047455A (en) * 2022-05-27 2022-09-13 南京理工大学 Lightweight SAR image ship target detection method
CN115063665A (en) * 2022-07-05 2022-09-16 西安邮电大学 A Lightweight Fire Detection Method Based on Weighted Bidirectional Feature Pyramid Network
CN115100457A (en) * 2022-06-02 2022-09-23 西安电子科技大学 A SAR image target detection method based on combined deep learning and CFAR
CN115205667A (en) * 2022-08-02 2022-10-18 江苏大学 A Dense Object Detection Method Based on YOLOv5s
CN115311194A (en) * 2022-05-23 2022-11-08 湘潭大学 Automatic CT liver image segmentation method based on transformer and SE block
CN115546259A (en) * 2022-09-22 2022-12-30 成都思晗科技股份有限公司 Multi-target tracking method used in complex scene of transformer substation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113269237B (en) * 2021-05-10 2022-12-27 青岛理工大学 Assembly change detection method, device and medium based on attention mechanism

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB202113615D0 (en) * 2021-09-23 2021-11-10 Ucl Business Ltd Computer-implemented method of enhancing object detection in a digital image of known underlying structure,& corresponding module, data processing apparatus
CN114155445A (en) * 2021-11-23 2022-03-08 北京理工大学 SAR image target detection method based on improved YOLOv3
CN115311194A (en) * 2022-05-23 2022-11-08 湘潭大学 Automatic CT liver image segmentation method based on transformer and SE block
CN115047455A (en) * 2022-05-27 2022-09-13 南京理工大学 Lightweight SAR image ship target detection method
CN115100457A (en) * 2022-06-02 2022-09-23 西安电子科技大学 A SAR image target detection method based on combined deep learning and CFAR
CN115063665A (en) * 2022-07-05 2022-09-16 西安邮电大学 A Lightweight Fire Detection Method Based on Weighted Bidirectional Feature Pyramid Network
CN115205667A (en) * 2022-08-02 2022-10-18 江苏大学 A Dense Object Detection Method Based on YOLOv5s
CN115546259A (en) * 2022-09-22 2022-12-30 成都思晗科技股份有限公司 Multi-target tracking method used in complex scene of transformer substation

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
High Precision Feature Fast Extraction Strategy for Aircraft Attitude Sensor Fault Based on RepVGG and SENet Attention Mechanism;Zhen Jia 等;《sensors》;1-12 *
RepVGG: Making VGG-style ConvNets Great Again;Xiaohan Ding 等;《2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition》;13728-13737 *
基于RB-YOLO生活垃圾实时检测算法;董霄霄 等;《智能计算机与应用》;第11卷(第10期);5-11、19 *
基于改进RepVGG网络的车道线检测算法;杨鹏强 等;《交通信息与安全》;73-81 *
多变环境下基于多尺度卷积网络的猪个体识别;王荣 等;《江西农业大学学报》;第42卷(第2期);391-400 *

Also Published As

Publication number Publication date
CN116343045A (en) 2023-06-27

Similar Documents

Publication Publication Date Title
CN116343045B (en) Lightweight SAR image ship target detection method based on YOLO v5
CN110211137B (en) Satellite image segmentation method based on residual error network and U-Net segmentation network
CN108460382B (en) Optical remote sensing image ship detection method based on deep learning single-step detector
Liu et al. Two-stage underwater object detection network using swin transformer
CN113569667B (en) Inland ship target identification method and system based on lightweight neural network model
CN109902715B (en) Infrared dim target detection method based on context aggregation network
CN112149591B (en) SSD-AEFF automatic bridge detection method and system for SAR image
CN111046917B (en) Object-based enhanced target detection method based on deep neural network
CN117911760B (en) Ship detection method in multi-scale SAR images based on attention mechanism
Yang et al. An effective and lightweight hybrid network for object detection in remote sensing images
Chen et al. Underwater target detection algorithm based on YOLO and Swin transformer for sonar images
CN118628898A (en) Underwater sonar image target detection method and system based on neural network
Wang et al. Underground defects detection based on GPR by fusing simple linear iterative clustering phash (SLIC-Phash) and convolutional block attention module (CBAM)-YOLOv8
CN116310837A (en) A SAR ship target rotation detection method and system
Yang et al. A lightweight underwater target detection network for forward-looking sonar images
CN118628905A (en) A multi-scale feature enhanced deep learning SAR ship detection method
Lin et al. Dcea: Detr with concentrated deformable attention for end-to-end ship detection in sar images
Wang et al. MSSD-Net: Multi-Scale SAR Ship Detection Network
Song et al. Dense face network: A dense face detector based on global context and visual attention mechanism
CN118799622A (en) A method for detecting waterway ships and navigation marks based on improved YOLOv8s algorithm
CN116486203B (en) Single-target tracking method based on twin network and online template updating
CN118053102A (en) Deep learning-based marine ship identification method
Guo et al. A Surface Target Recognition Algorithm Based on Coordinate Attention and Double‐Layer Cascade
CN119540703B (en) Deep learning-based SAR ship directional detection method, device, equipment and medium
Wang et al. Small Target Detection Algorithm of Edge Scene Based on Improved YOLOv8

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant