Semantic segmentation method, image processing device and storage medium based on image denoising

The image is denoised and segmented by SwinIR and SAM models, which solves the problem of low resource utilization in image processing and achieves efficient image processing.

CN119963846BActive Publication Date: 2025-09-05SHENZHEN SMARTCITY TECH DEV GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510444969.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-09-05
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

In the existing technology, the training process of image processing models requires a lot of computing resources and time, resulting in low resource utilization.

Method used

The SwinIR image restoration model and the training-free object segmentation model SAM are used to denoise and segment the image respectively, directly extracting and processing feature information to avoid model training.

Benefits of technology

It improves the resource utilization and efficiency of image processing, reduces the resource waste caused by model training, and improves the image segmentation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963846B_ABST
    Figure CN119963846B_ABST
Patent Text Reader

Abstract

The present application discloses a semantic segmentation method based on image denoising, an image processing device and a storage medium, and relates to the field of image processing technology. The method includes: after receiving an image to be processed, extracting feature information of the image to be processed based on a shallow feature extraction module and a deep feature extraction module of an image restoration model; performing denoising processing on the image to be processed based on the feature information to obtain a denoised image; and performing segmentation processing on the denoised image based on a segmentation model of all things and indication information of the denoised image to obtain an image segmentation result, wherein the indication information is used to identify entity instance objects of the image to be processed. Denoising and segmenting the image to be processed based on an image restoration model and a segmentation model of all things that do not require pre-training effectively improves resource utilization during image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a semantic segmentation method based on image denoising, an image processing device, and a storage medium. Background Art

[0002] The basic principle of deep learning image denoising is to use deep learning models such as convolutional neural networks (CNNs) to effectively remove various types of noise by learning local features of an image. Image segmentation is the process of dividing an image into several sub-regions based on the similarity and mutual exclusivity of certain local features (such as grayscale, texture, color, or statistical characteristics).

[0003] In order to improve the performance and generalization ability of the model, it is usually necessary to collect and label a large amount of image data for training. However, the long training process will take up a lot of computing resources and time, resulting in low resource utilization.

[0004] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of this application is to provide a semantic segmentation method, image processing device and storage medium based on image denoising, aiming to solve the technical problem of low resource utilization resulting from the need for model training when processing images.

[0006] To achieve the above objectives, this application proposes a semantic segmentation method based on image denoising, the method comprising:

[0007] After receiving the image to be processed, extracting feature information of the image to be processed based on the shallow feature extraction module and the deep feature extraction module of the image restoration model SwinIR;

[0008] After receiving the image to be processed, extracting feature information of the image to be processed based on the shallow feature extraction module and the deep feature extraction module of the image restoration model;

[0009] Based on the feature information, performing denoising on the image to be processed according to the image reconstruction module of the image restoration model to obtain a denoised image;

[0010] The denoised image is segmented according to the object segmentation model and the indication information of the denoised image to obtain an image segmentation result, wherein the indication information is used to identify the entity instance object of the image to be processed.

[0011] In one embodiment, before the step of performing segmentation processing on the denoised image according to the object segmentation model and the indication information of the denoised image to obtain an image segmentation result, and using the indication information to identify entity instance objects of the image to be processed, the step further includes:

[0012] Obtaining prompt information received by the prompt editing interface of the object segmentation model, and determining a prompt type of the prompt information, wherein the prompt type includes at least voice, text, point selection, box selection, mask, gesture, and template input;

[0013] Generate the indication information corresponding to the prompt information according to the prompt type, and / or update the indication information according to the prompt type.

[0014] In one embodiment, there are multiple prompt types, and the step of generating the indication information corresponding to the prompt information according to the prompt type and / or updating the indication information according to the prompt type includes:

[0015] Determining a set of indication information associated with a plurality of the prompt types;

[0016] If the number of subsets of the indication information set does not match the number of the prompt types, the indication information with empty status information is generated according to the prompt type, and the existing indication information is updated according to the prompt type.

[0017] In one embodiment, before the step of performing segmentation processing on the denoised image according to the object segmentation model and the indication information of the denoised image to obtain an image segmentation result, and using the indication information to identify entity instance objects of the image to be processed, the step further includes:

[0018] Identifying the entity instance object in the image to be processed based on a target detection algorithm, and obtaining position information and / or shape information of the entity instance object;

[0019] Generate the indication information according to the position information and / or the shape information and send the indication information to the object segmentation model.

[0020] In one embodiment, the step of performing segmentation processing on the denoised image according to the object segmentation model and the indication information of the denoised image to obtain an image segmentation result, wherein the indication information is used to identify an entity instance object of the image to be processed includes:

[0021] Scaling the denoised image according to a preset image processing size of the object segmentation model, and discretizing the scaled image to obtain a processing vector;

[0022] Inputting the processing vector into an image encoder to obtain image embedding information, and inputting the indication information into an indication information encoder to obtain indication information embedding information;

[0023] Inputting the image embedding information and the indication information embedding information into a mask encoder to obtain a segmentation mask;

[0024] The segmentation mask is used as the image segmentation result.

[0025] In one embodiment, after receiving the image to be processed, the step of extracting feature information of the image to be processed based on the shallow feature extraction module and the deep feature extraction module of the image restoration model includes:

[0026] After receiving the image to be processed, extracting shallow features of the image to be processed based on the shallow feature extraction module, and inputting the shallow feature map into the deep feature extraction module, wherein the shallow features at least include edges and contours of the image to be processed;

[0027] Extracting features of the shallow feature map according to the deep feature extraction module to obtain deep features, wherein the deep features at least include texture and detail information of the image to be processed;

[0028] Feature fusion processing is performed based on the shallow features and the deep features to obtain the fused feature information.

[0029] In one embodiment, the step of performing denoising on the image to be processed based on the feature information and using the image reconstruction module of the image restoration model to obtain the denoised image includes:

[0030] Inputting the fused feature information into the image reconstruction module of the image restoration model, so as to convert the fused feature map into an image space through the reconstruction module;

[0031] The reconstructed image is denoised according to preset network parameters to obtain the denoised image.

[0032] In one embodiment, before the step of performing denoising on the image to be processed based on the feature information and using the image reconstruction module of the image restoration model to obtain the denoised image, the step further includes:

[0033] A set of images to be processed is obtained, and the image restoration model is pre-trained based on the set of images to be processed, wherein the set of images to be processed is denoised images.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes an image processing device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the semantic segmentation method based on image denoising as described above.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the semantic segmentation method based on image denoising as described above are implemented.

[0036] One or more technical solutions proposed in this application have at least the following technical effects:

[0037] After receiving the image to be processed, the image restoration model directly extracts its feature information. Based on the extracted features, such as edges and contours, the image is denoised to produce a de-noised image. The de-noised image is then segmented using the object segmentation model and the instruction information to produce a segmentation result. De-noising and segmenting the image using the image restoration model and object segmentation model, respectively, without pre-training, improves resource utilization during image processing and enhances image processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0040] Figure 1 A flowchart of the first embodiment of the semantic segmentation method based on image denoising provided by this application;

[0041] Figure 2 A flowchart of the second embodiment of the semantic segmentation method based on image denoising provided by this application;

[0042] Figure 3 A flowchart illustrating a third embodiment of a semantic segmentation method based on image denoising provided by this application;

[0043] Figure 4 A flowchart illustrating a fourth embodiment of a semantic segmentation method based on image denoising provided by the present application;

[0044] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the semantic segmentation method based on image denoising in the embodiment of the present application.

[0045] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0047] The main solution of the embodiment of the present application is: after receiving the image to be processed, the shallow feature extraction module and the deep feature extraction module based on the image restoration model extract feature information of the image to be processed;

[0048] Based on the feature information, performing denoising on the image to be processed according to the image reconstruction module of the image restoration model to obtain a denoised image;

[0049] The denoised image is segmented according to the object segmentation model and the indication information of the denoised image to obtain an image segmentation result, wherein the indication information is used to identify the entity instance object of the image to be processed.

[0050] In existing technologies, in order to improve the performance and generalization ability of the model, it is usually necessary to collect and label a large amount of image data for training. The long training process will take up a lot of computing resources and time, resulting in low resource utilization.

[0051] The present application provides a solution that uses an image restoration model and an object segmentation model to perform denoising and segmentation processing on the image to be processed respectively. In this process, there is no need to train the two models, thereby improving the resource utilization and overall efficiency of image processing during the image processing process.

[0052] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device or image processing device capable of performing the above functions. This embodiment and the following embodiments will be described below using an image processing device as an example.

[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0054] The embodiment of the present application provides a semantic segmentation method based on image denoising, wherein semantic segmentation refers to pixel-level recognition of images, that is, marking the object category to which each pixel in the image belongs, including marking the grass, trees, buildings and object shapes that appear in the image. Figure 1 , Figure 1 This is a flowchart of the first embodiment of the semantic segmentation method based on image denoising in this application.

[0055] In this embodiment, the semantic segmentation method based on image denoising includes steps S10 to S30:

[0056] Step S10: After receiving the image to be processed, the shallow feature extraction module and the deep feature extraction module of the image restoration model are used to extract feature information of the image to be processed.

[0057] It should be noted that the image restoration model is SwinIR, an image restoration model based on the Swin Transformer, specifically designed for tasks such as image denoising, super-resolution, and deblurring. It introduces a hierarchical structure, a self-attention mechanism, and a shift window operation to extract features at different scales, thereby effectively improving the quality of image restoration. Compared with traditional convolutional neural networks, SwinIR excels in processing details and complex textures, making it more suitable for high-quality image denoising tasks. SwinIR consists of three modules: shallow feature extraction, deep feature extraction, and a high-quality image reconstruction module. The shallow feature extraction module and the deep feature extraction module process the image to be processed respectively, thereby extracting the feature information of the image. The features extracted by the two feature extraction modules are processed by the image reconstruction model, thereby effectively denoising the image.

[0058] Feature information refers to key attributes or elements within an image that can describe or distinguish its content. This information includes at least image edges and contours, texture, color and brightness, frequency information, and spatial relationships. By acquiring this image feature information, SwinIR can more effectively distinguish between noise and true image content. This helps preserve important image details and edge information during the denoising process while removing unnecessary interference.

[0059] Therefore, in this embodiment, when performing noise reduction processing on the image to be processed, the shallow feature extraction module and the deep feature extraction module of SwinIR are used to extract the current feature information of the image, so as to effectively denoise the image to be processed through the feature information.

[0060] Specifically, the shallow feature extraction module can simultaneously extract shallow features of the image to be processed, including simple information such as the edges and contours of the image to be processed, while the deep feature extraction module extracts deep features of the image to be processed, including texture and detail information of the image to be processed. In addition, after first performing feature extraction based on the shallow feature extraction module, the deep feature extraction module can further perform feature extraction processing on the feature image output by the shallow feature extraction module, thereby obtaining a deep feature extraction module.

[0061] When performing image processing, SwinIR can be used directly without training, effectively improving resource utilization during image processing. SwinIR's two feature extraction modules extract feature information from the image to be processed, improving image processing efficiency.

[0062] Step S20 , based on the feature information, performing denoising processing on the image to be processed according to the image reconstruction module of the image restoration model to obtain a denoised image.

[0063] It is understandable that existing deep learning-based image segmentation solutions often do not consider the interference of image noise, resulting in inaccurate segmentation results. Therefore, in this embodiment, after obtaining feature information, the image reconstruction module based on SwinIR processes the two features to obtain a denoised image. Among them, the features extracted from the shallow features and the deep features can be fused, and then noise reduction processing is performed based on the fused features.

[0064] As an optional implementation method of performing denoising on the processed image based on the image reconstruction module, the fused feature information can be input into the image reconstruction module of SwinIR, so that the fused feature map is converted into image space through the reconstruction module, and then the reconstructed image is denoised according to preset network parameters to obtain a denoised image. It is understood that the image reconstruction module uses a convolutional layer or other type of layer to convert the feature map back to the image space, and then adjusts the network parameters through an optimization algorithm and loss function (such as mean square error (MSE), peak signal-to-noise ratio (PSNR), etc.) to make the reconstructed image as close as possible to a clear, noise-free image, that is, to obtain a denoised image.

[0065] Based on this, before the image is segmented, a clear and noise-free image is provided to meet the actual image segmentation requirements.

[0066] Optionally, in addition to denoising the image using the SwinIR model, algorithms such as DPIR (DeepPlug-and-Play Image Restoration) and Unet (U-type network architecture) can also be used to achieve image denoising.

[0067] Step S30 , performing segmentation processing on the denoised image according to the object segmentation model and the indication information of the denoised image to obtain an image segmentation result, wherein the indication information is used to identify the entity instance object of the image to be processed.

[0068] It should be noted that the Everything Segmentation Model is SAM, a general object segmentation model developed by Meta AI. It is designed to handle the segmentation task of any object in an image without the need for specialized training or fine-tuning. Among them, SAM uses a Transformer-based architecture, combined with large-scale visual data and pre-training technology, to efficiently perform object segmentation in different scenarios. SAM includes an image-encoder, a prompt-encoder, and a mask-decoder. The image encoder converts the image into a vector, the prompt encoder processes the input prompt information, that is, processes the prompt, and the mask decoder generates a segmentation mask, that is, obtains the image segmentation result.

[0069] In terms of application scenarios, SAM has broad potential in areas such as computer vision, medical imaging, autonomous driving, and content creation. In computer vision, SAM can be used for tasks such as image processing, object recognition, and target tracking. In medical imaging, it can help segment organs or lesions, assisting doctors in diagnosis and treatment planning. In autonomous driving systems, SAM can be used to identify and segment obstacles such as pedestrians and vehicles on the road, providing decision support. Furthermore, in image and video editing, SAM can quickly segment objects, facilitating further editing.

[0070] Indication information is also called prompt information, which will be represented by prompt later. It is used to identify the entity instance object of the image to be processed. After obtaining the denoised image, the image needs to be segmented to extract the key elements in the image for subsequent image analysis, understanding and processing. SAM supports a variety of prompt methods, including point prompts, box prompts and text prompts. Users can gradually optimize the segmentation results in an interactive manner. For example, users can gradually correct the segmentation results output by the model by adding new prompts to obtain more accurate segmentation. The architecture of SAM consists of an encoder, a prompt encoder and a segmentation head. The encoder is used to extract the visual features of the image, the prompt encoder processes the prompt information input by the user, and the segmentation head generates the final segmentation results based on the visual features and prompts.

[0071] In this embodiment, during the image segmentation process, in order to reduce the need to train the image segmentation model and occupy excessive computing resources, the denoised image is directly segmented based on the SAM segmentation model that does not require training. There is no need to collect a large amount of training data and spend a lot of resources to train the model, thereby improving the resource utilization of image processing.

[0072] Specifically, when the denoised image is segmented based on SAM, the operation information set by the user can be received through the interactive interface, and the operation information can be converted into an instruction prompt that can be recognized by SAM. Then SAM processes the denoised image through the instruction prompt to identify and segment multiple different entity instance objects, including the whole, part and sub-part of the instance object.

[0073] Furthermore, in addition to being obtained through the interactive interface, the prompt can also be obtained through other neural network models. That is, after obtaining the denoised image, it is first analyzed through the neural network model to obtain a prompt that can be an entity instance object of the image to be processed, and then the prompt and the denoised image are input into SAM for processing.

[0074] The untrained SwinIR and SAM models are used to perform denoising and image segmentation on the processed images respectively, which improves the accuracy of image segmentation while reducing the resource waste caused by model training and improving the utilization of computing resources.

[0075] This embodiment provides a semantic segmentation method based on image denoising. During the image segmentation process, feature information of the image to be processed is extracted based on a SwinIR model that does not require training, and denoising is performed on the image based on the extracted feature information. This improves the image segmentation accuracy while eliminating the need to train the denoising model. The denoised image is then segmented using a SAM model that does not require pre-training, avoiding the need to train the image segmentation model, thereby improving resource utilization during image processing.

[0076] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be repeated hereafter. Figure 2 Before step S30, the semantic segmentation method based on image denoising further includes steps S40 to S50:

[0077] Step S40: obtaining prompt information received by the prompt editing interface of the object segmentation model, and determining a prompt type of the prompt information.

[0078] In this embodiment, developers can develop a prompt editing interface based on SAM to allow users to provide corresponding prompts within the interface. That is, users can enter prompt information for image segmentation through SAM's prompt editing interface, thereby generating prompts that SAM can recognize, thereby improving image segmentation results. Prompt types include at least voice, text, point selection, box selection, mask, gesture, and template input.

[0079] In this embodiment, the user can interact with the model during the segmentation process and adjust the prompt to optimize the segmentation result. If the initial segmentation result is inaccurate, the user can modify the prompt by adding additional points, boxes, or masks to obtain a more accurate segmentation result.

[0080] Step S50: Generate the indication information corresponding to the prompt information according to the prompt type, and / or update the indication information according to the prompt type.

[0081] In this embodiment, when generating a prompt corresponding to the prompt type, the voice input can be converted to text by a speech recognition system. This text can then be processed as text input, or a prompt matching the voice content can be directly generated based on the context. The text input may directly contain segmentation instructions (e.g., "Segment out the cat in the image") or a descriptive text (e.g., "The flowers in the image"). In this case, the processing module can parse the text using NLP techniques and generate a corresponding prompt. Inputs such as point selection and box selection directly indicate specific areas or objects in the image. Based on these inputs, the processing module can generate a prompt representing the area or object and then pass it to the SAM model. The mask input is a binary image of the same size as the image, where white areas represent the object of interest and black areas represent the background. The processing module can directly use this mask as part of the prompt or generate a more concise prompt based on the mask. Gesture input is typically performed on touchscreen devices. The processing module needs to be able to recognize and interpret these gestures and then generate a prompt that matches the gesture. The template input is a preset segmentation template. The processing module can generate a corresponding prompt based on the template selected by the user, and then pass it to the SAM model for segmentation.

[0082] In the process of updating prompts based on prompt information, for example, if there are prompts corresponding to clicked and framed content, and the user selects new clicked and framed content to update these prompts, the existing prompts are updated based on the latest prompt.

[0083] It is understandable that when the prompt corresponding to the prompt type is empty, a prompt can be generated based on the prompt type. If it is not empty, the prompt is updated based on the prompt type. Therefore, when there are multiple prompt types, the prompt sets associated with multiple prompt types can be determined. If the number of subsets of the prompt set does not match the number of prompt types, it means that some prompt types are associated with prompts, while others are not. For example, among the multiple prompt types, including box selection, text input, and gestures, the text input type corresponds to the prompt when the image was previously segmented. Therefore, the prompt is updated through the text input type, and new prompts corresponding to these types are generated based on gestures and box selection. Therefore, if the number of subsets of the prompt set does not match the number of prompt types, a prompt with empty status information can be generated according to the prompt type, and an existing prompt can be updated according to the prompt type.

[0084] Optionally, in another optional implementation of obtaining prompt, before step S30, steps S60 to S70 are further included:

[0085] Step S60: Identify the entity instance object in the image to be processed based on a target detection algorithm, and obtain position information and / or shape information of the entity instance object.

[0086] Step S70: Generate the indication information according to the position information and / or the shape information and send the indication information to the object segmentation model.

[0087] In this embodiment, in addition to receiving prompts through the prompt editing interface set by SAM, other computer vision technologies such as target detection algorithms can also be used to automatically identify entity instance objects in images, and convert the position, shape and other information of these objects into prompts and input them into the SAM model.

[0088] For example, the target detection model can be used to detect all cars in the image, and then the location information of these cars is input as prompt to the SAM model for segmentation.

[0089] Combined with the target detection algorithm, the image to be processed is automatically identified to obtain the prompt during segmentation processing, which reduces the manual operation process, improves the degree of automation of the image to be processed, and thus improves the segmentation efficiency of the image to be processed.

[0090] This embodiment provides a semantic segmentation method based on image denoising. Before SAM segments the denoised image, it generates a corresponding prompt or updates an existing prompt based on the prompt information received through the prompt editing interface of SAM, or identifies the image to be processed through a target detection algorithm, and generates a prompt based on the position information and shape information of the identified entity instance, so that SAM can accurately segment the denoised image through the prompt, thereby improving the image segmentation effect.

[0091] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be described in detail later. Figure 3 , step S30 further includes steps S31 to S34:

[0092] Step S31 : scaling the denoised image according to a preset image processing size of the object segmentation model, and discretizing the scaled image to obtain a processing vector.

[0093] In this embodiment, after obtaining the denoised image, it is necessary to scale it to the input size required by the SAM model (e.g., 1024x1024). Subsequently, a convolution operation is used to discretize the image into a series of vectors, which serve as input to the image encoder. Therefore, the denoised image must be scaled based on the SAM's preset image processing size and then discretized to obtain the processing vectors.

[0094] The image segmentation efficiency is improved by scaling and discretizing the denoised image.

[0095] Step S32: input the processing vector into an image encoder to obtain image embedding information, and input the indication information into an indication information encoder to obtain indication information embedding information.

[0096] In this embodiment, after obtaining the processing vector, it is input into the image encoder to obtain an embedded representation of the image (image-embedding), i.e., image embedding information. Simultaneously, the prepared prompt information is input into the prompt-encoder to obtain an embedded representation of the prompt information (prompt-embedding), i.e., prompt embedding information. Obtaining this embedded representation improves the accuracy of the segmentation process.

[0097] Step S33: input the image embedding information and the indication information embedding information into a mask encoder to obtain a segmentation mask.

[0098] Step S34: Using the segmentation mask as the graphic segmentation result.

[0099] In this embodiment, after obtaining the embedded information, the image-embedding and prompt-embedding are simultaneously input into the mask-decoder. The decoding process generates a segmentation mask. This segmentation mask is then optimized, such as removing small areas and smoothing edges, to improve the accuracy and consistency of the segmentation results. Finally, the optimized segmentation mask is output as the final image segmentation result.

[0100] Based on this, the pre-trained SAM model is used to segment the denoised image based on the received prompt information, thereby improving resource utilization during image processing and image segmentation effect.

[0101] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be described in detail later. Figure 4 , step S10 also includes steps S11 to S13:

[0102] Step S11: After receiving the image to be processed, shallow features of the image to be processed are extracted based on the shallow feature extraction module, and the shallow feature map is input into the deep feature extraction module.

[0103] In this embodiment, the shallow feature extraction module is mainly responsible for extracting the initial, relatively shallow feature information from the input low-quality image. A convolution layer is usually used for feature extraction. The function of this convolution layer is to map the input image from the image space to the high-dimensional feature space, thereby extracting the basic features of the image. Among them, in the process of extracting the feature information of the image to be processed, the shallow features of the image to be processed can be first extracted by the shallow feature extraction module. The shallow features include at least the edges and contours of the image to be processed, and then the shallow feature map after the information extraction is completed is input into the deep feature extraction module. Through the operation of the convolution layer, the shallow feature extraction module can extract low-frequency information in the image, such as basic features such as edges and contours. These shallow features will then be passed to the deep feature extraction module for further feature extraction and processing.

[0104] Step S12: extracting features from the shallow feature map according to the deep feature extraction module to obtain deep features.

[0105] In this embodiment, the deep feature extraction module is the core component of the SwinIR model, responsible for extracting deep features from the image. The deep feature module primarily consists of multiple residual Swin Transformer blocks (RSTBs), each of which contains multiple Swin Transformer layers and a residual connection. The Swin Transformer layers employ a local attention mechanism, capturing local features in the image and passing this feature information to the next RSTB via the residual connection.

[0106] During the deep feature extraction process, the input image is processed by multiple RSTBs to gradually extract deeper feature information. These deep features include more complex features such as texture and details in the image. The extracted deep features are then passed to a high-quality image reconstruction module for image reconstruction and restoration.

[0107] It's important to note that the deep feature extraction module doesn't directly process the original image. Its input is the feature maps (or feature tensors) output by the shallow feature extraction module. These feature maps already contain some basic image features, such as edges and textures. The deep feature extraction module's task is to further extract deeper features based on these features.

[0108] Step S13: performing feature fusion processing based on the shallow features and the deep features to obtain the fused feature information.

[0109] After obtaining shallow features and deep features, in order to enable SwinIR to reconstruct and repair the image more accurately, it is usually necessary to fuse the shallow features and deep features to improve the subsequent image denoising effect.

[0110] This embodiment provides a semantic segmentation method based on image denoising, which extracts low-frequency information and deep-level features in the image through a shallow feature extraction module and a deep feature extraction module, providing an important basis for subsequent denoising processing such as image reconstruction and restoration, and further improving the image denoising effect.

[0111] Based on the first embodiment of the present application, in the fifth embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be described in detail later. On this basis, the SwinIR model can also be trained using the processed images to further improve the image denoising effect of SwinIR. Therefore, before step S10, a set of images to be processed can be obtained, and the SwinIR model can be pre-trained based on the set of images to be processed, wherein the set of images to be processed is the denoised images.

[0112] In this embodiment, each image denoising is recorded after it is completed. Therefore, before denoising a new image to be processed, the model optimization process can be performed on the existing denoised image to improve the denoising effect.

[0113] It is understandable that the SwinIR model does not require a training set. The model has acquired super strong generalization ability during the pre-training process. The SwinIR image denoising model can be summarized as the following function:

[0114]

[0115] Where f represents the neural network, θ represents the network parameters (obtained by random initialization at the beginning), and z represents a fixed random noise initially input to the network. represents an image with noise, represents the output of the neural network, is the optimal solution of parameters obtained through training. The optimal output of the neural network is:

[0116] .

[0117] During pre-training, you can use images processed with SwinIR noise reduction to create a training dataset for the image segmentation model. Data annotation tools can then be used to annotate the images, providing information such as the original image and category labels. Additionally, image data augmentation can be performed, including brightness changes, random point additions, translation, and flipping. Optionally, the dataset can be partitioned into 75% training, 15% validation, and 15% test sets.

[0118] The present application provides an image processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the semantic segmentation method based on image denoising in the above-mentioned first embodiment.

[0119] Reference below Figure 5, which shows a schematic diagram of the structure of an image processing device suitable for implementing the embodiments of the present application. The image processing device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The image processing device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0120] like Figure 5 As shown, the image processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the image processing device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007, such as a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008, such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003, such as a magnetic tape or hard disk; and communication device 1009. The communication device 1009 can allow the image processing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an image processing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0121] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.

[0122] The image processing device provided in this application utilizes the semantic segmentation method based on image denoising in the above-mentioned embodiment, which can resolve the technical problem of low resource utilization caused by the need for model training when processing images. Compared with the prior art, the beneficial effects of the image processing device provided in this application are the same as those of the semantic segmentation method based on image denoising in the above-mentioned embodiment, and the other technical features of the image processing device are the same as those disclosed in the method of the previous embodiment, and are not further described here.

[0123] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0124] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0125] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, and the computer-readable program instructions are used to execute the semantic segmentation method based on image denoising in the above-mentioned embodiment.

[0126] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including, but not limited to, wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0127] The computer-readable storage medium may be included in the image processing device, or may exist independently without being incorporated into the image processing device.

[0128] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an image processing device, the image processing device: after receiving an image to be processed, extracts feature information of the image to be processed based on a shallow feature extraction module and a deep feature extraction module of an image restoration model SwinIR;

[0129] Based on the feature information, performing denoising on the image to be processed according to the image reconstruction module of SwinIR to obtain a denoised image;

[0130] The denoised image is segmented according to the object segmentation model SAM and the prompt information prompt of the denoised image to obtain an image segmentation result, wherein the prompt information is used to identify the entity instance object of the image to be processed.

[0131] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0132] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0133] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0134] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned semantic segmentation method based on image denoising. This computer-readable storage medium can address the technical issue of low resource utilization caused by the need for model training when processing images. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the semantic segmentation method based on image denoising provided in the aforementioned embodiments, and are not further elaborated here.

[0135] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A semantic segmentation method based on image denoising, characterized in that: The semantic segmentation method based on image denoising includes: After receiving the image to be processed, a shallow feature extraction module based on the image restoration model SwinIR without pre-training extracts shallow features of the image to be processed, and inputs the shallow feature map into the deep feature extraction module, wherein the shallow features include at least the edge and contour of the image to be processed; Extracting features of the shallow feature map according to the deep feature extraction module to obtain deep features, wherein the deep features at least include texture and detail information of the image to be processed; Performing feature fusion processing based on the shallow features and the deep features to obtain the fused feature information; Based on the feature information, performing denoising on the image to be processed according to the image reconstruction module of the image restoration model to obtain a denoised image; Obtain prompt information received in a prompt editing interface of a pre-trained object segmentation model, and determine a prompt type of the prompt information, where the prompt type includes at least voice, text, point selection, box selection, mask, gesture, and template input; generating, according to the prompt type, the indication information corresponding to the prompt information, or updating the indication information according to the prompt type, wherein, when there are multiple prompt types, first determining a set of indication information associated with the multiple prompt types; if the number of subsets of the indication information set does not match the number of prompt types, generating, according to the prompt type, the indication information with empty state information, and updating the existing indication information according to the prompt type, wherein the indication information is used to identify an entity instance object of the image to be processed, wherein, after the initial segmentation, the indication information can be modified based on additional points, boxes, or masks added by a user to update the indication information; Scaling the denoised image according to a preset image processing size of the object segmentation model, and discretizing the scaled image to obtain a processing vector; Inputting the processing vector into an image encoder to obtain image embedding information, and inputting the indication information into an indication information encoder to obtain indication information embedding information; inputting the image embedding information and the indication information embedding information into a mask encoder to obtain a segmentation mask; The segmentation mask is used as the image segmentation result.

2. The semantic segmentation method based on image denoising according to claim 1, wherein: Before the step of performing segmentation processing on the denoised image according to the object segmentation model and the indication information of the denoised image to obtain an image segmentation result, wherein the indication information is used to identify the entity instance object of the image to be processed, the method further includes: Identifying the entity instance object in the image to be processed based on a target detection algorithm, and obtaining position information and / or shape information of the entity instance object; Generate the indication information according to the position information and / or the shape information and send the indication information to the object segmentation model.

3. The semantic segmentation method based on image denoising according to claim 1, wherein: The step of performing denoising on the image to be processed based on the feature information according to the image reconstruction module of the image restoration model to obtain a denoised image comprises: Inputting the fused feature information into the image reconstruction module of the image restoration model, so as to convert the fused feature map into an image space through the reconstruction module; The reconstructed image is denoised according to preset network parameters to obtain the denoised image.

4. The semantic segmentation method based on image denoising according to claim 1, wherein: Before the step of performing denoising on the image to be processed based on the feature information and using the image reconstruction module of the image restoration model to obtain a denoised image, the method further includes: A set of images to be processed is obtained, and the image restoration model is pre-trained based on the set of images to be processed, wherein the set of images to be processed is denoised images.

5. An image processing device, characterized in that The image processing device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the semantic segmentation method based on image denoising according to any one of claims 1 to 4.

6. A storage medium, characterized in that The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the semantic segmentation method based on image denoising are implemented as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Detection method of coal rock infrared thermography damaged area

    CN117078931A

  • Damaged luggage case damage assessment method and system based on SAM segmentation large model

    CN118397277A