Image processing method, device, apparatus and storage medium
By performing multi-scale feature extraction and feature fusion on the target image, and generating a saliency map using a U-shaped network and residual connections, the problem of high computational load and poor stability of pixel-level image processing tasks on mobile terminals in existing technologies is solved, achieving more efficient image processing results.
Patent Information
- Application Number
- CN202210761355.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2042-06-29
AI Technical Summary
Existing technologies for implementing pixel-level image processing tasks involve large computational loads and complex processes, resulting in poor real-time performance and stability on mobile terminals, as well as high consumption of computing resources.
By performing multi-scale feature extraction on the target image, using a U-shaped network for progressive downsampling and upsampling, and combining residual connections for feature fusion, a saliency map is generated, including the superposition of the first and second output feature maps, thus achieving two multi-scale feature extractions and feature fusions.
It simplifies the image processing process, reduces computing resource consumption, improves the real-time performance and stability of processing on mobile terminals, and achieves better image processing results.
Smart Images

Figure CN117392489B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to an image processing method, apparatus, device, and storage medium. Background Technology
[0002] With the development of machine learning technology, machine learning-based image processing techniques are widely used in various applications. Among them, some network models used to achieve pixel-level image processing tasks obtain image features for achieving pixel-level tasks by capturing local and global information at different resolution scales of images.
[0003] However, existing network models for pixel-level image processing tasks involve large computational loads and complex processes. When used on mobile terminals, they suffer from poor real-time performance, poor stability, and high consumption of terminal computing resources. Summary of the Invention
[0004] This disclosure provides an image processing method, apparatus, device, and storage medium to overcome the problems of large computational load and complex process in network models for pixel-level image processing tasks in the prior art.
[0005] In a first aspect, embodiments of this disclosure provide an image processing method, including:
[0006] Multi-scale feature extraction is performed on the target image to obtain first fusion feature maps at different resolution scales; multi-scale feature extraction is performed on the first output feature map, and feature fusion is performed based on the first fusion feature map at each resolution scale to obtain second fusion feature maps at different resolution scales, wherein the first output feature map is the first fusion feature map corresponding to the maximum resolution scale; the first output feature map and the second output feature map are superimposed to generate a saliency map corresponding to the target image, wherein the second output feature map is the second fusion feature map corresponding to the maximum resolution scale.
[0007] Secondly, embodiments of this disclosure provide an image processing apparatus, comprising:
[0008] A first U-shaped network and a second U-shaped network, wherein the first U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the second U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the first U-shaped network and the second U-shaped network are connected by a fusion structure; the fusion structure includes an output connection, a first residual connection and a second residual connection, wherein the first residual connection is used to realize feature fusion between the downsampling layers of the first U-shaped network and the upsampling layers of the second U-shaped network; the second residual connection is used to realize feature fusion between the output of the first U-shaped network and the output of the second U-shaped network; and the output connection is used to realize feature transfer between the output of the first U-shaped network and the input of the second U-shaped network; the image processing device is used to generate a saliency map corresponding to the target image.
[0009] Thirdly, embodiments of this disclosure provide a neural network model, including:
[0010] A first U-shaped network and a second U-shaped network, wherein the first U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the second U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the first U-shaped network and the second U-shaped network are connected by a fusion structure; the fusion structure includes an output connection, a first residual connection and a second residual connection, wherein the first residual connection is used to realize feature fusion between the downsampling layers of the first U-shaped network and the upsampling layers of the second U-shaped network; the second residual connection is used to realize feature fusion between the output of the first U-shaped network and the output of the second U-shaped network; and the output connection is used to realize feature transfer between the output of the first U-shaped network and the input of the second U-shaped network; the neural network model is used to implement the image processing method described in the first aspect and various possible designs of the first aspect.
[0011] Fourthly, embodiments of this disclosure provide an image processing apparatus, comprising:
[0012] The first extraction module is used to extract multi-scale features from the target image to obtain the first fused feature map at different resolution scales;
[0013] The second extraction module is used to perform multi-scale feature extraction on the first output feature map, and to perform feature fusion based on the first fusion feature map at each resolution scale to obtain the second fusion feature map at different resolution scales, wherein the first output feature map is the first fusion feature map corresponding to the maximum resolution scale.
[0014] The overlay module is used to overlay the first output feature map and the second output feature map to generate a saliency map corresponding to the target image, wherein the second output feature map is the second fused feature map corresponding to the maximum resolution scale.
[0015] Fifthly, embodiments of this disclosure provide an electronic device, including:
[0016] A processor, and a memory communicatively connected to the processor;
[0017] The memory stores computer-executed instructions;
[0018] The processor executes computer execution instructions stored in the memory to implement the image processing method described in the first aspect and various possible designs of the first aspect.
[0019] In a sixth aspect, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the image processing method described in the first aspect and various possible designs of the first aspect.
[0020] In a seventh aspect, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the image processing method as described in the first aspect and various possible designs of the first aspect.
[0021] The image processing method, apparatus, device, and storage medium provided in this embodiment extract features from a target image at multiple scales to obtain first fused feature maps at different resolution scales. Multi-scale feature extraction is then performed on the first output feature map, and feature fusion is performed based on the first fused feature map at each resolution scale to obtain second fused feature maps at different resolution scales. The first output feature map is the first fused feature map corresponding to the maximum resolution scale. The first and second output feature maps are then superimposed to generate a saliency map corresponding to the target image, where the second output feature map is the second fused feature map corresponding to the maximum resolution scale. By performing two multi-scale feature extractions and feature fusions on the target image, first and second fused feature maps that represent the target image at different resolution scales are obtained. The saliency map obtained by fusing the first and second fused feature maps better represents the features of the target image in different dimensions, thereby achieving better image processing results. Simultaneously, the processing is simplified, reducing the computational resource consumption required to obtain the saliency map and improving the real-time performance and stability of processing when used on a mobile terminal. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is an application scenario diagram of the image processing method provided in the embodiments of this disclosure;
[0024] Figure 2 Flowchart of the image processing method provided in the embodiments of this disclosure Figure 1 ;
[0025] Figure 3 for Figure 2 The flowchart of the specific implementation steps of step S101 in the embodiment shown is as follows;
[0026] Figure 4 A schematic diagram of a U-shaped network provided in an embodiment of this disclosure;
[0027] Figure 5 Flowchart of the image processing method provided in the embodiments of this disclosure Figure 2 ;
[0028] Figure 6 for Figure 5 The flowchart of the specific implementation steps of step S201 in the embodiment shown is as follows;
[0029] Figure 7 for Figure 5 The flowchart of the specific implementation steps of step S202 in the embodiment shown is as follows;
[0030] Figure 8 for Figure 5 The flowchart of the specific implementation steps of step S203 in the embodiment shown is as follows;
[0031] Figure 9 A schematic diagram of a neural network model provided in an embodiment of this disclosure;
[0032] Figure 10 This is a schematic diagram of a residual addition process provided in an embodiment of the present disclosure;
[0033] Figure 11 This is a structural block diagram of an image processing apparatus provided in an embodiment of the present disclosure;
[0034] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0035] Figure 13This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0037] The application scenarios of the embodiments of this disclosure are explained below:
[0038] Figure 1 This diagram illustrates an application scenario of the image processing method provided in this disclosure. The image processing method provided in this disclosure can be applied to image processing scenarios on mobile devices. Specifically, it can be applied to application scenarios involving pixel-level image processing tasks on a mobile device, such as image segmentation and style transfer within an application (APP). Figure 1 As shown, the method provided in this disclosure can be applied to terminal devices, such as smartphones. The terminal device has a neural network model deployed in the form of a client program to implement the image processing method provided in this disclosure. The terminal device can run the application and call the neural network model installed in the application client to achieve specific pixel-level image processing tasks, such as portrait matting and image style transfer.
[0039] In existing technologies, achieving pixel-level image processing tasks requires obtaining not only global features but also local features of the image. This necessitates multi-dimensional feature extraction followed by feature fusion to obtain a saliency map and complete the image processing task. However, this requires complex network structures and consumes significant computational resources. Consequently, such network models for pixel-level image processing tasks are typically deployed on a server. When run on a mobile terminal with limited computing resources, the limitations can lead to issues such as lag, poor real-time performance, and instability, or even failure to run successfully.
[0040] This disclosure provides an image processing method, apparatus, device, and storage medium to solve the above-mentioned problems.
[0041] refer to Figure 2 , Figure 2 Flowchart of the image processing method provided in the embodiments of this disclosure Figure 1 The method of this embodiment can be applied to terminal devices, such as smartphones. This image processing method includes:
[0042] Step S101: Perform multi-scale feature extraction on the target image to obtain the first fused feature map at different resolution scales.
[0043] For example, the target image is the image to be processed. The target image can be a picture stored in the terminal device, or a video frame obtained by extracting frames from a video. In one possible implementation, the terminal device can take a picture or video through a camera application, and then confirm and obtain the target image from the captured picture or video based on user instructions.
[0044] Furthermore, multi-scale feature extraction is performed on the target image, that is, feature extraction is performed at different resolution scales of the target image to obtain feature maps at different resolution scales, namely the first fused feature map.
[0045] In one possible implementation, such as Figure 3 As shown, the specific implementation steps of step S101 include:
[0046] Step S1011: Perform step-by-step downsampling on the target image to obtain multiple first downsampled feature maps at various resolution scales.
[0047] Step S1022: Upsample the first minimum feature map step by step, and at each resolution scale, add the residuals of the first downsampled feature map at the corresponding resolution scale to obtain the first fused feature map at each resolution scale, wherein the first minimum feature map is the first downsampled feature map corresponding to the minimum resolution scale.
[0048] Specifically, this process can be implemented using a pre-trained U-shaped network, which is based on the U-Net (also known as Unet) network. This network uses a symmetrically configured multi-layer structure to perform layer-by-layer downsampling and upsampling of the image, achieving multi-scale feature extraction. The specific implementation process of step S101 will be further explained below in conjunction with the U-shaped network.
[0049] Figure 4 This is a schematic diagram of a U-shaped network provided in an embodiment of the present disclosure, as shown below. Figure 4As shown, the U-shaped network includes multiple downsampling layers (L1-L4) and multiple upsampling layers (L5-L8) arranged sequentially. These downsampling and upsampling layers are connected sequentially, and each downsampling layer is connected to its corresponding upsampling layer via a residual addition (ADD). This residual addition involves point-by-point addition between the images. After the target image is input into the U-shaped network, it is iteratively processed through multiple sequentially connected downsampling layers (i.e., the output of the previous layer becomes the input of the next). In each downsampling layer, operations such as convolution and pooling are performed to obtain a first downsampling feature map with progressively decreasing resolution. It should be noted that, based on the specific network structure, the last downsampling layer and the first upsampling layer are directly connected, and the output of the last downsampling layer is directly passed to the first upsampling layer. That is, when the first minimum feature map is input to the first upsampling layer, its corresponding first downsampling feature map is the same as the first minimum feature map; therefore, the sum of their residuals still yields the first minimum feature map.
[0050] Simultaneously, after all downsampling layers have been executed, the output of the last downsampling layer is the first minimum feature map, which is also the first downsampling feature map corresponding to the smallest resolution scale. Using the first minimum feature map as input, the target image is iteratively processed through multiple sequentially connected upsampling layers (i.e., the output of the previous layer is used as the input of the next layer), progressively increasing the image resolution layer by layer. For example, in the U-shaped network, the number of upsampling and downsampling layers is the same, with a one-to-one correspondence between the upsampling and downsampling layers. During the iterative processing of the target image through the upsampling layers, the first downsampling feature map output by the corresponding downsampling layer is simultaneously output to the upsampling layer by adding the residuals, thus restoring the image and obtaining the first fused feature map at each resolution scale. In this embodiment, by extracting multi-scale features from the gradually downsampling feature maps and performing image restoration through gradual upsampling and residual addition, the first fused feature map at each resolution scale after feature fusion is finally obtained. This process mitigates the loss of fine details caused by large-scale direct upsampling. By using residual addition for feature fusion, different branches can learn knowledge that other branches cannot learn, reduce information redundancy, and improve network learning efficiency.
[0051] Step S102: Perform multi-scale feature extraction on the first output feature map, and perform feature fusion based on the first fusion feature map at each resolution scale to obtain the second fusion feature map at different resolution scales, wherein the first output feature map is the first fusion feature map corresponding to the maximum resolution scale.
[0052] For example, in the process of generating the first fused feature maps corresponding to different resolution scales, as the upsampling and feature fusion processes continue (see reference...), Figure 4 As shown, the resolution scale corresponding to the first fused feature map increases with each subsequent upsampling layer, ultimately resulting in the first output feature map, which is also the first fused feature map corresponding to the largest resolution scale. Based on this first fused feature map, multi-scale feature extraction is performed again. The basic process of this multi-scale feature extraction is similar to that of multi-scale feature extraction of the target image, where feature extraction is performed at different resolution scales of the first output feature map to obtain feature maps at different resolution scales, i.e., the second fused feature map. The difference lies in that, during the multi-scale feature extraction process of the first output feature map, feature fusion is performed at each resolution scale based on the corresponding first fused feature map, thereby incorporating the image features contained in the first fused feature map into the second fused feature map, making the second fused feature map contain richer image features.
[0053] For example, the process of multi-scale feature extraction from the first output feature map can also be implemented using a U-shaped network. For a detailed introduction to the U-shaped network, please refer to [link to relevant documentation]. Figure 4 The relevant descriptions in the corresponding embodiments are as follows. Then, by fusing and connecting the U-shaped network corresponding to the first fused feature map (i.e., the first U-shaped network) and the U-shaped network corresponding to the second fused feature map (i.e., the second U-shaped network), the process of feature fusion based on the first fused feature map at each resolution scale is realized.
[0054] Step S103: Superimpose the first output feature map and the second output feature map to generate a saliency map corresponding to the target image, wherein the second output feature map is the second fused feature map corresponding to the maximum resolution scale.
[0055] For example, after obtaining each second fused feature map, the last second fused feature map, i.e., the result after the second multi-scale feature extraction, incorporates image features (first fused feature maps) from the first multi-scale feature extraction process at various resolution scales. This allows image feature information to be transferred between different U-shaped networks (first U-shaped network and second U-shaped network). The resulting second fused feature map contains the image features from the first fused feature map. Then, the first and second output feature maps are further superimposed to perform feature fusion, achieving the fusion of the results of the two multi-scale feature extractions, thereby obtaining a saliency map containing image features at various resolution scales.
[0056] For example, superimposing the first output feature map and the second output feature map to generate a saliency map corresponding to the target image includes: adding the residuals of the first output feature map and the second output feature map to generate a saliency map corresponding to the target image. By fusing through residual addition, the amount of data in the generated saliency map can be reduced while achieving effective information fusion, thereby improving the image data processing speed. Optionally, then, based on the saliency map containing rich image feature information, pixel-level image processing tasks on the target image can be achieved. Specific implementation methods for pixel-level image processing tasks based on saliency maps are existing technologies and will not be elaborated here.
[0057] In this embodiment, multi-scale feature extraction is performed on the target image to obtain first fused feature maps at different resolution scales. Multi-scale feature extraction is then performed on the first output feature map, and feature fusion is performed based on the first fused feature map at each resolution scale to obtain second fused feature maps at different resolution scales. The first output feature map is the first fused feature map corresponding to the largest resolution scale. The first and second output feature maps are then superimposed to generate a saliency map corresponding to the target image. The second output feature map is the second fused feature map corresponding to the largest resolution scale. By performing two multi-scale feature extractions and feature fusions on the target image, first and second fused feature maps that represent the target image at different resolution scales are obtained. The saliency map obtained by fusing the first and second fused feature maps better represents the features of the target image in different dimensions, thus achieving better image processing results. Simultaneously, the processing is simplified, reducing the computational resource consumption required to obtain the saliency map and improving the real-time performance and stability of processing on mobile terminals.
[0058] refer to Figure 5 , Figure 5 Flowchart of the image processing method provided in the embodiments of this disclosure Figure 2 This embodiment is in Figure 2 Based on the illustrated embodiment, step S102 is further refined, and a detailed description of the specific implementation method of the neural network model is added. This image processing method includes:
[0059] Step S201: Perform stepwise downsampling on the target image to obtain multiple first downsampled feature maps at various resolution scales.
[0060] One possible implementation is, such as Figure 6 As shown, the specific implementation steps of step S201 include:
[0061] Step S2011: Obtain the current loop count. If the loop count is greater than the preset downsampling count, exit the loop. If the loop count is not greater than the preset downsampling count, proceed to step S2012:
[0062] Step S2012: Perform downsampling operations on the target image sequentially using the downsampling ratio corresponding to the current loop number to obtain the first downsampled feature map corresponding to the current loop number;
[0063] Step S2013: Update the target image to the first downsampled feature map corresponding to the current loop number.
[0064] For example, the above steps can be implemented using a pre-trained U-shaped network, where the number of downsampling operations is related to the number of downsampling layers in the U-shaped network; the more downsampling layers, the more downsampling operations, and vice versa. During each downsampling operation, a corresponding downsampling ratio is determined based on the current loop number (i.e., the current downsampling layer), for example, 1 / 2, meaning the resolution is reduced by half. The target image is then downsampled based on this downsampling ratio to obtain a first downsampled feature map with reduced resolution. Specifically, this downsampling operation can be achieved, for example, by performing convolution and pooling operations on the target image. For example, the downsampling ratio can be determined by the network parameters of the U-shaped network; further details are omitted here.
[0065] Then, the generated first downsampled feature map is used as input to perform the next loop of downsampling operation until the number of loops exceeds the preset number of downsampling, at which point the loop is exited, thus completing the process of downsampling the target image step by step and obtaining the first downsampled feature map at each preset resolution scale.
[0066] Step S202: Upsample the first minimum feature map step by step, and at each resolution scale, add the residuals of the first downsampled feature map at the corresponding resolution scale to obtain the first fused feature map at each resolution scale, wherein the first minimum feature map is the first downsampled feature map corresponding to the minimum resolution scale.
[0067] For example, similar to the stepwise downsampling process, the first minimum feature map can be upsampled stepwise through a preset number of cyclic upsampling operations. During the upsampling process, the first downsampled feature maps at the corresponding level (resolution scale) are fused, and the residuals are added to restore the resolution of the target image, thereby obtaining the first fused feature map at each resolution scale. It should be noted that the upsampling process can be implemented through convolution and interpolation operations, but the actual resolution of the image is irreversibly reduced during downsampling. Therefore, the multi-scale feature extraction process is actually a process of obtaining features at different resolution scales by stepwise reducing the actual resolution of the image.
[0068] Optionally, such as Figure 7 As shown, the specific implementation steps of step S202 include:
[0069] Step S2021: Obtain the current loop count. If the loop count is greater than the preset upsampling count, exit the loop. If the loop count is not greater than the preset downsampling count, proceed to step S2022.
[0070] Step S2022: Add the residuals of the first minimum feature map and the first downsampled feature map at the corresponding resolution scale to obtain the first input feature map.
[0071] Step S2023: Using the upsampling ratio corresponding to the current loop number, perform upsampling operations on the first input feature map sequentially to obtain the first fused feature map corresponding to the current loop number.
[0072] Step S2024: Update the first minimum feature map to the first fused feature map corresponding to the current loop number.
[0073] For example, specifically, the above steps can be implemented using a pre-trained U-shaped network, where the number of upsampling operations is related to the number of upsampling layers in the U-shaped network; the more upsampling layers, the more upsampling operations, and vice versa. Specifically, the number of upsampling and downsampling layers in the U-shaped network implementation is the same.
[0074] Furthermore, in each iteration, firstly, the residuals of the first minimum feature map and the first downsampled feature map at the corresponding resolution scale are added together to obtain the first input feature map, achieving information fusion at the same resolution scale and increasing the information content in the first input feature map. Then, based on the current iteration number (i.e., the current upsampling layer), the corresponding upsampling ratio is determined. This upsampling ratio is the same as the downsampling ratio of the corresponding downsampling layer. Based on this upsampling ratio, the first minimum feature map is upsampled to obtain the first fused feature map with improved image resolution. Specifically, for example, this upsampling operation is achieved by performing convolution and interpolation operations on the target image. For example, the upsampling ratio can be determined by the network parameters of the U-shaped network; further details are omitted here.
[0075] Then, the generated first fused feature map is used as input to perform the next loop of upsampling operation until the number of loops exceeds the preset number of upsampling, at which point the loop is exited, thus completing the process of downsampling the first minimum feature map step by step and obtaining the first fused feature map at each preset resolution scale.
[0076] Step S203: The first output feature map is downsampled step by step, and at each resolution scale, the residuals of the first fused feature map at the corresponding resolution scale are added together to obtain the second downsampled feature map at each resolution scale.
[0077] For example, after obtaining the first fused feature maps at each resolution scale, the first multi-scale feature extraction is completed. The first output feature map is the first fused feature map with the largest resolution scale, which is the result of the first multi-scale feature extraction. Step S203 is the process of performing the second multi-scale feature extraction using the first output feature map as input.
[0078] Optionally, such as Figure 8 As shown, the specific implementation steps of step S203 include:
[0079] Step S2031: Obtain the current loop count. If the loop count is greater than the preset downsampling count, exit the loop. If the loop count is not greater than the preset downsampling count, proceed to step S2032:
[0080] Step S2032: Add the residuals of the first output feature map and the first fused feature map at the corresponding resolution scale to obtain the second input feature map.
[0081] Step S2033: Perform a downsampling operation on the second input feature map using the downsampling ratio corresponding to the current loop count to obtain the second downsampled feature map corresponding to the current loop count.
[0082] Step S2034: Update the first output feature map to the second downsampled feature map corresponding to the current loop count.
[0083] For example, in the second multi-scale feature extraction process, similar to the first multi-scale feature extraction process, the stepwise downsampling operation is completed through iteration. Specifically, firstly, the first output feature map from the first multi-scale feature extraction process is used as input, and the residual of the second fused feature map at the corresponding resolution scale is added to obtain the second input feature map. Then, the second input feature map is downsampled according to the downsampling ratio corresponding to the current iteration number to obtain the second downsampled feature map corresponding to the current iteration number. After that, the first output feature map is updated with the second downsampled feature map obtained in this iteration, and the next iteration is performed. Until the number of iterations reaches the preset number of downsampling iterations, the above-mentioned process of downsampling the first output feature map step by step can also be implemented by a U-shaped network. Specifically, in this embodiment, the U-shaped network that implements the first multi-scale feature extraction process is the first U-shaped network, and the U-shaped network that implements the second multi-scale feature extraction process is the second U-shaped network. In the above embodiment, the process of adding the residuals of the first output feature map and the first fused feature map at the corresponding resolution scale can be implemented by connecting the upsampling layer of the first U-shaped network and the downsampling layer of the second U-shaped network.
[0084] In this embodiment, the first fused feature map generated during the first multi-scale feature extraction process is fused into the second multi-scale feature extraction process, so that the feature information of the image is transferred in the multiple feature extraction processes. The feature maps of the same dimension (resolution scale) are fused, which helps to strengthen the aggregation of information. At the same time, multi-scale features are learned by adding residuals, thereby improving the effect of image processing.
[0085] Step S204: Upsample the second minimum feature map step by step, and at each resolution scale, add the residuals of the second downsampled feature map at the corresponding resolution scale to obtain the second fused feature map at each resolution scale, wherein the second minimum feature map is the second downsampled feature map corresponding to the minimum resolution scale.
[0086] For example, after completing the stepwise downsampling operation in the second multi-scale feature extraction process, the corresponding second minimum feature map output by the stepwise downsampling operation is used as input for stepwise upsampling. At each resolution scale, the residuals of the second downsampled feature map at the corresponding resolution scale are summed to restore the second minimum feature map. This process is similar to the stepwise upsampling operation in the first multi-scale feature extraction process. For the specific implementation process, please refer to the stepwise upsampling operation process in the first multi-scale feature extraction process in the above embodiment (step S202), which will not be repeated here.
[0087] Step S205: Superimpose the first output feature map and the second output feature map to generate a saliency map corresponding to the target image.
[0088] Figure 9 A schematic diagram of a neural network model provided in an embodiment of this disclosure, such as... Figure 9 As shown, the neural network model includes a first U-shaped network and a second U-shaped network. The first U-shaped network includes multiple downsampling layers and multiple upsampling layers arranged sequentially, and the second U-shaped network also includes multiple downsampling layers and multiple upsampling layers arranged sequentially. The first U-shaped network and the second U-shaped network are connected by a fusion structure. The fusion structure includes an output connection, a first residual connection, and a second residual connection. The first residual connection is used to achieve feature fusion between the downsampling layers of the first U-shaped network and the upsampling layers of the second U-shaped network (shown as ⊕ in the figure, indicating residual addition). The second residual connection is used to achieve feature fusion between the output of the first U-shaped network and the output of the second U-shaped network (shown as ⊕ in the figure, indicating residual addition). The output connection is used to achieve feature transfer between the output of the first U-shaped network and the input of the second U-shaped network.
[0089] The following is combined with Figure 9 The implementation process of steps S201-S205 in the embodiments of this disclosure will be further described as follows:
[0090] For example, firstly, the target image is input into a first U-shaped network. Then, the target image is downsampled step-by-step through multiple sequentially connected downsampling layers of the first U-shaped network to obtain multiple first downsampled feature maps at various resolution scales. For example, each downsampling layer corresponds to a downsampling ratio, which is determined based on the downsampling network parameters. The downsampling layers process the target image using their respective downsampling ratios. The output of the last downsampling layer is the first minimum feature map, i.e., the first downsampled feature map corresponding to the minimum resolution scale.
[0091] Subsequently, the first minimum feature map is upsampled stepwise through multiple sequentially connected upsampling layers of the first U-shaped network. Simultaneously, using the residual connections between the downsampling and upsampling layers, the residuals of the first downsampling feature maps output by the corresponding downsampling layers are summed to obtain the first fused feature map at each resolution scale. For example, each downsampling layer corresponds to an upsampling ratio, which is the same as the downsampling ratio of the corresponding downsampling layer, used to restore the image resolution size.
[0092] Figure 10 This is a schematic diagram of a residual addition process provided in an embodiment of the present disclosure, as shown below. Figure 10As shown, the downsampling layers include at least DL1, DL2, and DL3, and the upsampling layers include at least UL1, UL2, and UL3. UL1 corresponds to DL1, UL2 to DL2, and UL3 to DL3. After the previous layer of UL2 (shown as UL1 in the figure) outputs image P1, P1 is added to P2 (the first downsampling feature map) output by the downsampling layer DL2. Since P1 and P2 have the same image size, point-to-point pixel addition is performed to obtain P3, which is the residual addition result. P3 is then input into UL2 for upsampling, and UL2 outputs P4. Then, similar to the previous steps, P4 output by UL2 is added to P5 output by the downsampling layer DL3 to obtain P6, which is then input into the upsampling layer UL3 for upsampling. This process continues until all upsampling layers have been executed.
[0093] Further, exemplarily, each upsampling layer includes multiple sub-layers (not shown in the figure), such as convolutional layers, activation layers, interpolation layers, etc. Each sub-layer can be implemented by a specific function, which will not be elaborated here. Each time an upsampling layer with multiple sub-layers is passed, an upsampling process is completed, and the processing result of the upsampling operation, i.e., the first fused feature map, is generated. Finally, after passing through all upsampling layers, a feature map that fuses feature information from various resolution scales is obtained, i.e., the first output feature map. In this embodiment, feature fusion is performed by adding residuals, which helps different branches learn knowledge that other branches cannot learn and reduces information redundancy. Compared with residual feature merging (concatenation), this method has lower computational cost and faster processing speed.
[0094] Further, after the processing of the first U-shaped network is completed, a first output feature map is output. This first output feature map is then passed to the second U-shaped network via the output connection in the fusion structure, i.e., the first output feature map is passed to the downsampling layer of the second U-shaped network. Subsequently, the first output feature map is processed through multiple downsampling layers sequentially connected in the second U-shaped network. These downsampling layers are connected to multiple upsampling layers in the first U-shaped network via a first residual connection in the fusion structure. The first fused feature map output from the first U-shaped network is fused with the output of the previous downsampling layer in the second U-shaped network by adding residuals, resulting in a second input feature map. This second input feature map is then input to the next downsampling layer for downsampling, yielding a second downsampling feature map corresponding to the downsampling layer. The second downsampling feature map corresponding to the smallest resolution scale is the second minimum feature map.
[0095] Furthermore, using multiple upsampling layers symmetrically arranged with the downsampling layers in the second U-shaped network, the second minimum feature map is further upsampled layer by layer. During the upsampling process, the residual connection structure in the second U-shaped network is used to sum the residuals of the second downsampled feature map at each resolution scale, ultimately obtaining the second output feature map. Finally, the second output feature map and the second output feature map are added together using the second residual connection in the fusion structure to achieve feature fusion and obtain the final output, i.e., the saliency map.
[0096] In one possible implementation, the second U-shaped network and / or its upsampling and downsampling layers, including depthwise separable convolutional layers, combine depthwise (DW) and pointwise (PW) convolutions to extract feature maps. Compared to conventional convolution operations, this reduces the number of parameters and computational cost, improving its applicability in mobile terminal scenarios.
[0097] In this embodiment, a neural network model consisting of a first U-shaped network, a second U-shaped network, and a fusion structure connecting the two is used to achieve two multi-scale feature extractions of the target image. The structure of the first multi-scale feature extraction is fused into the second multi-scale feature extraction process, enabling the transmission of image feature information in different U-shaped networks. Moreover, the addition of residuals from feature maps with the same dimension (resolution scale) helps to strengthen information aggregation, and multi-scale features are learned through residuals. Finally, by adding the features output by the first and second U-shaped networks, the final model prediction result (saliency map) is output, improving the image processing effect.
[0098] In this embodiment, the implementation of step S205 is the same as that in this disclosure. Figure 2 The implementation of step S103 in the illustrated embodiment is the same, and will not be described in detail here.
[0099] This disclosure provides an image processing apparatus, including a first U-shaped network and a second U-shaped network. The first U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the second U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially. The first U-shaped network and the second U-shaped network are connected by a fusion structure.
[0100] The fusion structure includes an output connection, a first residual connection, and a second residual connection. The first residual connection is used to achieve feature fusion between the downsampling layer of the first U-shaped network and the upsampling layer of the second U-shaped network. The second residual connection is used to achieve feature fusion between the output of the first U-shaped network and the output of the second U-shaped network. The output connection is used to achieve feature transfer between the output of the first U-shaped network and the input of the second U-shaped network.
[0101] The image processing device is used to generate a saliency map corresponding to the target image.
[0102] More specifically, the aforementioned image processing apparatus includes: Figure 9 The neural network model shown can be implemented using this image processing device. Figures 2 to 10 For the specific implementation methods of the schemes in any of the embodiments shown, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0103] Corresponding to the image processing method in the above embodiments, Figure 11 This is a structural block diagram of an image processing apparatus provided according to embodiments of the present disclosure. For ease of explanation, only the parts relevant to embodiments of the present disclosure are shown. (Refer to...) Figure 11 Image processing device 3, comprising:
[0104] The first extraction module 31 is used to extract multi-scale features from the target image to obtain the first fused feature map at different resolution scales;
[0105] The second extraction module 32 is used to perform multi-scale feature extraction on the first output feature map, and to perform feature fusion based on the first fusion feature map of the corresponding resolution scale at each resolution scale to obtain the second fusion feature map at different resolution scales, wherein the first output feature map is the first fusion feature map corresponding to the maximum resolution scale.
[0106] The overlay module 33 is used to overlay the first output feature map and the second output feature map to generate a saliency map corresponding to the target image, wherein the second output feature map is the second fused feature map corresponding to the maximum resolution scale.
[0107] In one embodiment of this disclosure, the first extraction module 31 is specifically used to: perform step-by-step downsampling on the target image to obtain multiple first downsampled feature maps at each resolution scale; perform step-by-step upsampling on the first minimum feature map, and at each resolution scale, use the first downsampled feature map at the corresponding resolution scale to perform residual summation to obtain the first fused feature map at each resolution scale, wherein the first minimum feature map is the first downsampled feature map corresponding to the minimum resolution scale.
[0108] In one embodiment of this disclosure, when the first extraction module 31 performs step-by-step downsampling on the target image to obtain multiple first downsampled feature maps at various resolution scales, it is specifically used to: repeatedly execute the following steps until the number of iterations is greater than the preset number of downsampling iterations: perform downsampling operations on the target image sequentially using the downsampling ratio corresponding to the current number of iterations to obtain the first downsampled feature map corresponding to the current number of iterations; update the target image with the first downsampled feature map corresponding to the current number of iterations.
[0109] In one embodiment of this disclosure, when the first extraction module 31 performs progressive upsampling on the first minimum feature map and adds the residuals of the first downsampled feature map at each resolution scale to obtain the first fused feature map at each resolution scale, it specifically performs the following steps in a loop until the number of loops is greater than a preset number of upsampling: adding the residuals of the first minimum feature map and the first downsampled feature map at the corresponding resolution scale to obtain the first input feature map; performing upsampling operations on the first input feature map sequentially according to the upsampling ratio corresponding to the current number of loops to obtain the first fused feature map corresponding to the current number of loops; and updating the first minimum feature map to the first fused feature map corresponding to the current number of loops.
[0110] In one embodiment of this disclosure, the first extraction module 32 is specifically configured to: perform progressive downsampling on the first output feature map, and at each resolution scale, add the residuals using the first fused feature map at the corresponding resolution scale to obtain the second downsampled feature map at each resolution scale; perform progressive upsampling on the second minimum feature map, and at each resolution scale, add the residuals using the second downsampled feature map at the corresponding resolution scale to obtain the second fused feature map at each resolution scale, wherein the second minimum feature map is the second downsampled feature map corresponding to the minimum resolution scale.
[0111] In one embodiment of this disclosure, when the first extraction module 32 performs step-by-step downsampling on the first output feature map and adds the residuals of the first fused feature map at each resolution scale to obtain the second downsampled feature map at each resolution scale, it specifically performs the following steps in a loop until the number of loops is greater than a preset number of downsampling: adding the residuals of the first output feature map and the first fused feature map at the corresponding resolution scale to obtain the second input feature map; performing a downsampling operation on the second input feature map using the downsampling ratio corresponding to the current number of loops to obtain the second downsampled feature map corresponding to the current number of loops; and updating the first output feature map to the second downsampled feature map corresponding to the current number of loops.
[0112] In one embodiment of this disclosure, the overlay module 33 is specifically used to: add the residuals of the first output feature map and the second output feature map to generate a saliency map corresponding to the target image.
[0113] In one embodiment of this disclosure, the first fused feature map and / or the second fused feature map are obtained based on a depthwise separable convolution operation.
[0114] The first extraction module 31, the second extraction module 32, and the overlay module 33 are connected sequentially. The image processing device 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0115] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 12 As shown, the electronic device 4 includes:
[0116] Processor 41, and memory 42 communicatively connected to processor 41;
[0117] Memory 42 stores instructions executed by the computer;
[0118] The processor 41 executes computer execution instructions stored in the memory 42 to achieve, for example, Figures 2-10 The image processing method in the illustrated embodiment.
[0119] Optionally, the processor 41 and the memory 42 are connected via a bus 43.
[0120] For relevant instructions, please refer to the corresponding text. Figures 2-10 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.
[0121] refer to Figure 13 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 13 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0122] like Figure 13 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0123] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 13 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0124] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0125] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium 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, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0126] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0127] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0128] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0130] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0131] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0132] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0133] In a first aspect, according to one or more embodiments of the present disclosure, an image processing method is provided, comprising:
[0134] Multi-scale feature extraction is performed on the target image to obtain first fusion feature maps at different resolution scales; multi-scale feature extraction is performed on the first output feature map, and feature fusion is performed based on the first fusion feature map at each resolution scale to obtain second fusion feature maps at different resolution scales, wherein the first output feature map is the first fusion feature map corresponding to the maximum resolution scale; the first output feature map and the second output feature map are superimposed to generate a saliency map corresponding to the target image, wherein the second output feature map is the second fusion feature map corresponding to the maximum resolution scale.
[0135] According to one or more embodiments of this disclosure, the step of performing multi-scale feature extraction on a target image to obtain first fused feature maps at different resolution scales includes: performing step-by-step downsampling on the target image to obtain multiple first downsampled feature maps at each resolution scale; performing step-by-step upsampling on a first minimum feature map, and at each resolution scale, adding the residuals of the first downsampled feature maps at the corresponding resolution scale to obtain a first fused feature map at each resolution scale, wherein the first minimum feature map is the first downsampled feature map corresponding to the minimum resolution scale.
[0136] According to one or more embodiments of this disclosure, the step of downsampling the target image step by step to obtain multiple first downsampled feature maps at various resolution scales includes: repeatedly executing the following steps until the number of iterations is greater than a preset number of downsampling iterations: performing downsampling operations on the target image sequentially using the downsampling ratio corresponding to the current number of iterations to obtain the first downsampled feature map corresponding to the current number of iterations; and updating the target image to the first downsampled feature map corresponding to the current number of iterations.
[0137] According to one or more embodiments of this disclosure, the step of progressively upsampling the first minimum feature map and, at each resolution scale, summing the residuals of the first downsampled feature map at the corresponding resolution scale to obtain the first fused feature map at each resolution scale includes: repeatedly executing the following steps until the number of iterations is greater than a preset number of upsampling iterations: summing the residuals of the first minimum feature map and the first downsampled feature map at the corresponding resolution scale to obtain a first input feature map; sequentially upsampling the first input feature map using the upsampling ratio corresponding to the current number of iterations to obtain the first fused feature map corresponding to the current number of iterations; and updating the first minimum feature map to the first fused feature map corresponding to the current number of iterations.
[0138] According to one or more embodiments of this disclosure, the step of performing multi-scale feature extraction on the first output feature map and performing feature fusion based on the first fusion feature map at each resolution scale to obtain a second fusion feature map at different resolution scales includes: progressively downsampling the first output feature map and, at each resolution scale, summing the residuals using the first fusion feature map at the corresponding resolution scale to obtain a second downsampled feature map at each resolution scale; progressively upsampling the second minimum feature map and, at each resolution scale, summing the residuals using the second downsampled feature map at the corresponding resolution scale to obtain a second fusion feature map at each resolution scale, wherein the second minimum feature map is the second downsampled feature map corresponding to the minimum resolution scale.
[0139] According to one or more embodiments of this disclosure, the step of downsampling the first output feature map step by step, and at each resolution scale, adding the residuals of the first fused feature map at the corresponding resolution scale to obtain the second downsampled feature map at each resolution scale, includes: repeatedly executing the following steps until the number of iterations is greater than a preset number of downsampling iterations: adding the residuals of the first output feature map and the first fused feature map at the corresponding resolution scale to obtain the second input feature map; performing a downsampling operation on the second input feature map using the downsampling ratio corresponding to the current number of iterations to obtain the second downsampled feature map corresponding to the current number of iterations; and updating the first output feature map to the second downsampled feature map corresponding to the current number of iterations.
[0140] According to one or more embodiments of this disclosure, superimposing the first output feature map and the second output feature map to generate a saliency map corresponding to the target image includes: adding the residuals of the first output feature map and the second output feature map to generate a saliency map corresponding to the target image.
[0141] According to one or more embodiments of this disclosure, the first fused feature map and / or the second fused feature map are obtained based on a depthwise separable convolution operation.
[0142] Secondly, embodiments of this disclosure provide an image processing apparatus, comprising:
[0143] A first U-shaped network and a second U-shaped network, wherein the first U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the second U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the first U-shaped network and the second U-shaped network are connected by a fusion structure; the fusion structure includes an output connection, a first residual connection and a second residual connection, wherein the first residual connection is used to realize feature fusion between the downsampling layers of the first U-shaped network and the upsampling layers of the second U-shaped network; the second residual connection is used to realize feature fusion between the output of the first U-shaped network and the output of the second U-shaped network; and the output connection is used to realize feature transfer between the output of the first U-shaped network and the input of the second U-shaped network; the image processing device is used to generate a saliency map corresponding to the target image.
[0144] Thirdly, according to one or more embodiments of this disclosure, a neural network model is provided, comprising: a first U-shaped network and a second U-shaped network, wherein the first U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the second U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged sequentially, and the first U-shaped network and the second U-shaped network are connected by a fusion structure; the fusion structure includes an output connection, a first residual connection and a second residual connection, wherein the first residual connection is used to realize feature fusion between the downsampling layers of the first U-shaped network and the upsampling layers of the second U-shaped network; the second residual connection is used to realize feature fusion between the output of the first U-shaped network and the output of the second U-shaped network, and the output connection is used to realize feature transfer between the output of the first U-shaped network and the input of the second U-shaped network; the neural network model is used to implement the image processing method described in the first aspect and various possible designs of the first aspect.
[0145] Fourthly, according to one or more embodiments of this disclosure, a neural network model is provided, comprising:
[0146] The first extraction module is used to extract multi-scale features from the target image to obtain the first fused feature map at different resolution scales;
[0147] The second extraction module is used to perform multi-scale feature extraction on the first output feature map, and to perform feature fusion based on the first fusion feature map at each resolution scale to obtain the second fusion feature map at different resolution scales, wherein the first output feature map is the first fusion feature map corresponding to the maximum resolution scale.
[0148] The overlay module is used to overlay the first output feature map and the second output feature map to generate a saliency map corresponding to the target image, wherein the second output feature map is the second fused feature map corresponding to the maximum resolution scale.
[0149] According to one or more embodiments of this disclosure, the first extraction module is specifically configured to: perform stepwise downsampling on the target image to obtain multiple first downsampled feature maps at each resolution scale; perform stepwise upsampling on the first minimum feature map, and at each resolution scale, add the residuals using the first downsampled feature maps at the corresponding resolution scale to obtain a first fused feature map at each resolution scale, wherein the first minimum feature map is the first downsampled feature map corresponding to the minimum resolution scale.
[0150] According to one or more embodiments of this disclosure, when the first extraction module performs step-by-step downsampling on the target image to obtain multiple first downsampled feature maps at various resolution scales, it is specifically used to: repeatedly execute the following steps until the number of iterations is greater than a preset number of downsampling iterations: perform downsampling operations on the target image sequentially using the downsampling ratio corresponding to the current number of iterations to obtain the first downsampled feature map corresponding to the current number of iterations; update the target image with the first downsampled feature map corresponding to the current number of iterations.
[0151] According to one or more embodiments of this disclosure, when the first extraction module performs progressive upsampling on the first minimum feature map and adds the residuals of the first downsampled feature map at each resolution scale to obtain the first fused feature map at each resolution scale, it is specifically configured to: repeatedly execute the following steps until the number of iterations is greater than a preset number of upsampling iterations: add the residuals of the first minimum feature map and the first downsampled feature map at the corresponding resolution scale to obtain the first input feature map; perform upsampling operations on the first input feature map sequentially according to the upsampling ratio corresponding to the current number of iterations to obtain the first fused feature map corresponding to the current number of iterations; update the first minimum feature map to the first fused feature map corresponding to the current number of iterations.
[0152] According to one or more embodiments of this disclosure, the first extraction module is specifically configured to: perform progressive downsampling on the first output feature map, and at each resolution scale, add the residuals using the first fused feature map at the corresponding resolution scale to obtain a second downsampled feature map at each resolution scale; perform progressive upsampling on the second minimum feature map, and at each resolution scale, add the residuals using the second downsampled feature map at the corresponding resolution scale to obtain a second fused feature map at each resolution scale, wherein the second minimum feature map is the second downsampled feature map corresponding to the minimum resolution scale.
[0153] According to one or more embodiments of this disclosure, when the first extraction module performs stepwise downsampling on the first output feature map and, at each resolution scale, adds the residuals of the first fused feature map at the corresponding resolution scale to obtain the second downsampled feature map at each resolution scale, it is specifically configured to: repeatedly execute the following steps until the number of iterations is greater than a preset number of downsampling iterations: add the residuals of the first output feature map and the first fused feature map at the corresponding resolution scale to obtain the second input feature map; perform a downsampling operation on the second input feature map using the downsampling ratio corresponding to the current number of iterations to obtain the second downsampled feature map corresponding to the current number of iterations; and update the first output feature map to the second downsampled feature map corresponding to the current number of iterations.
[0154] According to one or more embodiments of this disclosure, the overlay module is specifically used to: add the residuals of the first output feature map and the second output feature map to generate a saliency map corresponding to the target image.
[0155] In one embodiment of this disclosure, the first fused feature map and / or the second fused feature map are obtained based on a depthwise separable convolution operation.
[0156] Fifthly, according to one or more embodiments of the present disclosure, an electronic device is provided, including: a processor, and a memory communicatively connected to the processor;
[0157] The memory stores computer-executed instructions;
[0158] The processor executes computer execution instructions stored in the memory to implement the image processing method described in the first aspect and various possible designs of the first aspect.
[0159] In a sixth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, implement the image processing method described in the first aspect and various possible designs of the first aspect.
[0160] In a seventh aspect, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the image processing method as described in the first aspect and various possible designs of the first aspect.
[0161] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0162] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0163] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. An image processing method, characterized in that, include: Multi-scale feature extraction of the target image is performed through a first U-shaped network to obtain first fusion feature maps at different resolution scales, including: downsampling the target image step by step to obtain multiple first downsampled feature maps at each resolution scale; upsampling the first minimum feature map step by step, and adding the residuals of the first downsampled feature maps at each resolution scale to obtain the first fusion feature map at each resolution scale, wherein the first minimum feature map is the first downsampled feature map corresponding to the minimum resolution scale; Multi-scale feature extraction is performed on the first output feature map using a second U-shaped network. At each resolution scale, feature fusion is performed based on the first fusion feature map corresponding to that resolution scale to obtain second fusion feature maps at different resolution scales. This includes: progressively downsampling the first output feature map, and at each resolution scale, summing the residuals using the first fusion feature maps at the corresponding resolution scale to obtain second downsampled feature maps at each resolution scale; progressively upsampling the second minimum feature map, and at each resolution scale, summing the residuals using the second downsampled feature maps at the corresponding resolution scale to obtain second fusion feature maps at each resolution scale. The first output feature map is the first fusion feature map corresponding to the maximum resolution scale, and the second minimum feature map is the second downsampled feature map corresponding to the minimum resolution scale. The first output feature map and the second output feature map are superimposed to generate a saliency map corresponding to the target image, wherein the second output feature map is the second fused feature map corresponding to the maximum resolution scale.
2. The method according to claim 1, characterized in that, The step of downsampling the target image at each level to obtain multiple first downsampled feature maps at various resolution scales includes: Repeat the following steps until the number of iterations exceeds the preset number of downsampling iterations: By using the downsampling ratio corresponding to the current loop number, the target image is sequentially downsampled to obtain the first downsampled feature map corresponding to the current loop number; The target image is updated to the first downsampled feature map corresponding to the current loop number.
3. The method according to claim 1, characterized in that, The step of progressively upsampling the first minimum feature map and, at each resolution scale, adding the residuals of the first downsampled feature map at the corresponding resolution scale to obtain the first fused feature map at each resolution scale includes: Repeat the following steps until the number of iterations exceeds the preset number of upsampling iterations: The first minimum feature map and the first downsampled feature map at the corresponding resolution scale are added together by residual addition to obtain the first input feature map; By using the upsampling ratio corresponding to the current loop number, the first input feature map is sequentially upsampled to obtain the first fused feature map corresponding to the current loop number; The first minimum feature map is updated to the first fused feature map corresponding to the current loop number.
4. The method according to claim 3, characterized in that, The step of downsampling the first output feature map at each resolution scale, and then summing the residuals of the first fused feature maps at each resolution scale to obtain the second downsampled feature map at each resolution scale, includes: Repeat the following steps until the number of iterations exceeds the preset number of downsampling iterations: The residuals of the first output feature map and the first fused feature map at the corresponding resolution scale are added together to obtain the second input feature map; The second input feature map is downsampled using the downsampling ratio corresponding to the current loop count to obtain the second downsampled feature map corresponding to the current loop count. The first output feature map is updated to the second downsampled feature map corresponding to the current loop number.
5. The method according to any one of claims 1-4, characterized in that, By superimposing the first output feature map and the second output feature map, a saliency map corresponding to the target image is generated, including: The residuals of the first output feature map and the second output feature map are added together to generate the saliency map corresponding to the target image.
6. The method according to any one of claims 1-4, characterized in that, The first fused feature map and / or the second fused feature map are obtained based on depthwise separable convolution operations.
7. An image processing apparatus, characterized in that, It includes a first U-shaped network and a second U-shaped network. The first U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged in sequence. The second U-shaped network includes a plurality of downsampling layers and a plurality of upsampling layers arranged in sequence. The first U-shaped network and the second U-shaped network are connected by a fusion structure. The fusion structure includes an output connection, a first residual connection, and a second residual connection. The first residual connection is used to achieve feature fusion between the downsampling layer of the first U-shaped network and the upsampling layer of the second U-shaped network. The second residual connection is used to achieve feature fusion between the output of the first U-shaped network and the output of the second U-shaped network. The output connection is used to achieve feature transfer between the output of the first U-shaped network and the input of the second U-shaped network. The image processing apparatus is used to generate a saliency map corresponding to the target image based on the image processing method according to any one of claims 1-6.
8. An image processing apparatus, characterized in that, include: The first extraction module is used to extract multi-scale features from the target image through a first U-shaped network to obtain first fusion feature maps at different resolution scales. The module includes: downsampling the target image step by step to obtain multiple first downsampled feature maps at each resolution scale; upsampling the first minimum feature map step by step, and adding the residuals of the first downsampled feature maps at each resolution scale to obtain the first fusion feature map at each resolution scale, wherein the first minimum feature map is the first downsampled feature map corresponding to the minimum resolution scale. The second extraction module is used to perform multi-scale feature extraction on the first output feature map through a second U-shaped network, and to perform feature fusion based on the first fusion feature map at each resolution scale to obtain a second fusion feature map at different resolution scales. This includes: progressively downsampling the first output feature map, and at each resolution scale, summing the residuals of the first fusion feature maps at the corresponding resolution scale to obtain a second downsampled feature map at each resolution scale; progressively upsampling the second minimum feature map, and at each resolution scale, summing the residuals of the second downsampled feature maps at the corresponding resolution scale to obtain a second fusion feature map at each resolution scale, wherein the first output feature map is the first fusion feature map corresponding to the maximum resolution scale, and the second minimum feature map is the second downsampled feature map corresponding to the minimum resolution scale. The overlay module is used to overlay the first output feature map and the second output feature map to generate a saliency map corresponding to the target image, wherein the second output feature map is the second fused feature map corresponding to the maximum resolution scale.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the image processing method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the image processing method as described in any one of claims 1 to 6.
11. A computer program product comprising a computer program that, when executed by a processor, implements the image processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Medical image segmentation method and computer readable storage medium
CN111951278A
High-resolution image building extraction method based on multi-scale residual network model
CN113205018A
Apparatus and method for image segmentation using a deep convolutional neural network with a nested u-structure
US20210201499A1
