Water-flooded plant detection method, system and equipment based on region context enhancement, and medium

By combining a regional context enhancement module and deep learning methods, the problem of insufficient detection accuracy of traditional flooded factory buildings in complex environments is solved, achieving higher accuracy and robustness in flooded area identification.

CN120997567APending Publication Date: 2025-11-21SANXIA JINSHAJIANG YUNCHUAN HYDROPOWER DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511037307.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Traditional methods for detecting flooded factory buildings lack accuracy in complex environments. They rely on single image features and ignore the spatial relationships and contextual information of different areas within the factory building, leading to frequent false positives and false negatives, and poor robustness.

Method used

By combining a regional context enhancement module, complex features are automatically learned through semantic segmentation and deep learning. Combining local and surrounding environmental features, multi-scale feature fusion and redundancy algorithms are employed to improve the recognition capability and robustness of flooded areas.

Benefits of technology

It significantly improves the detection accuracy and robustness of flooded areas, and can cope with complex factors such as changes in lighting, shading and water surface reflection, making it suitable for monitoring flooded factory buildings and disaster early warning in practical applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997567A_ABST
    Figure CN120997567A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of waterlogged factory building detection based on regional context enhancement, in particular to a waterlogged factory building detection method, system and device based on regional context enhancement and a medium. Collecting image information, and preprocessing the image information; segmenting the image by using a semantic segmentation technology, extracting context information of a water area and a surrounding environment through a regional context enhancement network, and extracting features of each area by using a convolution operation; processing the features by adopting a region context enhancement network, combining the local features of each region with the features of the surrounding region, and enhancing the recognition capability of the water-flooded region; a multi-scale feature fusion strategy is adopted, image features of different scales are combined, redundant detection frames are removed through a redundancy removal algorithm, and finally a water-flooded area is output. The method can adapt to complex flooding scenes, has high robustness and precision, and is suitable for application scenes such as actual flooding plant monitoring and disaster early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of flooded plant detection technology based on regional context enhancement, and particularly to methods, systems, equipment and media for flooded plant detection based on regional context enhancement. Background Technology

[0002] In the field of flooded factory building detection, with the continuous development of technology, image processing methods have undergone a transformation from traditional image processing to deep learning image processing. Traditional image processing methods mainly rely on techniques such as color space conversion, edge detection, and region growing. These methods are effective for simple scenes (such as environments where water is clearly visible), but they often fail to meet high-precision requirements in complex backgrounds (such as factory areas). Traditional methods segment water areas by converting color spaces (such as RGB to HSV, LAB spaces) and setting thresholds. However, when the water area is similar in color to the background (such as factory buildings, roads), this method is prone to false positives or false negatives. Edge detection methods (such as Canny edge detection and the Sobel operator) can effectively extract obvious water boundaries, but in low-contrast areas, especially around factories, edge information may be blurred, affecting detection accuracy. Region growing algorithms identify water areas by expanding the region from seed points, but their effectiveness is limited by the choice of seed points and is prone to false expansion in scenes with a lot of image noise or where the water area is similar to the background. Morphological processing (such as erosion and dilation) is used to correct the boundaries of the segmented water areas, but its effectiveness depends on the selected parameters and may lead to inaccurate boundaries in complex environments.

[0003] With the development of deep learning, especially the widespread application of convolutional neural networks (CNNs) in image segmentation, deep learning methods have gradually become the mainstream technology for detecting flooded factory buildings. Deep learning methods, by automatically learning image features, can capture more complex contextual information, significantly improving the accuracy of water area segmentation. For example, fully convolutional networks (FCNs), as a classic deep learning model, can generate pixel-level segmentation results through a fully convolutional structure, making them suitable for water area segmentation in large-scale images. The U-Net model, through its encoder-decoder structure and skip connections, can finely segment the boundaries between water areas and factory buildings, making it particularly suitable for accurate segmentation in small sample learning and complex backgrounds. The DeepLab series of models uses dilated convolutions to expand the receptive field, improving the model's ability to capture global contextual information and accurately extracting water areas, making it particularly suitable for complex environments such as urban areas or industrial factories. Mask R-CNN, by combining object detection and pixel-level segmentation, can accurately identify flooded areas within factory buildings and generate corresponding segmentation masks, making it suitable for instance-level water area segmentation. A key advantage of deep learning models is their ability to automatically learn complex features of water bodies from data, without relying on manually set thresholds and rules, and to adapt to more complex scenarios and environments.

[0004] Furthermore, with the development of region context enhancement methods, deep learning models, through multi-scale convolution or attention mechanisms, can combine the structural features of the factory building with the spatial information of the surrounding environment to better capture the features of water areas. This is particularly true when the water area and factory building background are close, significantly improving segmentation accuracy. How to combine deep learning methods with region context enhancement to improve the detection accuracy of flooded areas while simultaneously enhancing the model's robustness in complex environments has become a key research direction for the future detection of flooded factory buildings. Summary of the Invention

[0005] In view of the aforementioned existing problems, the present invention is proposed.

[0006] The purpose of this invention is to propose a flooded factory building detection method based on region context enhancement, aiming to overcome the limitations of existing detection technologies in flooded factory building scenarios. Traditional flood detection methods often rely on single image features, neglecting the spatial relationships and contextual information between different areas within the factory building, resulting in insufficient detection accuracy in complex environments. This invention enhances the model's semantic understanding of different areas within the factory building by incorporating region context information, thereby enabling more accurate identification and localization of flooded areas. By introducing a region context enhancement module, this invention not only improves the detection capability of flooded areas but also addresses complex factors such as changes in lighting, occlusion, and water surface reflection, improving the robustness and real-time performance of the detection system in practical applications.

[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0008] In a first aspect, the present invention provides a method for detecting flooded power plants based on region context enhancement, comprising:

[0009] Acquire image information and preprocess the image information;

[0010] The image is segmented using semantic segmentation techniques. A region context enhancement network is used to extract contextual information about the water area and its surrounding environment. Convolutional operations are used to extract features for each region.

[0011] A region context enhancement network is used to process features, combining local features of each region with features of the surrounding regions to enhance the ability to identify flooded areas;

[0012] A multi-scale feature fusion strategy is adopted, which combines image features at different scales and removes redundant detection boxes through a redundancy removal algorithm, and finally outputs the flooded area.

[0013] As a preferred embodiment of the region context enhancement-based flooded plant detection method of the present invention, the step of acquiring image information and preprocessing the image information includes:

[0014] Use filters to remove noise from images;

[0015] Normalize the image.

[0016] Image enhancement techniques are used to enhance image contrast.

[0017] As a preferred embodiment of the flooded factory detection method based on region context enhancement described in this invention, the method involves: segmenting the image using semantic segmentation technology, extracting contextual information of the water area and its surrounding environment through a region context enhancement network, and extracting features of each region using convolution operations, including...

[0018] In the water area segmentation and context information extraction stage, semantic segmentation technology is used to segment the image and accurately identify the water area;

[0019] The encoder part uses convolutional layers and max pooling to gradually extract high-level semantic features;

[0020] The decoder recovers the spatial resolution through upsampling and fuses it with the corresponding layer features from the encoder.

[0021] The beneficial effects of this preferred technical solution are that, by combining semantic segmentation technology with a regional context enhancement network, it can accurately identify water areas and extract contextual information about their surrounding environment. The encoder utilizes convolutional layers and max pooling to progressively extract high-level semantic features, ensuring feature richness and hierarchy; the decoder restores spatial resolution through upsampling and fuses it with features from the corresponding encoder layers, effectively preserving detailed information. This solution significantly improves the accuracy and robustness of flooded factory building detection.

[0022] As a preferred embodiment of the flooded factory building detection method based on region context enhancement described in this invention, the method employs a region context enhancement network to process features, combining local features of each region with features of the surrounding regions to enhance the identification capability of flooded areas, including...

[0023] A regional context enhancement network is used to fuse extracted local features across regions, which is achieved through an adaptive feature weighting mechanism.

[0024] By combining the local features of each region with the features of the surrounding regions, the ability to identify flooded areas is enhanced.

[0025] Fine-grained detection is performed using bounding box regression and region classification.

[0026] As a preferred embodiment of the region context enhancement-based flooded factory building detection method of the present invention, the method employs a multi-scale feature fusion strategy, combining image features of different scales, and removes redundant detection boxes using a redundancy removal algorithm, ultimately outputting the flooded area, including:

[0027] Redundant detection boxes are removed using a nonmaximum suppression algorithm to deduplicate the detection box set.

[0028] Arrange the categories in descending order of their classification scores to obtain an ordered set.

[0029] For the highest-scoring bounding box, calculate the intersection-union ratio of the remaining bounding boxes;

[0030] Duplicate test results are removed, and the final output is the flooded area.

[0031] As a preferred embodiment of the flooded factory detection method based on region context enhancement described in this invention, wherein: in the water area segmentation and context information extraction stage, semantic segmentation technology is used to segment the image and accurately identify the water area, as represented by:

[0032] The U-Net model based on convolutional neural networks is used for segmentation, and an improved U-Net model is used for water area segmentation. The network structure includes two parts: an encoder and a decoder, and skip connections are introduced to preserve multi-scale features.

[0033] The encoder part uses convolutional layers and max pooling to progressively extract high-level semantic features:

[0034] F i =MaxPool(ReLU(Conv) 3×3 (F i-1 )))

[0035] Among them, F i For the feature map of layer ii, Conv 3×3 This represents a 3×3 convolution kernel, with ReLU as the activation function;

[0036] The decoder recovers the spatial resolution through upsampling and fuses it with the corresponding layer features from the encoder:

[0037] D j =Conv 3×3 (Concat(Up ×2 (D j+1 ),F i ))

[0038] Where Concat represents feature concatenation, Up ×2 This is for upsampling.

[0039] As a preferred embodiment of the region context-enhanced method for detecting flooded power plants according to the present invention, wherein: the removal of redundant detection boxes using a redundancy removal algorithm is represented as follows:

[0040] Redundant detection boxes are removed using a non-maximum suppression algorithm, and the detection box set is processed. Perform deduplication;

[0041] Score by category i Arrange in descending order to obtain an ordered set;

[0042] For the current highest-scoring frame b i Calculate the remaining boxes b j The intersection-union ratio is expressed as,

[0043]

[0044] If IoU(b i ,b j If the threshold value is greater than or equal to τ (threshold, default 0.5), then remove the affected element.

[0045] Secondly, the present invention provides a flooded plant detection system based on region context enhancement, comprising:

[0046] The acquisition module acquires image information and preprocesses it.

[0047] The segmentation module uses semantic segmentation technology to segment the image, extracts contextual information about the water area and its surrounding environment through a region context enhancement network, and extracts features for each region using convolution operations.

[0048] The recognition module uses a region context enhancement network to process features, combining the local features of each region with the features of the surrounding regions to enhance the recognition ability of flooded areas.

[0049] The output module employs a multi-scale feature fusion strategy, combining image features at different scales and removing redundant detection boxes using a redundancy removal algorithm, ultimately outputting the flooded area.

[0050] Thirdly, the present invention provides an electronic device, comprising:

[0051] Memory and processor;

[0052] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the flooded plant detection method based on region context enhancement.

[0053] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the region context-enhanced flooded plant detection method.

[0054] Compared with existing technologies, the advantages of this invention are as follows: By combining the strengths of traditional image processing techniques and deep learning, a method for detecting flooded factory buildings based on region context enhancement is proposed. Through three core steps—image preprocessing and enhancement, water area segmentation and context information extraction, and refined detection and fusion based on region context enhancement—the accuracy of flooded area identification and segmentation is significantly improved. By combining feature pyramid networks and region context enhancement technology, this method can adapt to complex flooding scenarios, possesses strong robustness and accuracy, and is suitable for practical applications such as flooded factory building monitoring and disaster early warning. Attached Figure Description

[0055] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a flowchart illustrating a method for detecting flooded power plants based on region context enhancement, according to an embodiment of the present invention.

[0057] Figure 2 This is a diagram of a flooded factory building detection model based on regional context enhancement according to an embodiment of the present invention. Detailed Implementation

[0058] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0059] Example 1, referring to Figure 1 As an embodiment of the present invention, a method for detecting flooded power plants based on region context enhancement is provided, comprising:

[0060] S1: Collect images of the flooded factory and preprocess the images;

[0061] S2: Use semantic segmentation technology to segment the image, extract contextual information of the water area and its surrounding environment through the region context enhancement network, and use convolution operation to extract features of each region;

[0062] S3: The region context enhancement network is used to process the features, combining the local features of each region with the features of the surrounding regions to enhance the ability to identify flooded areas;

[0063] S4: Employ a multi-scale feature fusion strategy, combining image features at different scales, and remove redundant detection boxes using a redundancy removal algorithm to finally output the flooded area.

[0064] It should be noted that this invention proposes a flooded factory detection method based on region context enhancement. Through deep learning and contextual information enhancement, it effectively solves many problems faced by traditional image processing methods in flooded factory detection. Traditional methods rely on color thresholding and edge detection, which are prone to false positives and false negatives when the factory and water colors are similar or the edges are blurred. Furthermore, methods such as region growing are easily affected by the selection of seed points and may lead to incorrect expansion. In contrast, this solution first utilizes semantic segmentation and deep learning to automatically learn complex features, thus eliminating the reliance on single color information and enabling better differentiation of seemingly similar regions. Secondly, the region context enhancement network combines local and surrounding environmental features, significantly improving the model's understanding ability in complex factory backgrounds. Even in low-contrast, blurred-edge regions, it can more accurately identify flooded areas, avoiding the poor performance of traditional methods. In addition, the solution also processes flooded areas of different sizes through multi-scale feature fusion and uses a redundancy removal algorithm to optimize the final result, significantly improving the overall accuracy, robustness, and reliability of flooded area detection, overcoming the inherent defects of traditional methods such as fixed rules and poor adaptability.

[0065] Example 2, Reference Figure 2 As an embodiment of the present invention, based on the above embodiment, a method for detecting flooded factory buildings based on regional context enhancement is provided.

[0066] This technical solution addresses the task of detecting flooded factory buildings by proposing a deep learning method based on region context enhancement. Combining traditional image processing techniques with a deep learning model, it improves the accuracy of water area identification and segmentation through the fusion of region context information. The method mainly includes three core steps: image preprocessing and enhancement, water area segmentation and context information extraction, and refined detection and fusion based on region context enhancement. (See attached image.) Figure 2 As shown, it includes the following steps:

[0067] In this embodiment of the application, step S1, which involves acquiring image information of the flooded factory and preprocessing the image information, includes steps A1-A3:

[0068] A1: Use a filter to remove noise from the image.

[0069] A2: Normalize the image.

[0070] A3: Image enhancement techniques are used to enhance image contrast.

[0071] The specific implementation methods for steps A1-A3 are as follows:

[0072] In the image preprocessing and enhancement stage, noise removal is first performed on the input image using a Gaussian filter. The mathematical model of Gaussian filtering is as follows:

[0073]

[0074] Where (x, y) are pixel coordinates, and σ is the standard deviation, controlling the smoothness of the filter. This filter effectively reduces high-frequency noise in the image, minimizing interference from subsequent detection tasks. This effectively reduces the impact of poor image quality or other external interference on model training.

[0075] In an optional embodiment, the filter can also be a median filter. A median filter achieves noise reduction by replacing the value of each pixel with the median of the values ​​of its neighboring pixels. It is particularly effective for removing impulse noise such as salt-and-pepper noise because it does not rely on the statistical characteristics of neighboring pixels but directly takes the median, thus better preserving the edge information of the image and avoiding the over-smoothing problem that may result from Gaussian filtering.

[0076] In another alternative embodiment, the filter can also be a bilateral filter. A bilateral filter considers not only the spatial distance between pixels (similar to Gaussian filtering) but also the similarity of pixel values ​​(i.e., brightness or color differences) when calculating the weighted average. This dual-weighting mechanism allows the filter to effectively preserve image edges and details while smoothing noise, as it assigns lower weights to pixels with significant differences on either side of an edge. This makes bilateral filtering perform better in scenarios where preserving image details is crucial.

[0077] Next, the image is normalized using Z-Score normalization, calculated as follows:

[0078]

[0079] Where I(x,y) is the original pixel value, μ is the image mean, and σ is the standard deviation. Normalized image data has a more stable distribution, which is beneficial for model training convergence. Unifying pixel values ​​to the same range avoids the impact of brightness and contrast differences between different images on the training process. To improve the visibility of flooded areas, histogram equalization is used to enhance image contrast; the mathematical expression is as follows (taking a single region as an example):

[0080] I enhanced (x,y)=T(I(x,y))

[0081] Where T(·) is the histogram equalization transformation function for this region. In particular, flooded areas often have low brightness and contrast; after enhancement, these areas become more prominent, facilitating subsequent detection tasks. Furthermore, data augmentation is performed using methods such as rotation, flipping, scaling, and cropping to increase the diversity of training data, enhance the model's robustness, and prevent overfitting.

[0082] In an alternative embodiment, the image enhancement technique can also employ adaptive histogram equalization. Unlike global histogram equalization, the image is divided into several small blocks, and histogram equalization is performed independently on each block. This method can enhance local contrast, especially in images with uneven lighting, and can more precisely highlight the differences between flooded areas and their surroundings.

[0083] In another alternative embodiment, the image enhancement technique may also employ a Retinex-based image enhancement method, which aims to separate the reflection component (the inherent color and texture of an object) and the illumination component (lighting conditions) of an image. By enhancing the reflection component or adjusting the illumination component, the Retinex method can significantly improve the detail and contrast of an image under complex lighting conditions (such as shadows and low light), and is particularly effective in improving the visibility of flooded areas (which may be in shadow or under complex reflected light), better recovering flooded features that are obscured by uneven lighting.

[0084] In this embodiment of the application, step S2 uses semantic segmentation technology to segment the image, extracts contextual information of the water area and its surrounding environment through a region context enhancement network, and extracts features of each region using convolution operations, including steps B1-B3:

[0085] B1: In the water area segmentation and context information extraction stage, semantic segmentation technology is used to segment the image and accurately identify the water area;

[0086] B2: The encoder part uses convolutional layers and max pooling to gradually extract high-level semantic features;

[0087] B3: The decoder recovers the spatial resolution through upsampling and fuses it with the corresponding layer features of the encoder.

[0088] The specific implementation methods for steps B1-B3 are as follows:

[0089] In the water area segmentation and context information extraction stage, semantic segmentation technology is first used to segment the image and accurately identify the water area.

[0090] In the embodiments of this application, the semantic segmentation technology uses the U-Net model based on convolutional neural network (CNN) for segmentation, and the improved U-Net model is used for water area segmentation. Its network structure includes two parts: encoder (downsampling) and decoder (upsampling), and skip connections are introduced to preserve multi-scale features.

[0091] The encoder part uses convolutional layers (Conv) and max pooling to progressively extract high-level semantic features:

[0092] F i =MaxPool(ReLU(Conv) 3×3 (F i-1 )))

[0093] Among them, F i For the feature map of layer ii, Conv 3×3 This represents a 3×3 convolution kernel, with ReLU as the activation function. The decoder recovers the spatial resolution through upsampling and fuses it with the corresponding layer features from the encoder.

[0094] D j =Conv 3×3 (Concat(Up ×2 (D j+1 ),F i ))

[0095] Where Concat represents feature concatenation, Up ×2 Upsampling is employed. The model effectively extracts global features from the image and recovers details during the decoding stage, ensuring accurate segmentation of flooded areas. After water area segmentation, a region context enhancement network extracts contextual information about the water area and its surrounding environment. Region segmentation involves dividing the image into multiple regions of interest (ROIs), each representing a potential flooded area, and using convolutional operations to extract features from each region. These features can include information such as the shape, edges, and texture of the flooded area, which helps the model determine the size, shape, and relationship of the water area to the background.

[0096] In an optional embodiment, the semantic segmentation technique employs the Transformer-based SegFormer model. The SegFormer model combines the advantages of the Transformer in handling global dependencies with a lightweight multi-scale encoder, enabling efficient extraction of image features. Its network structure typically includes an encoder and a decoder. The encoder uses a lightweight Transformer module to progressively extract multi-scale features, while the decoder restores spatial resolution through simple deconvolution operations and fuses the multi-scale features with those from the encoder. The SegFormer model maintains high accuracy while having low computational complexity, making it suitable for scenarios with high real-time requirements. After water area segmentation, a region context enhancement network can be used to extract contextual information about the water area and its surrounding environment to further optimize the segmentation results.

[0097] In another optional embodiment, the semantic segmentation technique employed is the DeepLabv3+ model. The DeepLabv3+ model improves upon DeepLabv3 by introducing an Atrous Spatial Pyramid Pooling (ASPP) module and an encoder-decoder structure, enabling more efficient extraction of multi-scale features from images. Its encoder part uses depthwise separable convolutions and dilated convolutions to progressively extract high-level semantic features from the image; the decoder part restores spatial resolution through 1×1 convolutions and transposed convolutions, fusing these features with those from the encoder. The DeepLabv3+ model performs exceptionally well in handling complex scenes and fine-grained segmentation tasks, accurately segmenting water regions. Similarly, after water region segmentation, a region context enhancement network can be used to extract contextual information about the water region and its surrounding environment to enhance the model's discriminative ability.

[0098] In this embodiment of the application, step S3 uses a region context enhancement network to process the features, combining the local features of each region with the features of the surrounding regions to enhance the identification ability of flooded areas, including steps C1-C3:

[0099] C1: A regional context enhancement network is used to fuse extracted local features across regions, which is achieved through an adaptive feature weighting mechanism;

[0100] C2: Combines the local features of each region with the features of the surrounding regions to enhance the ability to identify flooded areas;

[0101] C3: Fine-grained detection is performed using bounding box regression and region classification.

[0102] The specific implementation methods for steps C1-C3 are as follows:

[0103] In the refined detection and fusion stage based on region context enhancement, a Region Context Enhancement Network (RCEN) is used to fuse extracted local features across regions, achieved through an adaptive feature weighting mechanism:

[0104] Feature similarity calculation: For any two regions with feature f i and f j Calculate the cosine similarity as the association weight:

[0105]

[0106] Among them, w ij ∈[-1,1] reflects the semantic correlation between regions.

[0107] Contextual feature aggregation: for each region f i By fusing its neighborhood features through a weighted average:

[0108]

[0109] Where N(i) represents the neighborhood of region i, α ij These are the attention weights after Softmax normalization.

[0110] By combining local features of each region with features from surrounding regions, the ability to identify flooded areas is enhanced. This process is achieved by weighted averaging of regional features, allowing features from different regions to complement each other and helping the model better understand the characteristics of water areas.

[0111] Based on these enhanced features, refined detection is achieved using bounding box regression and region classification. Bounding box regression allows the model to accurately locate flooded areas, and region classification determines whether an area is indeed flooded. For each region, cross-entropy loss is used to optimize the classification results, and L2 loss is used to optimize the regression task, ensuring the accuracy of flooded area detection. Specifically:

[0112] Bounding box regression: Optimizing the predicted bounding box b using the L2 loss function. pred = (x,y,w,h) and the true bounding box b gt Offset:

[0113]

[0114] Where (x,y) are the center coordinates, and (w,h) are the width and height.

[0115] Region classification: Optimize the classification probability p∈[0,1] of flooded regions using the cross-entropy loss function:

[0116]

[0117] Where y∈{0,1} is the true label (0: not flooded, 1: flooded).

[0118] In this embodiment, step S4 employs a multi-scale feature fusion strategy, combining image features at different scales, and removes redundant detection boxes using a redundancy removal algorithm, ultimately outputting the flooded area, including steps D1-D4:

[0119] D1: Remove redundant detection boxes using the non-maximum suppression algorithm to deduplicate the detection box set;

[0120] D2: Sort the categories in descending order of their scores to obtain an ordered set;

[0121] D3: For the highest-scoring bounding box, calculate the intersection-union ratio of the remaining bounding boxes;

[0122] D4: Remove duplicate detection results and output the flooded area.

[0123] The specific implementation methods for steps D1-D4 are as follows:

[0124] In this embodiment, a multi-scale feature fusion strategy is employed to handle flooded areas of different sizes. Through a Feature Pyramid Network (FPN), the model effectively combines image features of different scales, ensuring detection accuracy for small flooded areas while improving localization accuracy for large flooded areas. Finally, redundant detection boxes are removed using the Non-Maximum Suppression (NMS) algorithm, and the detection box set is then optimized. Follow these steps to remove duplicates:

[0125] Confidence ranking: by category score s i Arrange in descending order to obtain an ordered set.

[0126] Overlap calculation: For the current highest-scoring bounding box b i Calculate the remaining boxes b j Intersection over Union (IoU):

[0127]

[0128] Redundancy suppression: If IoU(b i ,b j If the threshold value is greater than or equal to τ (threshold, default 0.5), then remove the affected element.

[0129] Ensure that only one detection box is retained for each flooded area, remove duplicate detection results, and finally output the most accurate flooded area.

[0130] It should be noted that the specific operation process of the present invention is as follows: the collected images are labeled for model training, and the images undergo image preprocessing (denoising, filtering and normalization operations) and enhancement (rotation, flipping, scaling and cropping operations) and are used as input to the model.

[0131] The specific network structure of the model is as follows: Figure 2 As shown, an encoding / decoding structure based on the U-Net model of a convolutional neural network (CNN) is adopted. In the encoding stage, a VGG-16-based backbone network is used for water area segmentation and contextual information feature extraction, resulting in multi-level features. These high-level features are then classified through two linear operations. In the decoder stage, the network progressively upsamples and fuses features from earlier convolutional layers with those from later layers to generate more refined semantic segmentation results. Through multi-level feature fusion (8x and 16x downsampled feature maps), the network can more accurately locate water areas.

[0132] Training process: 10-fold cross-validation is used to train the model. The dataset is divided into 10 subsets, with 9 subsets selected for training and 1 subset for validation in each iteration. This reduces model bias and improves generalization ability. Stochastic gradient descent (SGD) is used for optimization, with a learning rate of 0.001 and a batch size of 4. Images with data augmentation are used during training to reduce overfitting and improve generalization performance. To address class imbalance, median frequency balancing is used to adjust the weights of the loss function to balance training across different classes.

[0133] In an optional embodiment, the redundancy removal algorithm can employ Soft-NMS. This is suitable for scenarios where the boundaries of the flooded area are blurred and there is a gradual transition between the flooded and unflooded areas.

[0134] In another alternative embodiment, in addition to redundant algorithms, Cluster-NMS can be employed. This is suitable for scenarios where the target (flooded area) is spatially represented as multiple independent small regions that are close to each other but do not completely overlap.

[0135] Example 3 illustrates a schematic scheme for a flood-prone factory building detection method based on region context enhancement. It should be noted that the technical solution of this system for detecting flood-prone factory buildings based on region context enhancement is based on the same concept as the technical solution of the aforementioned method. Details not described in detail in this embodiment can be found in the description of the aforementioned method.

[0136] This embodiment also provides a flooded plant detection system based on region context enhancement, including:

[0137] The acquisition module acquires image information and preprocesses it.

[0138] The segmentation module uses semantic segmentation technology to segment the image, extracts contextual information about the water area and its surrounding environment through a region context enhancement network, and extracts features for each region using convolution operations.

[0139] The recognition module uses a region context enhancement network to process features, combining the local features of each region with the features of the surrounding regions to enhance the recognition ability of flooded areas.

[0140] The output module employs a multi-scale feature fusion strategy, combining image features at different scales and removing redundant detection boxes using a redundancy removal algorithm, ultimately outputting the flooded area.

[0141] This embodiment also provides an electronic device suitable for detecting flooded factory buildings based on region context enhancement, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the region context enhancement-based flooded factory building detection method proposed in the above embodiment.

[0142] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the flooded plant detection method based on region context enhancement as proposed in the above embodiments.

[0143] The storage medium proposed in this embodiment and the method for detecting flooded factory buildings based on region context enhancement proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0144] Based on the above description of the implementation methods, those skilled in the art will clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0145] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting flooded factory buildings based on region context enhancement, characterized in that, include: Collect images of the flooded factory buildings and preprocess the images. The image is segmented using semantic segmentation techniques. A region context enhancement network is used to extract contextual information about the water area and its surrounding environment. Convolutional operations are used to extract features for each region. A region context enhancement network is used to process features, combining local features of each region with features of the surrounding regions to enhance the ability to identify flooded areas; A multi-scale feature fusion strategy is adopted, which combines image features at different scales and removes redundant detection boxes through a redundancy removal algorithm to output the flooded area.

2. The method for detecting flooded factory buildings based on region context enhancement as described in claim 1, characterized in that, The acquisition of image information and the preprocessing of the image information include, Use filters to remove noise from images; Normalize the image; Image enhancement techniques are used to enhance image contrast.

3. The method for detecting flooded factory buildings based on region context enhancement as described in claim 2, characterized in that, The image is segmented using semantic segmentation techniques. A region context enhancement network is used to extract contextual information about the water area and its surrounding environment. Convolutional operations are then used to extract features for each region, including... Semantic segmentation techniques are used to segment images and identify water areas; The encoder part uses convolutional layers and max pooling to gradually extract high-level semantic features; The decoder recovers the spatial resolution through upsampling and fuses it with the corresponding layer features from the encoder.

4. The method for detecting flooded factory buildings based on region context enhancement as described in claim 3, characterized in that, The method employs a region context enhancement network to process features, combining local features of each region with features from surrounding regions to enhance the ability to identify flooded areas. A regional context enhancement network is used to fuse extracted local features across regions, which is achieved through an adaptive feature weighting mechanism. By combining the local features of each region with the features of the surrounding regions, the ability to identify flooded areas is enhanced. Fine-grained detection is performed using bounding box regression and region classification.

5. The method for detecting flooded factory buildings based on region context enhancement as described in claim 4, characterized in that, The method employs a multi-scale feature fusion strategy, combining image features at different scales, and removes redundant detection boxes using a redundancy removal algorithm, ultimately outputting the flooded area, including... Redundant detection boxes are removed using a nonmaximum suppression algorithm to deduplicate the detection box set. Arrange the categories in descending order of their classification scores to obtain an ordered set. For the highest-scoring bounding box, calculate the intersection-union ratio of the remaining bounding boxes; Remove duplicate test results and output the flooded area.

6. The method for detecting flooded power plants based on region context enhancement as described in claim 5, characterized in that, In the water area segmentation and context information extraction stage, semantic segmentation technology is used to segment the image and accurately identify the water area, as shown below. The U-Net model based on convolutional neural networks is used for segmentation, and an improved U-Net model is used for water area segmentation. The network structure includes two parts: an encoder and a decoder, and skip connections are introduced to preserve multi-scale features. The encoder part uses convolutional layers and max pooling to progressively extract high-level semantic features: F i =MaxPool(ReLU(Conv 3×3 (F i-1 ))) Among them, F i For the feature map of layer ii, Conv 3×3 This represents a 3×3 convolution kernel, with ReLU as the activation function; The decoder recovers the spatial resolution through upsampling and fuses it with the corresponding layer features from the encoder: D j =Conv 3×3 (Concat(Up ×2 (D j+1 ),F i )) Where Concat represents feature concatenation, Up ×2 This is for upsampling.

7. The method for detecting flooded factory buildings based on region context enhancement as described in claim 6, characterized in that, The detection boxes that have had redundant detections removed using the redundancy removal algorithm are represented as follows: Redundant detection boxes are removed using a non-maximum suppression algorithm, and the detection box set is processed. Perform deduplication; Score by category i Arrange in descending order to obtain an ordered set; For the current highest-scoring frame b i Calculate the remaining boxes b j The intersection-union ratio is expressed as, If IoU(b i ,b j If )≥τ, then remove.

8. A flood-prone factory building detection system based on region context enhancement, using the method described in any one of claims 1-7, characterized in that, include: The acquisition module acquires image information and preprocesses it. The segmentation module uses semantic segmentation technology to segment the image, extracts contextual information about the water area and its surrounding environment through a region context enhancement network, and extracts features for each region using convolution operations. The recognition module uses a region context enhancement network to process features, combining the local features of each region with the features of the surrounding regions to enhance the recognition ability of flooded areas. The output module employs a multi-scale feature fusion strategy, combining image features at different scales and removing redundant detection boxes using a redundancy removal algorithm, ultimately outputting the flooded area.

9. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the flooded plant detection method based on regional context enhancement as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the region context-enhanced flooded plant detection method according to any one of claims 1 to 7.