Image processing method, device, equipment and medium

By combining deep features and shallow features to generate transparency features, the problem of edge information loss in instance segmentation of the deep neural network model is solved, and the accuracy of instance segmentation and edge segmentation performance are improved.

CN113744280BActive Publication Date: 2024-09-17BEIJING KUANGSHI TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110819544.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-20
Publication Date
2024-09-17
Estimated Expiration
2041-07-20

AI Technical Summary

Technical Problem

When the deep neural network model performs instance segmentation tasks, the edge information of the target area is lost, resulting in low accuracy of instance segmentation.

Method used

By combining deep features and shallow features, transparency features are generated to supplement edge information, and transparency features are used to enhance the preliminary instance segmentation results, thereby performing instance segmentation on the basis of retaining the complete edge information of the object.

Benefits of technology

It improves the accuracy of instance segmentation and edge segmentation performance, and enhances the retention of edge information of objects in the target area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113744280B
    Figure CN113744280B
Patent Text Reader

Abstract

The embodiments of the present invention provide an image processing method, apparatus, device and medium, which belong to the field of image processing technology and aim to improve the accuracy of instance segmentation. The method comprises: performing feature extraction on an image to be processed to obtain deep features and shallow features of a target area in the image to be processed; determining transparency features of the target area based on the deep features and the shallow features, and determining a first preliminary instance segmentation result of the image to be processed based on the deep features and the shallow features; performing instance segmentation on the image to be processed according to the first preliminary instance segmentation result and the transparency features to obtain an instance segmentation result of the target area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, device, equipment and medium. Background Art

[0002] In the instance segmentation task using a deep neural network model, the deep neural network model needs to be able to accurately segment different categories of objects on the image and different individuals of the same category of objects. In the related art, a deep neural network model is generally used to perform instance segmentation tasks. Specifically, the deep neural network model is used to frame the target area of ​​the object in the image and classify the objects in the image, and then instance segmentation is performed based on the framed target area to segment the object from the image.

[0003] Among them, the process of feature extraction for the target area is: interpolating the features in the target areas of different sizes (resolutions) to obtain features of fixed size (i.e. fixed resolution), which leads to the loss of edge information of objects in the target area, resulting in limited performance of edge segmentation during subsequent instance segmentation, and thus low accuracy of instance segmentation. Summary of the invention

[0004] In view of the above problems, an image processing method, apparatus, device and medium according to an embodiment of the present invention are proposed to overcome the above problems or at least partially solve the above problems.

[0005] In order to solve the above problem, the first aspect of the present invention discloses an image processing method, the method comprising:

[0006] Performing feature extraction on the image to be processed to obtain deep features and shallow features of the target area in the image to be processed;

[0007] Determine the transparency feature of the target area based on the deep feature and the shallow feature, and determine the first preliminary instance segmentation result of the image to be processed based on the deep feature and the shallow feature;

[0008] According to the first preliminary instance segmentation result and the transparency feature, instance segmentation is performed on the image to be processed to obtain an instance segmentation result of the target area.

[0009] Optionally, determining the transparency feature of the target area based on the deep feature and the shallow feature includes:

[0010] Processing the deep features to obtain a ternary map corresponding to the target area;

[0011] The ternary image and the shallow feature are spliced ​​to obtain a first spliced ​​feature;

[0012] The first splicing feature is processed to obtain the transparency feature.

[0013] Optionally, determining a first preliminary instance segmentation result of the image to be processed based on the deep features and the shallow features includes:

[0014] Processing the deep features to obtain a ternary map corresponding to the target area;

[0015] The ternary image and the shallow feature are spliced ​​to obtain a first spliced ​​feature;

[0016] The deep feature is fused with the first splicing feature to obtain a fused feature corresponding to the deep feature and the first splicing feature;

[0017] Instance segmentation is performed based on the fused features to obtain the first preliminary instance segmentation result.

[0018] Optionally, the processing of the deep features to obtain a ternary map corresponding to the target area includes:

[0019] Perform instance segmentation based on the deep features to obtain a second preliminary instance segmentation result of the target area;

[0020] Performing morphological processing on the second non-preliminary instance segmentation result to obtain a processed second preliminary instance segmentation result;

[0021] The processed second preliminary instance segmentation result is subjected to ternary processing to obtain a ternary image corresponding to the target area.

[0022] Optionally, the fusing the deep feature with the first splicing feature to obtain a fused feature corresponding to the deep feature and the first splicing feature includes:

[0023] Performing convolution processing on the deep features to obtain processed deep features;

[0024] Performing convolution processing on the first splicing feature to obtain a processed first splicing feature;

[0025] The feature values ​​corresponding to the same position in the processed deep feature and the processed first spliced ​​feature are added to obtain the fused feature.

[0026] Optionally, performing instance segmentation on the image to be processed according to the first preliminary instance segmentation result and the transparency feature to obtain the instance segmentation result of the target area includes:

[0027] Splicing the first preliminary instance segmentation result with the transparency feature to obtain a second splicing feature;

[0028] Instance segmentation is performed based on the second splicing feature to obtain an instance segmentation result of the target area.

[0029] Optionally, the instance segmentation of the image to be processed is implemented based on a neural network model;

[0030] Accordingly, the neural network model is trained through the following steps:

[0031] Extracting features from the sample image to obtain deep features and shallow features of the sample area in the sample image;

[0032] Inputting the deep features and shallow features of the sample area into a neural network model to generate an instance segmentation result of the sample area;

[0033] Determining the loss value of the neural network model according to the labels corresponding to each pixel in the sample area and the instance segmentation result of the sample area, wherein the label corresponding to a pixel indicates whether the pixel belongs to the foreground or the background;

[0034] According to the loss value, the parameters of the neural network model are updated to obtain an instance segmentation module.

[0035] Optionally, the method further comprises:

[0036] Processing the deep features of the sample area to obtain the covariance corresponding to the sample area;

[0037] Determining the loss value of the neural network model according to the label corresponding to each pixel point in the sample area and the instance segmentation result of the sample area includes:

[0038] According to the covariance, the label corresponding to each pixel point in the sample area and the instance segmentation result of the sample area, the loss value of the neural network model is determined according to the following formula;

[0039]

[0040] Among them, y u is the label corresponding to the u-th pixel in the sample area, p u is the predicted value of the u-th pixel in the instance segmentation result of the sample area, used to predict whether the u-th pixel belongs to the foreground or the background, N is the total number of pixels in the sample area, σ i Denotes the covariance.

[0041] According to a second aspect of the embodiments of the present application, an image processing device is provided, the device comprising:

[0042] A feature extraction module is used to extract features from the image to be processed to obtain deep features and shallow features of the target area in the image to be processed;

[0043] A feature enhancement module, used for determining the transparency feature of the target area based on the deep feature and the shallow feature;

[0044] A first segmentation module, used for determining a first preliminary instance segmentation result of the image to be processed based on the deep features and the shallow features;

[0045] The second segmentation module is used to perform instance segmentation on the image to be processed according to the first preliminary instance segmentation result and the transparency feature to obtain an instance segmentation result of the target area.

[0046] According to a third aspect of an embodiment of the present invention, an electronic device is disclosed, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes, the image processing method as described in the first aspect of the embodiment of the present invention is implemented.

[0047] According to a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is disclosed, wherein a computer program stored in the medium enables a processor to execute the image processing method as described in the first aspect of the embodiments of the present invention.

[0048] The embodiments of the present invention include the following advantages:

[0049] In an embodiment of the present invention, feature extraction can be performed on the image to be processed to obtain deep features and shallow features of the target area in the image to be processed; based on the deep features and the shallow features, the transparency features of the target area are determined, and, based on the deep features and the shallow features, a first preliminary instance segmentation result of the image to be processed is determined; based on the first preliminary instance segmentation result and the transparency features, instance segmentation is performed on the image to be processed to obtain an instance segmentation result of the target area.

[0050] By adopting the technical solution of this embodiment, on the one hand, considering that shallow features contain rich edge information, a fusion feature is obtained based on the deep features and shallow features of the target area, and the shallow features can be used to supplement the edge information of the object in the target area. Then, the target area with supplemented edge information is initially segmented to obtain a first preliminary instance segmentation result; on the other hand, a transparency feature of the target area is obtained based on the deep features and shallow features. The transparency feature can reflect the transparency of the image area framed by the target area in the alpha channel. When instance segmentation is performed on the processed image based on the transparency feature and the first preliminary instance segmentation result, the transparency feature can be used to further enhance the segmentation result of the edge information in the first preliminary instance segmentation result, so as to retain the complete edge information of the object in the target area as much as possible, and instance segmentation is performed on the basis of retaining the complete edge information of the object in the target area, so as to improve the performance of edge segmentation, thereby improving the accuracy of instance segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0052] Figure 1 is a flowchart of the steps of an image processing method in an embodiment of the present invention;

[0053] Figure 2 is a flow chart of the training steps of the instance segmentation module in an embodiment of the present invention;

[0054] Figure 3 It is a structural schematic diagram of a neural network model in the implementation of the present invention;

[0055] Figure 4 is a schematic diagram of the structure of an instance segmentation module in the implementation of the present invention;

[0056] Figure 5 is a structural diagram of another instance segmentation module in the implementation of the present invention;

[0057] Figure 6 It is a structural block diagram of an image processing device in the implementation of the present invention;

[0058] Figure 7 It is a structural block diagram of an electronic device in the implementation of the present invention. DETAILED DESCRIPTION

[0059] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] In the related art, instance segmentation is performed using features of a fixed size (i.e., a fixed resolution). Since the features of a fixed size (i.e., a fixed resolution) do not contain edge information of objects in the target area, the performance of edge segmentation is limited, and thus the accuracy of instance segmentation is low. To solve this technical feature, the embodiments of the present invention propose the following technical concepts: on the one hand, by utilizing the characteristic of rich edge information of shallow features, the deep features and shallow features of the target area are fused to obtain fused features supplemented with edge information; on the other hand, by utilizing the transparency feature of the image of the target area in the Alpha channel, the edge information contained in the fused features is enhanced, thereby retaining the complete edge information of the objects in the target area as much as possible, and instance segmentation is performed on the basis of retaining the complete edge information of the objects in the target area, so as to improve the performance of edge segmentation, thereby improving the accuracy of instance segmentation.

[0061] Reference Figure 1 As shown, a flowchart of the steps of an image processing method according to an embodiment of the present application is shown. Figure 1 As shown, the method can be applied to a terminal device or a server.

[0062] Among them, a neural network model (for example, a deep neural network model) can be run in the terminal device, the neural network model is obtained through training, and instance segmentation of objects in the image is performed based on the neural network model. In a specific embodiment, instance segmentation of objects in the image can be performed based on the example segmentation module in the neural network model. In this way, the instance segmentation module mentioned in the embodiment of the present application can be embedded in the instance segmentation branch in the deep neural network model to provide the instance segmentation branch with a mask map of the object in the image, so as to segment the object from the image.

[0063] In another embodiment, the neural network model in the terminal device may include multiple modules, for example, at least a positioning module, a classification module and an instance segmentation module, where the output end of the positioning module is connected to the instance segmentation module, and the output end of the classification module is connected to the instance segmentation module. Specifically, the positioning module can be used to obtain the target area where the object in the image is located, as well as the deep features and shallow features of the target area. The instance segmentation module is used to generate a mask map of the object according to the deep features and shallow features of the target area, and the instance segmentation module is used to perform instance segmentation according to the mask map of the object.

[0064] Of course, in some embodiments, the above-mentioned positioning module, classification module or instance segmentation module may also be a separate neural network model, and the embodiment of the present invention does not limit the specific structure of the neural network model adopted.

[0065] like Figure 1 As shown, an image processing method in an embodiment of the present application may specifically include the following steps:

[0066] Step S101: extracting features from an image to be processed to obtain deep features and shallow features of a target area in the image to be processed.

[0067] The target area is the area where the object in the image to be processed is located.

[0068] In this embodiment, the image to be processed may include one or more objects. When there are multiple objects in the image to be processed, the categories of the multiple objects may be the same or different. For example, the multiple objects may be multiple animals, including cats and dogs, and cats may include cats of multiple categories. Instance segmentation of the image to be processed refers to segmenting the multiple objects in the image to be processed from the image to be processed and determining the category to which each segmented object belongs.

[0069] In a specific implementation, the object in the image to be processed can be located, that is, the target area where the object is located can be obtained, and the target area can represent the position of the object in the image to be processed. Then, the image area selected by the target area can be feature extracted, and the extracted features can be interpolated to a preset size to obtain deep features of the target area, wherein the deep features contain global information of the object in the target area. When extracting features from the image where the target area is located, the image where the target area is located can be processed at multiple scales, for example, downsampling processing can be performed at multiple scales, and the feature maps obtained from each downsampling processing can be fused, and then the fused features can be interpolated to a preset size to obtain deep features of the target area.

[0070] Among them, when the target area where the target object is located is obtained, the shallow features of the image area framed by the target area can be obtained, wherein the shallow features retain relatively rich detail information of the object in the target area. In a possible implementation, an RGB image corresponding to the image area framed by the target area can be obtained, and then the features of the RGB image can be extracted to obtain the shallow features of the target area. Among them, RGB represents the three basic color channels of red, green, and blue respectively. Among them, the RGB image can refer to the color map of the image area framed by the target area, which is an image displayed in RGB color mode.

[0071] In the embodiment of the present application, the shallow features may also be referred to as shallow feature maps, and the deep features may also be referred to as deep feature maps, wherein the sizes of the shallow feature maps and the deep feature maps may be the same.

[0072] Step S102: determining the transparency feature of the target area based on the deep feature and the shallow feature, and determining a first preliminary instance segmentation result of the image to be processed based on the deep feature and the shallow feature.

[0073] In this embodiment, since the deep features contain global information of the objects in the target area, and the shallow features retain relatively rich detail information of the objects in the target area, the shallow features can be used to supplement the detail information lost by the deep features. Specifically, the shallow features can be used to supplement the edge information in the deep features, and then the initial instance segmentation is performed based on the deep features supplemented with the edge information to obtain the first preliminary instance segmentation result.

[0074] In this embodiment, the transparency feature can also be used to enhance the edge information contained in the fusion feature, so as to retain the complete edge information of the object in the target area as much as possible. The transparency feature can also be called an Alpha feature map, which can reflect the transparency of the image of the target area in the Alpha channel. If the image to be processed itself carries an Alpha feature map, the transparency feature of the target area can be directly obtained from the Alpha feature map of the image to be processed itself. If the image to be processed itself does not have an Alpha feature map, the transparency feature generation method proposed in the embodiment of the present application can be used to generate the transparency feature. Specifically, based on the deep features and shallow features of the target area, the transparency feature of the target area is obtained.

[0075] Step S103: performing instance segmentation on the image to be processed according to the first preliminary instance segmentation result and the transparency feature to obtain an instance segmentation result of the target area.

[0076] In this embodiment, after obtaining the first preliminary instance segmentation result, the transparency feature can be used to further enhance the first preliminary instance segmentation result. Specifically, the image to be processed can be instance segmented according to the transparency feature and the first preliminary instance segmentation result to obtain an instance segmentation result. The instance segmentation result can be understood as the result of whether each pixel point included in the target area in the image to be processed belongs to the foreground or background.

[0077] Specifically, the transparency feature and the first preliminary instance segmentation result can be fused to obtain a mask image of the target area. The pixel value of a pixel point in the mask image can represent the probability that the pixel point belongs to the foreground or the background. Among them, the foreground generally represents the object, and the background generally represents the environment in which the object is located.

[0078] Thus, the generated mask image can clearly distinguish the foreground and background of the target area, so that the object can be accurately segmented from the target area.

[0079] By adopting the technical solution of the present embodiment, on the one hand, considering that shallow features contain rich edge information, instance segmentation is performed on the target area based on the deep features and shallow features of the target area to obtain a first preliminary instance segmentation result of the image to be processed. In this way, the shallow features can be used to supplement the edge information of the objects in the target area to improve the instance segmentation result with higher accuracy. On the other hand, the transparency feature of the target area is obtained based on the deep features and shallow features. The transparency feature can reflect the transparency of the image area framed by the target area in the alpha channel. When instance segmentation is performed on the image to be processed based on the transparency feature and the first preliminary instance segmentation result, the transparency feature can be used to further enhance the segmentation result of the edge information in the first preliminary instance segmentation result, thereby enhancing the complete edge information of the objects in the target area as much as possible, and instance segmentation is performed on the basis of retaining the complete edge information of the objects in the target area to improve the performance of edge segmentation, thereby improving the accuracy of instance segmentation. In addition, the first preliminary instance segmentation result in the embodiment of the present application is obtained based on shallow features and deep features, and the transparency feature is also obtained based on shallow features and deep features. Therefore, the first preliminary instance segmentation result and the final instance segmentation result both utilize shallow features and deep features multiple times to achieve gradient enhancement of instance segmentation, so as to perform accurate instance segmentation.

[0080] In one embodiment of the present application, the process of obtaining the transparency feature can be described as follows: the deep feature is processed to obtain a ternary map corresponding to the target area; then, the ternary map is concatenated with the shallow feature (i.e., a concat operation) to obtain a first concatenated feature; then, the first concatenated feature is processed to obtain the transparency feature.

[0081] In this embodiment, processing the deep features may refer to performing convolution processing on the deep features. For example, the deep features may be subjected to two 3x3 convolutions and one 1x1 convolution to generate a rough mask image (representing the foreground / background); then, the rough mask image is ternary processed to generate a ternary image.

[0082] The pixel value of each pixel point in the ternary image represents whether the pixel point is a foreground, a background, or an unknown area, that is, three pixel values ​​are used to represent the foreground, the background, and the unknown area in the target area.

[0083] In some embodiments, when obtaining a ternary map, instance segmentation can be performed based on the deep features to obtain a second preliminary instance segmentation result of the target area; the second preliminary instance segmentation result can be morphologically processed to obtain a processed second preliminary instance segmentation result; the processed second preliminary instance segmentation result can be ternary processed to obtain a ternary map corresponding to the target area.

[0084] In this embodiment, performing instance segmentation based on deep features may refer to performing two 3x3 convolutions on the deep features to obtain a second preliminary instance segmentation result of the target area, and the second preliminary instance segmentation result may refer to a rough mask map, wherein the second preliminary instance segmentation result is subjected to morphological processing, which may refer to performing dilation and corrosion operations on the second preliminary instance segmentation result (for example, the dilation kernel may be (3, 3), and the number of iterations may be 20), to obtain the processed second-step instance segmentation result (which may be recorded as Unknown i Then, the processed second preliminary instance segmentation result is ternary processed to obtain a ternary image corresponding to the target area (which can be recorded as Tr i ,Tr i =255*CM i +128*(Unknown i -CM i )). The ternary processing may refer to determining whether each pixel in the second preliminary instance segmentation result belongs to the foreground, the background, and the unknown area.

[0085] The second preliminary instance segmentation result can be understood as a segmentation result of instance segmentation based on deep features, in which case the detail information contained in the shallow features has not been supplemented.

[0086] After obtaining the ternary map, the ternary map and the shallow feature can be spliced ​​to obtain a first spliced ​​feature. Specifically, the ternary map and the shallow feature can be spliced ​​and then subjected to two 3*3 convolutions so that the detail information contained in the shallow feature is added to the ternary map, and then the first spliced ​​feature is convoluted to obtain a transparency feature. Specifically, the convolution process can refer to a 1*1 convolution.

[0087] When this implementation is adopted, since the deep features are processed to obtain a ternary map, and then the ternary map is spliced ​​with the shallow features, the shallow features contain detail information and are added to the ternary map, thereby obtaining a transparency feature with enhanced detail information, thereby obtaining a more accurate transparency feature. In this way, the second preliminary instance segmentation result can be enhanced for the first time using the shallow features.

[0088] In another embodiment, the deep features can be processed to obtain a ternary map corresponding to the target area; the ternary map and the shallow features can be concatenated (i.e., a concat operation) to obtain a first concatenated feature; then, the deep features and the first concatenated features are fused to obtain a fused feature corresponding to the deep features and the shallow features, and then instance segmentation is performed based on the fused features to obtain the first preliminary instance segmentation result.

[0089] Among them, the process of obtaining the ternary map can refer to the above embodiment, and the process of obtaining the first splicing feature can also be as described in the above embodiment. In this embodiment, after obtaining the first splicing feature, the deep feature can be fused with the first splicing feature to obtain a fused feature. Since the deep feature is used twice in the process of obtaining the fused feature (the deep feature is used when obtaining the first splicing feature, and the splicing feature is used again during the fusion process), the global information contained in the deep feature is fully enhanced, thereby obtaining a fused feature that contains fully enhanced global information and supplements the edge information.

[0090] In another embodiment, when the deep feature and the first splicing feature are fused to obtain the fused feature, the deep feature can be convolved to obtain a processed deep feature; the first splicing feature can be convolved to obtain a processed first splicing feature; the feature values ​​corresponding to the same position in the processed deep feature and the processed first splicing feature can be added to obtain the fused feature.

[0091] In this implementation, performing convolution processing on the deep features may refer to subjecting the deep features to two 3x3 convolutions to perform feature extraction at two scales on the deep features, thereby obtaining processed deep features. In this way, the high-level semantic information contained in the deep features can be enhanced.

[0092] Among them, the first splicing feature refers to the feature after splicing the ternary map and the shallow feature. In practice, the convolution processing of the first splicing feature can refer to subjecting the first splicing feature to two 3*3 convolution processings in sequence to obtain the processed first splicing feature. The convolution processing here can adjust the size of the first splicing feature to the same size as the processed deep feature.

[0093] Next, the processed deep features and the features at the same position in the processed first spliced ​​features can be added. The same position can refer to the same spatial position, that is, the processed deep features and the processed first spliced ​​features are subjected to feature addition processing to obtain fused features. In this way, the edge information contained in the shallow features can be supplemented to the deep features. After forming the first spliced ​​features, the information of the first spliced ​​features is added to the high-level semantic information of the deep features, so that the edge information contained in the shallow features is supplemented to the deep features, thereby enhancing the edge information.

[0094] In this embodiment, when obtaining the instance segmentation result of the target area, instance segmentation may be performed based on the fusion feature to obtain a first preliminary instance segmentation result corresponding to the target area.

[0095] In this embodiment, performing instance segmentation based on fused features may refer to performing point convolution processing on the fused features, so as to obtain a first preliminary instance segmentation result corresponding to the target area, and the first preliminary instance segmentation result may be called an initial mask map.

[0096] Among them, the first preliminary instance segmentation result may refer to the instance segmentation of the features after the edge information is supplemented, which can be understood as the instance segmentation result obtained after the edge information is supplemented. Since the first splicing feature is obtained on the basis of the second preliminary instance segmentation result (the first splicing feature requires the use of a ternary map, and the ternary map requires the use of the second preliminary instance segmentation result), when the deep feature and the first splicing feature are used to obtain the fused feature and then the first preliminary instance segmentation result is obtained, it can be understood that the first splicing feature and the deep feature are used to enhance the second preliminary instance segmentation result to achieve the second enhancement of instance segmentation.

[0097] In this embodiment, both the fusion feature and the transparency feature fuse the information of the shallow feature and the deep feature, so that the global information of the object contained in the deep feature and the edge information of the object contained in the shallow feature are enhanced. Therefore, when performing instance segmentation on the processed image based on the fusion feature, and performing instance segmentation on the target area based on the first preliminary instance segmentation result and the transparency feature, the fully enhanced global information and edge information of the object can be utilized.

[0098] In another embodiment, when performing instance segmentation on the image to be processed based on the first preliminary instance segmentation result and the transparency feature, the first preliminary instance segmentation result and the transparency feature can be spliced ​​(i.e., concat operation) to obtain a second splicing feature; instance segmentation is performed based on the second splicing feature to obtain an instance segmentation result of the target area.

[0099] Next, the first preliminary instance segmentation result and the transparency feature may be concatenated (eg, a concat operation) to obtain a second concatenated feature. When this implementation is adopted, the first preliminary instance segmentation result may be further enhanced by the transparency feature.

[0100] Afterwards, point convolution can be performed on the second concatenated feature to obtain the final mask map, that is, the instance segmentation result of the target area.

[0101] In this embodiment, the final instance segmentation result is obtained by further enhancing the first preliminary instance segmentation result by using the transparency feature on the basis of the first preliminary instance segmentation result, and can be regarded as the third enhancement of instance segmentation. In this way, the instance segmentation enhancement can be performed multiple times on the target area to continuously improve the precision of instance segmentation, thereby improving the accuracy of instance segmentation.

[0102] In some embodiments, the instance segmentation of the image to be processed described in the present application can be implemented by a neural network module.

[0103] Specifically, the instance segmentation module can be used to perform the operations of steps S102 to S103 above: determine the transparency features of the target area based on the deep features and the shallow features, and determine the first preliminary instance segmentation result of the image to be processed based on the deep features and the shallow features; perform instance segmentation on the image to be processed according to the fusion features and the transparency features to obtain the instance segmentation result of the target area.

[0104] Of course, in yet another embodiment, the instance segmentation module may be used to perform the operations of steps S101 to S103 described above.

[0105] Accordingly, refer to Figure 2 As shown, a flowchart of the steps of training a neural network model to obtain an instance segmentation module is shown. Specifically, the training can be obtained by the following steps:

[0106] Step S201: extracting features from a sample image to obtain deep features and shallow features of a sample area in the sample image.

[0107] In this embodiment, the process of extracting features from the sample image can be performed with reference to the above step S101, which will not be described in detail herein. The sample image may refer to an image that has been instance segmented.

[0108] The sample area may refer to an image area where the sample object is located in the sample image.

[0109] Step S202: input the deep features and shallow features of the sample area into a neural network model to generate an instance segmentation result of the sample area.

[0110] In this embodiment, the deep features and shallow features of the sample region may be used as training samples and input into the neural network model, thereby obtaining an instance segmentation result of the sample region output by the neural network model.

[0111] The process of generating instance segmentation results of the sample area by the neural network model can refer to the process described in the above embodiment, which will not be repeated here.

[0112] Step S203: determining the loss value of the neural network model according to the label corresponding to each pixel in the sample area and the instance segmentation result of the sample area.

[0113] Among them, the label corresponding to a pixel represents whether the pixel belongs to the foreground or the background.

[0114] In this embodiment, the label corresponding to each pixel point can indicate whether the pixel point belongs to the foreground or the background. For example, if the label is 1, it indicates that the pixel point belongs to the foreground, and if the label is 0, it indicates that the pixel point belongs to the background.

[0115] Among them, the loss value of the neural network model can be calculated according to the label corresponding to each pixel point in the sample area and the pixel value of each pixel point in the instance segmentation result of the sample area. The loss value can reflect the accuracy of the neural network model in instance segmentation.

[0116] Step S204: According to the loss value, the parameters of the neural network model are updated to obtain an instance segmentation module.

[0117] In this embodiment, the parameters of the neural network model can be updated according to the loss value. When the update reaches a preset number of times or the model converges, the training is stopped to obtain an instance segmentation module.

[0118] Accordingly, in some embodiments, the deep features of the sample region may also be processed to obtain the covariance corresponding to the sample region.

[0119] In the process of training the neural network model, the deep features of the sample area can be processed to obtain the covariance corresponding to the sample area, or the deep features of the sample area can be processed in advance to obtain the covariance, which is not limited here.

[0120] In this embodiment, the deep features of the sample area can be processed by performing convolution processing of the deep features of the sample area twice with a size of 3*3 and once with a size of 1*1, and then normalizing them through a sigmoid function to generate a variance prediction result, i.e., covariance. The value of the covariance can characterize the reliability of the instance segmentation result output by the neural network model.

[0121] Accordingly, when determining the loss value of the neural network model, the loss value of the neural network model may be determined according to the covariance, the label corresponding to each pixel in the sample area, and the instance segmentation result of the sample area, according to the following formula;

[0122]

[0123] Among them, y u is the label corresponding to the u-th pixel in the sample area, p u is the predicted value of the u-th pixel in the instance segmentation result of the sample area, used to predict whether the u-th pixel belongs to the foreground or the background, N is the total number of pixels in the sample area, σ i Denotes the covariance.

[0124] Among them, σ i 2 ∈[0,1],y u The value is 0 or 1, 1 represents foreground and 0 represents background.

[0125] In this embodiment, the larger the covariance, the more unreliable the instance segmentation result output by the neural network model, and the contribution to the loss function should be reduced. Conversely, the smaller the covariance, the more reliable the instance segmentation result output by the neural network model, and the contribution to the loss function should be increased.

[0126] By adopting the technical solution of the embodiment of the present application, during the process of training or updating the neural network model, the neural network model can be guided to pay more attention to those features that are easy to be misjudged (that is, it is uncertain whether a feature is the foreground or the background, which can be understood as the feature points that cause Loss oscillation), thereby achieving the effect of enhancing the significance of edge information. By using the above formula s to perform uncertain modeling on the edge information of the sample target area, the neural network model can be guided to pay more attention to those features that are easy to be misjudged.

[0127] The edge features of the target area referred to in the embodiment of the present application can be understood as the features on the outline of the object in the target area. The more perfect the features on the outline of the target object are, the more accurate the foreground and background can be divided, making the boundary between the foreground and background more obvious.

[0128] The following describes the image processing method according to an embodiment of the present application in combination with a specific example.

[0129] Reference Figure 3 As shown, the neural network model in this example is shown, which specifically includes a ROI (Region of interest pooling) pooling module and an instance segmentation module. Among them, shallow features and deep features can be obtained through the ROI pooling module, and the instance segmentation module can be used to perform instance segmentation based on shallow features and deep features. Specifically, the ROI pooling module can be independent of the instance segmentation module, or it can be located at the input end of the instance segmentation module. When the ROI pooling module is independent of the instance segmentation module, it can be located in the positioning module, or connected between the positioning module and the instance segmentation module.

[0130] like Figure 3 As shown, the ROI pooling module is independent of the instance segmentation module, the input end of the ROI pooling module is connected to the output end of the positioning module, the positioning module includes an FPN (feature pyramid networks) module and a backbone network module, and the output end of the ROI pooling module is connected to the input end of the instance segmentation module.

[0131] Accordingly, in some embodiments, the FPN module in the backbone network module can be used to perform multi-scale feature extraction and fusion on the image to be processed. After that, the features output by the FPN module are input into the ROI pooling module to obtain deep features, and the color features extracted from the image to be processed are input into the ROI pooling module. After ROI pooling, color features, i.e., shallow features, are obtained. In this way, the shallow features of the target area and the deep features of the target area can be obtained respectively through the ROI pooling module.

[0132] In this embodiment, the ROI pooling module can also be called the ROI Pooling layer. Among them, the image in the target area where the object in the processed image is located can be subjected to feature extraction processing of multiple scales, such as downsampling processing of multiple scales to obtain a multi-scale feature map, and then the obtained multi-scale feature map of the target area is fused and input into the ROI pooling module, and the ROI pooling module can be used to interpolate the fused features of the target area to a preset size, thereby outputting the deep features of the target area.

[0133] Among them, the image area selected by the target area can be first cropped from the image to be processed, and then the image area selected by the target area is input into the ROI pooling module, wherein the target area selected generally retains the color information of the original image, so the image area input into the ROI pooling module can be considered as an RGB image, and then, the ROI pooling module can perform feature extraction on the image area to obtain an RGB feature map, which is also called a shallow feature.

[0134] For example, Figure 3 As shown in FIG. 1 , the FPN module and the backbone network module can be used to extract features of various scales from the input image to be processed f0. The process of the backbone network module processing the input image to be processed is as follows: Figure 3 As shown in the figure, the image to be processed is continuously subjected to convolution processing and downsampling at various scales, wherein each layer in the backbone network module is connected to the corresponding network layer of the FPN module, and the multiple network layers of the FPN module sequentially downsample the target area where the target object is located, thereby outputting a multi-scale feature map of the target area where the target object is located, such as feature map f1, feature map f2, feature map f3, and feature map f4. Then, the feature map f1, feature map f2, feature map f3, and feature map f4 can be fused, and the fused feature map is input into the ROI pooling module, so that the ROI pooling module outputs the deep feature f of the target area. i At the same time, the image of the target area where the target object is located in the image to be processed f0 can also be compressed to a preset size, and the color features of the image to be processed can be extracted, and then the color features are input into the ROI pooling module to output the shallow features r of the target area. i .

[0135] The ROI pooling module of the embodiment of the present application can process the input image area at the same time, and can also process the multi-scale feature map of the image area, thereby increasing the scope of application of the ROI pooling module, avoiding the need to set up a separate module to extract features from the image area, and thus reducing the complexity of the entire neural network structure. In this way, the instance segmentation module and the ROI pooling module also achieve weight sharing, so a large amount of additional calculations will not be introduced, thereby improving the efficiency of instance segmentation.

[0136] Reference Figure 4 FIG. 1 is a schematic diagram showing the structure of an instance segmentation module according to an embodiment of the present application, combined with Figure 4 As shown, how the instance segmentation module of the present application generates a mask map of the target area and performs instance segmentation based on deep features and shallow features.

[0137] like Figure 4As shown, in this embodiment, the instance segmentation module at least includes: an initial instance segmentation module, an Alpha feature map generation module, and a mask map generation module:

[0138] The initial instance segmentation module is used to process the deep features of the target area to determine a second preliminary instance segmentation result of the image to be processed;

[0139] The Alpha feature map generation module is used to process the deep features of the target area and the shallow features of the target area to obtain the transparency features of the target area;

[0140] The mask map generation module is used to process the first preliminary instance segmentation result and the transparency feature to generate a mask map of the target area to complete the instance segmentation of the target area and obtain an instance segmentation result.

[0141] Among them, the initial instance segmentation module may include a feature fusion unit and multiple convolution units. The feature fusion unit can perform multiple convolution processes on the deep features of the target area, and fuse the shallow features with the deep features after multiple convolution processes to obtain fused features. The multiple convolution units can obtain the first preliminary instance segmentation result of the image to be processed based on the fused features.

[0142] Among them, the Alpha feature map generation module can be used to splice deep features and shallow features, and multiple convolution units are used to perform multiple convolutions on the spliced ​​feature map to obtain a transparency feature, which can fully characterize the transparency of the image of the target area in the Alpha channel.

[0143] The multiple convolution units may include a fifth convolution unit, a sixth convolution unit, and a second point convolution unit. Specifically, Figure 4 As shown, the mask map generation module may further include: a splicing unit and a third point convolution unit;

[0144] Among them, the fifth convolution unit and the sixth convolution unit can use a 3×3 convolution kernel to convolve the fusion features, and the second point convolution unit can use a 1×1 convolution kernel to convolve the feature map output by the sixth convolution unit, so as to obtain a first preliminary instance segmentation result of the target area. In this way, the first preliminary instance segmentation result of the target area can be input into the splicing unit.

[0145] The splicing unit is used to splice the first preliminary instance segmentation result and the transparency feature to obtain a second splicing feature.

[0146] The third point convolution unit is used to perform point convolution processing on the second splicing feature to generate a mask map of the target area, that is, an instance segmentation result of the target area. The point convolution processing refers to performing convolution processing on the second splicing feature using a 1×1 convolution kernel.

[0147] Reference Figure 5 As shown, a schematic diagram of the structure of the instance segmentation module in this example is shown. Figure 5 The internal detailed structure of each module in the instance segmentation module is shown in a refined manner, such as Figure 5 As shown in the dotted box, the initial instance segmentation module and the Alpha feature map generation module share some units, and the specific shared units are: the first convolution unit and the second convolution unit connected in sequence, the ternary map generation unit, and the first splicing unit.

[0148] In one embodiment, the ternary map generation unit is connected after the second convolution unit, and is used to process the feature map output by the second convolution unit to generate a ternary map of the target area, wherein the pixel value of each pixel in the ternary map represents: each pixel in the target area belongs to the foreground, background or unknown.

[0149] The first stitching unit is used to stitch the ternary image and the shallow features of the target area to obtain a first stitching feature.

[0150] Thus, the feature fusion unit in the initial instance segmentation module can be used to fuse the deep feature with the first splicing feature to obtain the fused feature. Accordingly, the Alpha feature map generation module also includes a third convolution unit and a fourth convolution unit, which are used to process the first splicing feature to obtain the transparency feature.

[0151] Among them, the first convolution unit and the second convolution unit can both be 3×3 convolution kernels, and the ternary map generated by the ternary map generation unit can be understood as: the pixel value of each pixel point in the ternary map represents that the pixel point is the foreground, background and unknown area, that is, three pixel values ​​are used to represent the foreground, background and unknown area in the target area.

[0152] Among them, the ternary image is one-channel, and the shallow feature is three-channel. Therefore, the first splicing unit splices the ternary image and the shallow feature, which can refer to: concat operation, that is, splicing the one-channel ternary image and the three-channel shallow feature in the channel dimension to obtain the splicing result.

[0153] Among them, the fusion unit is connected to the output end of the second convolution unit and the output end of the fourth convolution unit. Since the first convolution unit and the second convolution unit are used to process the deep features in sequence, thereby obtaining the processed deep features, and the third convolution unit and the fourth convolution unit are used to process the first splicing features in sequence, thereby obtaining the processed first splicing features, then, the features corresponding to the same position in the processed deep features and the processed first splicing features are added, which is equivalent to adding the deep features whose edge details are lost after interpolation to a preset size and the features after supplementing the edge information to obtain the fused features.

[0154] like Figure 5 As shown, in one embodiment, the first point convolution unit can be connected after the second convolution unit, and the first point convolution unit can be connected to the input end of the ternary map generation unit, so that the deep features are processed by the first convolution unit and the second convolution unit, and then pass through the first point convolution unit to obtain the background / foreground of the target area, that is, the rough mask map, and then pass through the ternary map generation unit to obtain the ternary map of the background / foreground / unknown area accuracy prompt. Among them, the first point convolution unit is a 1×1 convolution kernel.

[0155] The ternary map generation unit in the embodiment of the present application obtains the ternary map by performing dilation and erosion operations on the rough mask map. However, in other embodiments, the ternary map may also be obtained by other methods.

[0156] To facilitate understanding of the above technical solution of the present application, an example is provided below:

[0157] First, we make full use of the shallow features rich in edge information and the transparency characteristics of the image alpha channel to design a learnable self-supervised M2M module and a feature refinement and fusion module. The learnable self-supervised M2M module and the feature refinement and fusion module form the instance segmentation module shown in this application, and its structure is as follows: Figure 4 or Figure 5 As shown in Figure 2, the instance segmentation module can be used to supplement the edge information lost due to the ROI Pooling mechanism.

[0158] Among them, since the instance segmentation module is obtained by training a neural network model (such as CNN), the shallow layer of the CNN has rich high-frequency information such as edges. The color image will have four channels, RGBA, where RGB represents the three basic color channels of red, green, and blue, and A represents the Alpha channel, which describes the transparency of the image. However, in reality, the Alpha information is often not recorded during the image shooting process. Therefore, the instance segmentation module is needed to predict the Alpha information of the image.

[0159] Specifically, for example, for image A, the image size is S = (w, 9, 3), and the coordinates of the i-th target area predicted by the positioning module are Then the i-th target area is processed by ROI Pooling, that is, the corresponding RGB feature map obtained by the ROI pooling module of this application is r i (shallow feature), the shape is (3, 28, 28), the i-th target area also passes through the ROI pooling module to obtain the corresponding deep feature f i (deep features), shape is (256, 28, 28).

[0160] Next, the deep feature f i After two 3x3 convolutions and one 1x1 convolution, a rough mask map (representing foreground / background) CM is generated. i , the shape is (1, 28, 28); the rough mask map CM i The three-value graph Tr is produced as follows i :First, CM i Perform classic dilation and erosion operations, with the dilation kernel being (3, 3) and the number of iterations being 20. The result is recorded as Unknown. i , then the three-value graph Tr i =255*CM i +128*(Unknownn i -CM i ), with a shape of (1, 28, 28).

[0161] Then, the ternary graph Tr i Splice with the RGB feature map rj to get the first splicing result Cat i =[Tr i , R i ], the shape is (4, 28, 28), and after two 3x3 convolutions and one 1x1 convolution, the Alpha feature map (transparency feature) is predicted, and the shape of the Alpha feature map is (1, 28, 28).

[0162] Through the above steps, the deep features f are supplemented i The edge information is lost due to the ROI Pooling mechanism.

[0163] After that, the feature of the previous step of the Alpha feature map, that is, the first splicing result Cat i =[Tr i , R i ], the shape is (4, 28, 28), the features obtained after two 3x3 convolutions, and the deep features f i The features obtained after two 3x3 convolutions are added together for feature enhancement.

[0164] Finally, the predicted Alpha feature map is concatenated with the feature map after feature enhancement in the previous step, and then a 1x1 convolution is performed to obtain the mask map M. i , because each pixel in the Alpha feature map represents the transparency of each pixel, which is essentially the confidence that each pixel belongs to the foreground, so it plays a priori role.

[0165] By adopting the technical solution of the above-mentioned embodiment of the present application, the Alpha information of the image to be processed can be autonomously learned through the Alpha feature map generation module in the instance segmentation module, thereby predicting the Alpha feature map of the target area in the image to be processed. Since the Alpha feature map actually refers to the confidence that each pixel belongs to the foreground, it can play a priori role. Therefore, it is not necessary to record the Alpha information during the image shooting process. In the case of not recording the Alpha information, the technical purpose of supplementing the edge information of the target area lost by the deep features through the color information of each pixel of the image to be processed can still be achieved.

[0166] In the above embodiments, Figure 4 and Figure 5 The process of how the instance segmentation module of the present application generates a mask map for instance segmentation based on shallow features and deep features is described in detail.

[0167] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0168] Reference Figure 6 As shown, a structural block diagram of an image processing device according to an embodiment of the present invention is shown. Figure 6 As shown, the device may specifically include the following modules:

[0169] A feature extraction module 601 is used to extract features from the image to be processed, and obtain deep features and shallow features of the target area in the image to be processed;

[0170] A feature enhancement module 602, configured to determine a transparency feature of the target area based on the deep feature and the shallow feature;

[0171] A first segmentation module 603 determines a first preliminary instance segmentation result of the image to be processed based on the deep features and the shallow features;

[0172] The second segmentation module 604 is used to perform instance segmentation on the image to be processed according to the first preliminary instance segmentation result and the transparency feature to obtain an instance segmentation result of the target area.

[0173] Optionally, the feature enhancement module 602 specifically includes the following units:

[0174] A first processing unit, used for processing the deep features to obtain a ternary map corresponding to the target area;

[0175] A splicing unit, used for splicing the ternary image with the shallow feature to obtain a first splicing feature;

[0176] The second processing unit is used to process the first splicing feature to obtain the transparency feature.

[0177] Optionally, the first segmentation module 603 specifically includes the following units:

[0178] A first processing unit, used for processing the deep features to obtain a ternary map corresponding to the target area;

[0179] A first splicing unit, used for splicing the ternary image with the shallow feature to obtain a first splicing feature;

[0180] A fusion unit, used for fusing the deep feature with the first splicing feature to obtain the fused feature;

[0181] The initial segmentation unit is used to perform instance segmentation based on the fused features to obtain the first preliminary instance segmentation result.

[0182] Optionally, the first processing unit specifically includes:

[0183] A first segmentation subunit, configured to perform instance segmentation based on the deep features to obtain a second preliminary instance segmentation result of the target area;

[0184] a morphological processing subunit, configured to perform morphological processing on the second preliminary instance segmentation result to obtain a processed second preliminary instance segmentation result;

[0185] The ternary processing subunit is used to perform ternary processing on the processed second preliminary instance segmentation result to obtain a ternary map corresponding to the target area.

[0186] Optionally, the fusion unit comprises:

[0187] A first processing subunit is used to perform convolution processing on the deep features to obtain processed deep features;

[0188] A first splicing subunit, configured to perform convolution processing on the first splicing feature to obtain a processed first splicing feature;

[0189] The feature adding subunit is used to add the feature values ​​corresponding to the same position in the processed deep feature and the processed first splicing feature to obtain the fused feature.

[0190] Optionally, the second segmentation module 604 includes:

[0191] A second splicing unit, configured to splice the first preliminary instance segmentation result with the transparency feature to obtain a second splicing feature;

[0192] The segmentation unit is used to perform instance segmentation based on the second splicing feature to obtain an instance segmentation result of the target area.

[0193] Optionally, the instance segmentation of the image to be processed is implemented based on a neural network model; accordingly, the device further includes the following modules:

[0194] A sample feature extraction module is used to extract features from a sample image to obtain deep features and shallow features of a sample area in the sample image;

[0195] An input module, used for inputting the deep features and shallow features of the sample area into a neural network model to generate an instance segmentation result of the sample area;

[0196] A loss determination module, used to determine the loss value of the neural network model according to the labels corresponding to each pixel in the sample area and the instance segmentation result of the sample area, wherein the label corresponding to a pixel indicates whether the pixel belongs to the foreground or the background;

[0197] An updating module is used to update the parameters of the neural network model according to the loss value to obtain an instance segmentation module.

[0198] Optionally, the device further comprises:

[0199] A covariance processing module, used for processing the deep features of the sample area to obtain the covariance corresponding to the sample area;

[0200] The updating module is specifically used to determine the loss value of the neural network model according to the covariance, the label corresponding to each pixel in the sample area and the instance segmentation result of the sample area according to the following formula;

[0201]

[0202] Among them, y u is the label corresponding to the u-th pixel in the sample area, p u is the predicted value of the u-th pixel in the instance segmentation result of the sample area, used to predict whether the u-th pixel belongs to the foreground or the background, N is the total number of pixels in the sample area, σ i Denotes the covariance.

[0203] It should be noted that the device embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.

[0204] Reference Figure 7 As shown, a structural block diagram of an electronic device 700 according to an embodiment of the present application is shown. Figure 7 As shown, an electronic device provided by an embodiment of the present invention, the electronic device 700 can be used to execute an image processing method, and may include a memory 701, a processor 702, and a computer program stored in the memory and executable on the processor, wherein the processor 702 is configured to execute the image processing method.

[0205] like Figure 7 As shown, in one embodiment, the electronic device 700 can completely include an input device 703, an output device 704 and an image acquisition device 705, wherein, when executing the image processing method of the embodiment of the present application, the image acquisition device 705 can acquire the image to be processed, and then the input device 703 can obtain the image to be processed acquired by the image acquisition device 705, and the image to be processed can be processed by the processor 702 to perform instance segmentation on the image to be processed, and the output device 704 can output the segmentation result of the instance segmentation of the image to be processed.

[0206] Of course, in one embodiment, the memory 701 may include a volatile memory and a non-volatile memory, wherein the volatile memory may be understood as a random access memory for storing and saving data. A non-volatile memory refers to a computer memory in which the stored data does not disappear when the current is turned off. Of course, the computer program of the image processing method of the present application may be stored in a volatile memory and a non-volatile memory, or in either of the two.

[0207] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program that enables a processor to execute the image processing method as described in the embodiment of the present invention.

[0208] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0209] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0210] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0211] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0212] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0213] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0214] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0215] The above is a detailed introduction to an image processing method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An image processing method, characterized in that: The method comprises: Performing feature extraction on the image to be processed to obtain deep features and shallow features of the target area in the image to be processed; Determine the transparency feature of the target area based on the deep feature and the shallow feature, and determine the first preliminary instance segmentation result of the image to be processed based on the deep feature and the shallow feature; Performing instance segmentation on the image to be processed according to the first preliminary instance segmentation result and the transparency feature to obtain an instance segmentation result of the target area; Wherein, determining the transparency feature of the target area based on the deep feature and the shallow feature includes: The deep features are processed to obtain a ternary image corresponding to the target area; the pixel value of each pixel point in the ternary image represents whether the pixel point is a foreground, a background, or an unknown area; The ternary image and the shallow feature are spliced ​​to obtain a first spliced ​​feature; The first splicing feature is processed to obtain the transparency feature.

2. The method according to claim 1, characterized in that The step of determining a first preliminary instance segmentation result of the image to be processed based on the deep features and the shallow features includes: Processing the deep features to obtain a ternary map corresponding to the target area; The ternary image and the shallow feature are spliced ​​to obtain a first spliced ​​feature; The deep feature is fused with the first splicing feature to obtain a fused feature corresponding to the deep feature and the first splicing feature; Instance segmentation is performed based on the fused features to obtain the first preliminary instance segmentation result.

3. The method according to claim 1, characterized in that: The processing of the deep features to obtain a ternary map corresponding to the target area includes: Perform instance segmentation based on the deep features to obtain a second preliminary instance segmentation result of the target area; Performing morphological processing on the second preliminary instance segmentation result to obtain a processed second preliminary instance segmentation result; The processed second preliminary instance segmentation result is subjected to ternary processing to obtain a ternary map corresponding to the target area; the ternary processing refers to determining whether each pixel point in the second preliminary instance segmentation result belongs to the foreground, background and unknown area.

4. The method according to claim 2, characterized in that: The fusing the deep feature with the first splicing feature to obtain a fused feature corresponding to the deep feature and the first splicing feature includes: Performing convolution processing on the deep features to obtain processed deep features; Performing convolution processing on the first splicing feature to obtain a processed first splicing feature; The feature values ​​corresponding to the same position in the processed deep feature and the processed first spliced ​​feature are added to obtain the fused feature.

5. The method according to any one of claims 1 to 4, characterized in that: The step of performing instance segmentation on the image to be processed according to the first preliminary instance segmentation result and the transparency feature to obtain an instance segmentation result of the target area includes: Splicing the first preliminary instance segmentation result with the transparency feature to obtain a second splicing feature; Instance segmentation is performed based on the second splicing feature to obtain an instance segmentation result of the target area.

6. The method according to any one of claims 1 to 4, characterized in that: The instance segmentation of the image to be processed is achieved based on a neural network model; Accordingly, the neural network model is trained through the following steps: Extracting features from the sample image to obtain deep features and shallow features of the sample area in the sample image; Inputting the deep features and shallow features of the sample area into a neural network model to generate an instance segmentation result of the sample area; Determining the loss value of the neural network model according to the labels corresponding to each pixel in the sample area and the instance segmentation result of the sample area, wherein the label corresponding to a pixel indicates whether the pixel belongs to the foreground or the background; According to the loss value, the parameters of the neural network model are updated to obtain an instance segmentation module.

7. The method according to claim 6, characterized in that The method further comprises: Processing the deep features of the sample area to obtain the covariance corresponding to the sample area; Determining the loss value of the neural network model according to the label corresponding to each pixel point in the sample area and the instance segmentation result of the sample area includes: According to the covariance, the label corresponding to each pixel in the sample area and the instance segmentation result of the sample area, the loss value of the neural network model is determined according to the following formula; Among them, y u is the label corresponding to the u-th pixel in the sample area, p u is the predicted value of the u-th pixel in the instance segmentation result of the sample area, used to predict whether the u-th pixel belongs to the foreground or the background, N is the total number of pixels in the sample area, σ i Denotes the covariance.

8. An image processing device, characterized in that: The device comprises: A feature extraction module is used to extract features from the image to be processed to obtain deep features and shallow features of the target area in the image to be processed; A feature enhancement module, used for determining the transparency feature of the target area based on the deep feature and the shallow feature; A first segmentation module, used for determining a first preliminary instance segmentation result of the image to be processed based on the deep features and the shallow features; A second segmentation module, configured to perform instance segmentation on the image to be processed according to the first preliminary instance segmentation result and the transparency feature, to obtain an instance segmentation result of the target area; The feature enhancement module specifically includes the following units: A first processing unit is used to process the deep features to obtain a ternary map corresponding to the target area; the pixel value of each pixel point in the ternary map represents whether the pixel point is a foreground, a background, or an unknown area; A splicing unit, used for splicing the ternary image with the shallow feature to obtain a first splicing feature; The second processing unit is used to process the first splicing feature to obtain the transparency feature.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the image processing method according to any one of claims 1 to 7, the image processing method is implemented.

10. A computer-readable storage medium, characterized in that: The computer program stored therein enables the processor to execute the image processing method as described in any one of claims 1 to 7.