Sea surface small target rapid detection method and device based on improved lightweight model, medium and program product
Through the improved lightweight MobileOne-YOLOv5 model, combined with data enhancement and optimization of loss function, the accuracy and speed problems of small object detection algorithms in the complex sea surface are solved, and high-precision and real-time small object detection effects are achieved. It is suitable for embedded edge devices with limited computing resources.
Patent Information
- Application Number
- CN202411924471.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art has problems with the accuracy and speed of small object detection algorithms in the complex sea surface background, especially in embedded edge devices with limited computing resources, which are difficult to achieve real-time and high-precision detection.
The improved lightweight MobileOne-YOLOv5 model is adopted, and the model inference is accelerated using the lightweight MobileOne backbone network and GhostBlock structure, combining data augmentation and optimization of loss functions (such as SIOU loss functions), and the model inference is accelerated using reparameterization technology at the inference stage.
It realizes high-precision small object detection under complex sea surface lighting and fog backgrounds, reduces the computational volume and improves the acceleration performance of model inference at the edge, and meets the real-time detection requirements of the unmanned boat embedded platform.
Smart Images

Figure CN119851191A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target detection, and in particular to a method, device, medium and program product for quickly detecting small targets on the sea surface based on an improved lightweight model. Background Art
[0002] Traditional unmanned boats use marine radars to detect obstacles such as ships on the sea surface for obstacle avoidance, which can effectively obtain information about the distance, direction and relative speed of obstacles, so as to maneuver and avoid obstacles. Due to the complex sea surface environment, such as the influence of sea surface clutter, ordinary marine radar detection produces a large number of false alarms, causing the unmanned boat to produce a large number of invalid maneuvers and unable to achieve accurate obstacle avoidance. Traditional image processing algorithms use manual features or are based on the prior knowledge that the target is located near the sea-sky line to detect sea surface targets when weather and lighting conditions are good. However, a large number of false alarms will still be generated under complex lighting conditions, fog and complex weather on the sea surface, with poor normalization performance and great difficulty in optimization.
[0003] In recent years, the target detection algorithm based on deep convolutional neural network has made great breakthroughs. The deep convolutional neural network has stronger adaptive feature extraction ability. The target detection algorithm based on deep convolutional neural network can achieve end-to-end training optimization. Thanks to the convolutional network of big data, it can learn more realistic data distribution characteristics from the data, has stronger generalization performance, and is more suitable for target detection tasks in complex sea environments. At present, target detection based on deep learning is mainly divided into two categories: two-stage target detection algorithm and one-stage target detection algorithm; the idea of the two-stage target detection algorithm is to detect all possible foreground boxes in the image as candidate boxes in the first stage, and in the second stage, the target ROI is obtained by fine regression and classification to finally obtain the target detection box and its recognition category. Although this type of method has certain detection capabilities, it is difficult to apply to embedded edge devices with limited computing resources due to the large number of model parameters and high model calculation complexity, and cannot meet the real-time requirements.
[0004] Compared with the two-stage target detection algorithm, the single-stage target detection algorithm (OneStage) represented by YOLO and SSD series integrates the target position prediction and category probability prediction into a neural network to achieve end-to-end training and reasoning, with less computational complexity. In addition, with the optimization and iteration of the algorithms of end-to-end target detection algorithms such as YOLOv2-YOLOv5 in recent years, the accuracy has gradually caught up with or even exceeded some two-stage end target detection algorithms. However, the accuracy and model lightweight of embedded small target detection in unmanned boats still cannot meet the requirements. Summary of the invention
[0005] The present invention aims to provide a method, device, medium and program product for rapid detection of small targets on the sea surface based on an improved lightweight model, so as to solve the problems of accuracy and speed of the small target detection algorithm against complex background of the sea surface.
[0006] In a first aspect, the present invention provides a method for quickly detecting small targets on the sea surface based on an improved lightweight model, comprising the following steps:
[0007] Step 1: collect and annotate images of small targets of real sea surface ships;
[0008] Step 2: Perform data enhancement on the annotated image;
[0009] Step 3: construct an improved lightweight MobileOne-YOLOv5 model;
[0010] Step 4: Optimize the loss function;
[0011] Step 5, training the lightweight MobileOne-YOLOv5 model based on the data-enhanced image and the optimized loss function;
[0012] Step 6: Reparameterize the MobileOne backbone network of the lightweight MobileOne-YOLOv5 model using the reparameterization technology in the inference stage;
[0013] Step 7: Collect real images of small sea surface ship targets and send them into the trained heavy-parameterized lightweight MobileOne-YOLOv5 model for reasoning, and finally obtain the prediction results of small sea surface ship targets.
[0014] In some embodiments, step one comprises:
[0015] Real infrared and visible light fixed-focus cameras are used to collect sea surface video data of real scenes including ships and buoys, and frame extraction is used to obtain a large amount of infrared and visible light image data, that is, real sea surface ship small target images are obtained, which contain various complex lighting and foggy sea surface backgrounds;
[0016] The LabelImg open source labeling tool is used to label the collected real sea surface ship small target images. The target types are ships and buoys. Therefore, rectangular frames can be used to label the ships and buoy targets in the collected images. After the labeling is completed, the data set obtained contains targets of different scales.
[0017] In some embodiments, in step 2, random brightness, random contrast and random uniform fog noise data enhancement are added to perform data enhancement on the image online during training to adapt to the complex illumination and foggy background of the sea surface.
[0018] In some embodiments, in step three, constructing an improved lightweight MobileOne-YOLOv5 model includes: introducing a lightweight MobileOne backbone network to replace the original C3 structure in the YOLOv5 network, and improving the C3 structure in the Neck feature fusion module PAN to a lightweight module unit based on the GhostBlock structure, and finally obtaining an improved lightweight MobileOne-YOLOv5 model structure.
[0019] In some embodiments, the improved lightweight MobileOne-YOLOv5 model includes a MobileOne backbone network, a GhostBlock-based feature fusion module GhostBlock_PAFPN and a detection head; the MobileOne backbone network includes 6 re-parameterizable MobileOneBlock structural units, wherein, in the inference stage, the MobileOne backbone network uses re-parameterization technology to merge multi-branch 1×1 convolution and 3x3 convolution kernel parameters into one convolution kernel to transform the multi-branch structure in the training stage into an ordinary convolution structure; the feature fusion module GhostBlock_PAFPN includes a lightweight module unit based on the GhostBlock structure; the GhostBlock structure is composed of k GhostBottlenecks stacked in series;.
[0020] In some embodiments, in step four, the optimized loss function is a SIOU loss function.
[0021] In some embodiments, in step five, when the data-enhanced image is input into the lightweight MobileOne-YOLOv5 model for training, the image size is adjusted to enhance the model's ability to detect small targets of surface ships.
[0022] In a second aspect, the present invention further provides an electronic device, comprising:
[0023] at least one processor; and a memory communicatively coupled to the at least one processor;
[0024] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the above method by executing the instructions stored in the memory.
[0025] In a third aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store instructions, and when the instructions are executed, the above method is implemented.
[0026] In a fourth aspect, the present invention further provides a computer program product, which, when called by a computer, enables the computer to execute the above method.
[0027] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0028] 1. Based on the original data enhancement of YOLOv5, the present invention adds random brightness, random contrast and random uniform fog noise data enhancement. Compared with the original algorithm, it can enhance the anti-interference ability of complex sea surface illumination and fog to adapt to the complex sea surface illumination and fog background.
[0029] 2. The improved lightweight MobileOne-YOLOv5 model structure of the present invention makes the algorithm model lighter by introducing lightweight MobileOneBlock structure and GhostBlock structure, effectively reducing the amount of calculation and enhancing the model's ability to extract features. In the reasoning stage, the heavy parameterization technology is used to transform the MobileOneBlock structure into 3×3 and 1×1 straight barrel convolution forms, further enhancing the model's reasoning acceleration performance at the edge.
[0030] 3. The present invention replaces the CIOU loss function with the SIOU loss function, which further enhances the model convergence performance and learning ability, speeds up the training speed of the original model and improves the final accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 The figure is a flow chart of a method for rapid detection of small targets on the sea surface based on an improved lightweight model in an embodiment of the present invention.
[0032] Figure 2 Schematic diagram of the structure of the lightweight MobileOne-YOLOv5 model in an embodiment of the present invention.
[0033] Figure 3 Schematic diagram of the structure of the MobileOne backbone network of the lightweight MobileOne-YOLOv5 model in an embodiment of the present invention.
[0034] Figure 4 Schematic diagram of the GhostBlock structure in an embodiment of the present invention.
[0035] Figure 5 It is a schematic diagram of the GhostBottleneck and GhsotModule structures, which are the constituent units of the GhostBlock structure in an embodiment of the present invention.
[0036] Figure 6 It is a schematic diagram of the principle of SIOU modeling angle loss in an embodiment of the present invention.
[0037] Figure 7 Schematic diagram of the principle of SIOU modeling distance loss in an embodiment of the present invention.
[0038] Figure 8 This is the effect of detecting small targets on the sea surface under visible light in an embodiment of the present invention.
[0039] Fig. 9 This is the sea surface infrared small target detection effect in an embodiment of the present invention.
[0040] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0042] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Example
[0044] The accuracy and speed of the small target detection algorithm in the complex background of the sea surface are problematic, such as Figure 1 As shown, this embodiment proposes a method for rapid detection of small targets on the sea surface based on an improved lightweight model, which has less computational effort and higher small target detection performance, and is more suitable for real-time small target detection in complex sea surface environments of unmanned boat embedded platforms. The method comprises the following steps:
[0045] Step 1: collect and annotate images of small targets of real sea surface ships;
[0046] In some embodiments, step one specifically includes:
[0047] Real infrared and visible light fixed-focus cameras are used to collect sea surface video data of real scenes including ships and buoys, and frame extraction is used to obtain a large amount of infrared and visible light image data, that is, real sea surface ship small target images are obtained, which contain various complex lighting and foggy sea surface backgrounds;
[0048] The LabelImg open source labeling tool is used to label the collected real sea surface ship small target images. The target types are ships and buoys. Therefore, rectangular frames can be used to label the ship and buoy targets in the collected images. After the labeling is completed, the data set obtained contains three scales of targets, large, medium and small, among which the number of small targets less than 20×20 pixels accounts for more than 60%; finally, the labeled data set is divided into training set and test set according to 7:3 to prepare for training.
[0049] Step 2: Perform data enhancement on the annotated image;
[0050] In some embodiments, random brightness, random contrast and random uniform fog noise data enhancement are added on the basis of the original data enhancement methods of YOLOv5 (such as mosaic data enhancement, random color jitter, random scaling, random left and right mirroring, random translation and shearing transformation and random rotation, etc.), which are used to perform data enhancement on images online during training to adapt to the complex lighting and foggy background of the sea surface.
[0051] Among them, the random uniform fog noise data enhancement method is based on the atmospheric dark channel prior fog model. The specific formula of the dark channel prior fog model is:
[0052] I(x)=t(x)J(x)+(1-t(x))A
[0053] Among them, t(x) is the transmittance value, J(x) represents the current image, A is the global atmospheric light value, and I(x) is the image after fogging. The calculation of the global atmospheric light value A is divided into two steps: (1) Find the dark channel map of the foggy image, and take the top 0.1% of the brightest pixels from the dark channel map according to the brightness; (2) Among these positions, find the corresponding point with the highest brightness in the original foggy image I(x) as the global atmospheric light value A. The specific process of random fog addition is to randomly generate a transmittance value t(x) between 0 and 1 and perform the inverse process of image defogging on the original image. Since the same transmittance is used for all pixels in the image, the superimposed fog effect is uniform fog. This method can randomly add uniform fog disturbance during training.
[0054] Step 3: construct an improved lightweight MobileOne-YOLOv5 model;
[0055] In some embodiments, constructing an improved lightweight MobileOne-YOLOv5 model includes: introducing a lightweight MobileOne backbone network to replace the original C3 structure in the YOLOv5 network, and improving the C3 structure in the Neck feature fusion module PAN to a lightweight module unit based on the GhostBlock structure, and finally obtaining an improved lightweight MobileOne-YOLOv5 model structure.
[0056] The structure of the improved lightweight MobileOne-YOLOv5 model is as follows Figure 2 As shown, the improved lightweight MobileOne-YOLOv5 model includes a MobileOne backbone network, a GhostBlock-based feature fusion module GhostBlock_PAFPN, and a detection head.
[0057] Specifically, the MobileOne backbone network includes 6 reparameterizable MobileOneBlock structural units, the structure of which is as follows: Figure 3 As shown in Figure 1, the MobileOneBlock structural unit is designed based on MobileNetV1 and absorbs the RepVGG re-parameterization idea. During the training phase, the structure of the MobileOneBlock structural unit is: Figure 3 As shown on the left, the first submodule of the MobileOneBlock structural unit is mainly composed of k 3×3 depthwise separable convolutions, 1 1×1 depthwise separable convolution and 1 BN layer in parallel. The corresponding linear addition operation is performed on the corresponding positions of each channel of the output of these three substructures, and the result of the addition is activated using the nonlinear activation function ReLU; the second submodule is mainly composed of k 1×1 ordinary convolutions and 1 BN layer. The outputs of these two substructures also perform linear addition of each channel, and then use the nonlinear activation function ReLU for activation. Figure 3 As shown on the right, in the inference phase, the multi-branch 1×1 convolution and 3x3 convolution kernel parameters are merged into one convolution kernel through the reparameterization technology, which converts the multi-branch structure in the training phase into a common convolution structure, further reducing the amount of calculation in actual use. Figure 2 As shown, the number of branches k in the 6 MobileOneBlock structural units of the MobileOne backbone network is [1, 2, 8, 5, 5, 1].
[0058] like Figure 2 The feature fusion module GhostBlock_PAFPN shown in FIG. 1 improves the C3 structure in the Neck feature fusion module PAN in the original YOLOv5 network into a lightweight module unit based on the GhostBlock structure. The GhostBlock structure is as follows: Figure 4 As shown in FIG. 1 , the GhostBlock structure is formed by stacking k GhostBottlenecks in series, and in this embodiment, k=1. Figure 5As shown in the figure, the structure of GhostBottleneck is mainly composed of the core module ChostModule. The core module ChostModule adopts the ordinary convolution method to first generate some intrinsic feature maps. Specifically, a 1×1 convolution is used to reduce the dimension of the input channel to half of the output channel, and then a 5×5 depth-separable convolution and its own Concat are used to obtain the number of channels required for the output. Compared with ordinary convolution, GhostModule uses cheap linear operations to enhance features and increase channels. While reducing the amount of calculation, it enhances the feature extraction capability.
[0059] like Figure 5 There are two main forms of GhostBottleneck structures. The first one is used when the input and output channels are equal and the convolution stride = 1, that is, the standard residual structure consisting of 2 GhostModules stacked; the second form of structure is used in other cases, mainly for spatial downsampling with stride = 2 and the case where the input and output channels are not equal, a 5×5 depth-wise separable convolution and a 1×1 labeled channel dimensionality reduction convolution are added to the residual branch.
[0060] The improved lightweight MobileOne-YOLOv5 model structure in this embodiment mainly improves the backbone network with large computational complexity in the original YOLOv5 into a lightweight network structure MobileOne, and improves the feature fusion module into a GhostBlock_PAFPN structure based on GhostBlock, thereby greatly reducing the model computational complexity while ensuring the feature extraction capability of the model.
[0061] Step 4: Optimize the loss function;
[0062] In some embodiments, the SIOU loss function is used to replace the original CIOU loss function as the loss function of the lightweight MobileOne-YOLOv5 model. The original YOLOv5 network uses CIOU as its loss function, which fully considers the three factors of IOU, center distance and aspect ratio, but does not consider the angle information between the predicted box and the real box. The SIOU loss function introduces angle information to guide the model to converge along the X-axis and Y-axis directions, and redefines IOU, center distance and shape loss, which further accelerates the convergence speed of the model. Therefore, the SIOU loss function consists of four loss functions, namely angle loss, distance loss, shape loss and IOU loss. The specific formula is as follows:
[0063] (1) Angle Cost
[0064] The center angle between the predicted box and the real box is as follows Figure 6 As shown, the angle loss formula is defined as follows:
[0065]
[0066] in:
[0067]
[0068] (2) Distance cost
[0069] The distance between the center of the predicted box and the real box is as follows Figure 7 As shown, the distance loss formula is defined as follows:
[0070]
[0071] in:
[0072]
[0073] Note that the distance loss introduces the angle loss Λ mentioned above.
[0074] (3) Shape cost
[0075] The shape loss formula is defined as follows:
[0076]
[0077] in:
[0078]
[0079] (4) IoU cost
[0080] The IoU loss formula is defined as follows:
[0081] L IoUCost =1-IoU
[0082] The final form of SIOU takes into account the above four losses and unifies them into one expression as the expression of the final loss function:
[0083]
[0084] Step 5, training the lightweight MobileOne-YOLOv5 model based on the data-enhanced image and the optimized loss function;
[0085] In some embodiments, when the image based on data enhancement is input into the lightweight MobileOne-YOLOv5 model for training, the image size is adjusted to enhance the model's ability to detect small targets of surface ships; for example, the input image size can be adjusted from 640×640 to 800×480, so that the lightweight MobileOne-YOLOv5 model can also perceive more detailed information of small targets in the receptive field to improve the ability to detect small targets of surface ships;
[0086] In some embodiments, the learning rate is dynamically adjusted using warmup and cosine annealing algorithms during training, and the optimal model is obtained after training is completed. Specifically, the bias of the convolution parameters in the warmup phase increases from 0.1 to 0.01, and the other parameters increase from 0 to 0.01. At the end of the warmup phase, the cosine annealing algorithm is used to gradually reduce the learning rate with the training epoch. The sliding average EMA algorithm is used to update the model parameters in each epoch, and the optimal model is saved.
[0087] Step six, in the inference stage, the MobileOne backbone network of the lightweight MobileOne-YOLOv5 model is reparameterized using the reparameterization technology to further improve the model edge inference acceleration performance.
[0088] Step 7: Collect the real sea surface ship small target image and send it to the trained heavy parameterized lightweight MobileOne-YOLOv5 model for inference, and finally obtain the prediction result of the sea surface ship small target. In some embodiments, the candidate prediction box inferred can be used to use non-maximum suppression (NMS) to finally obtain accurate recognition results of sea surface ship small targets. In this embodiment, the recognition result is as follows Figure 8 and Fig. 9 It should be noted that the actual deployment platform of the improved lightweight MobileOne-YOLOv5 model of the present invention is the embedded Arm core board RK3399Pro of the unmanned boat. The INT8 computing power of the chip deep learning acceleration engine NPU is 3TOPs, and the measured model forward reasoning time is 42ms, which meets the actual algorithm low-latency operation requirements.
[0089] Based on the same technical concept, an embodiment of the present invention further provides an electronic device, which can implement the process of the method for rapid detection of small targets on the sea surface based on the improved lightweight model provided in the above embodiment of the present application. In one embodiment, the electronic device can be a server, or a terminal device or other electronic device. Fig.10 As shown, the electronic device may include:
[0090] At least one processor, and a memory connected to the at least one processor. The specific connection medium between the processor and the memory is not limited in the embodiment of the present invention. Fig.10 The example in this article is that the processor and memory are connected through a bus. Fig.10 The connections between other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into address bus, data bus, control bus, etc. Fig.10 In the diagram, only one thick line is used, but this does not mean that there is only one bus or only one type of bus. Alternatively, a processor can also be called a controller, and there is no limitation on the name.
[0091] In an embodiment of the present invention, the memory stores instructions that can be executed by at least one processor. By executing the instructions stored in the memory, the at least one processor can execute the method for rapid detection of small sea targets based on an improved lightweight model discussed above. The processor can implement Fig.10 The functions of each module in the device shown.
[0092] Among them, the processor is the control center of the device, which can use various interfaces and lines to connect the various parts of the entire control device, and monitor the device as a whole by running or executing instructions stored in the memory and calling data stored in the memory, various functions of the device and processing data.
[0093] In an optional design, the processor may include one or more processing units, and the processor may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor. In some embodiments, the processor and the memory may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0094] The processor may be a general-purpose processor, such as a CPU, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of a method for rapid detection of small targets on the sea surface based on an improved lightweight model disclosed in the embodiments of the present invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0095] As a non-volatile computer-readable storage medium, the memory can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present invention can also be a circuit or any other device that can realize a storage function, used to store program instructions and / or data.
[0096] By designing and programming the processor, the code corresponding to the method for rapidly detecting small sea targets based on an improved lightweight model described in the aforementioned embodiment can be fixed into the chip, so that the chip can perform the steps of the method for rapidly detecting small sea targets based on an improved lightweight model in the aforementioned embodiment when running. How to design and program the processor is a technique known to those skilled in the art and will not be described in detail here.
[0097] Based on the same inventive concept, an embodiment of the present invention further provides a storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer executes a method for rapid detection of small sea targets based on an improved lightweight model discussed above.
[0098] In some optional embodiments, the present application also provides various aspects of a method for rapid detection of small sea surface targets based on an improved lightweight model, which can also be implemented in the form of a program product, which includes program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of a method for rapid detection of small sea surface targets based on an improved lightweight model according to various exemplary embodiments of the present application described above in this specification.
[0099] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of a unit described above can be further divided into multiple units to be embodied. In addition, although the operation of the method of the present application is described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.
[0100] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0101] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the 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 the 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 generate a server, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. 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.
[0102] Program code for performing the operations of the present application may be written using any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0103] Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0104] 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.
[0105] 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 The steps for the functions specified in one or more boxes.
[0106] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for rapid detection of small targets on the sea surface based on an improved lightweight model, characterized in that: The steps include: Step 1: collect and annotate images of small targets of real sea surface ships; Step 2: Perform data enhancement on the annotated image; Step 3: construct an improved lightweight MobileOne-YOLOv5 model; Step 4: Optimize the loss function; Step 5, training the lightweight MobileOne-YOLOv5 model based on the data-enhanced image and the optimized loss function; Step 6: Reparameterize the MobileOne backbone network of the lightweight MobileOne-YOLOv5 model using the reparameterization technology in the inference stage; Step 7: Collect real images of small sea surface ship targets and send them into the trained heavy-parameterized lightweight MobileOne-YOLOv5 model for reasoning, and finally obtain the prediction results of small sea surface ship targets.
2. The method for rapid detection of small sea targets based on an improved lightweight model according to claim 1, characterized in that: Step one includes: Real infrared and visible light fixed-focus cameras are used to collect sea surface video data of real scenes including ships and buoys, and frame extraction is used to obtain a large amount of infrared and visible light image data, that is, real sea surface ship small target images are obtained, which contain various complex lighting and foggy sea surface backgrounds; The LabelImg open source labeling tool is used to label the collected real sea surface ship small target images. The target types are ships and buoys. Therefore, rectangular frames can be used to label the ships and buoy targets in the collected images. After the labeling is completed, the data set obtained contains targets of different scales.
3. The method for rapid detection of small sea targets based on an improved lightweight model according to claim 1, characterized in that: In step 2, random brightness, random contrast, and random uniform fog noise data enhancement are added to perform online data enhancement on images during training to adapt to the complex lighting and foggy background of the sea surface.
4. The method for rapid detection of small targets on the sea surface based on an improved lightweight model according to claim 1, characterized in that: In step three, constructing an improved lightweight MobileOne-YOLOv5 model includes: introducing a lightweight MobileOne backbone network to replace the original C3 structure in the YOLOv5 network, and improving the C3 structure in the Neck feature fusion module PAN to a lightweight module unit based on the GhostBlock structure, and finally obtaining an improved lightweight MobileOne-YOLOv5 model structure.
5. The method for rapid detection of small sea targets based on an improved lightweight model according to claim 4, characterized in that: The improved lightweight MobileOne-YOLOv5 model includes a MobileOne backbone network, a GhostBlock-based feature fusion module GhostBlock_PAFPN and a detection head; the MobileOne backbone network includes 6 re-parameterizable MobileOneBlock structural units, wherein, in the inference stage, the MobileOne backbone network uses the re-parameterization technology to merge the multi-branch 1×1 convolution and 3x3 convolution kernel parameters into one convolution kernel to transform the multi-branch structure in the training stage into an ordinary convolution structure; the feature fusion module GhostBlock_PAFPN includes a lightweight module unit based on the GhostBlock structure; the GhostBlock structure is composed of k GhostBottlenecks stacked in series;.
6. The method for rapid detection of small sea targets based on an improved lightweight model according to claim 1, characterized in that: In step 4, the optimized loss function is the SIOU loss function.
7. The method for rapid detection of small sea targets based on an improved lightweight model according to claim 1, characterized in that: In step five, when the image based on data enhancement is input into the lightweight MobileOne-YOLOv5 model for training, the image size is adjusted to enhance the model's ability to detect small targets of surface ships.
8. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the method as described in any one of claims 1 to 7 by executing the instructions stored in the memory.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that When the computer program product is called by a computer, the computer is caused to execute the method according to any one of claims 1 to 7.