Seawater area eutrophication judgment and early warning method and system based on image recognition
Through the improved U-Net network and edge-guided attention mechanism, the problems of insufficient accuracy and adaptability in seawater eutrophication identification technology are solved, high-precision and explainable eutrophication warning is achieved, and the accuracy of red tide detection and concentration estimation is improved.
Patent Information
- Application Number
- CN202510913278.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-07-03
AI Technical Summary
Existing seawater eutrophication identification technologies have problems such as low recognition accuracy, lack of dynamic change assessment of red tide areas, lack of time series prediction capabilities, and poor model adaptability, making it difficult to achieve high-precision and explainable early warnings.
An improved U-Net network combined with a spatial channel fusion strategy is used to generate eutrophication area masks through multi-source image data preprocessing, occlusion area detection and mask construction. The diagnostic results are then visualized. An edge-guided attention mechanism and a structural consistency loss function are introduced to improve detection accuracy and concentration estimation capabilities.
It has significantly improved the accuracy and real-time performance of marine eutrophication detection, reduced the missed detection rate and false alarm rate, improved the accuracy of concentration estimation, generated structured and interpretable early warning results, and enhanced the adaptability and practicality of the model.
Smart Images

Figure CN120635720A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of seawater pollution early warning, and in particular to a seawater eutrophication judgment and early warning method and system based on image recognition. Background Art
[0002] Nitrogen and phosphorus-containing nutrients, such as industrial, agricultural, and domestic wastewater, enter the ocean through rivers, leading to algal blooms and increased turbidity. This in turn causes ecological disasters such as red tides and dead zones, seriously threatening fishery resources, marine biodiversity, coastal tourism, and the living environment of coastal residents. With the continued increase in agricultural non-point source pollution, industrial emissions, and urban wastewater discharge, eutrophication has become a major constraint to the sustainable development of marine ecosystems. Effective monitoring and early warning of eutrophication have become key technical links in marine environmental governance.
[0003] Current mainstream eutrophication monitoring methods include manual sampling and laboratory testing, remote sensing reflectance models, and online water quality buoy monitoring systems. While laboratory testing offers high accuracy, it suffers from poor timeliness and limited coverage. Remote sensing methods, while capable of monitoring large areas, significantly reduce recognition rates due to cloud cover, wave disturbances, and varying light angles, making it difficult to accurately reflect the fine-grained structure of red tides. Furthermore, water quality buoys are expensive and sparsely deployed, making them inadequate for regional early warnings.
[0004] In recent years, the rapid development of image recognition technology, particularly the widespread application of high-performance object detection networks such as YOLO (You Only Look Once) in industrial and agricultural visual recognition, has provided a new approach to identifying water anomalies with its strong real-time performance and adaptability to complex environments. However, the native YOLO framework carries a certain risk of misidentification when dealing with complex sea surface backgrounds, and its accuracy in detecting the boundaries of small objects and floating objects is insufficient. Furthermore, the formation process of red tides exhibits significant temporal evolution and spatial diffusion. Relying solely on static images cannot depict their changing trends, making it difficult to construct a continuous early warning system.
[0005] The following key problems exist in the existing seawater eutrophication identification technology: First, the traditional image recognition model has low recognition accuracy under the background of high reflectivity and high disturbance on the sea surface, and it is difficult to separate red tide from non-red tide areas; second, the detection results of red tide areas are limited to static identification of "presence or absence", and lack the ability to accurately estimate and quantitatively evaluate indicators such as concentration, range, and structural changes; third, there is a lack of time series-based prediction models, which cannot achieve forward-looking analysis and risk prediction of red tide development trends; fourth, the existing models are difficult to adapt to changes in data distribution in different sea areas or image sources (satellites, drones, buoys), and lack universality and migration capabilities.
[0006] To this end, it is urgent to propose a new technical path that integrates image recognition, time series modeling, regional reconstruction and visual early warning, which has strong generalization capabilities for different sea environments, can not only achieve high-precision eutrophication detection, but also support explainable, visual and predictable closed-loop diagnosis. Summary of the Invention
[0007] In order to solve the above-mentioned problems, the present invention provides a method and system for judging and warning of eutrophication of 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 solutions: A method for judging and warning of eutrophication in seawater based on image recognition, comprising: Acquire multi-source image data; Performing data preprocessing on the acquired multi-source image data; Perform occlusion area detection and mask construction on the preprocessed image data to generate the target detection frame; Based on the generated target detection frame, the improved U-Net network is used in combination with the spatial channel fusion strategy to output the eutrophication area mask; Visualize the diagnostic results based on the output mask.
[0009] Furthermore, the data preprocessing of the acquired multi-source image data includes image scale normalization, color normalization and brightness alignment, wherein image scale normalization includes using bicubic interpolation to convert the original acquired image Uniform scaling to target resolution By taking 16 neighborhood points around each pixel in the image to construct a fourth-order interpolation function, the edge information and contour details are retained during the scaling process to avoid aliasing and blurring problems; color normalization and brightness alignment include unifying the brightness intensity and normalizing the color space scale on the basis of maintaining the relative difference of the channels, so that the model can be generalized to different acquisition platforms. , calculate the mean value of all pixels in the image and standard deviation : , , in, and The default height and width of the image are both 512; 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, enter the next disturbance suppression module.
[0010] Furthermore, the data preprocessing of the acquired multi-source image data also includes identifying high-frequency local disturbance areas in the image, using the Sobel operator to calculate the gradient of the image in the horizontal and vertical directions respectively, merging them into amplitude maps, and calculating the image edge intensity map G(x, y) through the directional gradient; constructing a disturbance index map by integrating the edge intensity of the image edge intensity map and the relative change rate of the local brightness background; and then inputting the disturbance index map D(x, y) into a lightweight attention suppression network to construct a disturbance attention weight map A. noise (x,y); Finally, under the guidance of the perturbation attention weight map, channel-level suppression is performed on each pixel in the image: , For clean areas, For high disturbance areas, , the pixel value approaches 0, ensuring that the structure boundary is preserved and the non-target high-frequency part is automatically weakened.
[0011] Furthermore, the occlusion area detection and mask construction are performed on the preprocessed image data, including using the YOLOv8 model with an improved CSPDarknet architecture to extract shallow, middle, and deep feature maps at three scales, P3, P4, and P5, respectively, and introducing an edge-guided attention mechanism to construct a pixel-level edge attention map in the shallow feature map, enhancing the edge area response through a specific path, guiding the model to perceive the boundary semantics, and thus improving the detection accuracy of the target outer contour. Among them, the edge response map is constructed using the image gradient, and the Sobel operator is used to take the horizontal and vertical gradients of the grayscale image after channel fusion. The edge map is input into a lightweight neural network to generate an edge attention map, and then the attention map is expanded to the original feature dimension and fused with the original shallow feature map: , in, Attention map Expand to the original feature dimension map; this operation will be used to enhance the edge area and suppress the background area; obtain the enhanced shallow feature map For sensor head input.
[0012] Furthermore, the occlusion area detection and mask construction of the pre-processed image data also include designing a three-scale detection head and expanding the risk level prediction branch to output the red tide level corresponding to each detection frame, in view that the YOLO detection head only supports category and position output, and cannot model the severity of targets with ambiguous semantics and large red tide degree changes. The output of the detection head includes the input feature map , , , each scale outputs K anchor features through 3×3 convolution , each anchor prediction information is: , where b is the target frame, a total of 4 numbers, center coordinates and width and height; s Indicates confidence; l Indicates that the level prediction uses one-hot three-class classification and is based on the global pooling information of the target box feature area: , Among them, GAP represents global average pooling; is the classification weight matrix; is the category bias term.
[0013] Furthermore, the improved U-Net network is used in combination with the spatial channel fusion strategy to output the eutrophication area mask, including the introduction of a region clipping mechanism, extracting each eutrophication candidate area from the detection box set output by the previous module, clipping, aligning, and scaling it into a segmentation input tensor of a unified format, ensuring the influence of U-Net position and shape, and enhancing the stability of the model, wherein the candidate target set is taken L The detection box in ,in, is the position of the center point of the detection box in the image; is the width and height; The region is cropped with the frame as the center to form a candidate image patch ,in, The size after adding the border margin; then perform image scaling and normalization , the output normalized tensor dimension is , as the input of the U-Net network.
[0014] Furthermore, the method uses an improved U-Net network and combines it with a spatial channel fusion strategy to output a eutrophication area mask, and also includes constructing a five-layer symmetrical MSA-U-Net network, in which the encoder uses a SE-Resblock structure to introduce channel attention, the decoder inserts spatial attention, and multi-scale receptive fields are fused after each layer; an encoding path that extracts features through 5 layers of convolution and pooling; a decoding path that restores the resolution through deconvolution and jump connections, and each layer fuses channel attention and spatial attention mechanisms to emphasize key areas and features; the input features received by each attention mechanism are are derived from the encoding and decoding results of this layer; among them, the squeeze-and-excitation mechanism is used to generate the channel attention weight, that is, Perform global average pooling on each channel to obtain the channel statistics vector , expressed as: .
[0015] Furthermore, the improved U-Net network is combined with the spatial channel fusion strategy to output the eutrophication area mask, and a concentration inversion mechanism based on the mask image is also included to construct a regression network to output the concentration map, wherein the last layer is used to decode the output mask tensor: , in, Output features for the decoder; Indicates the probability that each pixel is a red tide area; the last layer of the encoder features Input the fully connected layer, extract the concentration features, and regress the pixel-level concentration map: , in, is the fully connected matrix; After Flattening, it becomes 32768×1; is the bias term; output is the concentration value corresponding to each pixel.
[0016] Furthermore, the visual display of the diagnostic results based on the output mask includes the output detection result set Draw on the original image, for each detection box color according to the level Draw; segmentation mask of each candidate box Map back to the original image coordinates according to the corresponding positions, and use the maximum confidence merging strategy for overlapping areas Finally, it is superimposed on the original image for transparent rendering. The high transparency area is the strong abnormal area; color coding is used to represent the eutrophication concentration or level; the concentration map output for each target area is Map back to the original image: Merge all regional concentration maps after coordinate alignment; Generate a unified concentration map , normalize the concentration value to [0,1], encode the color using the Jet colormap heat map color scheme, and transparently overlay it with the original image to generate a visual hot zone.
[0017] Secondly, a seawater eutrophication judgment and early warning system based on image recognition includes: A data acquisition module is configured to acquire multi-source image data; A 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 a target detection frame; The mask output module is configured to output the eutrophication area mask based on the generated target detection box using the improved U-Net network combined with the spatial channel fusion strategy; The visualization module is configured to visualize the diagnosis results based on the output mask.
[0018] 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 and executed by a processor of a terminal device, a method for judging and warning of eutrophication of seawater based on image recognition.
[0019] 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; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded and executed by the processor to describe a method for judging and warning of eutrophication of seawater based on image recognition.
[0020] In summary, the present invention has the following beneficial technical effects: Compared with the defects of existing eutrophication image recognition methods in detection accuracy, morphological restoration ability, structural interpretability and concentration modeling, this invention constructs an intelligent marine eutrophication recognition and early warning system based on a multi-module collaborative modeling strategy. First, through disturbance suppression and normalization operations, the differences in illumination, resolution and noise during the image acquisition stage are eliminated, significantly improving image stability; secondly, a YOLO-Eutro detection module is proposed, which introduces an edge guidance mechanism and a structural consistency loss function while retaining the high efficiency of YOLO, effectively improving the detection accuracy of weak-boundary algae clumps; further segmentation and concentration estimation are performed through the MSA-U-Net structure, realizing fine-grained edge reconstruction and chlorophyll concentration fitting of the candidate area; finally, through the visualization and grade scoring module, a structured and interpretable result map and risk level report are generated, significantly enhancing the practicality of the model output and the adaptability of regulatory decisions.
[0021] In typical offshore eutrophication remote sensing monitoring tasks, the system of the present invention can reduce the missed detection rate of small-area clusters from 23.4% to 6.8%, and the false alarm rate from 18.5% to 5.9%; the segmentation accuracy (IoU) is improved by 22.7%, and the concentration estimation error (RMSE) is reduced by 21.1%; the single image processing time is shortened from 2.3 seconds to 0.88 seconds. The overall performance of the system shows excellent results in terms of accuracy, real-time performance, and interpretability. It significantly improves the ability to capture early anomalies, the ability to model the diffusion trend of moderate eutrophication, and the ability to respond to severe areas in a graded manner. It has good engineering promotion potential and practical deployment value. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1Schematic diagram of a method for determining and warning of eutrophication of seawater based on image recognition according to Example 1 of the present invention.
[0023] Figure 2 3 is a comparison chart of the accuracy and segmentation precision of Example 1 of the present invention.
[0024] Figure 3 3 is a comparison chart of missed detection rate and concentration error in Example 1 of the present invention.
[0025] Figure 4 This is a comparison chart of inference time in Example 1 of the present invention.
[0026] Figure 5 This is a normalized performance comparison radar chart of Example 1 of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described in detail below with reference to the accompanying drawings.
[0028] Example 1 Reference Figure 1 The present embodiment provides a method for determining and warning of eutrophication of seawater based on image recognition, including: Acquire multi-source image data; Performing data preprocessing on the acquired multi-source image data; Perform occlusion area detection and mask construction on the preprocessed image data to generate the target detection frame; Based on the generated target detection frame, the improved U-Net network is used in combination with the spatial channel fusion strategy to output the eutrophication area mask; Visualize the diagnostic results based on the output mask.
[0029] Specifically: (1) Multi-source image acquisition and preprocessing module, In intelligent marine eutrophication identification and early warning systems, images are the fundamental data source for their operation. Common image acquisition platforms currently include high-resolution satellites (such as Sentinel-2 and GF-6), low- and medium-altitude drones (equipped with visible light or multispectral cameras), and fixed ocean buoys or shore-based video monitoring systems. These platforms vary significantly in image acquisition resolution, imaging angle, lighting conditions, and capture time. This results in highly heterogeneous input images in terms of size, color distribution, and background noise. Furthermore, ocean scenes inherently present complex physical interference, such as specular sunlight reflections, wave texture disturbances, foam obstructions, floating objects, and cloud shadows. These factors generate a significant amount of unstructured high-frequency noise in the images, which can significantly affect the accurate identification of target boundaries and regional extents by downstream eutrophication detection models. To ensure model recognition accuracy and enhance the system's cross-scenario adaptability, a series of structural preprocessing operations are necessary before the images enter the neural network.
[0030] 1) Scale normalization, The size of raw images varies significantly across platforms. For example, the resolution of remote sensing images may reach 10,000 × 10,000 pixels, while buoy monitoring images are only 1,024 × 768 pixels. Such input discrepancies will severely impact the subsequent detection model's receptive field configuration, anchor size matching, and the stability of feature map pyramid generation. If resizing is skipped, the model will be unable to correctly learn the mapping between object scale and feature map position. The ground truth box during training may mismatch the feature map receptive field, resulting in significant missed detections. Furthermore, during deployment, inconsistent resizing can prevent batch loading of images during model inference, leading to system crashes. Therefore, all input images must be resized to a fixed spatial scale to ensure model structure matching while also controlling inference time and video memory usage.
[0031] Bicubic interpolation is used to convert the original image Uniform scaling to target resolution Bicubic interpolation constructs a fourth-order interpolation function by taking 16 neighborhood points around each pixel in the image. It can better preserve edge information and contour details during the scaling process, avoiding aliasing and blurring problems. The formula is as follows: ,
[0032] Among them, setting The input size required by the YOLO backbone structure; if the input image is non-uniform, the "long side uniform scaling + edge zero padding" strategy is used to fill it; the output image Will be used as input for the subsequent color alignment step.
[0033] 2) Color normalization and brightness alignment, Even when capturing the same area using different devices, ocean imagery can 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 have a higher response in the red channel, making algae or sediment in the water appear "redder," while overexposure in the blue channel can cause the water to appear lighter. Skipping color normalization can lead the model to misinterpret "device differences" as "eutrophic abnormalities," severely impacting detection accuracy. More importantly, color shift (e.g., an increased G / B ratio) is a key discriminant of eutrophic algal blooms. Without contrast in the channel values themselves, the model cannot effectively extract color-critical features. Therefore, this step must maintain relative channel differences while unifying brightness intensities and normalizing the color space scale to ensure model generalization across different acquisition platforms.
[0034] For each color channel , calculate the mean value of all pixels in the image and standard deviation : , , Perform standard normalization: , in, and The default height and width of the image are both 512; 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, enter the next disturbance suppression module.
[0035] 3) Identification and suppression of disturbance areas, Non-target perturbations are common in marine scenes. These disturbances primarily arise from the natural environment and imaging conditions, such as brightness ripples caused by waves, specular reflections under direct sunlight, high-frequency textures from foam accumulation, and random suspended matter disturbances in non-eutrophic algal areas. These structures often appear in images as high-frequency, low-contrast, or locally abrupt brightness patterns, with texture intensity potentially exceeding the edges of the target areas (red tide patches). If these perturbations are not explicitly suppressed, subsequent detection models can easily misinterpret them as the boundaries or centers of eutrophic areas. This is especially true during the shallow feature extraction stage, where convolutional neural networks can easily misinterpret these perturbations as "valuable edge signals," leading to false positives or mislocalization. Furthermore, in the YOLO architecture, shallow feature maps have the strongest edge perception. If these features are misinterpreted as interference boundaries, subsequent fusion layers will amplify this misinterpretation, causing incorrect convergence of the entire pipeline. Therefore, it is necessary to design a special disturbance area identification mechanism, combine the directional gradient, local brightness characteristics and edge change rate to construct a disturbance score map, and perform pixel-level suppression on these areas at the image level, so as to "silence" invalid signals at the source and purify the input feature space.
[0036] ① Calculation of edge disturbance intensity, To identify high-frequency local disturbance areas in an image, we first calculate the image edge intensity map G(x, y) using directional gradients. We use the Sobel operator to calculate the gradients of the image in the horizontal and vertical directions, and then merge them into an amplitude map: , in, Indicates that the image is convolved horizontally and vertically respectively; the Sobel kernel defaults to 3×3, which can effectively enhance the gradient mutation area in the image; output Indicates the edge response strength of a pixel. However, edge responses contain a large number of "structural edges" (such as target boundaries) and "disturbance edges" (such as foam streaks), requiring further identification of high-frequency responses caused by noise.
[0037] ②Construction of perturbation index graph, In order to model the high-frequency disturbance area probabilistically, a disturbance index map D(x,y) is introduced, which combines the relative change rate of edge intensity and local brightness background. The formula is as follows , in, is the edge intensity map; It represents the mean value of a 5×5 region centered on x,y, reflecting the brightness background of the region; Prevent division by zero; output Represents the pixel disturbance index. A larger value indicates that the pixel has abnormal edge changes in the local brightness environment, which is most likely caused by high-frequency disturbances such as reflections and water waves.
[0038] ③Construction of perturbation suppression attention map, Input the perturbation index map D(x,y) into a lightweight attention suppression network to construct the perturbation attention weight map A noise (x,y), the network structure is: , Among them, two layers of 3×3 Conv convolution constitute the perturbation recognition convolution kernel with a receptive field of 5×5, which is used to adapt to the local perturbation area; the ReLU activation function is used in the middle to enhance the perturbation-significant area; is the Sigmoid function, which normalizes the weight range to [0, 1]; output weight map , each pixel represents the confidence of its "perturbation", and the larger the value, the less credible the area.
[0039] ④ Disturbance suppression processing, Under the guidance of the perturbation attention map, channel-level suppression is performed on each pixel in the image: , For clean areas, For high disturbance areas, , the pixel value approaches 0, ensuring that the structure boundary is preserved and the non-target high-frequency part is automatically weakened. The image tensor obtained after processing Scale unification, brightness standardization and disturbance structure suppression have been completed, and its feature expression is more focused on the real target boundary, while avoiding false texture responses that mislead subsequent models.
[0040] 4) Occlusion area detection and mask construction, In marine remote sensing or real-world imagery, occluded regions are a typical source of unstructured noise. These regions include clouds, cloud shadows, floating plastic, seabirds, ships, camera mounts, and shoreside infrastructure. Because these regions often exhibit high brightness, complex textures, or colors distinct from the background water, they can 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 patches in images and can be mistaken for red tide centers. On the other hand, dark regions such as cloud shadows obscure the actual water information, rendering the detection model "blind" in these areas and leading to missed detections. More seriously, if these regions are not removed during supervised training, they will be mistakenly trained as "non-red tide" background, causing the model to learn incorrect classification boundaries. Therefore, a dedicated mechanism must be designed to identify and mask occluded regions in images, ensuring that these regions are neither included in training nor interfere with the inference process. The processing process should be able to adapt to various occlusion types and automatically mask suspicious areas without losing key target structures.
[0041] ① Construction of significance score map, The occluded area usually has three typical characteristics: high local information complexity (such as texture details of floating objects); high edge strength but irregular structure (such as bird shadows, plastic bags); and color distribution deviates from the main color tone of normal water bodies.
[0042] Therefore, the present invention constructs a significance score map S(x,y) that integrates three types of indicators: , in, The local entropy value calculated with a 5×5 neighborhood as a window indicates the degree of information chaos in the area; Represents the gradient intensity (calculated by the Sobel operator), which is used to describe the degree of boundary mutation; Indicates the Euclidean distance between the pixel color and the normal seawater color (such as turquoise), which is used to identify "non-water color" areas; the weight coefficient is preset to ; Output Indicates the saliency of each pixel being considered as an “abnormal occlusion region”.
[0043] ② Occlusion mask generation, Perform thresholding on the saliency map S(x,y) to obtain a preliminary mask: , in, is the indicator function; is the adaptive threshold, calculated based on the mean and standard deviation of the saliency map; μS, σS: are the mean and standard deviation of the saliency value of the entire image; To adjust the sensitivity of occlusion judgment. To remove small-area pseudo-occlusions and connect the real occlusion areas, raw Then perform two morphological processing steps: dilation operation (kernelsize = 3×3) to connect the occlusion boundaries; opening operation to remove small pseudo-mask areas and output the final mask .
[0044] ③ Image mask processing, Use the occlusion mask to directly shield the image content of the corresponding area: , in, This means that in the mask, the position (x, y) is marked as the occluded area, and the pixel information will be reset to zero; the non-occluded area will be completely retained to ensure the continuity of the image structure. The final output image tensor is It is a "clean image input" that has been processed with size unification, color alignment, disturbance suppression, and occlusion masking. It has high availability, low noise, and strong boundary features, and is suitable for the downstream eutrophication area detection model.
[0045] (2) Eutrophication Area Detection Module (YOLO-Eutro) Marine eutrophication is an environmental anomaly characterized by spatial gradients, diverse morphologies, and fuzzy boundaries. Its visual manifestations typically appear as flakes, flocs, floating areas, or areas with unclear edges that appear greenish-blue. These objects in images exhibit irregular structures and color distributions similar to the background water. Furthermore, these objects are subject to interference from lighting, wind, waves, and imaging angle, making boundary segmentation and accurate region detection difficult. Traditional eutrophication detection methods rely primarily on threshold segmentation or color space analysis, which are extremely sensitive to image noise and struggle to adapt to complex marine environments. 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 detecting "hard-bounded objects" such as vehicles and faces, their performance suffers significantly when used to detect fuzzy-bounded, ill-defined marine algae clumps. Therefore, based on YOLOv8, this paper redefines the target detection strategy suitable for weak boundaries and fuzzy structures, and proposes the YOLO-Eutro architecture, which integrates the following design points: using multi-scale deep and shallow feature fusion to extract red tide areas of different scales; designing an edge-guided attention mechanism to guide shallow features to focus on real boundaries; introducing a structural consistency loss function to enhance the model's perception of morphological structure; expanding the classification output and adding auxiliary prediction of red tide levels (mild / moderate / severe). The entire module receives images from the preprocessing module. As input, output candidate target box set ,Each detection target contains location, confidence and level prediction information.
[0046] 1) Multi-scale backbone feature extraction structure, Eutrophic areas can appear at various spatial scales in images: some small, incipient red tides occupy only a small area of the image, with subtle, difficult-to-detect texture boundaries, while concentrated red tide outbreaks cover a wide area with complex regional contours. Feature extraction at a single scale cannot simultaneously account for the structural characteristics of both small and large objects. Furthermore, red tide targets often exhibit multi-layered semantic structure (such as edge feathering and strong central texture). Deep networks can extract high-level semantic features, while shallow networks are more adept at capturing edge information. Therefore, a pyramid-like multi-scale architecture is necessary to simultaneously model semantics and boundaries at different spatial resolutions. The YOLOv8 backbone utilizes a modified CSPDarknet architecture, which exhibits excellent multi-layer information fusion capabilities and can run efficiently on edge devices. Therefore, this module retains this backbone architecture while simultaneously extracting shallow, mid-level, and deep feature maps at the P3, P4, and P5 scales, respectively, to provide input for subsequent detection and attention mechanisms.
[0047] Input image After passing through the CSPDarknet backbone structure of YOLOv8, three sets of feature maps are output: , in, are the number of shallow, middle and deep feature channels respectively; output features F 3 Used to focus on fine-grained edge details; F 4 Used to model mesoscale contour information; F 5 It is used to integrate semantic information and overall structure. Each stage includes multiple residual structures, bottleneck blocks, and cross-stage partial connections to effectively prevent gradient vanishing and improve expressiveness.
[0048] The three-layer feature maps F3, F4, and F5 will serve as the input of subsequent sub-modules, including the edge-guided attention module (EGA) for weighting F3; the detection head fusion module for summarizing the three scale features and generating detection results; and the auxiliary level prediction branch for extracting red tide risk level features from F5.
[0049] 2) Edge-Guided Attention (EGA) In images of marine eutrophication, algae clumps often exhibit visual characteristics characterized by blurred boundaries, irregular structure, and gradient color distribution. This is particularly true in environments disturbed by waves and reflections, where the boundary between red tides and the water body is extremely unclear. Traditional object detection models are naturally adaptable to hard boundaries (such as vehicles and people). However, when faced with objects with weak boundaries, they struggle to separate the target region from the background response in the feature map, leading to problems such as drifting detection boxes, oversizing, and missed detections. Furthermore, while the lower-layer feature maps of the YOLO series models possess edge-aware capabilities, the default convolutional extraction process does not actively focus on the object boundaries. This boundary insensitivity can amplify model errors in weakly structured objects. Therefore, this paper designs an edge-guided attention mechanism (EGA) that constructs a pixel-level edge attention map within the shallow feature map. This mechanism enhances the response to edge regions through a specific path, guiding the model to perceive boundary semantics and thus improving the detection accuracy of the object's outer contour.
[0050] ①Edge graph construction, The input feature map comes from the shallow features of the backbone network , use the image gradient to construct the edge response map, and use the Sobel operator to take the horizontal and vertical gradients of the grayscale image after channel fusion: , in, is the channel average; They are horizontal and vertical Sobel filters respectively; the output is the edge response map .
[0051] ②Attention weight map generation, Input the edge map into a lightweight neural network to generate an edge attention map: , Among them, two layers of 3×3 Conv convolution are used to extract local texture; the ReLU activation function ensures the edge response enhancement nonlinearity; The Sigmoid function ensures that the attention map is in the range of [0,1]; the final output .
[0052] ③Attention feature map fusion, Expand the attention map to the original feature dimension and fuse it with the original shallow feature map: , in, Attention map Expand to the original feature dimension map; this operation will be used to enhance the edge area and suppress the background area; obtain the enhanced shallow feature map For sensor head input.
[0053] 3) Detection head structure and level output branch, The standard YOLO detection head only supports category and position output. For targets with ambiguous semantics and large changes in red tide severity, it is impossible to further model their "severity" and "morphological level" information. In the eutrophication monitoring task, the classification of "mild / moderate / severe" is not only conducive to early warning classification, but also provides support for downstream concentration estimation and governance scheduling. In addition, the multi-scale target structure requires the detection head to have cross-layer fusion capabilities to process large, medium and small targets at the same time. Therefore, a three-scale detection head is designed, and a "risk level prediction branch" is expanded to output the red tide severity level corresponding to each detection frame.
[0054] ①Detection head output, The input feature map is , , , each scale outputs K anchor features through 3×3 convolution: , The prediction information for each anchor is: , Among them, b is the target box, a total of 4 numbers, center coordinates and width and height; s Indicates confidence (whether there is an object), which is 1 number; l Indicates that the level prediction adopts one-hot three-class classification, which is 3 numbers.
[0055] ②Level prediction branch, The level prediction comes from the global pooling information of the target box feature area: , Among them, GAP represents global average pooling; is the classification weight matrix; is the category bias term.
[0056] The loss function is: , in, is the true label, and the cross entropy is used to calculate the classification error.
[0057] 4) Structural consistency loss function, Traditional object detection box regression uses IoU or GIoU loss, which only focuses on the degree of area overlap. For red tide targets with complex structures and blurred edges, the predicted box may "look good" in IoU, but the structure does not overlap with the real target at all, and it cannot detect edge leakage or holes in the box. To enhance the modeling of the target morphological structure, a structural consistency joint loss function is introduced: , in, Represents the center distance IoU loss, constraining the box center consistency; is the predicted box image area; is the real frame image area; SSIM represents the real frame image area; 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, and not only the frame is accurate, but also the shape is accurate.
[0058] The final output is a set of candidate targets: , in, Indicates the detection box position, center coordinates, width and height; Indicates confidence; Indicates the eutrophication level; N Indicates the number of candidate boxes. Each candidate box area will be sent to module (3) fine segmentation and concentration estimation module to perform pixel-level segmentation and water quality parameter inversion.
[0059] (3) Fine segmentation and concentration estimation module (MSA-U-Net) In marine eutrophication image analysis, while the object detection module (YOLO-Eutro) can initially delineate the bounding boxes of red tide patches, this result only provides coarse-grained location and area information, failing to accurately describe the boundary shape, actual coverage, and internal concentration variations. A key requirement of eutrophication early warning systems is to assess the true outline area, edge evolution trends, and concentration distribution of algal patches in the ocean. Traditional image segmentation methods (such as FCN and SegNet) lack the ability to preserve boundary details and generalize across scales. These methods are particularly prone to edge jaggedness, misclassification, and multi-level connection errors when dealing with eutrophic patches with blurred textures, feathered boundaries, and gradually changing structures. Therefore, this module utilizes a modified U-Net architecture, a multi-scale self-attention mechanism (MSA), and a spatial channel fusion strategy to precisely restore boundary information while maintaining global structural understanding. Ultimately, this module outputs a detailed eutrophication area mask on the one hand, and a pixel-level "concentration map" or "distribution density map" on the other hand, which is used to assist the system in assessing the risk level and warning intensity.
[0060] 1) Candidate region extraction and normalized input, Since the YOLO detection results provide rectangular bounding boxes, performing global segmentation directly on the entire image will cause the following problems: redundant calculations in non-target areas, wasting resources; misjudgments in non-target areas (such as waves being identified as red tides); and a lack of a target center alignment mechanism, which leads to semantic information offset.
[0061] Therefore, the present 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 in a unified format to ensure the influence of U-Net position and shape and enhance the stability of the model. Get the candidate target set L Detection box in: , in, is the position of the center point of the detection box in the image; is the width and height.
[0062] The original image The region is cropped with the frame as the center to form a candidate image patch: , in, This is the size after adding the border allowance.
[0063] Then perform image scaling and normalization: , The output normalized tensor dimension is , as the input of the U-Net network.
[0064] 2) MSA-U-Net structure construction, The original U-Net architecture extracts multi-scale information through a symmetrical downsampling / upsampling process and transfers boundary features through skip connections, making it suitable for scenes with continuous backgrounds, such as medical images. However, in ocean images, due to discontinuous boundaries, complex shapes, and colors close to the background, multi-scale modeling is required to adapt to clumps of varying sizes. A self-attention mechanism is needed to enhance focus on structural edges and internal regions of difference. Furthermore, a combined channel-attention and spatial-attention mechanism is needed to enable the model to focus on both regional locations and local texture and density variations.
[0065] 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, the decoder inserts the spatial attention module, and multi-scale receptive fields (3×3, 5×5, 7×7) are fused after each layer.
[0066] In this module, each detection box cropping area It will be input into the MSA-U-Net network structure as the input of the segmentation unit.
[0067] 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 the resolution through deconvolution and jump connections. Each layer integrates channel attention and spatial attention mechanisms to emphasize key areas and features; each attention mechanism receives input features. All of them come from the encoding or decoding results of this layer.
[0068] Taking a certain layer of U-Net as an example, its input features are recorded as: , Among them, l represents the lth layer; C, H, W : The number of channels and spatial dimensions of this layer; this feature comes from the intermediate result of the encoding path (downsampling) or the decoding path (deconvolution + concatenation).
[0069] ①Attention mechanism module Generate channel attention weights using the squeeze-and-excitation mechanism: , First Perform global average pooling on each channel to obtain the channel statistics vector .
[0070] Then use a two-layer fully connected network for weight compression and activation: , in, is the trainable parameter matrix, r is the compression ratio; The Sigmoid function is used to normalize the channel weights to [0, 1].
[0071] The output after channel enhancement is: , ②Spatial attention module Calculate spatial attention on the feature map after channel enhancement, and calculate the maximum pooling and average pooling results between channels: , After concatenation, convolution is used to generate spatial weights: , Among them, the output , indicating the importance of each pixel position.
[0072] The final output after attention fusion is: , 3) Concentration mapping and regression output, Detection and segmentation can only determine "eutrophication," but cannot provide information on "eutrophication level" or "concentration density." In practical applications, however, it's necessary to estimate algae density to distinguish between mild, moderate, and outbreak-level events. Therefore, this module uses a concentration inversion mechanism based on mask images, constructing a regression network to output a concentration map.
[0073] ①Mask output, Use the last layer to decode the output mask tensor: , in, Output features for the decoder; Indicates the probability that each pixel is a red tide area.
[0074] ②Concentration estimation output The last layer of the encoder features Input the fully connected layer, extract the concentration features, and regress the pixel-level concentration map: , in, is the fully connected matrix; After Flattening, it becomes 32768×1; is the bias term; output is the concentration value corresponding to each pixel (can be mapped to chlorophyll a concentration mg / m³).
[0075] (4) Diagnosis result visualization and warning interpretation module, In traditional eutrophication monitoring systems, even when using image recognition or physical sensing, the output is often just a set of data tables (e.g., 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 identify problem areas, spread trends, and warning levels, hindering efficient human-machine collaboration and response. In deep learning systems, in particular, neural network models process inputs in a highly "black-box" manner, lacking clear causal logic, making it difficult for decision-makers to trust the model's judgment. Furthermore, the severity of eutrophication events is inherently a continuous variable (from early weak changes to localized red tides to explosive clusters). If the model only outputs "whether or not an abnormality exists," it will miss the intermediate warning stages, resulting in delayed or overreaction. Therefore, this module aims to uniformly map all detection and analysis results of the system into visual images. Combining explanatory heat maps with a hierarchical scoring mechanism, it visually encodes event severity, improving the system's usability, interpretability, and controllability.
[0076] 1) Detection frame visualization overlay, The detection results output in module (2) are collected Draw on the original image, for each detection box color according to the level Drawing: Green / Yellow / Red (mild / moderate / severe); superimpose the confidence score and predicted level in the upper left corner of the box, such as "87%, moderate"; 2) Fine mask overlay and transparent rendering, The segmentation mask of each candidate box output in module (3) Map back to the original image coordinates according to the corresponding position: , in, Bundle The mask is scaled to box b i size; Place the scaled mask at the corresponding position in the original image (by b i Given), that is, the mask Map (align) back to the original image space to align it to the predicted box b i Location.
[0077] Use a maximum confidence merge strategy for overlapping regions: , Finally, the image is superimposed on the original image for transparent rendering, with high transparency areas representing strong anomaly areas. Color coding (gradient from green to red) is used to indicate eutrophication concentration or level. 3) Concentration heat map generation, Output the concentration map of each target area in module (3) Map back to the original image: Merge all regional concentration maps after coordinate alignment; Generate a unified concentration map , normalize the concentration value to [0,1], and use the Jet colormap color scheme to encode the color, and transparently overlay it with the original image to generate a visual hotspot 4) Abnormal scoring and level aggregation mechanism, To facilitate the overall scheduling of the system and quantify the degree of abnormality, a set of regional scoring functions are defined to aggregate and evaluate all eutrophication detection areas, with scores ranging from 0 to 100: , in, N is the number of detection areas; is the grade weighting coefficient, mild = 1, moderate = 2, severe = 3; To test confidence; is the area of the region (calculated by the mask); the final score S totalIt can be used for grade determination. Scores range from 0-20 for normal, 21-50 for slightly abnormal, 52-75 for moderately abnormal, and 76-100 for severely abnormal. A text summary is also output, including indicators such as the number of abnormal areas, the location of the maximum concentration area, the average grade, and the total area, for quick review by environmental managers.
[0078] Experimental verification: This experiment selected a typical remote sensing image dataset of seawater eutrophication, including satellite images, drone high-altitude images, and shore monitoring images from typical eutrophic coastal areas such as the East China Sea and Bohai Sea. The images were annotated to mark the boundaries of red tide clusters and multi-level concentration distributions, and provide actual water sampling concentration values. In constructing the test set, five sea disturbance levels were set: no disturbance (0), slight disturbance (0.25), moderate disturbance (0.5), severe disturbance (0.75), and extreme disturbance (1.0), respectively simulating changes in wind and waves, light, cloud cover, and other conditions. The experiment tested the robustness and stability of the model under different disturbance conditions.
[0079] 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: unimproved detection model; Mask R-CNN: detection + segmentation two-stage method.
[0080] The proposed method was evaluated on the same test set as the above five methods. The comparison indicators included: accuracy of eutrophication area detection (Acc); miss detection rate of small clusters (Miss); segmentation accuracy (IoU); root mean square error (RMSE); and diagnostic reasoning time (Time).
[0081] Table 1 Data comparison of different methods under five indicators method Accuracy Acc (%) Miss detection rate (%) Segmentation accuracy IoU (%) <![CDATA[Concentration error RMSE (mg / m 3 )]]> Reasoning 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 The experimental results are shown in Table 1. Figure 2 、 Figure 3 、 Figure 4As shown, since the five metrics are evaluated differently, they cannot be directly displayed in the same radar chart. Therefore, this invention retains the positive metrics (higher values are better, namely, accuracy and segmentation precision) unchanged. For the negative metrics (lower values are better, namely, missed detection rate, concentration error, and inference time), this invention applies the inverse processing of "1 - value" to uniformly convert all metrics to a "higher values are better" format for display in the same chart. In the normalization method, if a metric has the worst value among all methods, its normalized value is 0 (or very close to 0). When multiple such metrics appear, the radar chart will be retracted to the center point in multiple directions, resulting in a "straight line" or "point". To avoid this problem, this invention introduces a "paranoid offset ε" mechanism to compress the normalized values to the range [ε, 1-ε]. Assuming ε = 0.05, this means the worst value is 0.05 and the best value is 0.95, ensuring that all methods have at least some visual space in the chart.
[0082] Traditional methods such as SVM + HOG have some classification capabilities in undisturbed scenes and offer fast inference speeds (0.43s). However, due to their lack of contextual awareness and structural modeling capabilities, they exhibit poor accuracy and segmentation precision in identifying weak targets in eutrophic environments. They are particularly prone to significant missed detections in situations with blurred boundaries and colors close to the background, with a miss detection rate as high as 30.8%. CNN networks have some adaptability to image texture, but are limited by their shallow structure, making them incapable of multi-scale perception and concentration inversion. U-Net outperforms traditional architectures in segmentation accuracy (intersection over union), but lacks a detection branch and exhibits limited performance in concentration estimation and real-time inference. YOLOv5, leveraging its anchor mechanism and efficient structure, offers significant advantages in inference speed (0.67s) and detection capabilities compared to traditional models. However, due to its lack of integrated segmentation and concentration modeling capabilities, it has limited ability to perceive the boundaries of early algal blooms and lacks 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 warning scenarios.
[0083] While the proposed method's inference time (0.88 seconds) is slightly higher than that of YOLOv5 (0.67 seconds) and SVM (0.43 seconds), it achieves exceptionally high computational efficiency while maintaining high accuracy, complex concentration modeling capabilities, and visual output capabilities. Leveraging a modular parallel structure, it simultaneously generates segmentation and concentration output, avoiding duplicate feature extraction. Furthermore, through the introduction of an edge-guided mechanism and a multi-scale perception module, it accurately identifies microalgae clumps, achieving an excellent false negative rate of 6.8%, an IoU of 0.896, and an RMSE of only 0.057 mg / m³.
[0084] Therefore, the method of the present invention achieves good practical timeliness while ensuring comprehensive intelligent diagnostic capabilities, showing high applicability and engineering deployment value in large-scale ocean remote sensing intelligent early warning scenarios.
[0085] Example 2 This embodiment provides a seawater eutrophication judgment and early warning system based on image recognition, 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 method for judging and warning of eutrophication of seawater based on image recognition.
[0086] 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 describe a method for judging and warning eutrophication of seawater based on image recognition.
[0087] 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 method for judging and warning of eutrophication in seawater based on image recognition, characterized in that: include: Acquire multi-source image data; Performing data preprocessing on the acquired multi-source image data; Perform occlusion area detection and mask construction on the preprocessed image data to generate the target detection frame; Based on the generated target detection frame, the improved U-Net network is used in combination with the spatial channel fusion strategy to output the eutrophication area mask; Visualize the diagnostic results based on the output mask.
2. The method for judging and warning of eutrophication of 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, wherein the image scale normalization includes using bicubic interpolation to convert the original acquired image Uniform scaling to target resolution By taking 16 neighborhood points around each pixel in the image to construct a fourth-order interpolation function, the edge information and contour details are retained during the scaling process to avoid aliasing and blurring problems; color normalization and brightness alignment include unifying the brightness intensity and normalizing the color space scale on the basis of maintaining the relative difference of the channels, so that the model can be generalized to different acquisition platforms. , calculate the mean value of all pixels in the image and standard deviation : , , in, and The default height and width of the image are both 512; 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, enter the next disturbance suppression module.
3. The method for judging and warning of eutrophication of seawater based on image recognition according to claim 2, characterized in that: The data preprocessing of the acquired multi-source image data also includes identifying high-frequency local disturbance areas in the image, using the Sobel operator to calculate the gradient of the image in the horizontal and vertical directions respectively, merging them into amplitude maps, and calculating the image edge intensity map G(x, y) through the directional gradient; constructing a disturbance index map by integrating the edge intensity of the image edge intensity map and the relative change rate of the local brightness background; and then inputting the disturbance index map D(x, y) into a lightweight attention suppression network to construct a disturbance attention weight map A. noise (x,y); Finally, under the guidance of the perturbation attention weight map, channel-level suppression is performed on each pixel in the image: , For clean areas, For high disturbance areas, , the pixel value approaches 0, ensuring that the structure boundary is preserved and the non-target high-frequency part is automatically weakened.
4. The method for judging and warning of eutrophication of seawater based on image recognition according to claim 3, characterized in that: The occlusion area detection and mask construction of the preprocessed image data include using the YOLOv8 model with an improved CSPDarknet architecture to extract shallow, middle, and deep feature maps at three scales, P3, P4, and P5, respectively. The edge-guided attention mechanism is introduced to construct a pixel-level edge attention map in the shallow feature map, and the edge area response is enhanced through a specific path to guide the model to perceive the boundary semantics, thereby improving the detection accuracy of the target outer contour. The edge response map is constructed using the image gradient, and the Sobel operator is used to take the horizontal and vertical gradients of the grayscale image after channel fusion. The edge map is input into a lightweight neural network to generate an edge attention map, and the attention map is then expanded to the original feature dimension and fused with the original shallow feature map: , in, Attention map Expand to the original feature dimension map; this operation will be used to enhance the edge area and suppress the background area; obtain the enhanced shallow feature map For sensor head input.
5. The method for judging and warning of eutrophication of seawater based on image recognition according to claim 4, characterized in that: The occlusion area detection and mask construction of the pre-processed image data also include designing a three-scale detection head and expanding the risk level prediction branch to output the red tide level corresponding to each detection frame, in which the detection head output includes the input feature map as follows: , , , each scale outputs K anchor features through 3×3 convolution , each anchor prediction information is: ,in, b The target frame has 4 numbers: center coordinates, width, and height. s Indicates confidence; l Indicates that the level prediction uses one-hot three-class classification and is based on the global pooling information of the target box feature area: , Among them, GAP represents global average pooling; is the classification weight matrix; is the category bias term.
6. The method for judging and warning of eutrophication of seawater based on image recognition according to claim 5, characterized in that: The improved U-Net network is combined with the spatial channel fusion strategy to output the eutrophication area mask, including the introduction of a region clipping mechanism, extracting each eutrophication candidate area from the detection box set output by the previous module, clipping, aligning, and scaling it into a segmentation input tensor of a unified format, ensuring the influence of U-Net position and shape, and enhancing the stability of the model. L The detection box in ,in, is the position of the center point of the detection box in the image; is the width and height; The region is cropped with the frame as the center to form a candidate image patch ,in, The size after adding the border margin; then perform image scaling and normalization , the output normalized tensor dimension is , as the input of the U-Net network.
7. The method for judging and warning of eutrophication of seawater based on image recognition according to claim 6, characterized in that: , A method for judging and warning eutrophication of seawater based on image recognition according to claim 1, characterized in that the improved U-Net network is used in combination with the spatial channel fusion strategy to output the eutrophication area mask, and further comprises constructing a five-layer symmetrical MSA-U-Net network, wherein the encoder adopts the SE-ResBlock structure to introduce channel attention, the decoder inserts spatial attention, and multi-scale receptive fields are fused after each layer; an encoding path extracts features through 5 layers of convolution and pooling; a decoding path restores the resolution through deconvolution and jump connection, and each layer fuses channel attention and spatial attention mechanisms to emphasize key areas and features; the input features received by each attention mechanism are derived from the encoding and decoding results of this layer; among them, the squeeze-and-excitation mechanism is used to generate the channel attention weight, that is, Perform global average pooling on each channel to obtain the channel statistics vector , expressed as: 。 8. The method for judging and warning of eutrophication of seawater based on image recognition according to claim 7, characterized in that: The improved U-Net network is combined with a spatial channel fusion strategy to output a eutrophication area mask, and also includes a concentration inversion mechanism based on the mask image to construct a regression network to output a concentration map, wherein the last layer is used to decode the output mask tensor: , in, Output features for the decoder; Indicates the probability that each pixel is a red tide area; the last layer of the encoder features Input the fully connected layer, extract the concentration features, and regress the pixel-level concentration map: , in, is the fully connected matrix; After Flattening, it becomes 32768×1; is the bias term; output is the concentration value corresponding to each pixel.
9. The method for judging and warning of eutrophication of seawater based on image recognition according to claim 8, characterized in that: The visual display of the diagnostic results based on the output mask includes the output detection result set Draw on the original image, for each detection box color according to the level Draw; segmentation mask of each candidate box Map the corresponding positions back to the original image coordinates, and use the maximum confidence merging strategy for overlapping areas: , Finally, the original image is superimposed on the original image for transparent rendering. The high transparency area is the strong abnormal area. The color coding is used to represent the eutrophication concentration or level. The concentration map of each target area is output. Map back to the original image: Merge all regional concentration maps after coordinate alignment; Generate a unified concentration map , normalize the concentration value to [0,1], encode the color using the Jet colormap heat map color scheme, and transparently overlay it with the original image to generate a visual hot zone.
10. A seawater eutrophication judgment and early warning system based on image recognition, characterized in that: include: A data acquisition module is configured to acquire multi-source image data; A 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 a target detection frame; The mask output module is configured to output the eutrophication area mask based on the generated target detection box using the improved U-Net network combined with the spatial channel fusion strategy; The visualization module is configured to visualize the diagnosis results based on the output mask.
Citation Information
Patent Citations
Red tide multispectral detection method based on U-Net network
CN113298086A
Underwater image enhancement method based on Unet and multi-scale feature fusion
CN118761923A
River water ecological space global monitoring method and system
CN119251715A
Seawater quality monitoring method and system based on automatic multi-source data assimilation
CN119274085A
Coastal high spot monitoring green tide recognition early warning method, medium and system
CN119540781A