Red tide outbreak early warning method and system based on weak target detection
By constructing a small-target enhanced target recognition model based on Yolov8 structure, the problem of weak algae target recognition in the early stage of red tide was solved, and high-precision red tide warning was achieved, achieving a 91.1% recognition accuracy during the outbreak period and an 84.3% early recognition accuracy.
Patent Information
- Application Number
- CN202510615255.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-05-14
AI Technical Summary
Existing computer vision-based methods are difficult to quickly and effectively identify weak algae targets in early red tides, resulting in untimely warnings for red tides.
A small-objective enhanced target recognition model based on Yolov8 structure was constructed, and weak algae targets were identified and early warning were performed through feature extraction, fusion, target detection and incremental training.
The 91.1% recognition accuracy of images during the red tide explosion period was achieved, and the 84.3% recognition accuracy of images in the early stages of red tide were effectively identified, and the red tide images at different stages were realized to realize automated red tide warning.
Smart Images

Figure CN120472352A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of red tide early warning, and in particular to a red tide outbreak early warning method and system based on weak target detection. Background Art
[0002] Red tides are marine ecological disasters caused by the abnormal proliferation of phytoplankton. Their detection and early warning are crucial for fishery protection and marine ecological security. Traditional red tide early warning methods typically rely on satellite remote sensing analysis, on-site sampling and testing, and high-altitude visual inspection. However, in the early stages of a red tide, algae are sparsely distributed and their color signatures are faint. Traditional methods are limited by signal strength and environmental interference, making it difficult to quickly and effectively identify and issue warnings for red tides.
[0003] Existing computer vision-based methods can quickly and effectively identify abnormal seawater conditions, such as red tides. However, in the early stages of a red tide, when algae are relatively small, the accuracy of these methods for identifying faint targets needs to be improved. Therefore, developing a system that can accurately detect faint algae targets in the early stages of a red tide and issue early warnings has important practical applications. Summary of the Invention
[0004] To address the difficulty existing computer vision methods face in identifying faint algae at the onset of red tide, a small target enhancement target recognition model based on the Yolov8 architecture was proposed to accurately identify faint algae. The model comprehensively assesses the color gamut, density, and area of the identified faint algae. Automated sample collection technology automatically collects samples from the area for further analysis, and issues warnings if thresholds are exceeded.
[0005] In a first aspect, the present invention provides a red tide outbreak early warning method based on weak target detection, which adopts the following technical solutions: A red tide outbreak early warning method based on weak target detection, comprising: Obtain red tide dataset images and perform image preprocessing using Gaussian filtering; A weak target detection enhancement model based on Yolov8 structure is constructed, and the features of red tide dataset images are extracted using the weak target detection enhancement model based on Yolov8 structure. Perform feature fusion on the extracted features; Perform target detection based on the fused features and perform incremental training on the enhanced model for weak target detection based on the target detection results; Use the trained weak target detection enhancement model to provide red tide early warning.
[0006] Furthermore, the weak target detection enhancement model based on Yolov8 structure is used to extract features from the red tide dataset image, including: , where C is the number of channels, W is the image width, and H is the image height. First, the input image is input into the backbone network to extract feature information. The backbone network gradually reduces the size of the feature map from shallow to deep and expands the number of channels.
[0007] Furthermore, the feature fusion of the extracted features includes using the neck network of the model to fuse the high-order semantic information finally extracted by the backbone network with the low-order features through upsampling, wherein the entire feature map is first compressed to a single feature dimension, and the original feature map is compressed. Compressed to a single feature dimension Expressed as: in and are the length and width of the input feature map.
[0008] Furthermore, compressing the entire feature map to a single feature dimension includes first reducing the dimension of the entire feature map using a fully connected layer. times, and then restored to Finally, the inter-channel attention is obtained by re-weighting the original input graph through the Sigmoid function, which is expressed as: in, is the Sigmoid function, and There are two weight matrices, is the ReLU function.
[0009] Furthermore, the feature fusion of the extracted features also includes a channel attention mechanism LSE based on adding position information. After any convolution transformation U, the original feature map is compressed in the height direction and width direction respectively, and the two compressed matrices are deformed and fused. The convolutional layer extracts the position information, which is expressed as: in, is the ReLU activation function, the weight matrix , It is used to control the reduction rate of block size to reduce the computational overhead, and then Separate into two independent tensors and , using the other two The convolutional layer changes the number of channels back to C, and the final position channel attention is expressed as: in, is the Sigmod activation function, is a split operation, are two weight matrices.
[0010] Furthermore, the target detection based on the fused features includes constructing a decoupled feature head using the Yolov8 Header according to the fused features, and calculating the target box loss and classification loss respectively. In this method, an Anchor-Free structure is adopted, and the target center point is judged instead of the pre-defined anchor box. The distance between the center point and the target box and the center point is predicted, and the final target box is output. The loss function of the target box loss uses the sum of the CIOU and DFL loss functions, and the classification loss is optimized using the binary cross entropy function.
[0011] Furthermore, the target detection results are used to perform incremental training on the enhanced model for weak target detection, including the seasonal and time-sensitive effects of red tides. The collected data are input into the previously trained model in an incremental training mode for further incremental training. At the same time, the EWC method is used to alleviate the problem that the model is too inclined to the distribution of the new data set and forgets the distribution of the old data set. An additional EWC loss function is added during the incremental training, and the loss function is expressed as: in, is the loss function for training on the new dataset, are the parameters of the new model, are the optimal parameters of the old model, is a parameter The Fisher information matrix is used to measure the importance of parameters, and λ is the regularization coefficient, which controls the strength of protecting old task knowledge.
[0012] The second aspect is a red tide outbreak early warning system based on weak target detection, comprising: The data acquisition module is configured to acquire red tide dataset images and perform image preprocessing through Gaussian filtering; The feature extraction module is configured to construct a weak target detection enhancement model based on the Yolov8 structure, and use the weak target detection enhancement model based on the Yolov8 structure to extract features from the red tide dataset image; The feature fusion module is configured to perform feature fusion on the extracted features; The target detection module is configured to perform target detection based on the fused features and perform incremental training on a faint target detection enhancement model based on the target detection results; The early warning module is configured to use the trained weak target detection enhancement model to provide red tide early warning.
[0013] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor of a terminal device and executing the method described.
[0014] In a fourth aspect, the present invention provides a terminal device comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; and the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded by the processor and executing the described method.
[0015] In summary, the present invention has the following beneficial technical effects: 1. The model proposed in this invention has an accuracy rate of 91.1% for images during the red tide outbreak period and an accuracy rate of 84.3% for images in the early stages of the red tide, effectively identifying red tide images at different stages.
[0016] 2. The present invention realizes an automated red tide early warning monitoring technology. This paper uses improved channel attention and additional Neck linking methods to solve the problem that early red tide algae targets are small and difficult to identify, and effectively identify the early stages of red tides. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 1 is a schematic diagram of a red tide early warning process according to embodiment 1 of the present invention; Figure 2 Schematic diagram of the overall structure of the neural network of Example 1 of the present invention; Figure 3 1 is a schematic diagram of the EPM module structure of Example 1 of the present invention; Figure 4 Schematic diagram of the LSE attention structure of Example 1 of the present invention. DETAILED DESCRIPTION
[0018] The present invention will be further described in detail below with reference to the accompanying drawings.
[0019] Example 1 Reference Figure 1 , a red tide outbreak early warning method based on weak target detection in this embodiment includes: Get red tide dataset images; A weak target detection enhancement model based on Yolov8 structure is constructed, and the features of red tide dataset images are extracted using the weak target detection enhancement model based on Yolov8 structure. Perform feature fusion on the extracted features; Perform target detection based on the fused features and perform incremental training on the enhanced model for weak target detection based on the target detection results; Use the trained weak target detection enhancement model to provide red tide early warning.
[0020] Specifically: (a) Weak target detection enhancement model based on Yolov8 structure.
[0021] (1) Model structure, The model consists of three parts: Backbone, Neck and Detector, which are responsible for feature extraction, feature fusion and target detection respectively.
[0022] 1.Backbone structure, like Figure 2 As shown, for the input image , where C is the number of channels, W is the image width, and H is the image height. First, the input image is input into the backbone network to extract feature information. The backbone network gradually reduces the size of the feature map from shallow to deep and expands the number of channels. The input image size used in this paper is , after passing through the ConV layer and C2f layer, the feature map size is reduced and the number of channels is expanded. Finally, the features are input into the SPPF module for pyramid pooling. Among them, each ConV layer contains a BatchNorm layer, a standard convolution layer, and a ReLU activation function layer. The BatchNorm layer is used to normalize the batch input data to improve the overall convergence speed of the model and alleviate the problems of gradient descent and gradient explosion. Its specific definition is to calculate the mean and variance of each batch containing m data input to the model. The calculation method is as follows: in, All samples in the Batch the number of is the mean of all samples in the Batch, is the variance. Then for each sample in the Batch Perform normalization processing. The normalization calculation method is as follows: in, is a very small number to prevent division by 0.
[0023] The standard convolution layer performs sliding window calculations on the input feature map, extracts features in the local area, and generates a new feature map for feature extraction and dimensionality reduction. The standard convolution operation is defined as: in, is the convolution kernel, is the height and width of the convolution kernel, The convolution operation is a process of traversing all pixel values on a feature map and weighting them through a sliding window to extract the features of surrounding elements from a certain pixel. In addition, the convolution operation can increase or decrease the number of channels by increasing or decreasing the number of kernel windows.
[0024] stride in convolution operation Controls the sampling frequency. The default convolution step size is 1, which means that all points in the entire feature map are traversed. When the step size is 2, the convolution operation samples every other point, and the output feature level is reduced to half of the input feature map.
[0025] The activation function is used to perform nonlinear transformation on the entire feature. This model uses the SiLU activation function. The definition of SiLU is: The C2f layer is composed of different ConV layers. The number of input and output channels of the feature map remains unchanged when passing through the C2f layer. Specifically, the input first passes through a convolution kernel of The ConV layer with a stride of 1 doubles the number of input channels and then separates the feature map by the number of channels to generate two feature maps with the same number of input channels for the final connection. This is done to increase the expressive power of the model. After that, it passes through three Bottleneck layers, which consist of two convolution kernels. The ConV layer with a step size of 1 is used to extract features. Finally, the input itself, the feature map separated after the first ConV layer and the feature map output by the Bottleneck layer are spliced to obtain a feature map with three times the number of original channels. The feature map is passed through a convolution kernel of The ConV layer with a step size of 1 transforms it to the number of channels at the input to ensure that the number of input and output channels remains unchanged.
[0026] The order of feature map size changes of the backbone network is , , , , , The change of channel number and size is done through the ConV layer. Figure 2 These ConV layers have a stride of 2 and the number of output channels is twice the number of input channels.
[0027] 2. Neck structure, The feature pyramid structure (FPN) and path aggregation network (PAN) are proved to be a network that can effectively aggregate the feature information extracted by the backbone network at multiple scales. Figure 2 As shown in the figure, the neck network fuses the high-level semantic information ultimately extracted by the backbone network with low-level features through upsampling, improving the detection capability for objects of varying sizes. Faint targets typically only occupy 5-10% of the original image size. Feature maps located deeper in the backbone network are too small to capture the location information of these small targets. Overly large feature maps, located shallower in the backbone network, have a narrow channel count, and poor feature expression, making it difficult to effectively identify the feature information of small targets. To address these issues, this model improves the Neck structure by integrating earlier, larger feature maps into the detection head and using a feature extraction structure that incorporates channel attention to enhance the semantic information of early feature maps.
[0028] The channel attention method represented by the SE attention mechanism effectively improves the performance of CNN networks for image processing tasks. The essence of SE attention is to compress the entire feature map into a single feature dimension after any convolution transformation U, which is expressed as: in and is the length and width of the input feature map. Through this squeezing operation, the original feature map Compressed to a single feature dimension In order to utilize the feature information aggregated by the squeeze operation, a fully connected layer is used to reduce its dimension first. times, and then restored to Finally, the attention between channels is obtained through the Sigmoid function , this incentive is expressed as: in, is the Sigmoid function, and There are two weight matrices, is the ReLU function.
[0029] Although this channel attention method further improves network performance by obtaining attention between features, it ignores the position information of the features, which is very important for generating spatially selective attention maps. Therefore, this paper improves the current SE attention module and proposes a channel attention module LSE that adds position information. For any convolution transformation U, the original feature map is compressed in the height and width directions respectively. This method is expressed as: Among them, H, W are the height and width of the input feature map. After the above formula, the original input Separated into two different feature maps, the sizes are , which is then transposed and concatenated in the last dimension to obtain a new feature map with a size of Finally, use The convolutional layer extracts the position information, which is expressed as: in, is the ReLU activation function, the weight matrix , It is used to control the reduction rate of block size to reduce the computational overhead, and then Separate into two independent tensors and Using the other two The convolutional layer changes the number of channels back to C, and the final position channel attention is expressed as: in, is the Sigmod activation function, is a split operation, are two weight matrices.
[0030] like Figure 4 As shown in the figure, the entire improved channel attention module, referred to as the LSE model in this paper, consists of a dual stream of SE attention mechanism and position attention mechanism. Finally, all attention information is fed back to the original feature map, and a new feature map with added attention is obtained through convolution operation for the next layer training. The formula is expressed as: in, is the output of this layer, is the ReLU activation function, is the input of this layer.
[0031] The Neck structure of this model is improved based on the Yolov8 Neck structure. As shown in the figure, this paper improves the Yolov8 Neck structure and improves the Backbone and The feature map of the size introduces additional links into the original Yolov8 Neck and In the feature extraction module of size. This paper proposes a feature extraction module for feature extraction on links, called EPM module, the module structure is Convolutional layer, C2f module, LSE module and The convolution layer can effectively extract the features of large-scale feature maps. The specific structure is as follows Figure 3 shown.
[0032] 3. Detection head, This paper adopts the Yolov8 header structure to construct a decoupled feature head, separately calculating the target bounding box loss and classification loss. The specific structure is shown in the figure. Furthermore, this model adopts an anchor-free architecture. Instead of pre-determining anchor boxes, the target center point is determined, and the distances between the center point and the target bounding box, above, below, left, and right, are predicted. The target bounding box loss is optimized using the CIOU loss function, while the classification loss is optimized using the binary cross entropy function.
[0033] The specific calculation method of the Anchor-Free structure is as follows: for each feature map output by the detection head, each pixel is assumed to be the center point of the target box, and the four distances (top, bottom, left, and right) are calculated. The final output of the network contains (4 + number of target categories + target confidence) elements, specifically: [left offset, top offset, right offset, bottom offset, [algae species], [development stage], target confidence] The target confidence indicates the probability that the target exists in the predicted box. Assuming that each center point is x, the target box as a whole can be obtained by calculating the coordinate values of the upper left corner and the lower right corner of the target box. The calculation method is: These distances are optimized using CIOU, and the CIOU loss is calculated as: The calculation of CIOU consists of three parts: IOU, and Among them, IOU is the general intersection-over-union loss, which is calculated as follows: in, is the position of the prediction box It is the position of the real frame, which can be used to determine the size of the real frame covered by the predicted frame.
[0034] Is the center point of the prediction box and the center point of the real frame The Euclidean distance is calculated as: in, are the horizontal and vertical coordinates of the center point of the prediction box, It is the horizontal and vertical coordinates of the center point of the real frame.
[0035] It is the square of the diagonal length of the minimum bounding box that encloses the predicted box and the true box, which is used to normalize the distance.
[0036] is the aspect ratio consistency term, which is calculated as: in, is the width and height of the prediction box, is the width and height of the real frame.
[0037] α is the weight factor, which is calculated as: The binary cross entropy function is defined as: Where N is the number of categories, is the true value, is the predicted value.
[0038] (2) Model training data set collection and training methods, The model training dataset is constructed by combining a public dataset with a collection dataset. For the public dataset, this paper re-labels it and double-labels it according to algae species and development stage. The collection dataset uses an RGB camera carried by a multi-rotor drone to continuously collect data from different angles in the sea area. Data under different lighting conditions in the morning, noon and evening are selected to ensure data diversity. For the collected dataset, the image is first cropped to remove the extra background part, and all pictures are adjusted to a resolution of 640*640. Since the background area of different pictures is different, the cropped picture may be lower than the preset resolution, which will cause noise to be generated. Therefore, Gaussian filtering is used to denoise all pictures. The definition of Gaussian filtering is: Among them, x, y are the pixel coordinates, The standard deviation of the Gaussian function controls the smoothness of the Gaussian filter. Gaussian filtering can remove salt and pepper noise and Gaussian noise from images while preserving edges and details. The collected images are also labeled using a dual labeling method, based on algae species and development stage.
[0039] The overall data set consists of 45% normal seawater, 30% in the early stage of red tide, 15% in the outbreak period of red tide, and 10% red tide-like interference samples. The training set, validation set, and test set are split in 8:1:1. The model training iterations were 300 times, the learning rate was 0.0001, the weight decay was set to 0.0005, and the stochastic gradient descent method was used for optimization. Due to the seasonality and timeliness of red tides, there was not a large amount of data to train the network in the early stage of training, so the incremental training mode was adopted. This mode inputs the newly collected data into the previously trained model for further incremental training. For the problem that incremental learning may cause the model to be too inclined to the distribution of the new data set and forget the distribution of the old data set, the Elastic Weight Consolidation (EWC) method is used to alleviate this problem. An additional EWC loss function is added during incremental training. The loss function is expressed as: in, is the loss function for training on the new dataset, are the parameters of the new model, are the optimal parameters of the old model, is a parameter The Fisher information matrix is used to measure the importance of parameters, and λ is the regularization coefficient, which controls the strength of protecting old task knowledge.
[0040] (2) Red tide monitoring and early warning methods.
[0041] RGB surveillance cameras are deployed in specific sea areas, 10-30 meters from the sea surface. RGB images from all cameras are transmitted in real time to a computing server, where they are cropped to 640*640 pixels and Gaussian filtered to eliminate noise. The server detects the transmitted RGB images every 60 seconds using the proposed target detection model. When the target algae area occupies more than 15% of the ocean area in the image, the system alerts monitoring personnel of a red tide risk. When the system indicates a red tide risk, a multi-rotor drone equipped with automatic sampling functionality automatically samples seawater in the target monitoring area for biological testing. If the warning conditions are met, an alert is issued.
[0042] Example 2 This embodiment provides a red tide outbreak early warning system based on weak target detection, including: The data acquisition module is configured as follows: A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a red tide outbreak early warning method based on weak target detection.
[0043] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor to provide a red tide outbreak warning method based on weak target detection.
[0044] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A red tide outbreak early warning method based on weak target detection, characterized in that: include: Obtain red tide dataset images and perform image preprocessing using Gaussian filtering; A weak target detection enhancement model based on Yolov8 structure is constructed, and the features of red tide dataset images are extracted using the weak target detection enhancement model based on Yolov8 structure. Perform feature fusion on the extracted features; Perform target detection based on the fused features and perform incremental training on the enhanced model for weak target detection based on the target detection results; Use the trained weak target detection enhancement model to provide red tide early warning.
2. The red tide outbreak early warning method based on weak target detection according to claim 1 is characterized in that: The weak target detection enhancement model based on Yolov8 structure is used to extract features of the red tide dataset image, including the input image , where C is the number of channels, W is the image width, and H is the image height. First, the input image is input into the backbone network to extract feature information. The backbone network gradually reduces the size of the feature map from shallow to deep and expands the number of channels.
3. The red tide outbreak early warning method based on weak target detection according to claim 2 is characterized in that: The feature fusion of the extracted features includes using the neck network of the model to fuse the high-order semantic information finally extracted by the backbone network with the low-order features through upsampling, wherein the entire feature map is first compressed to a single feature dimension, and the original feature map is compressed. Compressed to a single feature dimension Expressed as: in and are the length and width of the input feature map.
4. The red tide outbreak early warning method based on weak target detection according to claim 3 is characterized in that: The method of compressing the entire feature map to a single feature dimension includes first reducing the dimension of the entire feature map using a fully connected layer. times, and then restored to Finally, the inter-channel attention is obtained by re-weighting the original input graph through the Sigmoid function, which is expressed as: in, is the Sigmoid function, and There are two weight matrices, is the ReLU function.
5. The red tide outbreak early warning method based on weak target detection according to claim 4 is characterized in that: The feature fusion of the extracted features also includes a channel attention mechanism LSE based on adding position information. After any convolution transformation U, the original feature map is compressed in the height direction and width direction respectively, and the two compressed matrices are deformed and fused. The convolutional layer extracts the position information, which is expressed as: in, is the ReLU activation function, the weight matrix , It is used to control the reduction rate of block size to reduce computational overhead, and then Separate into two independent tensors and , using the other two The convolutional layer changes the number of channels back to C, and the final position channel attention is expressed as: in, is the Sigmod activation function, is a split operation, are two weight matrices.
6. The red tide outbreak early warning method based on weak target detection according to claim 5, characterized in that: The target detection based on the fused features includes constructing a decoupled feature head using the Yolov8 Header according to the fused features, and calculating the target box loss and classification loss respectively. In this case, an Anchor-Free structure is adopted, and the target center point is judged instead of the pre-defined anchor box. The distance between the center point and the target box and the center point is predicted, and the final target box is output. The loss function of the target box loss uses the sum of the CIOU and DFL loss functions, and the classification loss is optimized using the binary cross entropy function.
7. The red tide outbreak early warning method based on weak target detection according to claim 6, characterized in that: The incremental training of the enhanced model for weak target detection based on the target detection results includes the seasonal and time-sensitive effects of red tides. The collected data is input into the previously trained model for further incremental training using an incremental training mode. At the same time, the EWC method is used to alleviate the problem that the model is too inclined to the distribution of the new data set and forgets the distribution of the old data set. In particular, an additional EWC loss function is added during the incremental training, and the loss function is expressed as: in, is the loss function for training on the new dataset, are the parameters of the new model, are the optimal parameters of the old model, is a parameter The Fisher information matrix is used to measure the importance of parameters, and λ is the regularization coefficient, which controls the strength of protecting old task knowledge.
8. A red tide outbreak warning system based on weak target detection, characterized in that: include: The data acquisition module is configured to acquire red tide dataset images and perform image preprocessing through Gaussian filtering; The feature extraction module is configured to construct a weak target detection enhancement model based on the Yolov8 structure, and use the weak target detection enhancement model based on the Yolov8 structure to extract features from the red tide dataset image; The feature fusion module is configured to perform feature fusion on the extracted features; The target detection module is configured to perform target detection based on the fused features and perform incremental training on a faint target detection enhancement model based on the target detection results; The early warning module is configured to use the trained weak target detection enhancement model to provide red tide early warning.
9. A computer-readable storage medium storing a plurality of instructions, characterized in that: The instructions are suitable for being loaded by a processor of a terminal device and executing the method according to claim 1 .
10. A terminal device comprising a processor and a computer-readable storage medium, wherein the processor is configured to implement various instructions; and the computer-readable storage medium is configured to store a plurality of instructions, wherein: The instructions are suitable for being loaded by a processor and for executing the method according to claim 1 .
Citation Information
Patent Citations
Model training method and device, infrared small target detection method and device and electronic equipment
CN116152591A
Fire detection early warning method based on attention mechanism and multi-scale characteristics
CN116343077A
Phytoplankton detection method and system
CN116486242A
Insulator detection method based on target detection algorithm and attention mechanism
CN116895030A
Marine microorganism microscopic image detection method based on deformable dynamic convolution
CN116977856A
Cited By
Multi-modal data fusion unmanned aerial vehicle offshore enteromorpha efficient monitoring method and system
CN121767883A