Infrared marine ship detection method based on improved YOLOv7
By improving the YOLOv7 model, using the REP-DSConv-ELAN module and InceptionNeXt module, combined with the bounding box regression loss function of the minimum point distance, the problem of false detection and missed detection in infrared maritime ship detection is solved, the detection accuracy and efficiency are improved, and the Accurate detection of different ship types.
Patent Information
- Application Number
- CN202410679526.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-10
AI Technical Summary
Existing infrared maritime ship detection methods have problems of false detection and missed detection in different scenarios and resolutions, and cannot effectively detect different ship types. Moreover, the model size is large, the number of parameters is large, and the detection accuracy and efficiency are insufficient.
Improve the YOLOv7 model, use the REP-DSConv-ELAN module to replace the ELAN module, introduce the InceptionNeXt module, use the bounding box regression loss function of the minimum point distance to build a lightweight maritime ship detection network, and improve feature extraction capabilities and detection accuracy.
The detection accuracy is improved under different scenarios and resolutions, the model volume and parameter amount are reduced, the detection capability of small ships is enhanced, the false detection and missed detection rates are reduced, and the detection efficiency is improved.
Smart Images

Figure CN118628880A
Abstract
Description
Technical Field
[0001] The invention relates to an infrared marine ship detection method based on improved YOLOv7, and belongs to the technical field of target detection. Background Art
[0002] With the large-scale exploitation of marine resources and the growing prosperity of the marine industry, the development of marine target detection technology is particularly critical, and it plays an important role in monitoring, tracking and confrontation. The existing ship infrared detection methods cannot fully meet the needs of coastal defense in terms of accuracy and real-time performance. Ship infrared detection research is still a hot topic and difficulty and has great practical significance.
[0003] In order to improve the accuracy and efficiency of infrared marine ship detection, researchers have conducted many studies, and a variety of advanced detection algorithms have been introduced. In the paper "Improved YOLOv5 Infrared Ship Target Detection Algorithm", Gu Jing et al. mentioned that the YOLOv5 model was improved, and the Reasoning layer was added to the network to improve the accuracy and real-time performance of marine infrared ship detection under complex backgrounds. In the paper "Infrared Ship Detection Based on Attention Mechanism and Multi-Scale Fusion", Zhang Shen et al. mentioned that by introducing the MobileNetv3 network in the trunk and then introducing the attention mechanism in the neck and using a bidirectional weighted feature pyramid, the detection speed was improved while meeting the detection speed requirements. In the paper "Multi-scale Infrared Target Detection Network Based on YOLO-MIR Algorithm", Zhou Jinjie et al. proposed a multi-scale infrared detection network YOLO-MIR to address the problems of low infrared image detection accuracy and poor robustness, and achieved accurate detection of infrared targets of various scales.
[0004] Although the above improved method has improved the detection accuracy in scenarios with small targets and background interference, it cannot meet the requirements of detecting different types of ships in different scenarios and resolutions, and is prone to problems such as false detection and missed detection. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide an infrared marine ship detection method based on improved YOLOv7, improve the problems of false detection and missed detection in detection under different scenes and resolutions, improve the detection accuracy, and make the model lighter.
[0006] The present invention adopts the following technical solutions to solve the above technical problems:
[0007] An infrared marine ship detection method based on improved YOLOv7 includes the following steps:
[0008] Step 1, obtain infrared marine ship datasets of different scenes, different time periods and different resolutions, and divide the datasets into training sets and test sets;
[0009] Step 2, construct an improved YOLOv7 model, the improved YOLOv7 model includes a backbone network, a neck network and a detection head part, the ELAN module is replaced by the REP-DSConv-ELAN module in the backbone network, the InceptionNeXt module is introduced in the neck network, and the CIoU loss function is replaced by the bounding box regression loss function of the minimum point distance in the detection head part;
[0010] Step 3, using the training set to train the improved YOLOv7 model constructed in step 2 to obtain a marine ship detection model;
[0011] Step 4: Input the test set into the marine ship detection model to obtain the ship type detection results under different scenarios and resolutions.
[0012] As a preferred solution of the present invention, in step 1, the infrared marine ship dataset comes from the infrared open source database released by infiRay, which includes cruise ships, bulk carriers, warships, sailboats, kayaks, container ships and fishing boats at sea, ports and seaside in different scenes, different time periods and different resolutions, and the dataset is divided into a training set and a test set in a ratio of 8:2.
[0013] As a preferred solution of the present invention, in step 2, the backbone network includes a first CBS module, a second CBS module, a third CBS module, a fourth CBS module, a first REP-DSConv-ELAN module, a first MP module, a second REP-DSConv-ELAN module, a second MP module, a third REP-DSConv-ELAN module, a third MP module and a fourth REP-DSConv-ELAN module connected in sequence;
[0014] The neck network includes the fifth to eighth CBS modules, the first to fourth InceptionNeXt modules, the fourth to fifth MP modules, the first to second upsampling modules and the cross-stage feature pyramid pooling module; the output of the second REP-DSConv-ELAN module is used as the input of the fifth CBS module, the output of the third REP-DSConv-ELAN module is used as the input of the sixth CBS module, and the output of the fourth REP-DSConv-ELAN module is used as the input of the cross-stage feature pyramid pooling module; the output of the cross-stage feature pyramid pooling module passes through the seventh CBS module and the first upsampling module in turn, and the output of the first upsampling module is spliced with the output of the sixth CBS module as the first InceptionNe The output of the first InceptionNeXt module passes through the eighth CBS module and the second upsampling module in sequence, and the output of the second upsampling module is spliced with the output of the fifth CBS module as the input of the second InceptionNeXt module; the output of the second InceptionNeXt module passes through the fourth MP module, and the output of the fourth MP module is spliced with the output of the first InceptionNeXt module as the input of the third InceptionNeXt module; the output of the third InceptionNeXt module passes through the fifth MP module, and the output of the fifth MP module is spliced with the output of the cross-stage feature pyramid pooling module as the input of the fourth InceptionNeXt module;
[0015] The detection head part includes the first to third parameter convolution modules and the first to third IDetect detection heads; the output of the second InceptionNeXt module is connected to the first IDetect detection head after passing through the first parameter convolution module, the output of the third InceptionNeXt module is connected to the second IDetect detection head after passing through the second parameter convolution module, and the output of the fourth InceptionNeXt module is connected to the third IDetect detection head after passing through the third parameter convolution module.
[0016] As a preferred solution of the present invention, the first to fourth REP-DSConv-ELAN modules have the same structure, and all include the ninth to eleventh CBS modules, the first to fourth dynamic snake convolution modules, the first to fourth RepVGG residual modules and the efficient channel attention module;
[0017] The input of the entire module is used as the input of the ninth CBS module, and the output of the ninth CBS module is sequentially passed through the first dynamic snake convolution module, the second dynamic snake convolution module, the third dynamic snake convolution module, the fourth dynamic snake convolution module and the efficient channel attention module; the input of the entire module is used as the input of the tenth CBS module, and the output of the tenth CBS module is spliced with the output of the efficient channel attention module, the output of the first dynamic snake convolution module and the output of the second dynamic snake convolution module as the input of the eleventh CBS module, and the output of the eleventh CBS module is used as the output of the entire module;
[0018] The output of the ninth CBS module also passes through the first RepVGG residual module, and the output of the first RepVGG residual module and the output of the first dynamic snake convolution module are used as the input of the second dynamic snake convolution module; the output of the first dynamic snake convolution module also passes through the second RepVGG residual module, and the output of the second RepVGG residual module and the output of the second dynamic snake convolution module are used as the input of the third dynamic snake convolution module; the output of the second dynamic snake convolution module also passes through the third RepVGG residual module, and the output of the third RepVGG residual module and the output of the third dynamic snake convolution module are used as the input of the fourth dynamic snake convolution module; the output of the third dynamic snake convolution module also passes through the fourth RepVGG residual module, and the output of the fourth RepVGG residual module and the output of the fourth dynamic snake convolution module are used as the input of the efficient channel attention module;
[0019] The structures of the first to fourth RepVGG residual modules are the same, and all include a convolution branch and a skip connection branch. The convolution branch includes a convolution layer and a batch normalization, and the skip connection branch includes a batch normalization.
[0020] As a preferred solution of the present invention, the structures of the first to fourth InceptionNeXt modules are the same, and are all composed of a combination of ConvNeXt and Inception. First, the input image channel of the entire module is divided into four branches, one of which performs identity mapping, and the other three branches use strip-shaped large convolution kernels 1×11, 11×1 and ordinary small convolution kernels 3×3 for depth convolution. The results obtained by the four branches are spliced and layer-normalized, and then 1×1 convolution and GELU activation function are used to increase the number of channels to 4 times the number of channels after layer normalization. Next, 1×1 convolution and scaling are used to scale the number of channels, and finally, after regularization, they are spliced with the input image as the output of the entire module.
[0021] As a preferred solution of the present invention, the first to eighth CBS modules have the same structure, all including a convolutional layer, a batch normalization and a SiLU activation function; the first to fifth MP modules have the same structure, all including a maximum pooling layer and a CBS module.
[0022] A computer device comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the steps of the infrared marine ship detection method based on improved YOLOv7 when executing the computer program.
[0023] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the infrared marine ship detection method based on improved YOLOv7 are implemented.
[0024] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0025] 1. The present invention uses a reconstructed REP-DSConv-ELAN structure in the backbone network, so that the backbone network can more accurately capture the detailed information of the ship and improve the feature extraction capability and reasoning speed of the ship image.
[0026] 2. The present invention introduces the InceptionNeXt module in the feature fusion part to increase the receptive field and strengthen the network's utilization of key features of infrared ship targets, thereby reducing the size and number of parameters of the model.
[0027] 3. The present invention uses the minimum point distance bounding box regression loss function (MPDIoU) in the detection head part, which improves the ability to detect small ships and improves the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a flow chart of the infrared marine ship detection method based on improved YOLOv7 of the present invention;
[0029] Figure 2 It is the network structure diagram of improved YOLOv7;
[0030] Figure 3 It is a structural diagram of the REP-DSConv-ELAN module constructed by the present invention;
[0031] Figure 4 are the submodules of the REP-DSConv-ELAN module constructed by the present invention, wherein (a) is a dynamic snake convolution (DSConv) module, (b) is a RepVGG residual module, and (c) is an efficient channel attention (ECA) module;
[0032] Figure 5 It is the InceptionNeXt module introduced in the present invention;
[0033] Figure 6 It is the minimum point distance based bounding box regression loss function (MPDIoU) module in the present invention;
[0034] Figure 7 The following is a comparison of the experimental detection results of the original YOLOv7 model and the improved YOLOv7 model in different scenarios and resolutions, where (a) is nearshore scene detection, (b) is nearshore overlapping dense scene detection, (c) is far sea small target scene detection, and (d) is far sea low-resolution scene detection. DETAILED DESCRIPTION
[0035] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0036] The present invention improves the YOLOv7 model and proposes a real-time and efficient detection algorithm that can improve the problems of false detection and missed detection in different scenes and resolutions. The flow chart is as follows: Figure 1 The specific steps are as follows:
[0037] Step 1: Collect infrared marine ship data set
[0038] The dataset used in this paper comes from the infrared marine ship dataset in the infrared open source database released by infiRay. The database contains 8402 images of cruise ships, bulk carriers, warships, sailboats, kayaks, container ships, and fishing boats at sea, ports, and seaside in different scenes, different time periods, and different resolutions. The original dataset is divided into training set and test set in a ratio of 8:2.
[0039] Step 2: Improve the original YOLOv7 network. The improved algorithm network structure is as follows: Figure 2As shown in the figure, the CBS module consists of a convolution (Conv) layer, a batch normalization (BN) layer, and an activation function (SiLU) layer. The MP module consists of a maximum pooling (Maxpool) layer and CBS. UPSample is an upsampling module, SPPCSPC is a cross-stage feature pyramid pooling module, RepConv is a re-parameterized convolution module, and Concat represents tensor concatenation. The dataset released by infiRay is used, the same parameters are set, and the YOLOv7 pre-trained weights are used. Then, the infiRay dataset is trained on the improved YOLOv7 model for 200 rounds, the batch-size is set to 8, and the SGD optimizer is used. The improvements are mainly in the following three points:
[0040] (1) Reconstruct the REP-DSConv-ELAN structure in the backbone network. Its module structure is shown in the following figure. Figure 3 As shown in Figure 2, the REP-DSConv-ELAN structure replaces the original ELAN module, allowing the backbone network to capture the details of the target object more accurately.
[0041] In order to improve the feature extraction ability and inference speed of the ELAN module in the backbone network for infrared marine ship images, the dynamic snake convolution (DSConv) is used to replace the CBS convolution layer in the original ELAN structure, and the residual branch structure in the RepVGG network is added between the four replaced DSConvs. Finally, the efficient channel attention (ECA) module is introduced to form the REP-DSConv-ELAN module.
[0042] like Figure 4 As shown in (a) of the figure, the principle of DSConv extracting the features of the object to be detected is as follows: the coordinates in the standard two-dimensional convolution are set to K, and the coordinates of the center point are K i =(x i ,y i ). The 3×3 kernel with a dilation factor of 1 is expressed as:
[0043] K={(x-1,y-1),(x-1,y),…,(x+1,y+1)}
[0044] In order to make the convolution kernel more flexible to focus on the complex geometric features of the object to be detected, a deformable bias Δ is introduced. If the model is allowed to freely learn the deformation bias, the receptive field will easily deviate from the target, especially in the case of tubular structures such as ships. Therefore, DSConv adopts an iterative method. Each convolution position is based on its previous position and freely chooses the swing direction. This ensures the continuity of attention and does not cause the receptive field to be too dispersed due to the deformation bias. In DSConv, the standard convolution kernel is straightened in the x-axis and y-axis directions. In a 9×9 convolution kernel, taking the x-axis direction as an example, the specific position of each grid in K is expressed as: K i±c =(x i±c ,y i±c ), where c = {0, 1, 2, 3} represents the horizontal distance from the center grid. Each grid position K in the convolution kernel K i+c The selection of is a cumulative process. From the center position K i Initially, the distance from the center grid position depends on the position of the previous grid: K i With K i+1 Compared to , an offset is added. Therefore, the offset needs to be accumulated to ensure that the convolution kernel conforms to the linear morphology structure.
[0045] In the x-axis direction, the specific position of each grid in K can be expressed as:
[0046]
[0047] In the y-axis direction, the specific position of each grid in K can be expressed as:
[0048]
[0049] Since the offset Δ is usually fractional, the bilinear interpolation performed is as follows:
[0050] K=∑ K′ B(K′,K)·K
[0051] Due to the two-dimensional (x-axis, y-axis) changes, DSConv covers a 9×9 range during the deformation process, which better adapts to the tubular structure based on the dynamic structure, thereby better capturing key features.
[0052] Traditional convolutional networks may have the problem of gradient vanishing, which makes training difficult. In order to avoid this problem, the present invention refers to the residual structure in the RepVGG network, whose structure is as follows Figure 4As shown in (b) in REP-DSConv-ELAN, the structure between each DSConv is adjusted to introduce two additional branches: one is a convolution branch of size 1×1, and the other is a skip connection branch. The convolution branch can adjust the number of input and output channels to keep the number of channels consistent. This design helps to improve the feature extraction efficiency of the network, improve the gradient flow, and reduce the number of parameters and computation of the network.
[0053] In order to better focus on the position and category of the ship target to be detected in the infrared marine ship detection task without being disturbed by background information, the efficient channel attention module (ECA) is introduced into the REP-DSConv-ELAN module. Its structure is as follows: Figure 4 As shown in (c) in the figure. ECA is a lightweight channel attention mechanism that learns channel attention through a 1D convolution layer to reduce computational complexity. In the ECA attention mechanism module, GAP represents the global average pooling operation that converts the input feature map from an H×W×C matrix to a 1×1×C feature vector. The adaptive one-dimensional convolution kernel size k is obtained by calculating the formula, and then the sigmoid function is used to learn the channel attention to obtain the weight of each channel in the feature map. The normalized weight is then multiplied by the original input feature map channel by channel to generate a weighted feature map.
[0054] (2) In the feature fusion part, the InceptionNeXt module is introduced to increase the receptive field and strengthen the network's use of key features of infrared ship targets. At the same time, the neck is also lightened. The ConvNeXt and Inception modules are combined to obtain the InceptionNeXt module of the present invention. The structure diagram of the InceptionNeXt module is shown in the figure. Figure 5 shown.
[0055] The InceptionNeXt module uses a large kernel receptive field to extract a more global feature expression. It divides the input channel of the infrared ship image with an input size of h×w×d. One branch performs identity mapping, and the other three branches use strip-shaped large convolution kernels 1×11, 11×1, and ordinary small convolution kernels 3×3 for depth convolution. The four sets of features obtained are concatenated and layer normalized. Then, the number of channels of the infrared ship image is increased to 4 times the original number using 1×1 convolution and GELU activation function. Next, the number of channels of the ship image is scaled using 1×1 convolution and Layer Scale. Finally, the regularization (Drop Path) operation is performed and the output is concatenated with the input branch. This module improves the problem of slow memory access of traditional large convolution kernels, making the model simple and effective.
[0056] (3) The detection head uses the minimum point distance based IoU (MPDIoU) bounding box regression loss function to replace the original CIoU loss function, which improves the ability to detect small ships and improves the detection accuracy. The structure of the MPDIoU loss function module is as follows: Figure 6 shown.
[0057] The infrared marine ship dataset of the present invention will contain low-quality samples, and geometric factors such as distance and aspect ratio will aggravate the penalty for low-quality infrared ship samples. When the predicted box and the true box have the same aspect ratio but the width and height are completely unequal, most of the existing bounding box regression loss functions cannot optimize it. In order to solve this problem, the present invention introduces a bounding box regression loss function based on minimum point distance (MPDIoU) to achieve more accurate bounding box positioning loss calculation between the predicted box and the true box in infrared marine ship detection. The formula of the MPDIoU loss function is defined as:
[0058]
[0059] Where: and Respectively represent the coordinates of the upper left and lower right points of the real box; and They represent the coordinates of the upper left and lower right points of the prediction box respectively; w and h represent the width and height of the input sample respectively.
[0060] The core idea of the MPDIoU loss function is to introduce a bounding box similarity metric with a minimum point distance, which can more accurately measure the difference between the predicted box and the true box. It contains all the relevant geometric factors in the existing loss function, namely the overlap area ratio (IoU), center point distance, width and aspect ratio, and simplifies the calculation process. Specifically, the MPDIoU loss function calculates the maximum probability distance between the predicted bounding box and the true bounding box, and then uses this distance as the loss value. In this way, even if the two bounding boxes overlap, as long as their positions or shapes are different, the MPDIoU loss function can capture these differences and give a higher loss value.
[0061] Step 3: Train the improved YOLOv7 model
[0062] The improved YOLOv7 model was trained on the datasets released by infiRay. The selected experimental environment configuration and hyperparameters are shown in Table 1 and Table 2 respectively.
[0063] Table 1 Experimental environment platform configuration
[0064] Configuration Name Version parameters GPU NVIDIA GeForce RTX 3090 CPU Intel(R)Xeon(R)Platinum8358P CPU@2.60GHz Deep Learning Frameworks PyTorch 1.11.0 programming language Python 3.8 CUDA 11.3
[0065] Table 2 Some hyper parameters of the algorithm
[0066] Hyperparameter Name Numeric Ir0 0.01 Irf 0.1 momentum 0.937 batch-size 8 epochs 200 workers 4
[0067] Step 4: Use the test set to test the detection performance of the improved YOLOv7
[0068] Load the trained model after the YOLOv7 improvement, perform inference prediction on the test set, and then output the detection of ship types in different scenes and resolutions, and compare the detection effects before and after the model improvement. Figure 7 Table 3 also shows the comparison results between the algorithm of the present invention and other algorithms.
[0069] Table 3 Comparison of the algorithm of the present invention with other algorithms
[0070] algorithm P / % R / % mAP@0.5 / % <![CDATA[FPS(frames -1 )]]> YOLOv4 88.36 84.30 88.93 46.8 YOLOv5m 89.30 87.91 91.07 76.5 YOLOX 90.53 86.56 91.57 73.4 PP-YOLOE 91.18 90.05 92.80 82.6 YOLOv7 91.07 88.66 92.21 82.8 The present invention 95.06 91.21 95.61 81.3
[0071] Based on the same inventive concept, an embodiment of the present application 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 computer program, the steps of the aforementioned infrared marine ship detection method based on improved YOLOv7 are implemented.
[0072] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the aforementioned infrared marine ship detection method based on improved YOLOv7 are implemented.
[0073] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0074] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0075] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0076] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0077] The above embodiments are only for illustrating the technical idea of the present invention, and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.
Claims
1. An infrared marine ship detection method based on improved YOLOv7, characterized in that: The steps include: Step 1, obtain infrared marine ship datasets of different scenes, different time periods and different resolutions, and divide the datasets into training sets and test sets; Step 2, construct an improved YOLOv7 model, the improved YOLOv7 model includes a backbone network, a neck network and a detection head part, the ELAN module is replaced by the REP-DSConv-ELAN module in the backbone network, the InceptionNeXt module is introduced in the neck network, and the CIoU loss function is replaced by the bounding box regression loss function of the minimum point distance in the detection head part; Step 3, using the training set to train the improved YOLOv7 model constructed in step 2 to obtain a marine ship detection model; Step 4: Input the test set into the marine ship detection model to obtain the ship type detection results under different scenarios and resolutions.
2. The infrared marine ship detection method based on improved YOLOv7 according to claim 1 is characterized in that: In step 1, the infrared marine ship dataset comes from the infrared open source database released by infiRay, which includes cruise ships, bulk carriers, warships, sailboats, kayaks, container ships and fishing boats at sea, ports and seaside in different scenes, different time periods and different resolutions. The dataset is divided into a training set and a test set in a ratio of 8:
2.
3. The infrared marine ship detection method based on improved YOLOv7 according to claim 1 is characterized in that: In step 2, the backbone network includes a first CBS module, a second CBS module, a third CBS module, a fourth CBS module, a first REP-DSConv-ELAN module, a first MP module, a second REP-DSConv-ELAN module, a second MP module, a third REP-DSConv-ELAN module, a third MP module, and a fourth REP-DSConv-ELAN module connected in sequence; The neck network includes the fifth to eighth CBS modules, the first to fourth InceptionNeXt modules, the fourth to fifth MP modules, the first to second upsampling modules and the cross-stage feature pyramid pooling module; the output of the second REP-DSConv-ELAN module is used as the input of the fifth CBS module, the output of the third REP-DSConv-ELAN module is used as the input of the sixth CBS module, and the output of the fourth REP-DSConv-ELAN module is used as the input of the cross-stage feature pyramid pooling module; the output of the cross-stage feature pyramid pooling module passes through the seventh CBS module and the first upsampling module in turn, and the output of the first upsampling module is spliced with the output of the sixth CBS module as the first InceptionNe The output of the first InceptionNeXt module passes through the eighth CBS module and the second upsampling module in sequence, and the output of the second upsampling module is spliced with the output of the fifth CBS module as the input of the second InceptionNeXt module; the output of the second InceptionNeXt module passes through the fourth MP module, and the output of the fourth MP module is spliced with the output of the first InceptionNeXt module as the input of the third InceptionNeXt module; the output of the third InceptionNeXt module passes through the fifth MP module, and the output of the fifth MP module is spliced with the output of the cross-stage feature pyramid pooling module as the input of the fourth InceptionNeXt module; The detection head part includes the first to third parameter convolution modules and the first to third IDetect detection heads; the output of the second InceptionNeXt module is connected to the first IDetect detection head after passing through the first parameter convolution module, the output of the third InceptionNeXt module is connected to the second IDetect detection head after passing through the second parameter convolution module, and the output of the fourth InceptionNeXt module is connected to the third IDetect detection head after passing through the third parameter convolution module.
4. The infrared marine ship detection method based on improved YOLOv7 according to claim 3 is characterized in that: The structures of the first to fourth REP-DSConv-ELAN modules are the same, including the ninth to eleventh CBS modules, the first to fourth dynamic snake convolution modules, the first to fourth RepVGG residual modules, and the efficient channel attention module; The input of the entire module is used as the input of the ninth CBS module, and the output of the ninth CBS module is sequentially passed through the first dynamic snake convolution module, the second dynamic snake convolution module, the third dynamic snake convolution module, the fourth dynamic snake convolution module and the efficient channel attention module; the input of the entire module is used as the input of the tenth CBS module, and the output of the tenth CBS module is spliced with the output of the efficient channel attention module, the output of the first dynamic snake convolution module and the output of the second dynamic snake convolution module as the input of the eleventh CBS module, and the output of the eleventh CBS module is used as the output of the entire module; The output of the ninth CBS module also passes through the first RepVGG residual module, and the output of the first RepVGG residual module and the output of the first dynamic snake convolution module are used as the input of the second dynamic snake convolution module; the output of the first dynamic snake convolution module also passes through the second RepVGG residual module, and the output of the second RepVGG residual module and the output of the second dynamic snake convolution module are used as the input of the third dynamic snake convolution module; the output of the second dynamic snake convolution module also passes through the third RepVGG residual module, and the output of the third RepVGG residual module and the output of the third dynamic snake convolution module are used as the input of the fourth dynamic snake convolution module; the output of the third dynamic snake convolution module also passes through the fourth RepVGG residual module, and the output of the fourth RepVGG residual module and the output of the fourth dynamic snake convolution module are used as the input of the efficient channel attention module; The structures of the first to fourth RepVGG residual modules are the same, and all include a convolution branch and a skip connection branch. The convolution branch includes a convolution layer and a batch normalization, and the skip connection branch includes a batch normalization.
5. The infrared marine ship detection method based on improved YOLOv7 according to claim 3 is characterized in that: The structures of the first to fourth InceptionNeXt modules are the same, and are all composed of a combination of ConvNeXt and Inception. First, the input image channel of the entire module is divided into four branches, one of which performs identity mapping, and the other three branches use large strip convolution kernels 1×11, 11×1 and ordinary small convolution kernels 3×3 for depth convolution. The results obtained from the four branches are spliced and layer normalized, and then 1×1 convolution and GELU activation function are used to increase the number of channels to 4 times the number of channels after layer normalization. Next, 1×1 convolution and scaling are used to scale the number of channels, and finally, after regularization, it is spliced with the input image as the output of the entire module.
6. The infrared marine ship detection method based on improved YOLOv7 according to claim 3 is characterized in that: The structures of the first to eighth CBS modules are the same, including a convolutional layer, a batch normalization and a SiLU activation function; the structures of the first to fifth MP modules are the same, including a maximum pooling layer and a CBS module.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the computer program, the steps of the infrared marine ship detection method based on improved YOLOv7 are implemented as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the infrared marine ship detection method based on improved YOLOv7 as described in any one of claims 1 to 6 are implemented.
