A method and system for judging and early warning of eutrophication of seawater based on image recognition
By using an improved U-Net network and multi-module collaborative modeling technology, the problems of identification accuracy and prediction in eutrophication identification of seawater were solved, realizing a high-precision and interpretable early warning system and improving the ability to detect red tides and estimate concentrations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG MARINE RESOURCE AND ENVIRONMENT RESEARCH INSTITUTE (SHANDONG MARINE ENVIRONMENTAL MONITORING CENTER SHANDONG AQUATIC PRODUCTS QUALITY INSPECTION CENTER)
- Filing Date
- 2025-07-03
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies for identifying eutrophication in seawater suffer from several drawbacks, including low accuracy under high reflectivity and disturbed backgrounds, lack of fine-grained estimation and quantitative assessment capabilities for red tide areas, lack of time series prediction models, and limited data distribution universality. Consequently, these technologies struggle to provide accurate and interpretable early warnings.
An improved U-Net network combined with a spatial channel fusion strategy is adopted. Through image preprocessing, occlusion region detection and mask construction, a nutrient-rich region mask is generated and the diagnostic results are visualized. Perturbation suppression, edge-guided attention mechanism and multi-scale feature extraction are introduced to build a multi-module collaborative modeling system.
It significantly improves detection accuracy, morphology reconstruction capability, and concentration modeling, reduces false alarm and missed detection rates, enhances the ability to predict red tide development trends, and generates structured and interpretable early warning results.
Smart Images

Figure CN120635720B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marine pollution early warning technology, and in particular to a method and system for judging and warning of eutrophication in marine waters based on image recognition. Background Technology
[0002] Nitrogen and phosphorus nutrients from industrial, agricultural, and domestic wastewater flow into the ocean via rivers, leading to excessive algal blooms, increased turbidity, and ultimately ecological disasters such as red tides and dead zones. These phenomena severely threaten fishery resources, marine biodiversity, and the living environment of coastal tourism and residents. With the continuous increase in agricultural non-point source pollution, industrial emissions, and urban sewage discharge, eutrophication has become a significant factor restricting the sustainable development of marine ecosystems. Effective monitoring and early warning systems for eutrophication have become a crucial technological aspect of marine environmental governance.
[0003] Current mainstream methods for monitoring eutrophication include manual sampling and laboratory testing, remote sensing reflectance models, and online monitoring systems using water quality buoys. Among these, while laboratory testing offers high accuracy, it suffers from poor timeliness and limited coverage. Remote sensing methods, although capable of large-scale monitoring, experience a significant decrease in recognition rate due to cloud cover, wave disturbances, and changes in lighting angle, making it difficult to accurately reflect fine-grained red tide structures. Water quality buoy equipment is costly and sparsely located, making it difficult to support regional-level early warning needs.
[0004] In recent years, with the rapid development of image recognition technology, especially the widespread application of high-performance target detection networks such as YOLO (You Only Look Once) in industrial and agricultural visual recognition, their strong real-time performance and adaptability to complex environments have provided a new approach for anomaly identification in water areas. However, the native YOLO framework has certain risks of false recognition when dealing with complex sea surface backgrounds, and its accuracy in detecting small targets and floating object boundaries is insufficient. In addition, the formation process of red tides has significant temporal evolution and spatial diffusion characteristics, and relying solely on static images cannot characterize its changing trends, nor can it build a continuous early warning system.
[0005] The following are the key problems existing in current marine eutrophication identification technologies: First, traditional image recognition models have low accuracy in high-reflectivity and high-disturbance sea surface backgrounds, making it difficult to separate red tide and non-red tide areas; second, the detection results for red tide areas are limited to static "present or absent" identification, lacking the ability to make fine estimates and quantitative assessments of indicators such as concentration, range, and structural changes; third, there is a lack of time-series-based prediction models, making it impossible to achieve forward-looking analysis and risk prediction of red tide development trends; and fourth, existing models are difficult to adapt to changes in data distribution across different sea areas or image sources (satellites, drones, buoys), lacking versatility and transferability.
[0006] Therefore, there is an urgent need to propose a new technical approach that integrates image recognition, temporal modeling, regional reconstruction and visual early warning, which has strong generalization ability for different marine environments, can achieve high-precision eutrophication detection, and support interpretable, visual and predictable closed-loop diagnosis. Summary of the Invention
[0007] To address the aforementioned problems, this invention provides a method and system for judging and warning of eutrophication in seawater based on image recognition.
[0008] In a first aspect, the present invention provides a method for judging and warning of eutrophication in seawater based on image recognition, which adopts the following technical solution:
[0009] A method for judging and early warning of eutrophication in seawater based on image recognition includes:
[0010] Acquire multi-source image data;
[0011] Data preprocessing is performed on the acquired multi-source image data;
[0012] Occlusion region detection and mask construction are performed on the preprocessed image data to generate target detection boxes;
[0013] Based on the generated target detection boxes, an improved U-Net network is used in conjunction with a spatial channel fusion strategy to output a eutrophication region mask;
[0014] Visualize diagnostic results based on output mask.
[0015] Furthermore, the data preprocessing of the acquired multi-source image data includes image scale normalization, color normalization, and brightness alignment. Image scale normalization includes using bicubic interpolation to normalize the original acquired image. Scaling to target resolution By constructing a fourth-order interpolation function by taking 16 neighboring points around each pixel in the image, edge information and contour details are preserved during scaling, avoiding jagged edges and blurring issues. Color normalization and brightness alignment include unifying brightness intensity and normalizing the color space scale while maintaining the relative differences between channels, making the model generalizable to different acquisition platforms. Specifically, for each color channel... Calculate the mean value of all pixels in the image. and standard deviation :
[0016] ,
[0017] ,
[0018] in, and The default height and width of the image are both 512; This is used to avoid division by zero; after normalization, the pixel value distribution of each channel has a mean of 0 and a standard deviation of 1, and the output image is a normalized tensor. With uniform brightness intensity and color scale, it proceeds to the next disturbance suppression module.
[0019] Furthermore, the data preprocessing of the acquired multi-source image data also includes, to identify high-frequency local perturbation regions in the image, using the Sobel operator to calculate the gradients of the image in the horizontal and vertical directions respectively, and then merging them into an amplitude map. The image edge intensity map G(x, y) is calculated using the directional gradient. A perturbation index map is constructed by combining the edge intensity of the image edge intensity map with the relative change rate of local brightness and background. The perturbation index map D(x, y) is then input into a lightweight attention suppression network to construct a perturbation attention weight map A. noise (x,y); Finally, guided by the perturbation attention weight map, channel-level suppression is performed on each pixel in the image:
[0020] ,
[0021] For clean areas, Then it is not suppressed; for high-disturbance regions, The pixel value approaches 0 to ensure that the structural boundary is preserved, and the non-target high-frequency part is automatically weakened.
[0022] Furthermore, the occlusion region detection and mask construction of the preprocessed image data includes using a YOLOv8 model with an improved CSPDarknet architecture to extract shallow, mid, and deep feature maps at the P3, P4, and P5 scales, respectively. An edge-guided attention mechanism is introduced to construct a pixel-level edge attention map in the shallow feature map, enhancing the edge region response through a specific path and guiding the model to perceive boundary semantics, thereby improving the detection accuracy of the target's outer contour. Specifically, an edge response map is constructed using image gradients, and the Sobel operator is used to extract the horizontal and vertical gradients of the channel-fused grayscale image. The edge map is then input into a lightweight neural network to generate an edge attention map, which is then expanded to the original feature dimension and fused with the original shallow feature map.
[0023] ,
[0024] in, For attention to the diagram Extending to the original feature map; this operation will be used to enhance edge regions and suppress background regions; resulting in an enhanced shallow feature map. Used for detecting head input.
[0025] Furthermore, the occlusion region detection and mask construction of the preprocessed image data also includes, addressing the limitation that the YOLO detection head only supports category and location output and cannot model the severity of semantically ambiguous targets or targets with large variations in red tide intensity, designing a three-scale detection head and extending it with a risk level prediction branch to output the red tide intensity level corresponding to each detection box. The detection head output includes the input feature map as follows: , , Each scale outputs K anchor features through a 3×3 convolution. The prediction information for each anchor is as follows: Where b is the target bounding box, consisting of four numbers: center coordinates and width and height; s Indicates confidence level; l The rating prediction uses one-hot three-class classification; and the rating prediction is based on the global pooling information of the target bounding box feature regions.
[0026] ,
[0027] Wherein, GAP represents global average pooling; This is the classification weight matrix; This is a category bias term.
[0028] Furthermore, the method of using an improved U-Net network and combining it with a spatial channel fusion strategy to output a eutrophication region mask includes introducing a region clipping mechanism. This mechanism extracts each eutrophication candidate region from the detection box set output by the previous module, clips, aligns, and scales it into a segmentation input tensor of a uniform format. This ensures that the position and shape of the U-Net do not affect the model's stability. Specifically, the candidate target set is selected... L Detection box in ,in, To determine the position of the center point of the detection box in the image; For width and height; change the original image The candidate image patch is formed by cropping the area centered on the frame. ,in, The dimensions are after adding boundary allowances; then image scaling and normalization are performed. The output normalized tensor has a dimension of , as input to the U-Net network.
[0029] Furthermore, the method of using an improved U-Net network and combining it with a spatial channel fusion strategy to output a nutrient-rich region mask also includes constructing a five-layer symmetrical MSA-U-Net network. The encoder uses an SE-Resblock structure to introduce channel attention, the decoder inserts spatial attention, and each layer fuses multi-scale receptive fields. The encoding path extracts features through five layers of convolution and pooling; the decoding path restores resolution through deconvolution and skip connections; each layer fuses channel attention and spatial attention mechanisms to emphasize key regions and features; and each attention mechanism receives input features... All of these originate from the encoding and decoding results of this layer; among them, the squeeze-and-excitation mechanism is used to generate channel attention weights, that is, first... Perform global average pooling on each channel to obtain the channel statistics vector. , is represented as:
[0030] .
[0031] Furthermore, the method of using an improved U-Net network and combining it with a spatial channel fusion strategy to output a eutrophication region mask also includes a concentration inversion mechanism based on the mask image to construct a regression network that outputs a concentration map. The mask tensor is output using the last layer of decoding.
[0032] ,
[0033] in, Features are output by the decoder; This represents the probability that each pixel is a red tide region; the last layer of features from the encoder... Input a fully connected layer, extract concentration features, and regress a pixel-level concentration map:
[0034] ,
[0035] in, It is a fully connected matrix; After Flattening, it becomes 32768×1; For bias terms; output This represents the concentration value for each pixel.
[0036] Furthermore, the visualization of diagnostic results based on the output mask includes displaying the set of output detection results. Plotted on the original image, with each detection box colored according to its level. Draw; create a segmentation mask for each candidate box. Map the coordinates back to the original image according to the corresponding positions, and use the maximum confidence merging strategy for overlapping areas. Finally, the image is overlaid on the original image for transparent rendering, with high transparency areas indicating strong anomalies; color coding is used to represent eutrophication concentration or level; and a concentration map is output for each target region. Similarly, mapping back to the original image: after coordinate alignment, merging all region concentration maps; generating a unified concentration map. The concentration values are normalized to [0,1], and the colors are encoded using the Jet colormap scheme. The colors are then transparently overlaid with the original image to generate visual heatmaps.
[0037] Secondly, an image recognition-based system for assessing and warning of eutrophication in seawater includes:
[0038] The data acquisition module is configured to acquire multi-source image data;
[0039] The preprocessing module is configured to perform data preprocessing on the acquired multi-source image data;
[0040] The target detection module is configured to perform occlusion region detection and mask construction on the preprocessed image data to generate target detection boxes;
[0041] The mask output module is configured to output a eutrophication region mask based on the generated target detection box using an improved U-Net network and a spatial channel fusion strategy.
[0042] The visualization module is configured to visualize diagnostic results based on the output mask.
[0043] Thirdly, the present invention provides a computer-readable storage medium storing a plurality of instructions adapted for loading and execution by a processor of a terminal device of the aforementioned image recognition-based method for judging and warning of eutrophication in seawater.
[0044] Fourthly, the present invention provides a terminal device, including 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, the instructions being adapted to be loaded and executed by the processor as described in the image recognition-based method for judging and warning of eutrophication in seawater.
[0045] In summary, the present invention has the following beneficial technical effects:
[0046] Compared to the shortcomings of existing eutrophication image recognition methods in terms of detection accuracy, morphological reconstruction ability, structural interpretability, and concentration modeling, this invention constructs an intelligent marine eutrophication identification and early warning system based on a multi-module collaborative modeling strategy. First, by suppressing perturbations and normalizing, differences in illumination, resolution, and noise during the image acquisition stage are eliminated, significantly improving image stability. Second, a YOLO-Eutro detection module is proposed, which, while retaining the efficiency of YOLO, introduces an edge guidance mechanism and a structural consistency loss function, effectively improving the detection accuracy of weakly boundary algal clusters. Furthermore, segmentation and concentration estimation are performed using the MSA-U-Net structure, achieving fine-grained edge reconstruction and chlorophyll concentration fitting for candidate regions. Finally, through visualization and rating modules, structured and interpretable result maps and risk level reports are generated, significantly enhancing the practicality of the model output and its adaptability to regulatory decisions.
[0047] In typical nearshore eutrophication remote sensing monitoring tasks, the system of this invention can reduce the false negative rate of small-area eutrophication patches from 23.4% to 6.8% and the false positive rate from 18.5% to 5.9%; improve segmentation accuracy (IoU) by 22.7% and reduce concentration estimation error (RMSE) by 21.1%; and shorten the processing time of a single image from 2.3 seconds to 0.88 seconds. The overall performance of the system is excellent in terms of accuracy, real-time performance, and interpretability. It significantly improves the ability to capture early anomalies, the ability to model the spread trend of moderate eutrophication, and the ability to respond hierarchically to severely affected areas. It has good potential for engineering promotion and practical deployment value. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of an image recognition-based method for judging and warning of eutrophication in seawater according to Embodiment 1 of the present invention.
[0049] Figure 2 This is a comparison chart of the accuracy and segmentation precision of Embodiment 1 of the present invention.
[0050] Figure 3 This is a comparison chart of the false detection rate and concentration error in Embodiment 1 of the present invention.
[0051] Figure 4 This is a comparison chart of inference time in Embodiment 1 of the present invention.
[0052] Figure 5 This is a radar chart comparing the normalized performance of Embodiment 1 of the present invention. Detailed Implementation
[0053] The present invention will be further described in detail below with reference to the accompanying drawings.
[0054] Example 1
[0055] Reference Figure 1 This embodiment of a method for judging and warning of eutrophication in seawater based on image recognition includes:
[0056] Acquire multi-source image data;
[0057] Data preprocessing is performed on the acquired multi-source image data;
[0058] Occlusion region detection and mask construction are performed on the preprocessed image data to generate target detection boxes;
[0059] Based on the generated target detection boxes, an improved U-Net network is used in conjunction with a spatial channel fusion strategy to output a eutrophication region mask;
[0060] Visualize diagnostic results based on output mask.
[0061] Specifically:
[0062] (1) Multi-source image acquisition and preprocessing module,
[0063] In intelligent identification and early warning systems for marine eutrophication, images are the fundamental data source for system operation. Common image acquisition platforms currently include high-resolution satellites (such as Sentinel-2 and GF-6), low- and medium-altitude UAVs (equipped with visible light or multispectral cameras), and fixed marine buoys or shore-based video monitoring systems. These platforms differ significantly in image acquisition resolution, imaging angle, lighting conditions, and shooting time periods, resulting in highly heterogeneous input images in terms of size, color distribution, and background structure noise. Furthermore, marine scenes themselves have complex physical interference backgrounds, such as specular reflection of sunlight, wave texture disturbances, foam obstruction, floating objects, and cloud shadows. These factors generate a large amount of unstructured high-frequency noise in the images, which can easily affect the accurate identification of target boundaries and area ranges by downstream eutrophication detection models. To ensure model recognition accuracy and improve the system's cross-scene adaptability, it is necessary to perform a series of structural preprocessing operations before the images enter the neural network.
[0064] 1) Scale normalization,
[0065] The original images vary significantly in size across different platforms. For example, remote sensing images may have a resolution of 10,000 × 10,000 pixels, while buoy monitoring images are only 1024 × 768 pixels. Such input differences severely impact the receptive field configuration, anchor size matching, and the stability of feature map pyramid generation in subsequent detection models. If size unification is skipped, the model will be unable to correctly learn the mapping relationship between the target scale and the feature map location. Ground truth boxes during training may mismatch with the receptive field of the feature map, resulting in significant missed detections. Furthermore, during deployment, inconsistent sizes prevent the model from batch loading images during inference, causing system crashes. Therefore, all input images must be uniformly adjusted to a fixed spatial scale to ensure model structure matching and control inference time and memory usage.
[0066] The original acquired image was processed using bicubic interpolation. Scaling to target resolution Bicubic interpolation constructs a fourth-order interpolation function by taking 16 neighboring points around each pixel in the image. This method can better preserve edge information and contour details during scaling, avoiding jagged edges and blurring. The formula is as follows:
[0067] ,
[0068] Among them, setting The input size is the size required for the YOLO backbone structure; if the input image is not proportional, a "proportional scaling of the long side + zero-padding at the edges" strategy is used for padding; the output image... This will be used as input for subsequent color alignment steps.
[0069] 2) Color normalization and brightness alignment.
[0070] Even when capturing the same area using different devices, marine images may exhibit systematic shifts in the brightness response curves of the R, G, and b color channels due to differences in imaging chips, lens parameters, white balance algorithms, and compression methods. For example, some infrared-enhanced drones may have a higher response in the red channel, making algae or sediment appear "redder," while overexposure in the blue channel may cause the seawater to appear lighter. If color normalization is skipped, the model may misinterpret "device differences" as "eutrophication anomalies," severely interfering with detection accuracy. More importantly, a key characteristic of eutrophic algal red tides is "color shift" (e.g., increased G / b values). If the channel values themselves lack comparativeness, the model will be unable to effectively extract color criterion features. Therefore, this step must maintain the relative differences between channels while unifying brightness intensity and normalizing the color space scale, enabling the model to generalize across different acquisition platforms.
[0071] For each color channel Calculate the mean value of all pixels in the image. and standard deviation :
[0072] ,
[0073] ,
[0074] Perform standard normalization:
[0075] ,
[0076] in, and The default height and width of the image are both 512; This is used to avoid division by zero; after normalization, the pixel value distribution of each channel has a mean of 0 and a standard deviation of 1, and the output image is a normalized tensor. With uniform brightness intensity and color scale, it proceeds to the next disturbance suppression module.
[0077] 3) Disturbance area identification and suppression,
[0078] Non-target perturbation structures are prevalent in marine scenes. These perturbations mainly originate from the natural environment and shooting conditions, such as brightness ripples caused by waves, specular reflections under direct sunlight, high-frequency textures generated by foam aggregation, and random suspended object disturbances in non-eutrophic areas with algae. These structures often appear in images as high-frequency, low-contrast, or locally abrupt brightness patterns, with texture intensity that may even exceed the edge of the target area (red tide mass). If these perturbations are not explicitly suppressed, subsequent detection models are highly likely to misclassify them as boundaries or centers of eutrophic areas, especially in the shallow feature extraction stage. Convolutional neural networks tend to treat perturbations as "valuable edge signals," leading to false positives or mislocalization problems. More seriously, in the YOLO architecture, shallow feature maps have the strongest edge perception capability. If this area has been misinterpreted as a perturbation boundary, subsequent fusion layers will amplify this misjudgment, causing the entire path to converge incorrectly. Therefore, a perturbation region identification mechanism needs to be specially designed. By combining directional gradient, local brightness characteristics and edge change rate, a perturbation scoring map can be constructed, and these regions can be suppressed at the image level to "silence" invalid signals at the source and purify the input feature space.
[0079] ① Calculation of edge disturbance intensity,
[0080] To identify high-frequency local perturbation regions in an image, the image edge intensity map G(x, y) is first calculated using directional gradients. The Sobel operator is then used to calculate the gradients in the horizontal and vertical directions, and these gradients are combined into an amplitude map.
[0081] ,
[0082] in, This indicates performing Sobel convolutions on the image in both the horizontal and vertical directions; the default Sobel kernel is [kernel name missing].
[0083] 3×3 can effectively enhance regions with abrupt gradient changes in the image; output This represents the edge response intensity of a pixel. However, the edge response contains a large number of "structural edges" (such as target boundaries) and "perturbation edges" (such as foam stripes), requiring further identification of which are high-frequency responses caused by noise.
[0084] ② Construction of the disturbance index map
[0085] To probabilistically model high-frequency perturbation regions, a perturbation index map D(x,y) is introduced, which integrates the relative rates of change between edge intensity and local brightness background. The formula is as follows:
[0086] ,
[0087] in, Edge intensity map; This represents the mean value of a 5×5 region centered at x,y, reflecting the brightness background of that region. Prevent division by zero; output This represents the pixel perturbation index. The larger the value, the more abnormal edge changes the pixel has in a local brightness environment, which is very likely caused by high-frequency perturbations such as reflections or water ripples.
[0088] ③ Construction of the perturbation suppression attention map,
[0089] The perturbation exponential graph D(x,y) is input into a lightweight attention suppression network to construct the perturbation attention weight graph A. noise (x,y), the network structure is as follows:
[0090] ,
[0091] Two 3×3 Conv convolutional layers form the perturbation recognition convolutional kernel with a receptive field of 5×5, which is used to adapt to local perturbation regions; the ReLU activation function is used in the middle to enhance the perturbation salience region; The sigmoid function normalizes the weights to [0, 1]; the output is a weighted graph. Each pixel represents its confidence level of being "perturbed," with higher values indicating less reliable areas.
[0092] ④ Disturbance suppression processing,
[0093] Guided by the perturbation attention map, channel-level suppression is performed on each pixel in the image:
[0094] ,
[0095] For clean areas, Then it is not suppressed; for high-disturbance regions, Pixel values approach 0 to preserve structural boundaries, while non-target high-frequency components are automatically attenuated. The resulting image tensor... Scale unification, brightness standardization, and perturbation structure suppression have been completed, and its feature representation is more focused on the real target boundary, while avoiding the misleading effect of pseudo-texture response on subsequent models.
[0096] 4) Occlusion area detection and mask construction,
[0097] In marine remote sensing or real-world images, occluded regions are a typical source of unstructured noise. These regions include clouds, cloud shadows, floating plastic, seabirds, boats, camera mounts, and shoreline facilities. Because these regions often have high brightness, high texture complexity, or colors different from the background water, they easily interfere with the target learning process of eutrophication detection models. On the one hand, these regions often resemble red tide masses in morphology and spectrum; for example, floating foam or flocks of birds appear as white blocks in images and may be misidentified as the center of a red tide. On the other hand, dark regions such as cloud shadows can obscure the true water body information, making the detection model "blind spots" in these areas, leading to missed detections. More seriously, in supervised training, if these regions are not removed, they will be mistakenly treated as "non-red tide" backgrounds, causing the model to learn incorrect classification boundaries. Therefore, a dedicated mechanism must be designed to discriminate and mask occluded regions in images, ensuring that these regions neither participate in training nor interfere with the inference process. The processing should be able to adapt to various occlusion types and automatically mask suspicious areas without losing the structure of key targets.
[0098] ①Construction of saliency score plot,
[0099] Because obscured areas typically have three characteristics: high local information complexity (such as details of floating object textures); high edge strength but irregular structure (such as bird shadows or plastic bags); and color distribution that deviates from the main color tone of normal water bodies.
[0100] Therefore, this invention constructs a significance scoring graph S(x,y) that integrates three types of indicators:
[0101] ,
[0102] in, It is a local entropy value calculated using a 5×5 neighborhood as a window, representing the degree of information disorder in that region; This represents the gradient strength (calculated using the Sobel operator) and is used to describe the degree of abrupt boundary changes. This represents the Euclidean distance between the pixel's color and a normal seawater hue (such as turquoise), used to identify "non-water color" regions; the weighting coefficient is preset to... Output This indicates the saliency of each pixel being considered an "abnormal occlusion area".
[0103] ② Mask generation is blocked.
[0104] Thresholding is performed on the saliency map S(x,y) to obtain a preliminary mask:
[0105] ,
[0106] in, For indicator functions; The adaptive threshold is calculated based on the mean and standard deviation of the significance plot; μS, σS: mean and standard deviation of the significance values across the entire plot; To adjust the sensitivity of occlusion detection. To eliminate small-area false occlusions and connect real occlusion areas, M... raw Then perform two more morphological processing steps: a dilation operation (kernel size = 3×3) connects the occlusion boundaries; an opening operation clears small pseudo-mask regions and outputs the final mask. .
[0107] ③ Image masking processing,
[0108] Use an occlusion mask to directly block the image content of the corresponding area:
[0109] ,
[0110] in, This means that within the mask, the position (x, y) is marked as the occluded region, and its pixel information will be reset to zero; the unoccluded region will be fully preserved, ensuring the continuity of the image structure. The final output image tensor is... It is a "clean image input" that has undergone size uniformity, color alignment, perturbation suppression, and occlusion masking. It has high availability, low noise, and strong boundary features, and is suitable for downstream eutrophication area detection models.
[0111] (2) Eutrophication Area Detection Module (YOLO-Eutro)
[0112] Eutrophication in marine waters is an environmental anomaly characterized by spatial variability, morphological diversity, and blurred boundaries. Visually, it typically manifests as sheet-like, flocculent, floating, or poorly defined greenish-blue areas. In images, these phenomena present irregular target structures with color distributions similar to the background water, and are further affected by factors such as lighting, waves, and imaging angles, making boundary segmentation difficult and region detection challenging. Traditional eutrophication detection methods primarily rely on threshold segmentation or color space analysis, which are extremely sensitive to image noise and ill-suited to the complex natural marine environment. In recent years, object detection models such as Faster R-CNN and the YOLO series have achieved significant results in general object detection tasks. However, while frameworks like YOLO excel at handling "hard-boundary objects" such as vehicles and faces, their performance suffers significantly when used to detect blurred-boundary, undefined clumps of marine algae. Therefore, this invention redefines a target detection strategy suitable for weak boundaries and fuzzy structures based on YOLOv8, proposing the YOLO-Eutro architecture, which incorporates the following design points: utilizing multi-scale shallow and deep feature fusion to extract red tide regions at different scales; designing an edge-guided attention mechanism to guide shallow features to focus on the true boundary; introducing a structural consistency loss function to enhance the model's perception of morphological structure; and expanding the classification output to add red tide level auxiliary prediction (mild / moderate / severe). The entire module accepts images from the preprocessing module. As input, the output is a set of candidate target boxes. Each detected target includes location, confidence level, and grade prediction information.
[0113] 1) Multi-scale backbone feature extraction structure,
[0114] Eutrophication regions can exhibit multiple spatial scales in images: some small-area red tides in their initial stages occupy only a small area of the image with subtle and difficult-to-discern texture boundaries, while some concentrated outbreaks of red tides cover a wide area with complex contours. Single-scale feature extraction cannot simultaneously capture the structural features of both small and large targets. Furthermore, red tide targets often possess multi-layered semantic structures (such as edge feathering and strong central texture). Deep networks can extract high-semantic features, while shallow networks are better at capturing edge information. Therefore, a pyramid-shaped multi-scale structure must be designed to enable the model to simultaneously model semantics and boundaries at different spatial resolutions. The YOLOv8 backbone adopts an improved CSPDarknet architecture, possessing excellent multi-layer information fusion characteristics and efficient operation on edge devices. Therefore, this module retains its backbone structure and extracts shallow, mid-layer, and deep feature maps at the P3, P4, and P5 scales respectively, providing an input foundation for subsequent detection and attention mechanisms.
[0115] Input image After passing through the YOLOv8 CSPDarknet backbone, three sets of feature maps are output:
[0116] ,
[0117] in, These represent the number of feature channels for shallow, middle, and deep layers, respectively; output features F 3 Used to focus on fine-grained edge details; F 4 Used for modeling mesoscale contour information; F 5 It is used to integrate semantic information and overall structure. Each stage includes multiple sets of residual structures, bottleneck blocks, and cross-stage partial connections to effectively prevent gradient vanishing and improve expressive power.
[0118] The three feature maps F3, F4, and F5 will serve as inputs to subsequent sub-modules, including an edge-guided attention module (EGA) for weighting F3; a detection head fusion module for summarizing features at three scales and generating detection results; and an auxiliary level prediction branch for extracting red tide risk level features from F5.
[0119] 2) Edge-Guided Attention (EGA)
[0120] In images of eutrophication in the ocean, algal clumps often exhibit visual characteristics such as "blurred boundaries, irregular structures, and gradual color distribution." This is especially true under disturbed environments like waves and reflections, where the boundary between red tides and the water body becomes extremely unclear. Traditional object detection models are naturally adaptable to hard boundaries (such as vehicles and people), but when faced with weakly defined boundaries, the target region in the feature map is difficult to separate from the background response, leading to problems such as bounding box drift, oversized boxes, and missed detections. Furthermore, while the lower-layer feature maps of YOLO series models possess edge-awareness capabilities, the default convolution extraction process does not actively focus on target boundaries. In weakly structured targets, this boundary insensitivity amplifies model errors. Therefore, this invention designs an Edge-Guided Attention (EGA) mechanism, constructing a pixel-level edge attention map in the shallow feature map. By enhancing the edge region response through specific paths, it guides the model to perceive boundary semantics, thereby improving the detection accuracy of the target's outer contour.
[0121] ①Edge graph construction,
[0122] The input feature map comes from shallow features of the backbone network. An edge response map is constructed using image gradients, and the Sobel operator is used to extract the horizontal and vertical gradients of the channel-fused grayscale image.
[0123] ,
[0124] in, Average of channels; These are horizontal and vertical Sobel filters, respectively; the output is the edge response map. .
[0125] ② Attention weight map generation,
[0126] Input the edge map into a lightweight neural network to generate an edge attention map:
[0127] ,
[0128] Two 3×3 Conv convolutional layers are used to extract local textures; the ReLU activation function ensures non-linear enhancement of edge responses; To ensure the attention graph is in the range [0,1] for the Sigmoid function; final output .
[0129] ③ Attention feature map fusion,
[0130] The attention map is expanded to the original feature dimension and then merged with the original shallow feature map:
[0131] ,
[0132] in, For attention to the diagram Extending to the original feature map; this operation will be used to enhance edge regions and suppress background regions; resulting in an enhanced shallow feature map. Used for detecting head input.
[0133] 3) Detection head structure and graded output branches,
[0134] Standard YOLO detectors only support category and location output. For targets with semantic ambiguity or large variations in red tide intensity, they cannot further model information such as "severity" and "morphological level." However, in eutrophication monitoring tasks, classifying targets as "mild / moderate / severe" is not only beneficial for early warning grading but also supports downstream concentration estimation and remediation scheduling. Furthermore, the multi-scale target structure requires detectors to have cross-layer fusion capabilities to simultaneously process large, medium, and small targets. Therefore, a three-scale detector is designed, and a "risk level prediction branch" is extended to output the red tide intensity level corresponding to each detection box.
[0135] ①Detector head output,
[0136] The input feature map is , , Each scale outputs K anchor features through a 3×3 convolution:
[0137] ,
[0138] The prediction information for each anchor is as follows:
[0139] ,
[0140] Where b is the target bounding box, consisting of four numbers: center coordinates and width and height; s The confidence level (whether an object exists) is represented by a single number. l This indicates that the rank prediction uses one-hot three-class classification, which consists of three numbers.
[0141] ② Grade prediction branch,
[0142] The ranking prediction is derived from the global pooling information of the target bounding box feature regions:
[0143] ,
[0144] Wherein, GAP represents global average pooling; This is the classification weight matrix; This is a category bias term.
[0145] The loss function is:
[0146] ,
[0147] in, The classification error is calculated using cross-entropy, with the actual labels as the base values.
[0148] 4) Structural consistency loss function,
[0149] Traditional object detection bounding box regression uses IoU or GIoU loss, focusing only on area overlap. For red tide targets with complex structures and blurred edges, the predicted bounding boxes may "look good" in terms of IoU, but structurally they do not overlap with the real target at all, failing to identify edge leakage or voids within the bounding box. To enhance the modeling of target morphology and structure, a joint loss function based on structural consistency is introduced:
[0150] ,
[0151] in, This indicates the IoU loss due to center distance, and the consistency of the constraint box centers; The predicted bounding box region; The true bounding box region is the image region; SSIM represents the image region of the true bounding box. The weight is set to 0.7. This loss function ensures that the detection results are closer to the real target in terms of structural contour and texture consistency, not only in terms of accurate bounding but also in terms of "shape accuracy".
[0152] The final output is a set of candidate targets:
[0153] ,
[0154] in, This indicates the location of the detection box, its center coordinates, and its width and height. Indicates confidence level; Indicates the level of eutrophication; N This indicates the number of candidate boxes. Each candidate box region will be sent to module (3) fine segmentation and concentration estimation module to perform pixel-level segmentation and water quality parameter inversion.
[0155] (3) Fine segmentation and concentration estimation module (MSA-U-Net)
[0156] In marine eutrophication image analysis, although the target detection module (YOLO-Eutro) can initially delineate the bounding box region of red tide masses, the results only provide coarse-grained location and area information, failing to accurately describe the boundary shape, actual coverage, and internal concentration changes. One of the key requirements of eutrophication early warning systems is to assess the true outline area, edge evolution trend, and concentration distribution of algal masses in the sea area. Traditional image segmentation methods (such as FCN and SegNet) have shortcomings in preserving boundary details and scale generalization. Especially when dealing with eutrophic masses with blurred textures, feathered boundaries, and gradual structural changes, these methods often suffer from jagged edges, misclassification, and multi-level connection errors. Therefore, this module adopts an improved U-Net structure, designs a multi-scale attention (MSA) mechanism, and combines it with a spatial channel fusion strategy to finely restore boundary information while maintaining a global structural understanding. Ultimately, this module outputs both a fine-grained mask of eutrophication areas and a pixel-level "concentration map" or "distribution density map" to assist the system in assessing risk levels and warning intensity.
[0157] 1) Candidate region extraction and input normalization.
[0158] Since YOLO detection results provide rectangular bounding boxes, performing global segmentation directly on the entire image will cause the following problems: redundant calculation of non-target areas, wasting resources; misjudgment of non-target areas (such as ocean waves being identified as red tides); and lack of target center alignment mechanism, resulting in semantic information offset.
[0159] Therefore, this invention introduces a region clipping mechanism to extract each eutrophication candidate region from the detection box set output by the previous module, and clip, align, and scale it into a segmentation input tensor of a uniform format. This ensures that the position and shape of the U-Net are not affected, thus enhancing model stability.
[0160] Take the candidate target set L The detection box in the middle:
[0161] ,
[0162] in, To determine the position of the center point of the detection box in the image; For width and height.
[0163] Original image The candidate image patch is formed by cropping the area centered on this frame.
[0164] ,
[0165] in, This is the dimension after adding boundary allowance.
[0166] Then perform image scaling and normalization:
[0167] ,
[0168] The output normalized tensor has a dimension of , as input to the U-Net network.
[0169] 2) MSA-U-Net architecture construction,
[0170] The original U-Net architecture extracts multi-scale information through a symmetrical downsampling / upsampling process and transmits boundary features via skip connections, making it suitable for continuous background scenes such as medical images. However, in marine images, due to discontinuous boundaries, complex shapes, and colors close to the background, multi-scale modeling is required to adapt to clumps of different sizes; self-attention mechanisms are needed to enhance attention to structural edges and internal differential regions; and a joint mechanism of channel attention and spatial attention needs to be designed so that the model can focus on both regional location and local texture and density changes.
[0171] Therefore, the MSA-U-Net structure is proposed, which is a five-layer symmetric network. The encoder adopts the SE-Resblock structure to introduce channel attention, and the decoder inserts a spatial attention module. After each layer, multi-scale receptive fields (3×3, 5×5, 7×7) are fused.
[0172] In this module, the clipping area for each detection box is... It will be input into the MSA-U-Net network structure as the input to the segmentation unit.
[0173] The structure of MSA-U-Net includes: an encoding path that extracts features through 5 layers of convolution and pooling; a decoding path that restores resolution through deconvolution and skip connections, with each layer incorporating channel attention and spatial attention mechanisms to emphasize key regions and features; and input features received at each attention mechanism. All of these originate from the encoding or decoding results of this layer.
[0174] Taking a certain layer of U-Net as an example, its input features are denoted as:
[0175] ,
[0176] Where l represents the l-th layer; C, H, W The number of channels and spatial dimension of this layer; this feature comes from the intermediate results of the encoding path (downsampling) or decoding path (deconvolution + concatenation).
[0177] ①Attention Mechanism Module
[0178] Channel weights are generated using a squeeze-and-excitation mechanism.
[0179] ,
[0180] That is, first to Perform global average pooling on each channel to obtain the channel statistics vector. .
[0181] Next, a two-layer fully connected network is used for weight compression and activation:
[0182] ,
[0183] in, For a trainable parameter matrix, r Compression ratio; The Sigmoid function is used to normalize the channel weights to [0, 1].
[0184] The output after channel enhancement is:
[0185] ,
[0186] ② Spatial Attention Module
[0187] Spatial attention is computed on the channel-enhanced feature maps, and the results of inter-channel max pooling and average pooling are calculated:
[0188] ,
[0189] Spatial weights are generated using convolution after concatenation:
[0190] ,
[0191] Among them, the output This indicates the importance of each pixel position.
[0192] The final output after attention fusion is:
[0193] ,
[0194] 3) Concentration mapping and regression output,
[0195] Since detection and segmentation can only determine "whether eutrophication has occurred," but cannot provide "the degree of eutrophication" or "concentration density," and practical applications require estimation of algal density to distinguish between minor, moderate, and explosive events, this module designs a concentration inversion mechanism based on masked images to construct a regression network that outputs a concentration map.
[0196] ①Mask output,
[0197] Use the last layer of decoded output mask tensor:
[0198] ,
[0199] in, Features are output by the decoder; This represents the probability that each pixel is a red tide region.
[0200] ②Concentration estimation output
[0201] The last layer of features of the encoder Input a fully connected layer, extract concentration features, and regress a pixel-level concentration map:
[0202] ,
[0203] in, It is a fully connected matrix; After Flattening, it becomes 32768×1; For bias terms; output This represents the concentration value per pixel (which can be mapped to chlorophyll a concentration in mg / m³).
[0204] (4) Diagnostic result visualization and early warning interpretation module,
[0205] In traditional eutrophication monitoring systems, even with image recognition or physical sensing, the output is often just a set of data tables (such as location, area, and concentration values), lacking an intuitive spatial presentation. This makes it difficult for end-users (such as maritime and environmental dispatchers) to intuitively judge the problem area, spread trend, and warning level, hindering efficient human-machine collaboration. Especially in deep learning systems, the neural network model's input processing is highly "black box," lacking clear causal logic, making it difficult for decision-makers to trust the model's judgment. Furthermore, the severity of eutrophication events is essentially a continuous variable (from early weak changes → localized red tides → explosive clumps). If the model only outputs "whether it is abnormal," it will miss intermediate warning stages, resulting in delayed or overreacting responses. Therefore, this module aims to uniformly map all detection and analysis results of the system onto visual images, while combining interpretive heatmaps and a tiered scoring mechanism to visually encode the severity of events, improving the system's usability, interpretability, and controllability.
[0206] 1) Visual overlay of detection boxes,
[0207] The set of detection results output from module (2) Plotted on the original image, with each detection box colored according to its level. Plotting: Green / Yellow / Red (mild / moderate / severe); Overlay the confidence score and prediction level in the upper left corner of the box, such as "87%, moderate";
[0208] 2) Fine-grained mask overlay and transparency rendering.
[0209] The segmentation mask of each candidate box output in module (3) Map back to the original image coordinates according to the corresponding positions:
[0210] ,
[0211] in, Bundle The mask is scaled proportionally to the frame b. i Dimensions; Place the scaled mask at the corresponding position in the original image (by b). i (Given), the mask is about to be applied. The `align` property maps the image back to its original space, aligning it to the predicted bounding box b. i Location.
[0212] For overlapping regions, use the maximum confidence merging strategy:
[0213] ,
[0214] Finally, the image is overlaid on the original image and rendered transparently, with high transparency areas representing strong anomalies; color coding (green to red gradient) is used to represent eutrophication concentration or level.
[0215] 3) Generation of concentration heatmap,
[0216] The concentration map output by each target region in module (3) Similarly, mapping back to the original image: after coordinate alignment, merging all region concentration maps; generating a unified concentration map. The concentration values are normalized to [0,1], and the colors are encoded using the Jet colormap scheme. These colors are then transparently overlaid with the original image to generate visual heatmaps.
[0217] 4) Anomaly scoring and rating aggregation mechanism,
[0218] To facilitate overall system scheduling and quantification of anomaly severity, a set of regional scoring functions is defined to aggregate and evaluate all eutrophication detection areas, with scores ranging from 0 to 100.
[0219] ,
[0220] in, N Number of detection areas; The weighting coefficients are for severity levels: minor = 1, moderate = 2, severe = 3. To test the confidence level; The area is the region (calculated from the mask); the final score is S. total It can be used for grading. A score range of 0-20 indicates normal, 21-50 indicates weak anomaly, 52-75 indicates moderate anomaly, and 76-100 indicates severe anomaly. It also outputs a text summary, including indicators such as the number of anomaly areas, the location of the area with the highest concentration, the average grade, and the total area, for environmental managers to quickly review.
[0221] Experimental verification:
[0222] This experiment selected a typical remote sensing image dataset of seawater eutrophication, including satellite images, UAV aerial images, and shore-based monitoring images from typical eutrophic areas along the East China Sea and Bohai Sea. The images were annotated to indicate red tide boundaries, multi-level concentration distributions, and actual water sample concentration values. In constructing the test set, five sea state disturbance levels were set: no disturbance (0), slight disturbance (0.25), moderate disturbance (0.5), severe disturbance (0.75), and extreme disturbance (1.0), simulating changes in conditions such as wind, waves, illumination, and cloud cover. The robustness and stability of the model were tested under different disturbance conditions.
[0223] The comparison methods include five classic image recognition models: SVM: Support Vector Machine + HOG features; CNN: Standard Convolutional Neural Network; U-Net: Basic segmentation structure; YOLOv5: No improved detection model; Mask R-CNN: Two-stage method of detection + segmentation.
[0224] The method of this invention was evaluated on the same test set as the five methods mentioned above. The comparison indicators included: accuracy of eutrophication area detection (Acc); false negative rate of small clump detection (Miss); segmentation accuracy (IoU); concentration estimation error (RMSE); and diagnostic inference time (Time).
[0225] Table 1. Comparison of data from different methods under five major indicators.
[0226] method Accuracy (%) Miss rate (%) Segmentation accuracy IoU (%) <![CDATA[Concentration error RMSE (mg / m 3 ).]]> Inference time (Time(s)) SVM + HOG 69.2 30.8 0.42 0.128 0.43 CNN 78.3 25.9 0.57 0.104 0.91 U-Net 83.4 20.6 0.68 0.089 1.32 YOLOv5 86.1 17.2 0.62 0.094 0.67 Mask R-CNN 89.0 14.1 0.73 0.072 1.49 Method of the present invention 93.2 6.8 0.896 0.057 0.88
[0227] The experimental results are shown in Table 1. Figure 2 , Figure 3 , Figure 4 As shown, since the five indicators are evaluated differently, they cannot be directly displayed in the same radar chart. Therefore, this invention retains the positive indicators (higher values are better, i.e., accuracy and segmentation precision) unchanged. For the negative indicators (lower values are better, i.e., false negative rate, concentration error, and inference time), this invention applies a reverse processing of "1 - value," uniformly converting all indicators into a "higher values are better" format for display in the same chart. In the normalization method, if an indicator is the worst among all methods, its normalized value is 0 (or very close to 0). When multiple such indicators appear, the method shrinks back to the center point in multiple directions on the radar chart, resulting in a "straight line" or "point." To avoid this problem, this invention introduces a "biased offset ε" mechanism, forcibly compressing the normalized value to the range [ε, 1-ε]. Let ε = 0.05, meaning the worst value is 0.05 and the best value is 0.95, ensuring that all methods have at least some visual display space in the chart.
[0228] Traditional methods such as SVM + HOG demonstrate some classification ability in undisturbed scenes and have a relatively fast inference speed (0.43s). However, due to a lack of context awareness and structural modeling capabilities, their accuracy and segmentation precision are poor in identifying weak targets in eutrophication environments, especially in scenarios with blurred boundaries and colors close to the background, where severe false negatives are prone to occur, with a false negative rate as high as 30.8%. CNN networks have some adaptability to image textures, but are limited by their shallow structure, making it difficult to complete multi-scale perception and concentration inversion tasks. U-Net outperforms traditional structures in segmentation accuracy (IoU), but lacks a detection branch and is weak in concentration estimation and real-time inference. YOLOv5, with its anchor mechanism and efficient structure, has a significant advantage in inference speed (0.67s) and superior detection capabilities compared to traditional models. However, due to the lack of integrated segmentation and concentration modeling functions, its perception of early algal bloom boundaries is weak, resulting in insufficient precision. Mask R-CNN is relatively comprehensive in terms of detection and segmentation accuracy, but due to its two-stage structure, it has a high computational cost and an inference time of 1.49 seconds, which poses a deployment burden in real-time early warning scenarios.
[0229] While the inference time of this invention (0.88 seconds) is slightly longer than that of YOLOv5 (0.67 seconds) and SVM (0.43 seconds), it achieves extremely high computational efficiency optimization while maintaining high accuracy, complex concentration modeling capabilities, and visualization output capabilities. Utilizing a modular parallel structure, segmentation and concentration output are generated simultaneously, avoiding redundant feature extraction. Furthermore, with the introduction of an edge-guided mechanism and a multi-scale sensing module, it accurately identifies tiny algal clusters, achieving excellent performance with a false negative rate of 6.8%, an IoU of 0.896, and an RMSE of only 0.057 mg / m³.
[0230] Therefore, the method of the present invention achieves good practicality and timeliness while ensuring comprehensive intelligent diagnostic capabilities, demonstrating high applicability and engineering deployment value in large-scale marine remote sensing intelligent early warning scenarios.
[0231] Example 2
[0232] This embodiment provides an image recognition-based system for judging and warning of eutrophication in seawater, including:
[0233] The data acquisition module is configured as follows:
[0234] A computer-readable storage medium storing a plurality of instructions adapted for loading and execution by a processor of a terminal device, the aforementioned image recognition-based method for determining and warning of eutrophication in seawater.
[0235] A terminal device includes a processor and a computer-readable storage medium, the processor being used to implement various instructions; the computer-readable storage medium being used to store multiple instructions, the instructions being adapted to be loaded and executed by the processor as described in the image recognition-based method for judging and warning of eutrophication in seawater.
[0236] 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, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for judging and early warning of eutrophication in seawater based on image recognition, characterized in that, include: Acquire multi-source image data; Data preprocessing is performed on the acquired multi-source image data; Occlusion region detection and mask construction are performed on the preprocessed image data to generate target detection boxes; Based on the generated target detection boxes, an improved U-Net network is used in conjunction with a spatial channel fusion strategy to output a eutrophication region mask; Visualize diagnostic results based on output mask; The process of detecting occlusion regions and constructing masks for preprocessed image data includes using a YOLOv8 model with an improved CSPDarknet architecture to extract shallow, mid, and deep feature maps at P3, P4, and P5 scales, respectively. An edge-guided attention mechanism is introduced to construct pixel-level edge attention maps in the shallow feature maps, enhancing edge region responses through specific paths and guiding the model to perceive boundary semantics, thereby improving the detection accuracy of target outlines. Specifically, an edge response map is constructed using image gradients, and the Sobel operator is used to extract the horizontal and vertical gradients of the channel-fused grayscale image. The edge map is then input into a lightweight neural network to generate an edge attention map, which is then expanded to the original feature dimension and fused with the original shallow feature map. , in, This represents the shallow feature map extracted from the input image at the P3 scale using the CSPDarknet backbone structure. For attention to the diagram Extending to the original feature map dimension enhances edge regions and suppresses background regions, resulting in an enhanced shallow feature map. Used for inputting the detection head; The process of detecting occlusion regions and constructing masks for the preprocessed image data also includes designing a three-scale detection head and extending it with a risk level prediction branch to address the limitation that the YOLO detection head only supports category and location output and cannot model the severity of semantically ambiguous targets or targets with large variations in red tide intensity. This branch is used to output the red tide intensity level corresponding to each detection box. The detection head output includes the input feature map... , , Each scale outputs K anchor features through a 3×3 convolution. The prediction information for each anchor is as follows: ,in, b The bounding box contains four numbers: center coordinates, width, and height. s Indicates confidence level; l The rating prediction uses one-hot three-class classification; and the rating prediction is based on the global pooling information of the target bounding box feature regions. Where GAP represents global average pooling; This is the classification weight matrix; For category bias items; The method utilizes an improved U-Net network and combines it with a spatial channel fusion strategy to output eutrophication region masks. This includes introducing a region clipping mechanism: extracting each eutrophication candidate region from the detection box set output by the previous module, clipping, aligning, and scaling it into a segmentation input tensor of a uniform format. This ensures that the position and shape of the U-Net do not affect the model's stability. Specifically, the candidate target set is selected... L Detection box in ,in, To determine the position of the center point of the detection box in the image; For width and height; change the original image The candidate image patch is formed by cropping the area centered on the frame. ,in, The dimensions are after adding boundary allowances; then image scaling and normalization are performed. The output normalized tensor has a dimension of , as input to the U-Net network; The method of using an improved U-Net network combined with a spatial channel fusion strategy to output a nutrient-rich region mask also includes constructing a five-layer symmetrical MSA-U-Net network. The encoder uses an SE-ResBlock structure to introduce channel attention, and the decoder inserts spatial attention. Each layer then fuses multi-scale receptive fields. The encoding path extracts features through five layers of convolution and pooling; the decoding path restores resolution through deconvolution and skip connections. Each layer fuses channel attention and spatial attention mechanisms to emphasize key regions and features. Each attention mechanism receives input features... All of these originate from the encoding and decoding results of this layer; among them, the squeeze-and-excitation mechanism is used to generate channel attention weights, that is, first... Perform global average pooling on each channel to obtain the channel statistics vector. , represented as: ; in, This represents the input feature map of this layer. Total number of channels, parameters This indicates a specific channel index number, and its value range is... ; The method of using an improved U-Net network and combining it with a spatial channel fusion strategy to output a eutrophication region mask also includes a concentration inversion mechanism based on the mask image, constructing a regression network to output a concentration map, wherein the last layer is used to decode and output the mask tensor: ,in, Features are output by the decoder; This represents the probability that each pixel is a red tide region; the last layer of features from the encoder... Input a fully connected layer, extract concentration features, and regress a pixel-level concentration map: ,in, It is a fully connected matrix; After Flattening, it becomes 32768×1; For bias terms; output This represents the concentration value for each pixel.
2. The method for judging and warning of eutrophication in seawater based on image recognition according to claim 1, characterized in that, The data preprocessing of the acquired multi-source image data includes image scale normalization, color normalization, and brightness alignment. Image scale normalization includes using bicubic interpolation to normalize the original acquired image. Scaling to target resolution By constructing a fourth-order interpolation function by taking 16 neighboring points around each pixel in the image, edge information and contour details are preserved during scaling, avoiding jagged edges and blurring issues. Color normalization and brightness alignment include unifying brightness intensity and normalizing the color space scale while maintaining the relative differences between channels, making the model generalizable to different acquisition platforms. The scaled image output after the preceding image scale normalization step is in coordinate... The pixel value at that location is denoted as For each color channel Calculate the mean value of all pixels in the image. and standard deviation : , , in, and The image's preset height and width are both 512; the normalized tensor calculation is represented as: ,in, This is used to avoid division by zero; after normalization, the pixel value distribution of each channel has a mean of 0 and a standard deviation of 1, and the output image is a normalized tensor. With uniform brightness intensity and color scale, it proceeds to the next disturbance suppression module.
3. The method for judging and warning of eutrophication in seawater based on image recognition according to claim 2, characterized in that, The data preprocessing of the acquired multi-source image data also includes using the Sobel operator to calculate the gradients of the image in the horizontal and vertical directions to identify high-frequency local disturbance regions in the image, then merging them into an amplitude map, and calculating the image edge intensity map through the directional gradient. A perturbation index map is constructed by combining the relative change rates of edge intensity and local brightness of the image edge intensity map with those of the background; then the perturbation index map is... Input a lightweight attention inhibition network and construct a perturbation attention weight graph. Finally, guided by the perturbation attention weight map, channel-level suppression is performed on each pixel in the image: , For clean areas, Then it is not suppressed; for high-disturbance regions, The pixel value approaches 0 to ensure that the structural boundary is preserved, and the non-target high-frequency part is automatically weakened.
4. The method for judging and warning of eutrophication in seawater based on image recognition according to claim 3, characterized in that, The visualization of diagnostic results based on the output mask includes displaying the set of output detection results. Plotted on the original image, with each detection box colored according to its level. Draw; create a segmentation mask for each candidate box. Mapping back to the original image coordinates from the corresponding positions, the first... After the segmentation mask of each candidate box is mapped back to the original image coordinates according to the corresponding position, in the coordinates The mask value at that location is expressed as The maximum confidence merging strategy is used for overlapping regions. Finally, the image is overlaid on the original image for transparent rendering, with high transparency areas indicating strong anomalies; color coding is used to represent eutrophication concentration or level; and a concentration map is output for each target region. Similarly, mapping back to the original image: after coordinate alignment, merge all region concentration maps; generate a unified concentration map. The concentration values are normalized to [0,1], and the colors are encoded using the Jet colormap scheme. The colors are then transparently overlaid with the original image to generate visual heatmaps.
5. A seawater eutrophication judgment and early warning system based on image recognition, executing the seawater eutrophication judgment and early warning method based on image recognition as described in claim 1, characterized in that, include: The data acquisition module is configured to acquire multi-source image data; The preprocessing module is configured to perform data preprocessing on the acquired multi-source image data; The target detection module is configured to perform occlusion region detection and mask construction on the preprocessed image data to generate target detection boxes; The mask output module is configured to output a eutrophication region mask based on the generated target detection box using an improved U-Net network and a spatial channel fusion strategy. The visualization module is configured to visualize diagnostic results based on the output mask.
Citation Information
Patent Citations
Red tide multispectral detection method based on U-Net network
CN113298086A
Seawater quality monitoring method and system based on automatic multi-source data assimilation
CN119274085A