Water accumulation identification methods, devices, equipment, media and products

CN122574752APending Publication Date: 2026-08-14ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

在这类场景下,若直接训练一个通用分类模型,则模型对积水边缘、细长条状积水、小面积积水以及湿润反光区域的结构差异学习不足,容易在复杂光照和弱纹理场景下产生误判,积水识别准确性低

Benefits of technology

[0010]本申请实施例中,目标模型复用积水分割模型中的特征提取器,积水分割模型在训练过程中对特征提取器进行训练,得到目标特征提取器,由于积水分割模型是在像素级水平上训练得到的,这样得到的目标特征提取器具备优秀的空间结构、区域边界,以及前景和背景的区分能力,将目标特征提取器复用(即迁移)到目标模型中,一方面,在训练阶段,只需要对目标模型训练少量参数,即可得到具备图像级识别能力的目标模型,提高了模型的训练效率,另一方面,目标模型可以继承积水分割模型中得到的空间结构、区域边界,以及前景和背景的区分能力,从而提高积水识别准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122574752A_ABST
    Figure CN122574752A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, medium, and product for identifying water accumulation, comprising: acquiring an image to be identified; inputting the image to be identified into a target model to obtain the identification result output by the target model, wherein the target model includes a target feature extractor and a classification head, the target feature extractor being a feature extractor in a water accumulation segmentation model, the water accumulation segmentation model being used to predict the probability of whether a pixel in any image belongs to a water accumulation area, and the target feature extractor learning the spatial structure of the water accumulation area, the area boundary, and the distinction between foreground and background during the training of the water accumulation segmentation model, thereby improving the accuracy of water accumulation identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to a method, apparatus, device, medium and product for identifying water accumulation. Background Technology

[0002] Water accumulation identification in vehicle-mounted inspection vision, road scene perception, and factory equipment area monitoring typically requires both high recognition accuracy and the engineering demands of rapid early warning, lightweight deployment, and low-cost iteration. Existing solutions can be broadly categorized into three types: one type directly uses image classification networks to classify the entire image as "with or without water accumulation" or risk level; another type uses semantic segmentation networks to output water accumulation areas and then obtains image-level judgment results based on segmentation area, connected regions, or threshold rules; and the third type uses detection models or multi-task models to simultaneously output region localization and image-level discrimination.

[0003] In practical applications, rapid image-level recognition of water accumulation is often used for pre-screening, lightweight early warning, rapid edge discrimination, or as a pre-stage trigger module in two-stage recognition systems. In these scenarios, if a general classification model is directly trained, the model will not be able to adequately learn the structural differences between water accumulation edges, thin strips of water accumulation, small areas of water accumulation, and wet reflective areas. This can easily lead to misjudgments in complex lighting and weak texture scenes, resulting in low accuracy in water accumulation recognition. Summary of the Invention

[0004] This application provides a water accumulation identification method, apparatus, device, medium, and product, which can improve the accuracy of water accumulation identification using models.

[0005] In a first aspect, embodiments of this application provide a method for identifying water accumulation, the method comprising: Acquire the image to be recognized; The image to be identified is input into the target model to obtain the recognition result output by the target model. The target model includes a target feature extractor and a classification head. The target feature extractor is a feature extractor in the water accumulation segmentation model. The water accumulation segmentation model is used to predict the probability of whether a pixel in any image belongs to a water accumulation area. The target feature extractor learns the spatial structure of the water accumulation area, the area boundary, and the knowledge of distinguishing between foreground and background during the training of the water accumulation segmentation model.

[0006] Secondly, embodiments of this application provide a water accumulation detection device, the device comprising: The acquisition module is used to acquire the image to be recognized; The recognition module is used to input the image to be recognized into the target model and obtain the recognition result output by the target model. The target model includes a target feature extractor and a classification head. The target feature extractor is a feature extractor in the water accumulation segmentation model. The water accumulation segmentation model is used to predict the probability of whether a pixel in any image belongs to a water accumulation area. The target feature extractor learns the spatial structure of the water accumulation area, the area boundary, and the knowledge of distinguishing between foreground and background during the training of the water accumulation segmentation model.

[0007] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory storing computer program instructions; the processor executes the computer program instructions to implement the water accumulation identification method as described in the first aspect.

[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the water accumulation identification method as described in the first aspect.

[0009] Fifthly, embodiments of this application provide a computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the water accumulation identification method as described in the first aspect.

[0010] In this embodiment, the target model reuses the feature extractor from the water accumulation segmentation model. The water accumulation segmentation model trains the feature extractor during training to obtain the target feature extractor. Since the water accumulation segmentation model is trained at the pixel level, the resulting target feature extractor has excellent spatial structure, region boundaries, and foreground and background discrimination capabilities. Reusing (i.e., transferring) the target feature extractor to the target model has several advantages. First, during the training phase, only a small number of parameters need to be trained on the target model to obtain a target model with image-level recognition capabilities, which improves the training efficiency of the model. Second, the target model can inherit the spatial structure, region boundaries, and foreground and background discrimination capabilities obtained from the water accumulation segmentation model, thereby improving the accuracy of water accumulation recognition. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart illustrating the water accumulation identification method provided in the embodiments of this application; Figure 2This is a schematic diagram of the water accumulation identification device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0013] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0014] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0015] In all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. Additionally, when embodiments of this application require access to sensitive personal information, separate permission or consent from the user is obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments obtained.

[0016] The water accumulation identification method provided in the embodiments of this application will be introduced first below.

[0017] Figure 1 A flowchart illustrating a water accumulation identification method according to an embodiment of this application is shown. Figure 1As shown, the water accumulation identification method provided in this application embodiment is applied to an electronic device and includes the following steps 101-102, wherein: Step 101: Obtain the image to be recognized; Step 102: Input the image to be recognized into the target model to obtain the recognition result output by the target model. The target model includes a target feature extractor and a classification head. The target feature extractor is a feature extractor in the water accumulation segmentation model. The water accumulation segmentation model is used to predict the probability of whether a pixel in any image belongs to a water accumulation area. The target feature extractor learns the spatial structure of the water accumulation area, the area boundary, and the knowledge of distinguishing between foreground and background during the training of the water accumulation segmentation model.

[0018] By using the target model to identify water accumulation in the image to be identified, the classification of water accumulation in the image can be determined, such as whether there is water accumulation or the size of the water accumulation, etc., without any limitations.

[0019] The water accumulation segmentation model can be a convolutional network, a Transformer network, or a combination of both, and its specific structure is not limited.

[0020] Since the water accumulation segmentation model is trained at the pixel level, the resulting target feature extractor has excellent spatial structure, region boundaries, and knowledge of distinguishing foreground and background. Reusing (i.e., transferring) the target feature extractor to the training of the target model allows the target model to inherit the spatial structure, region boundaries, and knowledge of distinguishing foreground and background from the water accumulation segmentation model, thereby improving the accuracy of water accumulation recognition.

[0021] In this embodiment, the target model reuses the feature extractor from the water accumulation segmentation model. The water accumulation segmentation model trains the feature extractor during training to obtain the target feature extractor. Since the water accumulation segmentation model is trained at the pixel level, the resulting target feature extractor has excellent spatial structure, region boundaries, and foreground and background discrimination capabilities. Reusing (i.e., transferring) the target feature extractor to the target model has two advantages. First, during the training phase, only a small number of parameters need to be trained on the target model to obtain a target model with image-level recognition capabilities, which improves the training efficiency of the model. Second, the target model can inherit the spatial structure, region boundaries, and foreground and background discrimination capabilities obtained from the water accumulation segmentation model, thereby improving the accuracy of water accumulation recognition.

[0022] After obtaining the recognition result, an early warning can be issued based on the result, or a more refined subsequent recognition process can be triggered. For example, after inputting the image to be recognized into the target model and obtaining the recognition result output by the target model, the method further includes: If the identification result indicates that the risk of water accumulation has reached the warning threshold, the water accumulation segmentation model is invoked to segment the image to be identified, thereby obtaining the water accumulation pixels in the image to be identified, and thus obtaining the fine positioning result of the water accumulation area.

[0023] The water accumulation segmentation model includes the target feature extractor and the segmentation decoding head; The training process of the water accumulation segmentation model includes: Multiple second training samples are obtained. The second training samples include a second sample image and a category label for each pixel in the second sample image. The category label of the pixel is used to identify whether the pixel belongs to the water accumulation area of ​​the second sample image. For each of the second training samples, the second sample image in the second training sample is input into the water accumulation segmentation model, and the target feature extractor in the water accumulation segmentation model performs feature extraction. The features extracted by the target feature extractor are input into the segmentation decoding head, and the segmentation decoding head outputs the segmentation result of the second sample image. The segmentation result of the second sample image includes the probability of whether each pixel in the second sample image belongs to the water accumulation area. The second loss value is obtained based on the category label of the second sample image and the segmentation result of the second sample image; Using the second loss value, the parameters of the target feature extractor and the segmentation decoder are adjusted, and the process jumps to the step of inputting the second sample image from the second training sample into the water accumulation segmentation model until the second iteration stopping condition is met.

[0024] Training the water accumulation segmentation model using a second training sample allows the target feature extractor to learn the spatial structure patterns and foreground / background distinguishing features of the water accumulation region at the pixel level, enabling the water accumulation segmentation model to segment water accumulations in any image. The stopping condition for the second iteration can be set according to the actual situation and is not limited here.

[0025] Through the above training, the target feature extractor can learn the spatial structure, region boundaries, and foreground and background distinctions of the water accumulation area in pixel-level tasks. When transferring this learned knowledge to the training of the base model, it can be used to extract features from the input image, thereby improving the accuracy of the target model in water accumulation recognition.

[0026] In one embodiment of this application, the target feature extractor includes multiple feature extraction layers; The target model is trained according to the following process: Multiple first training samples are obtained. The first training samples include first sample images and category labels for each first sample image. The category labels of the first sample images are used to identify water accumulation information in the first sample images. For each of the first training samples, the first sample image from the first training sample is input to the target feature extractor for feature extraction, resulting in image features output by multiple feature extraction layers; and... The image features output from multiple feature extraction layers are fused to obtain the feature vector of the first sample image; The feature vector of the first sample image is input into the classification head to obtain the recognition result of the first sample image; A first loss value is determined based on the category label of the first sample image and the recognition result of the first sample image; The parameters of the classification head are adjusted using the first loss value, and the process jumps to the step of inputting the first sample image into the target feature extractor for feature extraction, until the first iteration stopping condition is met, thus obtaining the target model.

[0027] For example, the water accumulation information can be described as "there is water accumulation" or "there is no water accumulation", or it can be described as "a small amount of water accumulation", "a large amount of water accumulation", or "a very large amount of water accumulation", etc. The specific settings can be set according to the actual situation, and there are no restrictions here.

[0028] Multiple feature extraction layers can be set according to actual needs, and no limitation is made here. For example, different feature extraction layers can extract features at different scales from the first sample image. For instance, the low-level feature extraction layer can extract shallow features of the water accumulation area in the first sample image, including details and edge features of the water accumulation area, etc.; the middle-level feature extraction layer can extract the shape features of the water accumulation area; and the high-level feature extraction layer can extract the overall scene features of the water accumulation area.

[0029] After obtaining the image features output by each feature extraction layer, considering that water accumulation in the image may appear as either a small local area or a large connected region, the image features output by some or all of the feature extraction layers can be fused (also called aggregated). For example, based on experience, some image features output by the feature extraction layers can be selected to participate in subsequent fusion processing. Specifically, the image features output by multiple feature extraction layers are fused to obtain the feature vector of the first training sample, including: Select some or all of the image features output by the feature extraction layer, and perform global average pooling and global max pooling on the image features respectively to obtain a first pooling vector and a second pooling vector; The first pooling vector and the second pooling vector corresponding to each of the image features are concatenated to obtain the feature vector of the first training sample.

[0030] In the above process, for each selected feature extraction layer, global average pooling is performed on the image features output by the feature extraction layer to obtain the first pooling vector corresponding to that feature extraction layer. Global max pooling is then performed on the image features output by the feature extraction layer to obtain the second pooling vector corresponding to that feature extraction layer. The first and second pooling vectors are concatenated to obtain the pooling vector corresponding to that feature extraction layer. In other words, the pooling vector corresponding to the feature extraction layer is composed of the first and second pooling vectors. Finally, the pooling vectors corresponding to each feature extraction layer are concatenated to obtain the feature vector of the first training sample. In other words, the feature vector of the first training sample is composed of the pooling vectors corresponding to each feature extraction layer.

[0031] Existing image-level fast recognition methods typically employ a single feature layer for global representation, lacking the ability to accommodate water accumulation targets at different scales. Water accumulation targets can manifest as small local areas or large connected regions. Relying solely on a single-level feature layer for image-level aggregation makes it difficult to simultaneously retain both local salient responses and overall scene distribution information, thus affecting the ability to recognize different forms of water accumulation. In this embodiment, by clustering the image features output from some or all feature extraction layers (e.g., global average pooling and global max pooling), and by simultaneously retaining average response information (represented by the first pooling vector) and salient response information (represented by the second pooling vector), the feature vector of the first training sample used for image-level representation can express both the overall water accumulation distribution trend in the scene and retain the response intensity of locally salient water accumulation areas, thereby improving the image-level representation capability of different forms of water accumulation.

[0032] In another embodiment of this application, during the training phase, the target model further includes an attention gating network, which is used to assist training. During the application phase of the target model, the target model does not include an attention gating network. The image features output from multiple feature extraction layers are fused to obtain the feature vector of the first sample image, including: For each image feature output by the feature extraction layer, global average pooling and global max pooling are performed on the image features respectively to obtain a first pooling vector and a second pooling vector. The first pooling vector and the second pooling vector corresponding to the same feature extraction layer are concatenated to obtain the pooling vector of the feature extraction layer. The feature vector of the first sample image is obtained by weighted summation of the pooling vectors of each feature extraction layer through the attention gating network.

[0033] In this embodiment, global average pooling is performed on the image features output by the feature extraction layer to obtain the first pooling vector corresponding to the feature extraction layer; global max pooling is performed on the image features output by the feature extraction layer to obtain the second pooling vector corresponding to the feature extraction layer; the first pooling vector and the second pooling vector are concatenated to obtain the pooling vector corresponding to the feature extraction layer, that is, the pooling vector corresponding to the feature extraction layer is composed of the first pooling vector and the second pooling vector.

[0034] It should be noted that if the pooling vectors corresponding to each feature extraction layer have different dimensions, then the dimensions of the pooling vectors corresponding to each feature extraction layer need to be transformed first to transform the pooling vectors corresponding to each feature extraction layer to the same dimension.

[0035] The attention-gated network can generate corresponding attention weights for each feature extraction layer based on the pooling vectors of that layer. This attention-gated network is lightweight with few parameters, reducing training costs. Training of the attention-gated network is synchronized with the training of the classification head; that is, while adjusting the parameters of the classification head based on the first loss value, the parameters of the attention-gated network are also adjusted. This allows for continuous optimization of the attention-gated network, improving the accuracy of its generation of attention weights for each feature extraction layer's pooling vectors.

[0036] The pooling vectors of each feature extraction layer are input into an attention gating network. The attention gating network then generates corresponding attention weights for each feature extraction layer's pooling vector. For example, larger attention weights can be generated for scale channels with greater discriminative contributions, and smaller attention weights for scale channels with smaller discriminative contributions. For instance, if the first sample image includes a small water accumulation area, lower-level feature extraction layers can extract shallow features of this area, including details and edge features. In this case, the lower-level feature extraction layers contribute more, resulting in larger attention weights for their pooling vectors; conversely, higher-level feature extraction layers contribute less, resulting in smaller attention weights for their pooling vectors.

[0037] Then, the pooling vectors of each feature extraction layer are weighted and summed to obtain the feature vector of the first sample image, which is then output to the classification head. It should be noted that the sum of all attention weights is 1.

[0038] In the above, the pooling vectors of each feature extraction layer are weighted and summed through the attention gating network to obtain the feature vector of the image-level representation, namely the feature vector of the first sample image. The feature vector of the first sample image is obtained by adaptively amplifying the scale channel that truly contributes to the discrimination based on the first sample image (the attention weight of the pooling vector output by the feature extraction layer of this scale channel will be larger), thereby enhancing the image-level representation capability of water accumulation in different forms.

[0039] In another embodiment of this application, determining a first loss value based on the category label of the first sample image and the recognition result of the first sample image includes: The category labels of the first sample image are subjected to label smoothing processing to obtain the label smoothing result; Based on the label smoothing result and the recognition result of the first sample image, the classification basic loss value is determined; The first loss value is determined based on the classification base loss value and the target regularization term; The target regularization term includes at least one of the following: A focus modulation term, which is determined based on the predicted probability corresponding to the category label in the recognition result of the first sample image; A weight decay regularization term, which is applied to the parameters of the classification head. Regular expression yields; The scale consistency regularization term is determined based on the recognition result of the first sample image and the auxiliary prediction probability distribution obtained by prediction based on the pooling vector of each feature extraction layer.

[0040] For example, for real labels Perform label smoothing on the first sample image i (i.e., the category label of the first sample image i) to obtain the label smoothing vector. (i.e., label smoothing results); (1); In the above formula, The label smoothing coefficient. For the indicator function, when the true category The value is 1 when c represents the true class, and 0 otherwise. This represents the basic classification loss value based on smoothed labels. As shown in equation (2): (2) in, To identify the first sample image i, the first sample image i is obtained as the category. The predicted probability is given by C, where C is the total number of categories.

[0041] To alleviate the underlearning problem of the minority class caused by the majority class samples, such as "no standing water," dominating the loss, a focus modulation term is introduced, assuming... The focus modulation term is the predicted probability on the true class output by the classification head. The result is obtained according to the following formula (3): (3) in, The category weighting coefficient can be determined by the number of samples in the category to which the first sample image belongs, for example, by the reciprocal of the number of samples. This is the focus modulation intensity coefficient.

[0042] By adding a focus modulation term to the first loss value, the target model can dynamically reduce the loss contribution of easily separable samples and relatively amplify the loss contribution of difficult-to-separate and minority class samples during training, thereby alleviating class imbalance.

[0043] To mitigate the risk of overfitting of the classification head in small-sample transfer scenarios, the classification head parameters are adjusted. With attention gating parameters Simultaneously apply Regularization yields the weight decay regularization term. : (4) It should be noted that the weight decay regularization term can be added to the first loss value as a loss term, or it can be added to the target model structure in a way that is built into the optimizer to achieve the same effect. No limitation is made here.

[0044] To promote the collaborative convergence of features at different scales for image-level discrimination and avoid a single-scale channel monopolizing the discrimination contribution, embodiments of this application provide a scale consistency regularization term. Suppose that for the scale pooling vector (i.e., the first) (The pooling vector output from the feature extraction layer of the layer) is used to construct an auxiliary classifier separately. ,get . Indicates the first Auxiliary prediction probability distribution of layer: Auxiliary classifier for the th layer The pooling vectors of the feature extraction layer (these pooling vectors are obtained from the i-th first sample image) are used for prediction to obtain the i-th... Auxiliary prediction probability distribution of the layer, scale consistency regularization term Determined according to the following formula (5): (5) in, , It is the number of the feature extraction layer. It is the total number of feature extraction layers. The KL divergence, in its physical sense, requires that the auxiliary prediction distributions at each single scale (i.e., the auxiliary prediction probability distributions corresponding to each feature extraction layer) be as close as possible to the final fused prediction distribution (i.e., the probability distribution output by the classification head; in this case, the recognition result of the first sample image includes the probability distribution output by the classification head). This consistency encourages channels at different scales to collaboratively provide discriminative evidence during training, reducing the risk of the attention-gated network getting stuck in a local solution that "monopolizes a certain scale" during the initial convergence phase.

[0045] The KL divergence mentioned above can also be replaced by Jensen–Shannon divergence, or by using the divergence between different scales. Consistency constraint. The auxiliary classifier is used only during the training phase and does not participate in the computation during the inference phase.

[0046] In the above process, the classification base loss value is determined by performing label smoothing on the category labels of the first sample image, which can alleviate the problem of overconfidence in probability that often occurs when only a classification head is trained; the focus modulation term is involved in determining the first loss value, which can solve the problem of class imbalance that often occurs when only a classification head is trained; the weight decay regularization term is involved in determining the first loss value, which can solve the problem of overfitting that often occurs when only a classification head is trained; and the scale consistency regularization term is involved in determining the first loss value, which can solve the problem of insufficient multi-scale contribution coordination that often occurs when only a classification head is trained.

[0047] Preferably, the first loss value It can be calculated according to the following formula (6): (6) It should be noted that in certain application scenarios where computing power is limited, the class distribution is relatively balanced, or the differences in morphological scale are small, the first loss value can be flexibly composed of only the basic classification loss and some regularization terms. For example, only the focus modulation term, only the weight decay regularization term, or only the scale consistency regularization term can be added. Alternatively, any two or three of these terms can be added, i.e., the aforementioned weighting coefficients. One or more of them can be zero.

[0048] In yet another embodiment of this application, during the training phase, the target model further includes an auxiliary classifier; The scale consistency regularization term is determined according to the following process: The auxiliary classifier is used to make predictions based on the pooling vector of each feature extraction layer to obtain the auxiliary prediction probability distribution corresponding to each feature extraction layer. In each training round, the parameters of the auxiliary classifier and the parameters of the classification head are adjusted. The scale consistency regularization term is determined based on the auxiliary prediction probability distribution corresponding to each feature extraction layer and the recognition result of the first sample image.

[0049] For details, please refer to the relevant content of the above formula (5) to determine the scale consistency regularization term, which will not be elaborated here.

[0050] In this embodiment, by adding a scale consistency regularization term to the first loss value, it is possible to promote the coordinated convergence of features at different scales for image-level discrimination, thereby avoiding the exclusive discrimination contribution of a single scale channel. The water accumulation recognition method provided in this application transforms the backbone network (i.e., the target feature extractor) of the already trained water accumulation segmentation model into a feature extractor that can directly serve image-level fast recognition tasks. Unlike related solutions that retrain a complete image classification network or continue to use the complete segmentation model for pixel-level inference before indirectly obtaining image-level judgments, this application organizes the fast recognition process into a continuous technical chain of "segmentation backbone loading—backbone parameter freezing—multi-scale feature extraction—attention-weighted feature aggregation—lightweight classification head construction—composite loss-driven training—group learning rate and stabilization parameter update—validation set-driven early stopping and temperature calibration—image-level fast recognition output". This ensures that the water accumulation spatial structure knowledge already formed in pixel-level tasks can be reused in image-level fast recognition tasks, while also ensuring that the training process still possesses stability, anti-overfitting properties, and probabilistic calibrability even in transfer scenarios where only a small number of classification head parameters are trained.

[0051] In one embodiment of this application, a trained water accumulation segmentation model is obtained. Let the target feature extractor of the segmentation model be... The segmented decoding head is The water accumulation segmentation model then applies to the input image. The output can be represented as: (7); in, This represents a pixel-level water accumulation probability map. The water accumulation segmentation model can be a convolutional network, a Transformer network, or a combination of both, in an encoder-decoder structure; its specific training method is not limited. Due to the backbone network... (i.e., target feature extractor) The spatial structure, boundary and context of the water accumulation area have been learned during the training process of the water accumulation segmentation task. In this application embodiment, the backbone network is directly reused as the feature extractor in the image-level fast recognition task.

[0052] After the backbone loading is completed, the parameters of the backbone network are frozen. Let the parameters of the backbone network in the image-level fast recognition task be denoted as... Then we have: (8); in, The first loss value, This means that the parameters of the backbone network are not updated during the image-level training phase. Through this step, the backbone network only participates in forward computation as a fixed feature extractor during image-level recognition training, without participating in backward parameter updates. The purpose of this is to reduce the number of parameters that need to be updated during training while preserving the backbone network's existing cognitive abilities, thereby reducing training costs and the risk of overfitting.

[0053] After loading and freezing the backbone network, obtain the dataset with image-level labels (i.e., the first training samples). Let the... The training samples are ,in This represents the input image (i.e., the first sample image). This represents the image-level label (i.e., the category label of the first sample image); in a binary classification scenario, This can represent no water accumulation and water accumulation respectively; in multi-classification scenarios, It can represent different risk levels or different categories of water accumulation. The system will display the images. Inputting the frozen backbone network yields feature maps at one or more scales: (9); in, These represent the features output from different levels of the backbone network. Considering that water accumulation targets may appear as small local areas or large connected regions, this invention preferably extracts features from one or more levels and performs image-level aggregation.

[0054] Furthermore, select several hierarchical feature sets. Global average pooling and global max pooling are performed on the corresponding feature maps respectively: (10); in, Indicates global average pooling. Indicates global max pooling. Indicates the first Pooling vectors at different scales. By simultaneously preserving both average and salient response information, each scale's pooling vector can express both the overall water accumulation distribution tendency in the scene and the response intensity of locally significant water accumulation areas. It should be noted that the global aggregation operation for backbone-level features is not limited to a combination of GAP and GMP; it can also be equivalently replaced by Spatial Pyramid Pooling (SPP), Generalized Mean Pooling (GeM), a self-attention-based global aggregation layer, or other operations that can globally compress two-dimensional feature maps. No limitation is made here.

[0055] Unlike the approach of directly concatenating pooling vectors of different scales with equal weights, the embodiments of this application can also construct a lightweight scale attention gating network on top of the pooling vectors. It generates scale attention weights related to the samples based on the samples: (11); in, For gating network parameters, Indicates training samples In the Attention weights at different scales. A lightweight structure of "fully connected—activation—fully connected—Softmax" can be used. Its input is the concatenated result of pooling vectors at each scale after uniform dimensional transformation, and the output dimension is equal to... Construct attention-weighted image-level representation vectors. : (12); Alternatively, a learnable dimension alignment transformation can be performed on the vectors at each scale before splicing. ,get: (13); Through the above processing, the image-level representation can adaptively amplify the scale channels that truly contribute to discrimination based on the input samples, thereby further enhancing the image-level representation capability of different water accumulation morphologies while preserving the knowledge of the segmentation backbone spatial structure.

[0056] After obtaining the image-level representation, the system constructs a lightweight classification head on top of it. The classification head can be a single-layer linear classifier, a fully connected layer, a lightweight multilayer perceptron, or other lightweight discriminant modules. Let the classification head be denoted as... Its internal structure can be further divided into feature fusion layers. With the final classification output layer Overall satisfaction In multi-class classification scenarios, the image-level prediction logits and probability vectors are respectively: (14); in For unnormalized logits, Indicates sample Belongs to the The predicted probability of the class. For binary classification scenarios, Degenerate into a scalar The predicted probability is output using the Sigmoid algorithm. (15); in, For classification header parameters, This represents the Sigmoid function.

[0057] No segmentation decoder is needed in the image-level fast recognition stage. Participate in reasoning.

[0058] The water accumulation identification method provided in this application has the following beneficial effects: 1) By reusing the backbone network in the water accumulation segmentation model, the ability to perceive the spatial structure of water accumulation can be significantly enhanced for image-level rapid recognition. The water accumulation recognition method in this application can better inherit the knowledge of region boundaries, morphological distribution, and foreground / background distinction formed in the segmentation task, thereby improving the recognition targeting in complex scenes.

[0059] 2) By freezing the backbone network and training only a lightweight classification head, the training cost and parameter optimization burden of the image-level recognition model can be significantly reduced. Compared to retraining the complete water accumulation recognition model, which often requires more data and a longer training period, the solution in this application only needs to train a small number of newly added classification parameters to complete the construction of image-level recognition capabilities, resulting in higher training efficiency and parameter utilization.

[0060] 3) By performing image-level discrimination directly on the features output by the backbone network, the cost of complete segmentation inference can be reduced while retaining a certain spatial structure perception capability. Compared with continuing to perform pixel-level segmentation and then generating image-level judgment, this solution eliminates the segmentation decoding and pixel-level output stages, making it more suitable for rapid early warning, lightweight deployment, and edge applications.

[0061] 4) By employing an attention-weighted multi-scale aggregation mechanism, the image-level representation can exhibit sample-adaptive characteristics in its discriminative contribution to water accumulation of different shapes and areas. Compared to static equal-weighted stitching, this scheme can dynamically emphasize truly discriminative scale channels based on input samples, improving expressive flexibility and robustness.

[0062] 5) By using a composite loss function (i.e., the method for determining the first loss value), training stability and final accuracy can be significantly improved in scenarios with small parameters where only the classification head is trained, and the problems of class imbalance and overconfidence in probability can be effectively alleviated.

[0063] The water accumulation identification method provided in this application can provide a more efficient, stable, and task-specific solution for subsequent rapid early warning, pre-screening, and lightweight deployment.

[0064] Figure 2 A structural diagram of the water accumulation identification device provided in an embodiment of this application is shown. Figure 2 As shown, the water accumulation detection device 200 includes: The acquisition module 201 is used to acquire the image to be recognized; The recognition module 202 is used to input the image to be recognized into the target model and obtain the recognition result output by the target model. The target model includes a target feature extractor and a classification head. The target feature extractor is a feature extractor in the water accumulation segmentation model. The water accumulation segmentation model is used to predict the probability of whether a pixel in any image belongs to a water accumulation area. The target feature extractor learns the spatial structure of the water accumulation area, the area boundary, and the knowledge of distinguishing between foreground and background during the training of the water accumulation segmentation model.

[0065] The water accumulation identification device 200 provided in this application embodiment can realize all the processes implemented in the aforementioned water accumulation identification method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0066] Figure 3 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.

[0067] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.

[0068] Specifically, the processor 601 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0069] Memory 602 may include mass storage for data or instructions. For example, and not limitingly, memory 602 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 602 may include removable or non-removable (or fixed) media. Where appropriate, memory 602 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 602 is non-volatile solid-state memory.

[0070] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to the first or second aspect of this disclosure.

[0071] The processor 601 reads and executes computer program instructions stored in the memory 602 to implement any of the water accumulation identification methods in the above embodiments.

[0072] In one example, the electronic device may also include a communication interface 603 and a bus 610. For example, Figure 3 As shown, the processor 601, memory 602, and communication interface 603 are connected through bus 610 and complete communication with each other.

[0073] The communication interface 603 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0074] Bus 610 includes hardware, software, or both. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 610 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0075] Furthermore, in conjunction with the water accumulation identification methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the water accumulation identification methods in the above embodiments.

[0076] This application provides a computer program product in which the instructions are executed by the processor of an electronic device, causing the electronic device to perform any of the water accumulation identification methods described in the above embodiments.

[0077] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described as examples. However, the method process of this application is not limited to the specific steps described. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0078] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0079] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0080] The foregoing flowcharts and / or block diagrams of methods, apparatus (systems) according to embodiments of the present disclosure have described various aspects of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0081] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for identifying water accumulation, characterized in that, The method includes: Acquire the image to be recognized; The image to be identified is input into the target model to obtain the recognition result output by the target model. The target model includes a target feature extractor and a classification head. The target feature extractor is a feature extractor in the water accumulation segmentation model. The water accumulation segmentation model is used to predict the probability of whether a pixel in any image belongs to a water accumulation area. The target feature extractor learns the spatial structure of the water accumulation area, the area boundary, and the knowledge of distinguishing between foreground and background during the training of the water accumulation segmentation model.

2. The water accumulation identification method according to claim 1, characterized in that, The target feature extractor includes multiple feature extraction layers; The target model is trained according to the following process: Multiple first training samples are obtained. The first training samples include first sample images and category labels for each first sample image. The category labels of the first sample images are used to identify water accumulation information in the first sample images. For each of the first training samples, the first sample image from the first training sample is input to the target feature extractor for feature extraction, resulting in image features output by multiple feature extraction layers; and... The image features output from multiple feature extraction layers are fused to obtain the feature vector of the first sample image; The feature vector of the first sample image is input into the classification head to obtain the recognition result of the first sample image; A first loss value is determined based on the category label of the first sample image and the recognition result of the first sample image; The parameters of the classification head are adjusted using the first loss value, and the process jumps to the step of inputting the first sample image into the target feature extractor for feature extraction, until the first iteration stopping condition is met, thus obtaining the target model.

3. The water accumulation identification method according to claim 2, characterized in that, The image features output from multiple feature extraction layers are fused to obtain the feature vector of the first training sample, including: Select some or all of the image features output by the feature extraction layer, and perform global average pooling and global max pooling on the image features respectively to obtain a first pooling vector and a second pooling vector; The first pooling vector and the second pooling vector corresponding to each of the image features are concatenated to obtain the feature vector of the first training sample.

4. The water accumulation identification method according to claim 2, characterized in that, During the training phase, the target model also includes an attention gating network; The image features output from multiple feature extraction layers are fused to obtain the feature vector of the first sample image, including: For each image feature output by the feature extraction layer, global average pooling and global max pooling are performed on the image features respectively to obtain a first pooling vector and a second pooling vector. The first pooling vector and the second pooling vector corresponding to the same feature extraction layer are concatenated to obtain the pooling vector of the feature extraction layer. The feature vector of the first sample image is obtained by weighted summation of the pooling vectors of each feature extraction layer through the attention gating network.

5. The water accumulation identification method according to claim 4, characterized in that, The step of adjusting the parameters of the classification head using the first loss value includes: The parameters of the classification head and the attention gating network are adjusted using the first loss value.

6. The water accumulation identification method according to claim 2, characterized in that, Based on the category label of the first sample image and the recognition result of the first sample image, a first loss value is determined, including: The category labels of the first sample image are subjected to label smoothing processing to obtain the label smoothing result; Based on the label smoothing result and the recognition result of the first sample image, the classification basic loss value is determined; The first loss value is determined based on the classification base loss value and the target regularization term; The target regularization term includes at least one of the following: A focus modulation term, which is determined based on the predicted probability corresponding to the category label in the recognition result of the first sample image; A weight decay regularization term, which is applied to the parameters of the classification head. Regular expression yields; The scale consistency regularization term is determined based on the recognition result of the first sample image and the auxiliary prediction probability distribution obtained by prediction based on the pooling vector of each feature extraction layer.

7. The water accumulation identification method according to claim 6, characterized in that, During the training phase, the target model also includes an auxiliary classifier; The scale consistency regularization term is determined according to the following process: The auxiliary classifier is used to predict the pooling vector of each feature extraction layer to obtain the auxiliary prediction probability distribution corresponding to each feature extraction layer. In each training round, the parameters of the auxiliary classifier and the parameters of the classification head are adjusted. The scale consistency regularization term is determined based on the auxiliary prediction probability distribution corresponding to each feature extraction layer and the recognition result of the first sample image.

8. The water accumulation identification method according to claim 1, characterized in that, After inputting the image to be recognized into the target model and obtaining the recognition result output by the target model, the method further includes: If the recognition result indicates that the risk of water accumulation has reached the warning threshold, then the water accumulation segmentation model is invoked to segment the image to be identified, thereby obtaining the water accumulation pixels in the image to be identified.

9. A water accumulation detection device, characterized in that, The device includes: The acquisition module is used to acquire the image to be recognized; The recognition module is used to input the image to be recognized into the target model and obtain the recognition result output by the target model. The target model includes a target feature extractor and a classification head. The target feature extractor is a feature extractor in the water accumulation segmentation model. The water accumulation segmentation model is used to predict the probability of whether a pixel in any image belongs to a water accumulation area. The target feature extractor learns the spatial structure of the water accumulation area, the area boundary, and the knowledge of distinguishing between foreground and background during the training of the water accumulation segmentation model.

10. An electronic device, characterized in that, include: Processor and memory storing computer program instructions; When the processor executes the computer program instructions, it implements the water accumulation identification method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the water accumulation identification method as described in any one of claims 1-8.

12. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the water accumulation identification method as described in any one of claims 1-8.