Image semantic segmentation method and system based on few samples

Through the image semantic segmentation method based on few samples, combined with preprocessing, feature extraction and fusion technology, the problems of inaccurate segmentation results, high computing resource consumption and long training time in image segmentation are solved, and the real-time and accuracy of image segmentation are achieved. , improving the application reliability of driverless technology.

CN119339381AActive Publication Date: 2025-01-21SHANDONG UNIV

Patent Information

Application Number
CN202411895972.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-01-21
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The prior art has problems in the semantic segmentation of images, such as inaccurate segmentation results, large computing resources consumption and long training time, especially in the face of object occlusion, complex road conditions and resource limitations.

Method used

The image semantic segmentation method based on few samples is used to optimize the image semantic segmentation model to improve segmentation efficiency and accuracy by preprocessing, feature extraction and fusion of images, combined with recursive enhancement mechanism and feature interaction.

Benefits of technology

It achieves real-time and accuracy of image segmentation under resource constraints and short training time, can effectively handle object occlusion and complex road conditions, and improves the application reliability of driverless technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339381A_ABST
    Figure CN119339381A_ABST
Patent Text Reader

Abstract

The invention discloses an image semantic segmentation method and system based on few samples, and relates to the technical field of semantic segmentation in computer vision. The method comprises the following steps: acquiring a known image sample set, and training an image semantic segmentation model by using a preprocessed image; wherein the training process comprises the following steps of: performing feature extraction operation on an image, performing enhancement processing on a high-frequency component, combining the enhanced high-frequency component with a low-frequency component, capturing correlation between information in a preliminary fusion feature through feature interaction and multi-layer fusion, and iteratively optimizing feature representation by using a recursion enhancement mechanism to obtain a final fusion feature; and recovering image information according to the final fusion feature to obtain a final output image. And performing image semantic segmentation on a to-be-segmented image by using the image semantic segmentation model to obtain an image segmentation result. According to the method, the problems of object shielding, complex road conditions, resource limitation and too long training time can be solved, and the real-time performance and accuracy of image segmentation are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of semantic segmentation in computer vision, and in particular to a method and system for image semantic segmentation based on a small number of samples. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Scene segmentation is an important technology in the field of computer vision. Its main purpose is to classify images at the pixel level and divide images into different specific area attributes, so as to achieve semantic understanding of image content. Scene segmentation not only involves the recognition of objects in the image, but also includes an in-depth understanding of the spatial relationship, shape and semantic information of the objects. It can realize the machine's perception like a human, and recognize the relationship and classification between the background and foreground of a painting, so as to identify the characteristics of the image. Scene segmentation is used in many scenarios in practical applications. In autonomous driving, scene segmentation can identify various elements on the road in real time, provide accurate environmental perception information for the autonomous driving system, and help the vehicle to plan and make decisions. In augmented reality and virtual reality, the interaction between virtual objects and the real environment is enhanced by accurately identifying and segmenting objects in the real world. In industrial automation, scene segmentation can effectively identify defects and flaws of items on the production line, thereby ensuring the intelligence of the entire assembly line process.

[0004] Although scene segmentation technology has made significant progress in many fields, there are still problems to be solved in practical applications. First, the interference of various factors in the image collection process causes unclear images, such as light, angle and other factors, which leads to inaccurate segmentation results, thus affecting the effect of practical applications. Secondly, scene segmentation models based on deep learning often require a lot of computing resources. When processing high-resolution images or videos, the computing overhead and storage requirements are large, which is a challenge for real-time systems. Therefore, how to improve segmentation efficiency and reduce computing costs and resource consumption in the image segmentation process is a problem that needs to be solved urgently in existing technologies. Summary of the invention

[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method and system for image semantic segmentation based on a small number of samples, which can overcome the problems of object occlusion, complex road conditions, resource limitations and long training time, and ensure the real-time and accuracy of image segmentation.

[0006] In order to achieve the above object, the present invention is implemented through the following technical solutions: A first aspect of the present invention provides a method for image semantic segmentation based on a small number of samples, comprising the following steps: Obtain a known image sample set and perform preprocessing operations on the sample set images; Build an image semantic segmentation model and use the preprocessed images to train the image semantic segmentation model; The training process includes: performing feature extraction on the image, dividing the extracted features into high-frequency and low-frequency components, enhancing the high-frequency components and combining them with the low-frequency components to obtain preliminary fusion features, capturing the correlation between information in the preliminary fusion features through feature interaction and multi-layer fusion, and iteratively optimizing feature representation using a recursive enhancement mechanism to obtain the final fusion features, restoring image information based on the final fusion features, and obtaining the final output image; The loss function is used to evaluate the difference between the output image and the actual label image, and the parameters of the image semantic segmentation model are optimized to obtain a trained image semantic segmentation model. The trained image semantic segmentation model is used to perform image semantic segmentation on the image to be segmented to obtain the image segmentation result.

[0007] Furthermore, the sample set image preprocessing operations include data enhancement, image cropping and normalization, and the sample set images are labeled and divided into a training set and a test set.

[0008] Furthermore, before each training, the sample set images are randomly cropped to increase the number of images and ensure image diversity.

[0009] Furthermore, an image semantic segmentation model is constructed through encoding and decoding. The encoding part uses ResNet50 as the basic backbone network to extract image features. All parameters of the backbone network are fixed and not updated during the training process.

[0010] Furthermore, the decoding part recovers the information of the input image according to the final fused features through convolution and bilinear interpolation operations.

[0011] Furthermore, the specific steps of enhancing the high frequency components and combining them with the low frequency components are as follows: The high-frequency components are guided by the mask, and the details of the information are captured through pooling, convolution, ReLU activation function and DFA enhancement processing to obtain enhanced high-frequency components; The enhanced high-frequency components are normalized and fused with the low-frequency components.

[0012] Furthermore, the specific steps of capturing the correlation between information in the preliminary fusion features through feature interaction and multi-layer fusion are: The preliminary fusion features are combined with the mask to generate target-specific support features, and the query image is processed in a dual-branch manner, where one branch enhances the directional information through the DFA module to obtain the directional features of the query image, and the other branch extracts the global features; Support features that interact with the directional features of the query image and are fused with the global features of the query image after weighting; The fusion result of each layer is combined with the output of the previous layer to generate the final feature representation.

[0013] A second aspect of the present invention provides an image semantic segmentation system based on a small number of samples, comprising: A data acquisition module is configured to acquire a known image sample set and perform a preprocessing operation on the sample set images; A model training module is configured to build an image semantic segmentation model and train the image semantic segmentation model using the preprocessed images; The training process includes: performing feature extraction on the image, dividing the extracted features into high-frequency and low-frequency components, enhancing the high-frequency components and combining them with the low-frequency components to obtain preliminary fusion features, capturing the correlation between information in the preliminary fusion features through feature interaction and multi-layer fusion, and iteratively optimizing feature representation using a recursive enhancement mechanism to obtain the final fusion features, restoring image information based on the final fusion features, and obtaining the final output image; A model optimization module is configured to use a loss function to evaluate the difference between the output image and the actual label image, optimize the image semantic segmentation model parameters, and obtain a trained image semantic segmentation model; The image semantic segmentation module is configured to perform image semantic segmentation on the image to be segmented using the trained image semantic segmentation model to obtain an image segmentation result.

[0014] A third aspect of the present invention provides a medium having a program stored thereon, which, when executed by a processor, implements the steps in the image semantic segmentation method based on few samples as described in the first aspect of the present invention.

[0015] The fourth aspect of the present invention provides a device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the image semantic segmentation method based on a small number of samples as described in the first aspect of the present invention are implemented.

[0016] One or more of the above technical solutions have the following beneficial effects: The present invention discloses a method and system for image semantic segmentation based on few samples. First, the input image is preprocessed, and the pixel value is normalized and mapped to a range of 0 to 1 to reduce the influence of external factors. Then, the image is feature extracted through a fixed backbone network resnet. In the encoding stage, convolution is used for feature extraction. Then, the HLFFFA module enhances the representation of the target feature by separating the high-frequency and low-frequency components, and independently calculates the attention weight for the high-frequency part, while retaining the global context information. The RCFM module evaluates the correlation between the support and query features through cosine similarity, and iteratively optimizes the feature representation through a recursive enhancement mechanism. In the decoding stage, the information of the input image is restored through convolution and bilinear interpolation operations to generate an output image with semantic information. Finally, the difference between the predicted result and the actual label image is evaluated through the DICE loss function, and the segmentation model is further optimized to output the final segmentation result. The semantic segmentation algorithm of the present invention improves the unmanned driving technology, solves the problems of object occlusion, complex road conditions, resource limitations and long training time, and ensures real-time performance and accuracy.

[0017] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0019] Figure 1 This is a framework diagram of the image semantic segmentation method based on a small number of samples in the first embodiment of the present invention; Figure 2 is a schematic diagram of a method for preprocessing an image in Embodiment 1 of the present invention; Figure 3 is a schematic diagram of HLFFFA in Embodiment 1 of the present invention; Figure 4 is a schematic diagram of RCFM in Embodiment 1 of the present invention; Figure 5 is a schematic diagram of DFA in Embodiment 1 of the present invention; Figure 6 It is a schematic diagram of the FWB in the first embodiment of the present invention. DETAILED DESCRIPTION

[0020] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0021] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "include" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or their combinations; Embodiment 1: Embodiment 1 of the present invention provides a method for image semantic segmentation based on a small number of samples, comprising the following steps: S1: Obtain a known image sample set and perform preprocessing operations on the sample set images.

[0022] S1.1: Receive a video stream and extract an image sequence according to a preset frame rate to obtain continuous image frame data from the same scene.

[0023] This embodiment takes the semantic segmentation of images in the process of unmanned driving as an example. By collecting the video of the autonomous driving scene and extracting each frame of the image, the video is composed of a series of image frames, which are segmented into single-frame images, and one frame is extracted every 10 frames to obtain input data.

[0024] S1.2: Preprocessing operations on sample set images.

[0025] In a specific embodiment, Figure 2 As shown in the figure, the preprocessing operations on the sample set images include data augmentation, image cropping and normalization, and the sample set images are labeled and divided into training set and test set. After the preprocessing is completed, the training set is divided into support set and query set, which are input into the network for training respectively. The images in the support set are support images, and the images in the query set are query images. The support set is used to train and adjust the model, while the query set is used to evaluate the generalization ability of the model.

[0026] Collect videos of autonomous driving scenes and extract key frame images from them. Label the images pixel by pixel, clarify the category label of each image, and finally generate training sets and test sets. Before each training, randomly crop the sample set images to increase the number of images and ensure image diversity.

[0027] S1.2.1: Assign a category label to each pixel and generate a corresponding binary image.

[0028] When processing a large amount of image data, especially for pixel-by-pixel annotation, manual annotation is not only time-consuming and error-prone, resulting in a large waste of human resources, but also easily introduces inconsistencies, affecting the quality of the training set. In order to improve the accuracy and reliability of the model, a large amount of high-quality annotated data is usually required, but the traditional manual annotation method is not only cumbersome and error-prone, but also becomes a bottleneck for training deep learning models due to the large amount of data and long annotation cycle. In order to solve this problem, the dependence on a large amount of annotated data can be significantly reduced by optimizing data utilization through preprocessing technology. Through intelligent processing methods such as data enhancement, image cropping and normalization, not only the data quality is maintained, but also the number of required images can be greatly reduced, which improves the training effect and accuracy of the model. In addition, the intelligent label generation method can effectively reduce annotation errors and improve the accuracy of training data. In summary, the innovation of preprocessing technology not only saves the cost of manual annotation and avoids the deviation caused by incorrect annotation, but also improves network performance and training efficiency by reducing the dependence on massive annotated data, thereby significantly improving the accuracy of the model, providing strong support for the promotion and development of deep learning technology in practical applications.

[0029] A device for establishing a background model by calculating the mean and variance of each pixel in the image, normalizing the pixels, and extracting scene features; S1.2.2: Before each training, the input images and annotated images are randomly cropped to ensure image diversity.

[0030] If the cropped image is larger than the original image, it is cropped from a random position; if it is smaller than the original image, it is filled and randomly flipped. Repeat the above steps to ensure that the training image changes each time, which actually increases the amount of training data.

[0031] S1.2.3: Calculate the similarity of all pixels in the image and start building the network model.

[0032] S1.2.4: Use normalization methods to standardize images.

[0033] In a specific embodiment, the image data is converted to a form that conforms to a normal distribution by subtracting the mean and dividing by the standard deviation. This process effectively removes the difference in image brightness, reduces the contrast fluctuation between different images, ensures the consistency of input data, and avoids the interference of brightness changes on the training process. After standardization, the neural network can converge more quickly and stably, and improves the sensitivity to image details.

[0034] This embodiment constructs a detailed background model by calculating the mean and variance of each pixel in the image, and uses normalization technology to effectively extract key features of the image, thereby improving the segmentation ability and performance of the model.

[0035] S2: Build Figure 1 The image semantic segmentation model shown uses the preprocessed images to train the image semantic segmentation model.

[0036] In this process, the image features are extracted through the pre-trained backbone network, the backbone parameters in the network are frozen, and a model architecture with a fixed background is established. The training process is optimized by preprocessing the images in the training set. The image semantic segmentation model designs the HLFFFA module to enhance the representation of the target features by separating the high-frequency and low-frequency components, and independently calculates the attention weights for the high-frequency parts while retaining the global context information; the RCFM module evaluates the correlation between the support and query features through cosine similarity, and iteratively optimizes the feature representation through a recursive enhancement mechanism; finally, 2D convolution is used to output the prediction results. This process effectively improves the processing efficiency of the network and reduces the error rate, thereby optimizing the model performance.

[0037] In a specific implementation, this embodiment uses an efficient lightweight network model to perform real-time scene segmentation on image frames extracted from autonomous driving scene videos.

[0038] The image semantic segmentation model is constructed by encoding and decoding. The encoding part uses ResNet50 as the basic backbone network to extract image features. All parameters of the backbone network are fixed and not updated during the training process.

[0039] Specifically, ResNet50 is used as the basic backbone network, and the query image and the support image are respectively input into the network that has been pre-trained on ImageNet to extract the features of the image. In order to ensure that the network can adapt to a wider range of scenarios and avoid overfitting, all parameters of the backbone network are fixed and not updated during the training process.

[0040] Among them, the training process of the image semantic segmentation model includes: S2.1: Perform feature extraction on the image and divide the extracted features into high-frequency and low-frequency components.

[0041] S2.1.1: In the process of feature extraction, this embodiment designs a high-low frequency feature fusion attention module (High-Low Frequency Feature Fusion Attention Module, HLFFFA), such as Figure 3As shown in the figure, the image is first processed by a 7×7 convolution kernel with a stride of 2, and the resulting feature map size is 119×119×128, which can extract the basic spatial information of the image. Then, the feature map extracted in the middle layer contains richer spatial information and has a size of 60×60×1024. Finally, deeper semantic features are obtained through advanced feature extraction, and the feature map size is 60×60×2048. In order to reduce the computational complexity, a 1×1 convolution is used to compress the number of channels to 64, reducing unnecessary calculations.

[0042] S2.1.2: Through the masked average pooling method, the middle-level features and high-level features of the support image are fused to form the support features, and the support features are finally abstracted into a prototype vector of size 1×1×256. The prototype vector represents the core information of the support image.

[0043] The generation process can be described by the following formula: .

[0044] in, represents the prototype vector, represents the average pooling operation, The interpolation and filling operations are used to transform the mask Remodeled with supporting features For the same shape, in 5-shot, the average of the 5 prototype vectors is taken as the new prototype vector.

[0045] Support features Separation into high frequency components by Fourier transform and low frequency components .

[0046] , .

[0047] in, represents the Fourier transform, Represents the separation of high and low frequency functions.

[0048] S2.2: After enhancing the high-frequency components, combine them with the low-frequency components to obtain preliminary fusion features.

[0049] S2.2.1: The high-frequency components are guided by the mask, and the details of the information are captured through pooling, convolution, ReLU activation function and DFA enhancement processing to obtain the enhanced high-frequency components.

[0050] In a specific implementation, these enhanced high-frequency components are then normalized and fused with the low-frequency components, thereby enriching the detail information while retaining the global context information, as shown in FIG. 3 .

[0051] For high frequency components and support mask , the enhanced high frequency components The generation process is as follows: , , .

[0052] in, By applying the mask and Element-by-element multiplication is performed to highlight the characteristics of the target area; It is generated by combining the outputs of max pooling and average pooling to capture multi-scale contextual information; It is the final refined high-frequency component generated by the directional feature aggregation module.

[0053] S2.2.2: The enhanced high-frequency components are normalized and fused with the low-frequency components.

[0054] The high-frequency normalization process is defined as: , , .

[0055] in, It is through The output after applying the maximum pooling and average pooling operations is concatenated. It is the high-frequency component obtained by normalizing the high-frequency component through the activation function. It is the enhanced feature. After the high-frequency component is enhanced, the normalized high-frequency component is combined with the low-frequency component by element-by-element multiplication.

[0056] S2.3: Capture the correlation between information in preliminary fused features through feature interaction and multi-layer fusion.

[0057] S2.3.1: Combine the preliminary fused features with the mask to generate target-specific support features while processing the query image in a dual-branch manner.

[0058] Among them, this embodiment designs a recursive cosine fusion module (RCFM), such as Figure 4As shown in Figure 1, the RCFM module generates target-specific support features by combining support image features with masks, and processes the query image in a dual-branch manner: one branch enhances the directional information through the forward feature fusion module (Directional Feature Aggregation, DFA) to obtain the directional features of the query image, and the other branch extracts the global features. The DFA module structure is shown in Figure 1. Figure 5 As shown, the module structure is divided into two paths, one path includes a 3×3 convolution, and the other path includes two 3×1 convolutions. The query image extracts the direction information after passing through the two paths, and then passes through a 1×1 convolution to serve as the output of the DFA module. This embodiment can extract richer direction information by setting two convolution kernels of different sizes to extract direction features from the query image respectively.

[0059] S2.3.2: The support features interact with the directional features of the query image and are fused with the global features of the query image after weighting.

[0060] S2.3.3: Combine the fusion results of each layer with the output of the previous layer to generate the final feature representation.

[0061] Through feature interaction and multi-layer fusion, this module effectively improves the model's ability to capture local details and global semantics, thereby enhancing the representation of target features, such as Figure 4 The formula is as follows: , , , , .

[0062] in, represents the product of the support mask and the support feature, is the final output feature after fusion and element-by-element multiplication. is the query feature enhanced by convolution, is the query feature extracted by 3×3 convolution, represents element-wise multiplication, represents the concatenation operation along the channel dimension, Represents the features of the previous layer output.

[0063] S2.4: Use the recursive enhancement mechanism to iteratively optimize the feature representation and obtain the final fusion feature.

[0064] This embodiment proposes a feature weight module (FWM). Figure 6 As shown in the figure, FWM extracts multi-scale receptive fields through dilated convolution, avoiding the information loss that may be caused by the pooling layer. Dilated convolution can expand the receptive field and maintain detailed information, thereby enhancing the model's ability to capture features of different scales and improving the speed and accuracy of image segmentation tasks. Its formula is: .

[0065] in, represents the prior mask, refers to the prototype vector, is the concatenation of the intermediate features of the query image, Indicates FWM operation, is the attention feature, emphasizing the important areas in the feature space, Represents recursive enhancement of features through iterative processing refinement.

[0066] S2.5: Restore the image information according to the final fusion features to obtain the final output image.

[0067] In this embodiment, the decoding part restores the information of the input image according to the final fusion features through convolution and bilinear interpolation operations.

[0068] S2.5.1: In the decoding stage, a 1×1 convolutional layer (with a stride of 1) is first used to reduce the number of channels and remove redundant information. Then, another 1×1 convolutional layer (also with a stride of 1) is used to enhance the nonlinear features, and the output feature map is 60×60×64.

[0069] S2.5.2: Pool the input feature map with different-sized pooling kernels (such as 1x1, 2x2, 3x3, 6x6, etc.) to obtain features of different scales, and then upsample the pooling results to make them consistent with the original feature map size and splice them together along the channel dimension. The spliced ​​multi-scale feature map contains rich global information, which helps the network better understand objects of different sizes, and finally improves the semantic segmentation accuracy through convolution processing.

[0070] S2.5.3: Finally, the image is upsampled by bilinear interpolation so that the size of the predicted output is the same as the original Figure 1 The size of the feature map is 400×400×the number of categories.

[0071] S3: Use the loss function to evaluate the difference between the output image and the actual label image, optimize the image semantic segmentation model parameters, and obtain a trained image semantic segmentation model.

[0072] In a specific implementation, in a lightweight network, the optimization process is performed by comparing the difference between the predicted image and the original image. To achieve this goal, this embodiment uses a loss function to measure the difference between the two. The formula of the loss function is: .

[0073] in, is the weighting coefficient of each category, represents the probability distribution of the predicted output, represents the probability distribution of the true label, is a small constant used to prevent the denominator from being zero.

[0074] In the final evaluation phase, in order to ensure that the network's performance on the test set is consistent with that in the training phase, the test set processing flow is the same as the training set, with the only difference being that no random cropping and data augmentation operations are performed. This is because in the test phase, we hope that the network can reason in unseen real scenes and evaluate its generalization ability, and data augmentation is usually used to improve the robustness of the model during the training process, so the original image data needs to be used for prediction in the test phase.

[0075] In addition, in order to comprehensively evaluate the performance of the model, this embodiment uses multiple evaluation indicators to quantify its segmentation effect. Two important indicators are the average intersection-over-union ratio and the foreground-background intersection-over-union ratio.

[0076] S4: Use the trained image semantic segmentation model to perform image semantic segmentation on the image to be segmented to obtain the image segmentation result.

[0077] The semantic segmentation algorithm of the present invention can effectively optimize the unmanned driving technology, ensure accuracy while ensuring the real-time performance of the system, and can cope with challenges such as object occlusion and complex road conditions. In addition, the algorithm is specially designed to overcome the problems of tight computing resources and long training time, so that the unmanned driving system can process image data more efficiently in actual operation. Through in-depth analysis of different scenarios and environments, the algorithm can provide stable performance under various road conditions, ensuring that autonomous driving vehicles can make fast and accurate decisions in complex and dynamic environments, significantly improving the application reliability and intelligence level of unmanned driving technology.

[0078] Embodiment 2: Embodiment 2 of the present invention provides a system for image semantic segmentation based on few samples, including: A data acquisition module is configured to acquire a known image sample set and perform a preprocessing operation on the sample set images; A model training module is configured to build an image semantic segmentation model and train the image semantic segmentation model using the preprocessed images; The training process includes: performing feature extraction on the image, dividing the extracted features into high-frequency and low-frequency components, enhancing the high-frequency components and combining them with the low-frequency components to obtain preliminary fusion features, capturing the correlation between information in the preliminary fusion features through feature interaction and multi-layer fusion, and iteratively optimizing feature representation using a recursive enhancement mechanism to obtain the final fusion features, restoring image information based on the final fusion features, and obtaining the final output image; A model optimization module is configured to use a loss function to evaluate the difference between the output image and the actual label image, optimize the image semantic segmentation model parameters, and obtain a trained image semantic segmentation model; The image semantic segmentation module is configured to perform image semantic segmentation on the image to be segmented using the trained image semantic segmentation model to obtain an image segmentation result.

[0079] Embodiment three: Embodiment 3 of the present invention provides a medium on which a program is stored. When the program is executed by a processor, the steps in the image semantic segmentation method based on few samples as described in Embodiment 1 of the present invention are implemented.

[0080] Embodiment 4: Embodiment 4 of the present invention provides a device, including a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in the image semantic segmentation method based on a small number of samples as described in Embodiment 1 of the present invention are implemented.

[0081] The steps involved in the above embodiments 2, 3 and 4 correspond to the method embodiment 1. For the specific implementation methods, please refer to the relevant description part of embodiment 1.

[0082] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.

[0083] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A method for image semantic segmentation based on few samples, characterized in that: The following steps are involved: Obtain a known image sample set and perform preprocessing operations on the sample set images; Build an image semantic segmentation model and use the preprocessed images to train the image semantic segmentation model; The training process includes: performing feature extraction on the image, dividing the extracted features into high-frequency and low-frequency components, enhancing the high-frequency components and combining them with the low-frequency components to obtain preliminary fusion features, capturing the correlation between information in the preliminary fusion features through feature interaction and multi-layer fusion, and iteratively optimizing feature representation using a recursive enhancement mechanism to obtain the final fusion features, restoring image information based on the final fusion features, and obtaining the final output image; The loss function is used to evaluate the difference between the output image and the actual label image, and the parameters of the image semantic segmentation model are optimized to obtain a trained image semantic segmentation model. The trained image semantic segmentation model is used to perform image semantic segmentation on the image to be segmented to obtain the image segmentation result.

2. The image semantic segmentation method based on few samples according to claim 1, characterized in that: The sample set image preprocessing operations include data augmentation, image cropping and normalization, and the sample set images are labeled and divided into training sets and test sets.

3. The image semantic segmentation method based on few samples as claimed in claim 2, characterized in that: Before each training, the sample set images are randomly cropped to increase the number of images and ensure image diversity.

4. The image semantic segmentation method based on few samples according to claim 1, characterized in that: The image semantic segmentation model is constructed by encoding and decoding. The encoding part uses ResNet50 as the basic backbone network to extract image features. All parameters of the backbone network are fixed and not updated during the training process.

5. The image semantic segmentation method based on few samples according to claim 4, characterized in that: The decoding part restores the information of the input image based on the final fusion features through convolution and bilinear interpolation operations.

6. The image semantic segmentation method based on few samples according to claim 1, characterized in that: The specific steps of enhancing the high-frequency components and combining them with the low-frequency components are: The high-frequency components are guided by the mask, and the details of the information are captured through pooling, convolution, ReLU activation function and DFA enhancement processing to obtain enhanced high-frequency components; The enhanced high-frequency components are normalized and fused with the low-frequency components.

7. The image semantic segmentation method based on few samples according to claim 1, characterized in that: The specific steps of capturing the correlation between information in the preliminary fusion features through feature interaction and multi-layer fusion are: The preliminary fusion features are combined with the mask to generate target-specific support features, and the query image is processed in a dual-branch manner, where one branch enhances the directional information through the DFA module to obtain the directional features of the query image, and the other branch extracts the global features; Support features that interact with the directional features of the query image and are fused with the global features of the query image after weighting; The fusion result of each layer is combined with the output of the previous layer to generate the final feature representation.

8. A system for image semantic segmentation based on few samples, characterized in that: include: A data acquisition module is configured to acquire a known image sample set and perform a preprocessing operation on the sample set images; A model training module is configured to build an image semantic segmentation model and train the image semantic segmentation model using the preprocessed images; The training process includes: performing feature extraction on the image, dividing the extracted features into high-frequency and low-frequency components, enhancing the high-frequency components and combining them with the low-frequency components to obtain preliminary fusion features, capturing the correlation between information in the preliminary fusion features through feature interaction and multi-layer fusion, and iteratively optimizing feature representation using a recursive enhancement mechanism to obtain the final fusion features, restoring image information based on the final fusion features, and obtaining the final output image; A model optimization module is configured to use a loss function to evaluate the difference between the output image and the actual label image, optimize the image semantic segmentation model parameters, and obtain a trained image semantic segmentation model; The image semantic segmentation module is configured to perform image semantic segmentation on the image to be segmented using the trained image semantic segmentation model to obtain an image segmentation result.

9. A computer-readable storage medium, characterized in that: A plurality of instructions are stored therein, and the instructions are suitable for being loaded by a processor of a terminal device and executing the image semantic segmentation method based on a small number of samples as described in any one of claims 1-7.

10. A terminal device, characterized in that: It includes a processor and a computer-readable storage medium, the processor is used to implement each instruction; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded by the processor and executing the image semantic segmentation method based on few samples described in any one of claims 1-7.

Citation Information

Patent Citations

  • Infrared image generation method and device, equipment and medium

    CN115861753A

  • Training method and device of small sample semantic segmentation model, equipment and medium

    CN118096800A

  • Small sample three-dimensional medical image segmentation system

    CN118470322A

  • Similarity propagation for one-shot and few-shot image segmentation

    US20210397876A1

  • Few-shot semantic image segmentation using dynamic convolution

    US20230154007A1

Cited By

  • Unmanned aerial vehicle flight path planning method based on semantic guidance and visual perception

    CN120293149A

  • UAV flight path planning method based on semantic guidance and visual perception

    CN120293149B

  • Image fusion classification method and device based on segmentation guide data enhancement

    CN120318557A