CN112669338A - Image segmentation method and device, electronic equipment and storage medium - Google Patents

Image segmentation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112669338A
CN112669338A CN202110024811.5A CN202110024811A CN112669338A CN 112669338 A CN112669338 A CN 112669338A CN 202110024811 A CN202110024811 A CN 202110024811A CN 112669338 A CN112669338 A CN 112669338A
Authority
CN
China
Prior art keywords
processed
prediction
network
level
feature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110024811.5A
Other languages
Chinese (zh)
Other versions
CN112669338B (en
Inventor
李祥泰
何昊
程光亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sensetime Technology Development Co Ltd
Original Assignee
Beijing Sensetime Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sensetime Technology Development Co Ltd filed Critical Beijing Sensetime Technology Development Co Ltd
Priority to CN202110024811.5A priority Critical patent/CN112669338B/en
Publication of CN112669338A publication Critical patent/CN112669338A/en
Application granted granted Critical
Publication of CN112669338B publication Critical patent/CN112669338B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The disclosure relates to an image segmentation method and apparatus, an electronic device, and a storage medium. The method comprises the following steps: acquiring a first to-be-processed feature of an image to be processed; obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed; adjusting the first feature to be processed according to the first edge prediction graph to obtain an adjusted first feature to be processed; and obtaining a first segmentation prediction graph of the image to be processed according to the adjusted first feature to be processed.

Description

Image segmentation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image segmentation method and apparatus, an electronic device, and a storage medium.
Background
Objects or transparent bodies with high reflectivity such as mirrors, glass and transparent cups are widely distributed in real life. There are a wide range of applications for identifying such objects in an image, for example, in visual navigation of a robot, the robot needs to avoid such obstacles in a path. Segmenting such objects in an image is a crucial pre-processing step in identifying such objects in an image. The accuracy of image segmentation will affect the accuracy of image recognition.
Disclosure of Invention
The present disclosure provides an image segmentation technical solution.
According to an aspect of the present disclosure, there is provided an image segmentation method including:
acquiring a first to-be-processed feature of an image to be processed;
obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed;
adjusting the first feature to be processed according to the first edge prediction graph to obtain an adjusted first feature to be processed;
and obtaining a first segmentation prediction graph of the image to be processed according to the adjusted first feature to be processed.
The method comprises the steps of obtaining a first feature to be processed of an image to be processed, obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed, adjusting the first feature to be processed according to the first edge prediction graph to obtain an adjusted first feature to be processed, and obtaining a first segmentation prediction graph of the image to be processed according to the adjusted first feature to be processed, so that the accuracy of image segmentation of the image to be processed can be improved by enhancing processing of edge information.
In a possible implementation manner, the obtaining a first edge prediction map of the image to be processed according to the first feature to be processed includes:
acquiring a first shallow feature of the image to be processed;
and obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed and the first shallow feature of the image to be processed.
In this implementation manner, the first to-be-processed feature of the to-be-processed image and the first shallow feature of the to-be-processed image are fused to perform edge prediction on the to-be-processed image, so that a more accurate first edge prediction graph of the to-be-processed image can be obtained by combining richer edge information in the first shallow feature of the to-be-processed image.
In a possible implementation manner, the adjusting the first to-be-processed feature according to the first edge prediction graph to obtain an adjusted first to-be-processed feature includes:
determining K first key points according to the first edge prediction graph, wherein K is an integer larger than 1;
and adjusting the initial features of the K first key points in the first to-be-processed features to obtain the adjusted first to-be-processed features.
In this implementation manner, K first keypoints are determined according to the first edge prediction graph, and initial features of the K first keypoints in the first to-be-processed features are adjusted, so that the obtained adjusted first to-be-processed features can more accurately express global edge information, and therefore, the accuracy of image segmentation on the to-be-processed image is further improved.
In a possible implementation manner, the determining K first key points according to the first edge prediction graph includes:
and determining K pixel points with the highest probability of belonging to the edge in the first edge prediction graph as K first key points.
The K pixel points with the highest edge probability in the first edge prediction graph are determined as K first key points, and the K first key points determined by the K first key points can more accurately represent the information of the edge of the image to be processed.
In a possible implementation manner, the adjusting initial features of the K first key points in the first to-be-processed feature to obtain an adjusted first to-be-processed feature includes:
obtaining initial features of the K first key points according to the first feature to be processed;
performing graph convolution operation on the initial features of the K first key points to obtain adjusted features of the K first key points;
and adjusting the initial characteristics of the K first key points in the first to-be-processed characteristic according to the adjusted characteristics of the K first key points to obtain the adjusted first to-be-processed characteristic.
Obtaining initial features of the K first key points according to the first to-be-processed features, performing graph convolution operation on the initial features of the K first key points to obtain adjusted features of the K first key points, and adjusting the initial features of the K first key points in the first to-be-processed features according to the adjusted features of the K first key points to obtain the adjusted first to-be-processed features, so that reasoning can be performed on a first undirected graph corresponding to the K first key points to obtain global context information, and the obtained adjusted first to-be-processed features can more accurately express global edge information.
In one possible implementation, the image segmentation method employs a neural network for processing, where the neural network includes N-level prediction subnetworks, where N is an integer greater than or equal to 1; any one of the N-level prediction subnetworks comprises a first module;
the obtaining of the first edge prediction graph of the image to be processed according to the first feature to be processed includes:
for any one level of the N levels of the prediction sub-networks, inputting the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network and the first shallow feature of the image to be processed into the first module of the level of the prediction sub-network, and outputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network through the first module of the level of the prediction sub-network.
The neural network is adopted for image segmentation, so that the accuracy and the speed of image segmentation on the image to be processed are improved. For any one level of the N-level prediction sub-networks, the first module of the level of the prediction sub-network processes the first to-be-processed feature of the to-be-processed image corresponding to the level of the prediction sub-network and the first shallow feature of the to-be-processed image, so that a preliminary prediction map of the to-be-processed image corresponding to the edge of the level of the prediction sub-network can be obtained quickly.
In a possible implementation manner, before the inputting, for any one of the N-level prediction sub-networks, the first to-be-processed feature of the to-be-processed image corresponding to the level prediction sub-network and the first shallow feature of the to-be-processed image into the first module of the level prediction sub-network, the method further includes:
acquiring an edge true value image of a training image and a non-edge true value image of the training image;
processing a second feature to be processed of the training image corresponding to the level prediction sub-network and a second shallow feature of the training image through a first module of the level prediction sub-network to obtain a second edge prediction graph of the training image corresponding to the level prediction sub-network and a non-edge prediction graph of the training image corresponding to the level prediction sub-network;
and training the neural network according to the second edge prediction graph of the training image corresponding to the level of the prediction sub-network, the non-edge prediction graph of the training image corresponding to the level of the prediction sub-network, the edge true value graph of the training image and the non-edge true value graph of the training image.
The neural network is trained by combining the non-edge prediction graph of the training image and the non-edge true value graph of the training image, and the second edge prediction graph of the training image and the edge true value graph of the training image, so that not only the edge part in the training image is supervised, but also the non-edge part in the training image is supervised, thereby being beneficial to the ability of the first module to learn to accurately perform edge representation, and further accurate edge representation can be generated through the first module.
In a possible implementation manner, the processing, by the first module of the class prediction sub-network, the second to-be-processed feature of the training image corresponding to the class prediction sub-network and the second shallow feature of the training image to obtain a second edge prediction graph of the training image corresponding to the class prediction sub-network and a non-edge prediction graph of the training image corresponding to the class prediction sub-network includes:
processing a second feature to be processed of the training image corresponding to the level prediction sub-network and a second shallow feature of the training image through a first module of the level prediction sub-network to obtain an edge feature of the training image corresponding to the level prediction sub-network;
obtaining a second edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the edge characteristics of the training image corresponding to the level of the prediction sub-network;
obtaining non-edge features of the training image corresponding to the level of the prediction sub-network according to the second to-be-processed features of the training image corresponding to the level of the prediction sub-network and the edge features of the training image corresponding to the level of the prediction sub-network;
and obtaining a non-edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the non-edge characteristics of the training image corresponding to the level of the prediction sub-network.
The non-edge features of the training image are obtained by utilizing the edge features of the training image, so that the non-edge part is predicted, and the accuracy of the edge prediction of the first module can be improved.
In a possible implementation manner, the obtaining, according to the non-edge feature of the training image corresponding to the class prediction sub-network, a non-edge prediction graph of the training image corresponding to the class prediction sub-network includes:
acquiring the middle layer characteristics of the training image corresponding to the level of the prediction sub-network;
and obtaining a non-edge prediction graph of the training image corresponding to the level prediction sub-network according to the non-edge characteristics of the training image corresponding to the level prediction sub-network and the intermediate layer characteristics of the training image corresponding to the level prediction sub-network.
By combining the training images with the intermediate layer characteristics of the prediction sub-network corresponding to the level, detailed information can be supplemented, and the accuracy of the neural network in non-edge prediction can be improved.
In one possible implementation, any one of the N-level prediction subnetworks includes a second module;
the adjusting the first to-be-processed feature according to the first edge prediction graph to obtain an adjusted first to-be-processed feature includes:
and for any one level of the N levels of the prediction sub-networks, inputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network and the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network into the second module of the level of the prediction sub-network, and outputting the adjusted first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network through the second module of the level of the prediction sub-network.
In this implementation, for any one of the N-level prediction subnetworks, the second module of the level prediction subnetwork processes the first edge prediction graph of the image to be processed corresponding to the level prediction subnetwork and the first to-be-processed feature of the image to be processed corresponding to the level prediction subnetwork, so that the adjusted first to-be-processed feature of the image to be processed corresponding to the level prediction subnetwork can be obtained quickly.
In one possible implementation, any one of the N-level prediction subnetworks further includes a third module;
before, for any one of the N-level prediction subnetworks, inputting the first edge prediction graph of the to-be-processed image corresponding to the level prediction subnetwork and the first to-be-processed feature of the to-be-processed image corresponding to the level prediction subnetwork into the second module of the level prediction subnetwork, the method further includes:
processing a second edge prediction image of a training image corresponding to the level prediction sub-network and a second to-be-processed feature of the training image corresponding to the level prediction sub-network through a second module of the level prediction sub-network to obtain an adjusted second to-be-processed feature of the training image corresponding to the level prediction sub-network;
processing the adjusted second feature to be processed of the training image corresponding to the level prediction sub-network through a third module of the level prediction sub-network to obtain a second segmentation prediction graph of the training image corresponding to the level prediction sub-network;
and training the neural network according to the segmentation true value graph of the training image and a second segmentation prediction graph of the training image corresponding to the level of the prediction sub-network.
In this implementation, the second module can effectively capture global edge information, and thus the accuracy of the third module in performing the partition prediction can be improved.
In one possible implementation, N is greater than 1, the neural network further comprising a feature extraction subnetwork;
the acquiring of the first feature to be processed of the image to be processed includes:
for any one level of prediction sub-network in the N-level prediction sub-network, in response to the level of prediction sub-network being a first level of prediction sub-network of the N-level prediction sub-network, extracting deep features of the image to be processed through the feature extraction sub-network to obtain a first feature to be processed of the image to be processed corresponding to the level of prediction sub-network;
and/or the presence of a gas in the gas,
and for any one of the N-level prediction sub-networks, in response to the fact that the level prediction sub-network is not the first-level prediction sub-network, obtaining a first to-be-processed feature of the to-be-processed image corresponding to the level prediction sub-network according to the adjusted first to-be-processed feature of the to-be-processed image corresponding to the previous-level prediction sub-network of the level prediction sub-network.
In this implementation, the use of more than two cascaded prediction subnetworks contributes to further improving the segmentation effect.
In a possible implementation manner, the obtaining a first segmentation prediction map of the image to be processed according to the adjusted first feature to be processed includes:
and processing the adjusted first to-be-processed feature of the to-be-processed image corresponding to the last-stage prediction sub-network through the last-stage prediction sub-network in the N-stage prediction sub-networks to obtain a first segmentation prediction graph of the to-be-processed image.
In this implementation, the accuracy of the first segmentation prediction map can be improved by using the output of the last stage of the prediction sub-network among the two or more cascaded prediction sub-networks as the first segmentation prediction map of the image to be processed.
In one possible implementation, the neural network is trained based on a weighted sum of the loss functions corresponding to the N-th prediction subnetworks.
In this implementation, joint training of the N-class prediction subnetworks contributes to an improvement in the overall segmentation effect of the neural network.
According to an aspect of the present disclosure, there is provided an image segmentation apparatus including:
the first acquisition module is used for acquiring a first to-be-processed feature of an image to be processed;
the first prediction module is used for obtaining a first edge prediction image of the image to be processed according to the first feature to be processed;
the first adjusting module is used for adjusting the first feature to be processed according to the first edge prediction graph to obtain an adjusted first feature to be processed;
and the second prediction module is used for obtaining a first segmentation prediction graph of the image to be processed according to the adjusted first feature to be processed.
In one possible implementation, the first prediction module is configured to:
acquiring a first shallow feature of the image to be processed;
and obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed and the first shallow feature of the image to be processed.
In one possible implementation manner, the first adjusting module is configured to:
determining K first key points according to the first edge prediction graph, wherein K is an integer larger than 1;
and adjusting the initial features of the K first key points in the first to-be-processed features to obtain the adjusted first to-be-processed features.
In one possible implementation manner, the first adjusting module is configured to:
and determining K pixel points with the highest probability of belonging to the edge in the first edge prediction graph as K first key points.
In one possible implementation manner, the first adjusting module is configured to:
obtaining initial features of the K first key points according to the first feature to be processed;
performing graph convolution operation on the initial features of the K first key points to obtain adjusted features of the K first key points;
and adjusting the initial characteristics of the K first key points in the first to-be-processed characteristic according to the adjusted characteristics of the K first key points to obtain the adjusted first to-be-processed characteristic.
In one possible implementation, the image segmentation method employs a neural network for processing, where the neural network includes N-level prediction subnetworks, where N is an integer greater than or equal to 1; any one of the N-level prediction subnetworks comprises a first module;
the first prediction module is to:
for any one level of the N levels of the prediction sub-networks, inputting the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network and the first shallow feature of the image to be processed into the first module of the level of the prediction sub-network, and outputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network through the first module of the level of the prediction sub-network.
In one possible implementation, the apparatus further includes:
the second acquisition module is used for acquiring an edge true value image of a training image and a non-edge true value image of the training image;
the third prediction module is used for processing a second feature to be processed of the training image corresponding to the level of the prediction sub-network and a second shallow feature of the training image through the first module of the level of the prediction sub-network to obtain a second edge prediction graph of the training image corresponding to the level of the prediction sub-network and a non-edge prediction graph of the training image corresponding to the level of the prediction sub-network;
and the first training module is used for training the neural network according to the second edge prediction graph of the training image corresponding to the level prediction sub-network, the non-edge prediction graph of the training image corresponding to the level prediction sub-network, the edge true value graph of the training image and the non-edge true value graph of the training image.
In one possible implementation, the third prediction module is configured to:
processing a second feature to be processed of the training image corresponding to the level prediction sub-network and a second shallow feature of the training image through a first module of the level prediction sub-network to obtain an edge feature of the training image corresponding to the level prediction sub-network;
obtaining a second edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the edge characteristics of the training image corresponding to the level of the prediction sub-network;
obtaining non-edge features of the training image corresponding to the level of the prediction sub-network according to the second to-be-processed features of the training image corresponding to the level of the prediction sub-network and the edge features of the training image corresponding to the level of the prediction sub-network;
and obtaining a non-edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the non-edge characteristics of the training image corresponding to the level of the prediction sub-network.
In one possible implementation, the third prediction module is configured to:
acquiring the middle layer characteristics of the training image corresponding to the level of the prediction sub-network;
and obtaining a non-edge prediction graph of the training image corresponding to the level prediction sub-network according to the non-edge characteristics of the training image corresponding to the level prediction sub-network and the intermediate layer characteristics of the training image corresponding to the level prediction sub-network.
In one possible implementation, any one of the N-level prediction subnetworks includes a second module;
the first adjusting module is used for:
and for any one level of the N levels of the prediction sub-networks, inputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network and the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network into the second module of the level of the prediction sub-network, and outputting the adjusted first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network through the second module of the level of the prediction sub-network.
In one possible implementation, any one of the N-level prediction subnetworks further includes a third module;
the device further comprises:
the second adjusting module is used for processing a second edge prediction image of a training image corresponding to the level prediction sub-network and a second to-be-processed feature of the training image corresponding to the level prediction sub-network through the second module of the level prediction sub-network to obtain an adjusted second to-be-processed feature of the training image corresponding to the level prediction sub-network;
the fourth prediction module is used for processing the adjusted second feature to be processed of the training image corresponding to the level of the prediction sub-network through the third module of the level of the prediction sub-network to obtain a second segmentation prediction graph of the training image corresponding to the level of the prediction sub-network;
and the second training module is used for training the neural network according to the segmentation true value graph of the training image and a second segmentation prediction graph of the training image corresponding to the level of the prediction sub-network.
In one possible implementation, N is greater than 1, the neural network further comprising a feature extraction subnetwork;
the first obtaining module is configured to:
for any one level of prediction sub-network in the N-level prediction sub-network, in response to the level of prediction sub-network being a first level of prediction sub-network of the N-level prediction sub-network, extracting deep features of the image to be processed through the feature extraction sub-network to obtain a first feature to be processed of the image to be processed corresponding to the level of prediction sub-network;
and/or the presence of a gas in the gas,
and for any one of the N-level prediction sub-networks, in response to the fact that the level prediction sub-network is not the first-level prediction sub-network, obtaining a first to-be-processed feature of the to-be-processed image corresponding to the level prediction sub-network according to the adjusted first to-be-processed feature of the to-be-processed image corresponding to the previous-level prediction sub-network of the level prediction sub-network.
In one possible implementation, the second prediction module is configured to:
and processing the adjusted first to-be-processed feature of the to-be-processed image corresponding to the last-stage prediction sub-network through the last-stage prediction sub-network in the N-stage prediction sub-networks to obtain a first segmentation prediction graph of the to-be-processed image.
In one possible implementation, the neural network is trained based on a weighted sum of the loss functions corresponding to the N-th prediction subnetworks.
According to an aspect of the present disclosure, there is provided an electronic device including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke the memory-stored executable instructions to perform the above-described method.
According to an aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
In the embodiment of the disclosure, a first feature to be processed of an image to be processed is obtained, a first edge prediction graph of the image to be processed is obtained according to the first feature to be processed, the first feature to be processed is adjusted according to the first edge prediction graph to obtain an adjusted first feature to be processed, and a first segmentation prediction graph of the image to be processed is obtained according to the adjusted first feature to be processed, so that the accuracy of image segmentation of the image to be processed can be improved by enhancing processing of edge information.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flowchart of an image segmentation method provided by an embodiment of the present disclosure.
Fig. 2 shows a schematic diagram of a first module provided by an embodiment of the present disclosure.
Fig. 3a shows a schematic diagram of a training image, fig. 3b shows a schematic diagram of a second edge prediction graph predicted by a neural network that does not supervise non-edge portions, fig. 3c shows a schematic diagram of a second edge prediction graph predicted by a neural network that supervises non-edge portions, and fig. 3d shows an edge true value graph of a training image.
Fig. 4 shows a schematic diagram of a second module provided by an embodiment of the present disclosure.
Fig. 5a shows a schematic diagram of a training image, fig. 5b shows a segmentation truth map of the training image, fig. 5c shows a schematic diagram of a second segmentation prediction map predicted by a neural network that does not adapt the second feature to be processed using the third module, and fig. 5d shows a schematic diagram of a second segmentation prediction map predicted by a neural network that adapts the second feature to be processed using the third module.
Fig. 6 shows a schematic diagram of a neural network provided by an embodiment of the present disclosure.
FIG. 7a shows a schematic of a segmentation truth map for a training image, FIG. 7b shows a schematic of a second edge prediction map for which the training image corresponds to a third-level prediction sub-network, and FIG. 7c shows a schematic of a second segmentation prediction map for which the training image corresponds to a third-level prediction sub-network.
Fig. 8 shows a block diagram of an image segmentation apparatus provided in an embodiment of the present disclosure.
Fig. 9 illustrates a block diagram of an electronic device 800 provided by an embodiment of the disclosure.
Fig. 10 shows a block diagram of an electronic device 1900 provided by an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
In the embodiment of the disclosure, a first feature to be processed of an image to be processed is obtained, a first edge prediction graph of the image to be processed is obtained according to the first feature to be processed, the first feature to be processed is adjusted according to the first edge prediction graph to obtain an adjusted first feature to be processed, and a first segmentation prediction graph of the image to be processed is obtained according to the adjusted first feature to be processed, so that the accuracy of image segmentation of the image to be processed can be improved by enhancing processing of edge information.
The following describes an image segmentation method provided by the embodiments of the present disclosure in detail with reference to the accompanying drawings. Fig. 1 shows a flowchart of an image segmentation method provided by an embodiment of the present disclosure. In one possible implementation, the image segmentation method may be performed by a terminal device or a server or other processing device. The terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, or a wearable device. In some possible implementations, the image segmentation method may be implemented by a processor calling computer readable instructions stored in a memory. As shown in fig. 1, the image segmentation method includes steps S11 through S14.
In step S11, a first feature to be processed of the image to be processed is acquired.
In step S12, a first edge prediction map of the image to be processed is obtained according to the first feature to be processed.
In step S13, the first feature to be processed is adjusted according to the first edge prediction graph, so as to obtain an adjusted first feature to be processed.
In step S14, a first segmentation prediction map of the image to be processed is obtained according to the adjusted first feature to be processed.
In the embodiment of the present disclosure, the image to be processed may represent an image that needs to be subjected to image segmentation. In the embodiment of the present disclosure, the target object to be segmented from the image may be a transparent body and/or an object with a high reflectivity, or may be any other object or person to be segmented. The transparent body may represent an object that allows light to pass through, for example, the transparent body may be a glass, a transparent cup, a transparent bottle, a window, or the like. The object having a high reflectance may refer to an object having a reflectance greater than or equal to a first preset value, for example, the object having a high reflectance may be a mirror or the like. For example, the first preset value may be 80% or 85%, and the like, which is not limited herein.
In the embodiment of the present disclosure, the first feature to be processed may represent a feature of the image to be processed, which is used for performing edge prediction. The first edge prediction graph represents an edge prediction graph of the image to be processed, for example, the first edge prediction graph may represent a preliminary prediction graph of edges of the image to be processed. In the first edge prediction graph, the pixel value of any pixel point may represent the probability that the corresponding pixel point in the image to be processed belongs to the edge. By adjusting the first feature to be processed according to the first edge prediction graph, the adjusted first feature to be processed obtained based on the preliminary prediction result of the edge of the image to be processed can more accurately represent the image to be processed. And performing segmentation prediction according to the adjusted first feature to be processed to obtain a first segmentation prediction graph of the image to be processed, so that the accuracy of image segmentation on the image to be processed can be improved. Wherein, the segmentation prediction may represent predicting a region where a target object in the image to be processed is located. In the first segmentation prediction graph, the pixel value of any pixel point may indicate whether the pixel point belongs to a target object, or the pixel value of any pixel point may indicate the probability that the pixel point belongs to the target object.
In a possible implementation manner, the obtaining a first edge prediction map of the image to be processed according to the first feature to be processed includes: acquiring a first shallow feature of the image to be processed; and obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed and the first shallow feature of the image to be processed. In this implementation, the first shallow feature of the image to be processed is different from the first feature to be processed. The first shallow feature of the image to be processed is a shallow feature of the image to be processed, that is, the first shallow feature of the image to be processed may represent a feature of the image to be processed output by a shallow layer of a feature extraction sub-network. The shallow layer of the feature extraction sub-network may refer to any one of the first S layers of the feature extraction sub-network, where S is an integer greater than or equal to 1, and the shallow layer of the feature extraction sub-network does not include the last layer of the feature extraction sub-network. For example, the first shallow feature of the image to be processed may be a feature of the image to be processed output by the first layer of the feature extraction sub-network. Of course, the first shallow feature of the image to be processed may also be a feature of the image to be processed output by other shallow layers of the feature extraction sub-network, which is not limited herein. Wherein, the feature extraction sub-network can adopt scaled ResNet or ResNet, etc. For example, the feature extraction sub-network may employ an encoder of deplab v3+, i.e., the feature extraction sub-network may include a first Layer (Layer1), a second Layer (Layer2), a third Layer (Layer3), a fourth Layer (Layer4), and an ASPP (aperture Spatial Pyramid Pooling) Layer of the encoder of deplab v3 +. For another example, the feature extraction sub-network may also adopt PSPNet or DANet, and the ASPP layer may be replaced by PPM (Pyramid Pooling Module) or DAM (Dual Attention Module). Wherein the first shallow feature of the image to be processed contains richer detail information (including edge information) in the image to be processed, thereby facilitating more accurate edge prediction of the image to be processed. In this implementation manner, the first to-be-processed feature of the to-be-processed image and the first shallow feature of the to-be-processed image are fused to perform edge prediction on the to-be-processed image, so that a more accurate first edge prediction graph of the to-be-processed image can be obtained by combining richer edge information in the first shallow feature of the to-be-processed image.
In one possible implementation, the first feature to be processed may include a deep feature of the image to be processed, and/or may include an adjusted deep feature of the image to be processed. For example, the deep features of the image to be processed may represent features of the image to be processed that are deep outputs of a feature extraction sub-network. For example, the first feature to be processed may include a feature of the image to be processed output by a last layer (e.g., ASPP layer) of a feature extraction sub-network. Wherein, the deep layer of the feature extraction sub-network may refer to a layer with a number of layers greater than S in the feature extraction sub-network. Of course, in other possible implementations, the first feature to be processed may not be a deep feature of the image to be processed, for example, the first feature to be processed may also be a shallow feature different from the first shallow feature of the image to be processed.
In a possible implementation manner, the adjusting the first to-be-processed feature according to the first edge prediction graph to obtain an adjusted first to-be-processed feature includes: determining K first key points according to the first edge prediction graph, wherein K is an integer larger than 1; and adjusting the initial features of the K first key points in the first to-be-processed features to obtain the adjusted first to-be-processed features. In this implementation manner, the K first keypoints do not include all the pixel points in the image to be processed, that is, all the pixel points of the image to be processed are not regarded as first keypoints. In this implementation manner, the first key point may be determined according to the probability that the pixel point in the first edge prediction graph belongs to the edge. For example, some or all of the pixel points predicted to belong to the edge in the first edge prediction graph may be used as the first key point. For example, K may be equal to 96, 90, 100, etc. Of course, those skilled in the art can flexibly set the size of K according to the requirements and/or experience of the actual application scenario, and is not limited herein. In this implementation manner, K first keypoints are determined according to the first edge prediction graph, and initial features of the K first keypoints in the first to-be-processed features are adjusted, so that the obtained adjusted first to-be-processed features can more accurately express global edge information, and therefore, the accuracy of image segmentation on the to-be-processed image is further improved.
As an example of this implementation, the determining K first keypoints according to the first edge prediction graph includes: and determining K pixel points with the highest probability of belonging to the edge in the first edge prediction graph as K first key points. In this example, K pixel points with the highest probability of belonging to an edge in the first edge prediction graph are determined as K first key points, and the K determined first key points can more accurately represent information of the edge of the image to be processed.
As another example of the implementation manner, if the number of the pixel points in the first edge prediction graph, of which the probability of belonging to the edge is greater than or equal to the second preset value, is greater than or equal to K, the K pixel points in the first edge prediction graph, of which the probability of belonging to the edge is the highest, may be determined as K first key points. If, in the first edge prediction graph, the number of pixels having the edge probability greater than or equal to the second preset value is smaller than K, for example, the number of pixels having the edge probability greater than or equal to the second preset value is K ', where K ' < K, all the pixels having the edge probability greater than or equal to the second preset value may be respectively used as the first key points, and the value of K may be adjusted to be equal to K '. For example, the second preset value may be equal to 0.9. Of course, those skilled in the art can flexibly set the second preset value according to the requirements and/or experience of the actual application scenario, and is not limited herein.
As an example of this implementation, the adjusting initial features of the K first key points in the first to-be-processed feature to obtain an adjusted first to-be-processed feature includes: obtaining initial features of the K first key points according to the first feature to be processed; performing graph convolution operation on the initial features of the K first key points to obtain adjusted features of the K first key points; and adjusting the initial characteristics of the K first key points in the first to-be-processed characteristic according to the adjusted characteristics of the K first key points to obtain the adjusted first to-be-processed characteristic. In this example, from the first edge prediction graph, the coordinates of the K first keypoints may be determined. According to the coordinates of the K first key points, the initial features of the K first key points can be obtained from the first feature to be processed. Wherein the initial features of the K first keypoints may represent features of the K first keypoints in the first feature to be processed. After the adjusted features of the K first keypoints are obtained, according to the coordinates of the K first keypoints, the initial features of the K first keypoints in the first to-be-processed feature may be replaced with the adjusted features of the K first keypoints, so as to obtain the adjusted first to-be-processed feature. Or, in the adjusted first to-be-processed feature, the feature of any first keypoint may be a weighted sum of the initial feature of the first keypoint and the adjusted feature. In this example, the initial features of the K first keypoints are obtained according to the first feature to be processed, the adjusted features of the K first keypoints are obtained by performing graph convolution on the initial features of the K first keypoints, and the initial features of the K first keypoints in the first feature to be processed are adjusted according to the adjusted features of the K first keypoints to obtain the adjusted first feature to be processed, so that inference can be performed on a first undirected graph corresponding to the K first keypoints to obtain global context information, and the obtained adjusted first feature to be processed can more accurately express global edge information.
In an example, a first undirected graph corresponding to the K first keypoints may be constructed, where the K first keypoints may be respectively used as nodes in the first undirected graph, and an edge may be established between every two first keypoints. The initial value of the weight of the edge between any two first key points in the K first key points may be 1, and of course, the initial value may also be flexibly set according to the requirements of the actual application scenario. And reasoning the first undirected graph corresponding to the K first key points through graph convolution so as to acquire global context information of the image to be processed. For example, equation 1 may be used to obtain the matrix G of the adjusted features of the K first keypointsout
Gout=σ(WgGin(I-Ag) Is given in the formula 1) is given,
wherein G isinA matrix representing initial features of the K first keypoints, I representing an identity matrix, AgAn adjacency matrix representing the correspondence of the K first key points, WgAnd representing the weight matrix corresponding to the K first key points, wherein the sigma () represents graph convolution operation. The features of the K first keypoints and the weights of the edges between different first keypoints will be updated via the graph convolution operation.
In one possible implementation, the image segmentation method is processed by using a neural network, and the neural network includes a feature extraction sub-network and an N-level prediction sub-network, where N is an integer greater than or equal to 1. Wherein, the feature extraction sub-network can be used for feature extraction, and the N-level prediction sub-network can be used for edge prediction and/or segmentation prediction. In this implementation, the number of levels of the prediction sub-network may be one or more than two levels. In the implementation mode, the neural network is adopted for image segmentation, so that the accuracy and the speed of image segmentation on the image to be processed are improved.
In one possible implementation, the image segmentation method employs a neural network for processing, where the neural network includes N-level prediction subnetworks, where N is an integer greater than or equal to 1; any one of the N-level prediction subnetworks comprises a first module; the obtaining of the first edge prediction graph of the image to be processed according to the first feature to be processed includes: for any one level of the N levels of the prediction sub-networks, inputting the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network and the first shallow feature of the image to be processed into the first module of the level of the prediction sub-network, and outputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network through the first module of the level of the prediction sub-network. Wherein the image to be processed corresponds to the first feature to be processed of the level prediction sub-network and may represent the first feature to be processed of the image to be processed input into the level prediction sub-network. The image to be processed corresponds to the first edge prediction graph of the level prediction sub-network, which may represent the first edge prediction graph of the image to be processed output by the level prediction sub-network. For example, for any one of the N-level prediction sub-networks, a first feature to be processed of the image to be processed corresponding to the level prediction sub-network and a first shallow feature of the image to be processed may be merged (configured), so as to obtain a first merging result of the image to be processed corresponding to the level prediction sub-network. The 3 × 3 convolutional layer may be used to convolve the first merging result of the to-be-processed image corresponding to the level prediction sub-network, so as to obtain the edge feature of the to-be-processed image corresponding to the level prediction sub-network. And (3) convolving the edge features of the image to be processed corresponding to the level prediction sub-network by using a 3 x 3 convolution layer to obtain a first edge prediction graph of the image to be processed corresponding to the level prediction sub-network. Of course, those skilled in the art may change the combination into the addition according to the requirements of the actual application scenario, and may also flexibly select the size of the convolution kernel, which is not limited herein. For any one level of the N-level prediction sub-networks, the first module of the level prediction sub-network processes the first to-be-processed feature of the to-be-processed image corresponding to the level of the prediction sub-network and the first shallow feature of the to-be-processed image, so that the preliminary prediction graph of the to-be-processed image corresponding to the edge of the level of the prediction sub-network can be obtained quickly.
In one example, in the case where N is greater than 1, the first feature to be processed of the image to be processed corresponding to different levels of the prediction sub-network may be different. In another example, in the case where N is greater than 1, the first feature to be processed of the image to be processed corresponding to the different levels of the prediction sub-network may be the same.
In one example, before the inputting, for any one of the N-level prediction sub-networks, the first feature to be processed of the image to be processed corresponding to the level prediction sub-network and the first shallow feature of the image to be processed into the first module of the level prediction sub-network, the method further includes: acquiring an edge true value image of a training image and a non-edge true value image of the training image; processing a second feature to be processed of the training image corresponding to the level prediction sub-network and a second shallow feature of the training image through a first module of the level prediction sub-network to obtain a second edge prediction graph of the training image corresponding to the level prediction sub-network and a non-edge prediction graph of the training image corresponding to the level prediction sub-network; and training the neural network according to the second edge prediction graph of the training image corresponding to the level of the prediction sub-network, the non-edge prediction graph of the training image corresponding to the level of the prediction sub-network, the edge D of the training image and the non-edge true value graph of the training image.
In this example, the training images may represent images used to train the neural network. The number of training images may be plural. The edge true value map of the training image may be used to represent true values for the positions of the edges of the target object in the training image. For example, the edge true value map of the training image may be the same size as the training image. If any pixel point in the training image belongs to the edge of the target object, the value of the pixel point in the edge true value graph of the training image can be 1; if any pixel point in the training image does not belong to the edge of the target object, the value of the pixel point in the edge true value graph of the training image may be 0. The non-edge truth map of the training image may be used to represent a true value for a position in the training image where a non-edge of a target object is located. For example, the non-edge true value map of the training image may be the same size as the training image. If any pixel point in the training image belongs to a non-edge region of the target object, the value of the pixel point in the non-edge true value graph of the training image may be 1; if any pixel point in the training image does not belong to the non-edge region of the target object, the value of the pixel point in the non-edge true value graph of the training image may be 0. The second feature to be processed represents a feature of the training image for edge prediction. The training image corresponds to a second feature to be processed of the class prediction sub-network and may represent the second feature to be processed of the training image for input into the class prediction sub-network. The second edge prediction graph may represent a preliminary prediction graph of edges of the training image. The training image corresponds to a second edge prediction graph of the level prediction sub-network, which may represent the second edge prediction graph of the training image output by the level prediction sub-network. The training images correspond to non-edge prediction maps of the class prediction sub-network, which may represent non-edge prediction maps of the training images output by the class prediction sub-network. In the second edge prediction graph of the training image corresponding to the level prediction sub-network, the pixel value of any pixel point may represent the probability that the corresponding pixel point in the training image predicted by the level prediction sub-network belongs to an edge. In the non-edge prediction graph of the training image corresponding to the level of the prediction sub-network, the pixel value of any pixel point may represent the probability that the corresponding pixel point in the training image predicted by the level of the prediction sub-network belongs to the non-edge.
In this example, the second shallow feature of the training image is different from the second feature to be processed of the training image corresponding to any level of the prediction sub-network. The second shallow features of the training image are shallow features of the training image, e.g., the second shallow features of the training image may represent features of the training image output by a shallow layer of a feature extraction sub-network. For example, the second shallow features of the training image may be features of the training image output by the first layer of the feature extraction sub-network. Of course, the second shallow feature of the training image may also be a feature of the training image output by other shallow layers of the feature extraction sub-network, which is not limited herein.
In one example, the second to-be-processed feature may include a deep feature of the training image, and/or may include an adjusted deep feature of the training image. Wherein the deep features of the training image may represent features of the training image that are deep outputs of a feature extraction sub-network. For example, the second feature to be processed may include a feature of the training image output by the last layer of the feature extraction sub-network. Of course, in other examples, the second feature to be processed may not be a deep feature of the training image, for example, a shallow feature different from the second shallow feature of the training image.
In one example, where N is greater than 1, the second pending features of the training image corresponding to different levels of the prediction sub-network may be different. In another example, where N is greater than 1, the second pending features of the training images corresponding to different levels of the prediction sub-network may be the same.
In this example, the neural network is trained by combining the non-edge prediction graph of the training image, the non-edge true value graph of the training image, and the second edge prediction graph of the training image, the edge true value graph of the training image, thereby supervising not only the edge portion in the training image but also the non-edge portion in the training image, thereby facilitating the first module to learn the ability to accurately represent edges, and thus being able to produce a more accurate edge representation by the first module.
In one example, the processing, by the first module of the class prediction sub-network, the second to-be-processed feature of the training image corresponding to the class prediction sub-network and the second shallow feature of the training image to obtain the second edge prediction graph of the training image corresponding to the class prediction sub-network and the non-edge prediction graph of the training image corresponding to the class prediction sub-network includes: processing a second feature to be processed of the training image corresponding to the level prediction sub-network and a second shallow feature of the training image through a first module of the level prediction sub-network to obtain an edge feature of the training image corresponding to the level prediction sub-network; obtaining a second edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the edge characteristics of the training image corresponding to the level of the prediction sub-network; obtaining non-edge features of the training image corresponding to the level of the prediction sub-network according to the second to-be-processed features of the training image corresponding to the level of the prediction sub-network and the edge features of the training image corresponding to the level of the prediction sub-network; and obtaining a non-edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the non-edge characteristics of the training image corresponding to the level of the prediction sub-network. In this example, the non-edge features of the training image are obtained by using the edge features of the training image, so that the non-edge part is predicted, and the accuracy of the edge prediction performed by the first module can be improved.
For example, in a case where the second shallow feature of the training image and the second feature to be processed of the training image corresponding to the class of prediction sub-network have different sizes, bilinear interpolation may be performed on the second shallow feature of the training image, so that the bilinear interpolated second shallow feature has the same size as the second feature to be processed of the training image corresponding to the class of prediction sub-network. After bilinear interpolation is performed on the second shallow feature of the training image, the second shallow feature of the training image and the second feature to be processed of the training image corresponding to the prediction sub-network of the level may be merged to obtain a second merging result of the training image corresponding to the prediction sub-network of the level. The second merging result of the training image corresponding to the class prediction sub-network may be convolved with a 3 × 3 convolution layer to obtain an edge feature of the training image corresponding to the class prediction sub-network. And (3) convolving the edge features of the training image corresponding to the level prediction sub-network by using a 3 x 3 convolution layer to obtain a second edge prediction graph of the training image corresponding to the level prediction sub-network. Of course, those skilled in the art may change the combination into the addition according to the requirements of the actual application scenario, and may also flexibly select the size of the convolution kernel, which is not limited herein.
For example, equation 2 may be used to obtain the edge feature F of the training image corresponding to the class prediction sub-networkedge
Fedge=FConv(Concat(Flow,Fmerge) Is) of the formula 2,
wherein, FmergeRepresenting a second feature to be processed of said training image corresponding to the prediction subnetwork of that level, FlowRepresenting a second shallow feature of the training image. Concat (F)low,Fmerge) Represents a pair FlowAnd FmergeAnd merging. In one example, at FlowAnd FmergeIn the case of different sizes of (2), in the pair FlowAnd FmergeBefore merging, F can be also combinedlowPerforming bilinear interpolation to make F after bilinear interpolationlowAnd FmergeAre the same size. FConv(Concat(Flow,Fmerge) Represents a pair of Concat (F)low,Fmerge) And performing convolution. For example, convolution can be performed using a 3 × 3 convolutional layer.
For example, the second feature to be processed of the training image corresponding to the class prediction sub-network may be subtracted from the edge feature of the training image corresponding to the class prediction sub-network to obtain the non-edge feature of the training image corresponding to the class prediction sub-network. For example, equation 3 may be used to obtain the non-edge feature F of the training image corresponding to the class prediction sub-networkresidual
Fresidual=Fmerge-FedgeAnd (3) formula.
For example, the obtaining a non-edge prediction graph of the training image corresponding to the class prediction sub-network according to the non-edge feature of the training image corresponding to the class prediction sub-network includes: acquiring the middle layer characteristics of the training image corresponding to the level of the prediction sub-network; and obtaining a non-edge prediction graph of the training image corresponding to the level prediction sub-network according to the non-edge characteristics of the training image corresponding to the level prediction sub-network and the intermediate layer characteristics of the training image corresponding to the level prediction sub-network. In this example, the training image corresponds to an intermediate layer feature of the prediction sub-network of any level, different from the second shallow feature of the training image, and different from the second pending feature of the prediction sub-network of any level. The intermediate layer features of the training image corresponding to any one level of the prediction subnetwork can be shallow features of the training image or deep features of the training image. The intermediate layer characteristics of the training images corresponding to different levels of the prediction subnetwork may be different or the same. In this example, by combining the training images with the intermediate layer features corresponding to the class prediction sub-network, detailed information can be supplemented, and the accuracy of the neural network in performing non-edge prediction can be improved.
For example, equation 4 may be used to obtain a non-edge prediction graph F of the training image corresponding to the class prediction sub-networkr
Fr=FConv(Concat(Fresidual,Frefine) Is) of the formula 4,
wherein, FrefineMeans intermediate layer characteristics, Concat (F), of said training images corresponding to the prediction subnetwork of that levelresidual,Frefine) Represents a pair FresidualAnd FrefineAre combined, FConv(Concat(Fresidual,Frefine) Represents a pair of Concat (F)residual,Frefine) And performing convolution.
Fig. 2 shows a schematic diagram of a first module provided by an embodiment of the present disclosure. As shown in FIG. 2, in the training phase of the neural network, the first module of any level of the prediction sub-network can correspond to the second feature to be processed F of the level of the prediction sub-network on the training imagemergeAnd a second shallow feature F of the training imagelowMerging (Concat), and after merging, convolving with a 3 × 3 convolution layer (conv) to obtain the edge feature F of the training image corresponding to the level of the prediction sub-networkedge. Predicting the edge feature F of the sub-network corresponding to the level of the training image by using a 3 x 3 convolutional layeredgePerforming convolution to obtain a second edge prediction graph F of the training image corresponding to the level prediction sub-networkb. A second edge prediction graph F corresponding to the level prediction subnetwork according to the training imagebAnd an edge true value graph of the training image, and a loss function L corresponding to a second edge prediction graph of the training image corresponding to the level prediction sub-network can be obtainededge. Corresponding the training image to the second feature F to be processed of the level prediction sub-networkmergeEdge feature F of the prediction subnetwork corresponding to the class with the training imageedgeBy subtraction, the non-edge feature F of the training image corresponding to the class prediction sub-network can be obtainedresidual. Corresponding the training image to the intermediate layer characteristic F of the level prediction sub-networkrefineNon-edge features F of the prediction sub-network corresponding to this level with said training imageresidualAfter merging, performing 3 × 3 convolution twice to obtain a non-edge prediction graph F of the training image corresponding to the level of prediction sub-networkr. Non-edge prediction graph F corresponding to the level of the prediction sub-network according to the training imagerAnd a non-edge true value graph of the training image, wherein a loss function L corresponding to the non-edge prediction graph of the level of the prediction sub-network corresponding to the training image can be obtainedresidual. Corresponding the training image to the edge characteristic F of the level prediction sub-networkedgeNon-edge features F of the prediction sub-network corresponding to this level with said training imageresidualAdding up, the second feature F to be processed of the training image corresponding to the prediction subnetwork of the class can be retrievedmergeAs input to the second module of the class prediction subnetwork. The edge prediction graph obtained by the lightweight first module shown in fig. 2 is helpful for improving the speed and accuracy of image segmentation.
Fig. 3a shows a schematic diagram of a training image, fig. 3b shows a schematic diagram of a second edge prediction graph predicted by a neural network that does not supervise non-edge portions, fig. 3c shows a schematic diagram of a second edge prediction graph predicted by a neural network that supervises non-edge portions, and fig. 3d shows an edge true value graph of a training image. As shown in fig. 3a to 3d, through learning of the non-edge portion, a more accurate edge prediction map can be obtained, and the predicted edge prediction map can become finer grained.
As one example of this implementation, any one of the N-level prediction subnetworks comprises a second module; the adjusting the first to-be-processed feature according to the first edge prediction graph to obtain an adjusted first to-be-processed feature includes: and for any one level of the N levels of the prediction sub-networks, inputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network and the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network into the second module of the level of the prediction sub-network, and outputting the adjusted first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network through the second module of the level of the prediction sub-network. The image to be processed corresponds to the adjusted first feature to be processed of the level prediction sub-network, and may represent the adjusted first feature to be processed of the image to be processed output by the level prediction sub-network. For any one of the N-level prediction sub-networks, the second module of the level prediction sub-network processes the first edge prediction graph of the image to be processed corresponding to the level prediction sub-network and the first feature to be processed of the image to be processed corresponding to the level prediction sub-network, so that the adjusted first feature to be processed of the image to be processed corresponding to the level prediction sub-network can be obtained quickly.
In one example, any one of the N-level prediction subnetworks further comprises a third module; before, for any one of the N-level prediction subnetworks, inputting the first edge prediction graph of the to-be-processed image corresponding to the level prediction subnetwork and the first to-be-processed feature of the to-be-processed image corresponding to the level prediction subnetwork into the second module of the level prediction subnetwork, the method further includes: processing a second edge prediction image of a training image corresponding to the level prediction sub-network and a second to-be-processed feature of the training image corresponding to the level prediction sub-network through a second module of the level prediction sub-network to obtain an adjusted second to-be-processed feature of the training image corresponding to the level prediction sub-network; processing the adjusted second feature to be processed of the training image corresponding to the level prediction sub-network through a third module of the level prediction sub-network to obtain a second segmentation prediction graph of the training image corresponding to the level prediction sub-network; and training the neural network according to the segmentation true value graph of the training image and a second segmentation prediction graph of the training image corresponding to the level of the prediction sub-network. The first module of the level prediction sub-network can add the edge features of the training image corresponding to the level prediction sub-network and the non-edge features of the training image corresponding to the level prediction sub-network to obtain the second to-be-processed features of the training image corresponding to the level prediction sub-network, and the obtained second to-be-processed features of the training image corresponding to the level prediction sub-network are input into the second module of the level prediction sub-network. Alternatively, the training image corresponding to the second feature to be processed of the class prediction sub-network may be directly input to the second module. In this example, the training image corresponds to a second partitioned prediction graph of the class prediction sub-network, which may represent the second partitioned prediction graph of the training image output by the class prediction sub-network. In the second segmentation prediction graph of the training image corresponding to the level prediction sub-network, the pixel value of any pixel point may represent the probability that the corresponding pixel point in the training image predicted by the level prediction sub-network belongs to the target object. In this example, the second module can effectively capture global edge information, thereby improving the accuracy of the third module in performing the partition prediction.
Fig. 4 shows a schematic diagram of a second module provided by an embodiment of the present disclosure. As shown in FIG. 4, for example, the training image corresponds to the level of the predicted subnetSecond edge prediction graph F of the complexbThe size of (d) may be H × W × 1. The training image may be mapped to a second edge prediction graph F of the class prediction sub-networkbAnd determining the K pixel points with the highest probability of belonging to the edge as K second key points. From the coordinates of the K second keypoints, a second feature to be processed F of the sub-network can be predicted from the training image corresponding to the levelmergeObtaining initial features of the K second keypoints. Wherein the training image corresponds to the second feature to be processed F of the class prediction subnetworkmergeThe size of (d) may be H × W × C. The initial features of the K second keypoints may represent second features F to be processed of the training image corresponding to the level prediction sub-networkmergeThe features of the K second keypoints in (a). In an example, a second undirected graph corresponding to the K second keypoints may be constructed, where the K second keypoints may be respectively used as nodes in the second undirected graph, and an edge may be established between every two second keypoints. The initial value of the edge weight between any two second key points in the K second key points may be 1, and of course, may also be flexibly set according to the requirements of the actual application scenario. And performing Graph convolution operation on the initial features of the K second key points by using a Graph Convolution (GCN) layer to obtain adjusted features of the K second key points. After obtaining the adjusted features of the K second keypoints, the training image may be corresponding to the second feature to be processed F of the class prediction sub-network according to the coordinates of the K second keypointsmergeReplacing the initial features of the K second key points with the adjusted features of the K second key points to obtain an adjusted second feature to be processed F of the training image corresponding to the level of the prediction sub-networkmerge'. Through the lightweight second module shown in fig. 4, the adjusted feature to be processed can be obtained quickly, thereby contributing to improving the speed of image segmentation.
Fig. 5a shows a schematic diagram of a training image, fig. 5b shows a segmentation truth map of the training image, fig. 5c shows a schematic diagram of a second segmentation prediction map predicted by a neural network that does not adapt the second feature to be processed using the third module, and fig. 5d shows a schematic diagram of a second segmentation prediction map predicted by a neural network that adapts the second feature to be processed using the third module. As shown in fig. 5a to 5d, a more accurate and smooth segmentation prediction graph can be obtained by adjusting the second feature to be processed by using the third module.
As one example of this implementation, N is greater than 1, the neural network further comprises a feature extraction subnetwork; the acquiring of the first feature to be processed of the image to be processed includes: for any one level of prediction sub-network in the N-level prediction sub-network, in response to the level of prediction sub-network being a first level of prediction sub-network of the N-level prediction sub-network, extracting deep features of the image to be processed through the feature extraction sub-network to obtain a first feature to be processed of the image to be processed corresponding to the level of prediction sub-network; and/or for any one of the N-level prediction sub-networks, in response to the fact that the level prediction sub-network is not the first-level prediction sub-network, obtaining a first to-be-processed feature of the to-be-processed image corresponding to the level prediction sub-network according to the adjusted first to-be-processed feature of the to-be-processed image corresponding to the previous-level prediction sub-network of the level prediction sub-network. For example, the feature of the image to be processed finally output by the feature extraction sub-network may be used as the first feature to be processed of the image to be processed corresponding to the first-level prediction sub-network. For example, the image to be processed may be input into a feature extraction sub-network, and the output of the last layer (e.g., ASPP layer) of the feature extraction sub-network may be taken as the first feature to be processed of the first-level prediction sub-network corresponding to the image to be processed. In this example, the use of more than two cascaded prediction subnetworks contributes to further improving the effect of segmentation.
In an example, the obtaining a first segmentation prediction map of the image to be processed according to the adjusted first feature to be processed includes: and processing the adjusted first to-be-processed feature of the to-be-processed image corresponding to the last-stage prediction sub-network through the last-stage prediction sub-network in the N-stage prediction sub-networks to obtain a first segmentation prediction graph of the to-be-processed image. In this example, the accuracy of the first segmentation prediction map can be improved by using the output of the last stage of the prediction sub-network in the cascaded two or more stages of prediction sub-networks as the first segmentation prediction map of the image to be processed.
In one example, the neural network is trained based on a weighted sum of the loss functions corresponding to the N-th prediction subnetworks. In this example, joint training of the N-class predictor sub-networks helps to improve the overall segmentation of the neural network.
Fig. 6 shows a schematic diagram of a neural network provided by an embodiment of the present disclosure. As shown in fig. 6, the neural network may employ a cascaded framework, which may include a feature extraction sub-network and a tertiary prediction sub-network. Wherein, the feature extraction sub-network may adopt an encoder of Deeplabv3 +. As shown in fig. 6, the feature extraction sub-network may include a first Layer (Layer1), a second Layer (Layer2), a third Layer (Layer3), a fourth Layer (Layer4), and an ASPP Layer of the encoder of deplaybv 3 +. Each level of the prediction subnetwork may include a first module, a second module, and a third module. The first Module may be RDM (modified Differential Module), the second Module may be PGM (Point based Graph volume network Module), and the third Module may be a prediction Module (Pred in fig. 6). As shown in fig. 6, the third module may include a 3 × 3 convolution (conv) layer, a normalization (bn) layer, an activation (relu) layer, and a 3 × 3 convolution layer. Of course, those skilled in the art can flexibly select the size of the convolution kernel, and may also select other activation functions (e.g., sigmoid, etc.), which is not limited herein.
In other possible implementations, a function for image segmentation may be designed in advance, and the image segmentation is performed on the image to be processed by using the pre-designed function, which is not limited herein.
The image segmentation method provided by the embodiment of the disclosure can significantly improve the segmentation accuracy for transparent bodies and objects with high reflectivity by enhancing edge learning, and can generally improve the segmentation accuracy for various objects. The embodiment of the disclosure can be applied to the application fields of computer vision, intelligent image processing, deep learning and the like, and can be applied to application scenes such as robot vision navigation, robot vision positioning, mechanical arm grabbing of an object, scene understanding, transparent body segmentation, mirror segmentation, transparent body matting, mirror matting, image segmentation and the like.
The following describes an image segmentation method provided by the embodiment of the present disclosure with a specific application scenario. In this application scenario, the image segmentation method may employ a neural network for processing, for example, the neural network may include a feature extraction sub-network and a tertiary prediction sub-network. The three levels of prediction sub-networks may be referred to as a first level prediction sub-network (e.g., the lowest RDM + PGM + Pred in fig. 6), a second level prediction sub-network (e.g., the middle RDM + PGM + Pred in fig. 6), and a third level prediction sub-network (e.g., the highest RDM + PGM + Pred in fig. 6), respectively.
In the training phase:
any training image can be input into a feature extraction sub-network, and the second shallow features (F) of the training image are output via a first layer of the feature extraction sub-networklow). The middle layer features of the training image may be output via the second, third and fourth layers of the feature extraction sub-network, respectively, e.g., the middle layer features of the training image may be denoted as Frefine. For example, the middle layer features of the training image for the second layer output of a feature extraction sub-network may be denoted as Frefine2The middle layer features of the training image output by the third layer of the feature extraction sub-network can be denoted as Frefine3The middle layer features of the training image output by the fourth layer of the feature extraction subnetwork can be noted as Frefine4. Via the ASPP of the feature extraction sub-network, a second feature to be processed of the training image corresponding to the first-level prediction sub-network may be output, e.g., the second feature to be processed of the training image corresponding to the first-level prediction sub-network may be denoted as Fmerge1
Input to a first module of a first-level prediction subnetworkIt may be included that said training image corresponds to a second feature to be processed F of the first-level prediction subnetworkmerge1(i.e., features of the ASPP output), second shallow features F of the training imagelowAnd mid-layer features F of the training image output by the fourth layer of the feature extraction sub-networkrefine4(ii) a The output of the first module of the first-level prediction subnetwork may comprise the second feature to be processed F of the training image corresponding to the first-level prediction subnetworkmerge1The training image corresponds to a second edge prediction graph F of the first-level prediction sub-networkb1And the training image corresponds to a non-edge prediction graph F of a first-level prediction sub-networkr1(ii) a The input to the second module of the first-level prediction subnetwork may comprise the second feature to be processed F of the training image corresponding to the first-level prediction subnetworkmerge1And said training image corresponds to a second edge prediction graph F of the first-level prediction subnetworkb1(ii) a The output of the second module of the first-level prediction sub-network may comprise the adjusted second feature to be processed F of the training image corresponding to the first-level prediction sub-networkmerge2(ii) a The input to the third module of the first-level prediction subnetwork may comprise the adjusted second feature to be processed F of the training image corresponding to the first-level prediction subnetworkmerge2(ii) a The output of the third module of the first-level prediction subnetwork may include a second segmentation prediction graph F of the training image corresponding to the first-level prediction subnetworkm1
The input to the first module of the second-level prediction subnetwork may comprise the second feature to be processed F of the training image corresponding to the second-level prediction subnetworkmerge2(i.e., the training image corresponds to the adjusted second feature to be processed of the first-level prediction sub-network), the second shallow feature F of the training imagelowAnd mid-level features F of the training image output by the third level of the feature extraction sub-networkrefine3(ii) a The output of the first module of the second level prediction subnetwork may comprise the second feature to be processed F of the training image corresponding to the second level prediction subnetworkmerge2The training image corresponds to a second edge prediction graph F of a second-stage prediction sub-networkb2And the training image corresponds to a non-edge prediction graph F of a second-level prediction sub-networkr2(ii) a The input to the second module of the second-level prediction subnetwork may comprise the second feature to be processed F of the training image corresponding to the second-level prediction subnetworkmerge2And the training image corresponds to a second edge prediction graph F of a second-level prediction subnetworkb2(ii) a The output of the second module of the second level prediction sub-network may comprise the adjusted second feature to be processed F of the training image corresponding to the second level prediction sub-networkmerge3(ii) a The input to the third module of the second level prediction sub-network may comprise the adjusted second feature to be processed F of the training image corresponding to the second level prediction sub-networkmerge3(ii) a The output of the third module of the second level prediction subnetwork may comprise a second segmentation prediction graph F of the training image corresponding to the second level prediction subnetworkm2
The input to the first module of the third-level prediction subnetwork may comprise the second feature to be processed F of the training image corresponding to the third-level prediction subnetworkmerge3(i.e., the training image corresponds to the adjusted second feature to be processed of the second-level prediction sub-network), the second shallow feature F of the training imagelowAnd mid-level features F of the training image output by the second level of the feature extraction sub-networkrefine2(ii) a The output of the first module of the third level prediction subnetwork may comprise the second pending feature F of the training image corresponding to the third level prediction subnetworkmerge3The training image corresponds to a second edge prediction graph F of a third-level prediction sub-networkb3And the training image corresponds to a non-edge prediction graph F of a third-level prediction sub-networkr3(ii) a The input to the second module of the third-level prediction subnetwork may comprise the second feature to be processed F of the training image corresponding to the third-level prediction subnetworkmerge3And the training image corresponds to a second edge prediction graph F of a third-level prediction sub-networkb3(ii) a The output of the second module of the third level prediction sub-network may comprise the adjusted second feature to be processed F of the training image corresponding to the third level prediction sub-networkmerge4(ii) a Third-level prediction of subnetworksThe input to the third module may comprise the adjusted second feature to be processed F of the training image corresponding to the third-level prediction sub-networkmerge4(ii) a The output of the third module of the third level prediction sub-network may include a second segmentation prediction graph F in which the training image corresponds to the third level prediction sub-networkm3
The loss function L of the neural network can be obtained by using equation 5:
L=α1L12L23L3in the formula 5, the first step is,
wherein L is1Representing the corresponding penalty function, L, of the first-level predictor sub-network2Representing the corresponding loss function, L, of the second-stage prediction subnetwork3Representing the loss function, α, corresponding to the third-level prediction subnetwork1Representing the weight, alpha, of the penalty function corresponding to the first-stage prediction subnetwork2Representing the weight, alpha, of the loss function corresponding to the second-stage prediction subnetwork2And representing the weight corresponding to the loss function corresponding to the third-level prediction sub-network. E.g. alpha1=α2=α31. Of course, those skilled in the art may also flexibly set the weight of the loss function corresponding to the tertiary prediction sub-network according to the requirements of the actual application scenario, which is not limited herein.
Wherein L is1、L2And L3Can be obtained using formula 6, formula 7 and formula 8, respectively:
L1=λ11Lresidual(Fr1,Gr)+λ12Ledge(Fb1,Gb)+λ13Lmerge(Fm1,Gm) In the formula (6), the compound is represented by the formula,
L2=λ21Lresidual(Fr2,Gr)+λ22Ledge(Fb2,Gb)+λ23Lmerge(Fm2,Gm) In the formula 7, the compound represented by the formula,
L3=λ31Lresidual(Fr3,Gr)+λ32Ledge(Fb3,Gb)+λ33Lmerge(Fm3,Gm) In the formula 8, the compound represented by the formula,
wherein G isrA non-edge true value graph, G, representing the training imagebAn edge truth map, G, representing the training imagemA segmentation truth map representing the training image. For example, GbThe width of the middle edge may be 8, and of course, those skilled in the art can flexibly determine G according to the actual application scene requirement and/or experiencebThe width of the middle edge. For example, in the non-edge true value graph G of the training imagerIn the method, the value of the pixel point belonging to the non-edge region of the target object may be 1, and the value of the pixel point not belonging to the non-edge region of the target object may be 0; edge truth map G in the training imagebIn the method, the value of the pixel point belonging to the edge of the target object may be 1, and the value of the pixel point not belonging to the edge of the target object may be 0; a segmentation truth map G in the training imagemIn the above description, the values of the pixels belonging to the target object may be 1, and the values of the pixels not belonging to the target object may be 0. Wherein the non-edge true value graph G of the training imagerThe pixel point with the value of 0 may include the segmentation true value graph G of the training imagemPixel point with median value of 0, and edge true value graph G of the training imagebAnd the pixel point with the median value of 0. I.e. the non-edge true value map G of the training imagerThe set of pixel points with a median value of 1 may be a segmentation truth map G of the training imagemSet of pixel points with median value of 1 and edge true value graph G of the training imagebDifference of pixel point set with median 1. I.e. the edge truth map G of the training imagebSet of pixel points with median value 1 and non-edge true value graph G of the training imagerThe union set of the pixel point sets with the median value of 1 can be a segmentation true value graph G of the training imagemA set of pixel points with a median of 1, and an edge true value graph G of the training imagebSet of pixel points with median value 1 and non-edge true value graph G of the training imagerThe intersection of the set of pixel points with a median value of 1 is an empty set.
Lresidual(Fr1,Gr) Non-edge prediction graph F representing the training image corresponding to a first-level prediction sub-networkr1Corresponding loss function, λ11Represents Lresidual(Fr1,Gr) A corresponding weight; l isedge(Fb1,Gb) A second edge prediction graph F representing said training image corresponding to a first-level prediction sub-networkb1Corresponding loss function, λ12Represents Ledge(Fb1,Gb) A corresponding weight; l ismerge(Fm1,Gm) A second segmentation prediction graph F representing said training image corresponding to a first-level prediction sub-networkm1Corresponding loss function, λ13Represents Lmerge(Fm1,Gm) A corresponding weight; wherein λ is11、λ12And λ13For superparameters, e.g. λ11=λ12=λ131, of course, those skilled in the art can flexibly set λ according to the requirements of practical application scenarios11、λ12And λ13The size of (2) is not limited herein.
Lresidual(Fr2,Gr) Non-edge prediction graph F representing the training image corresponding to a second-level prediction sub-networkr2Corresponding loss function, λ21Represents Lresidual(Fr2,Gr) A corresponding weight; l isedge(Fb2,Gb) A second edge prediction graph F representing said training image corresponding to a second-level prediction sub-networkb2Corresponding loss function, λ22Represents Ledge(Fb2,Gb) A corresponding weight; l ismerge(Fm2,Gm) A second segmentation prediction graph F representing said training image corresponding to a second-level prediction sub-networkm2Corresponding loss function, λ23Represents Lmerge(Fm2,Gm) A corresponding weight; wherein λ is21、λ22And λ23For superparameters, e.g. λ21=λ22=λ231, of course, those skilled in the art can flexibly set λ according to the requirements of practical application scenarios21、λ22And λ23The size of (2) is not limited herein.
Lresidual(Fr3,Gr) Non-edge prediction graph F representing the training image corresponding to a third-level prediction sub-networkr3Corresponding loss function, λ31Represents Lresidual(Fr3,Gr) A corresponding weight; l isedge(Fb3,Gb) A second edge prediction graph F representing the training image corresponding to a third-level prediction sub-networkb3Corresponding loss function, λ32Represents Ledge(Fb3,Gb) A corresponding weight; l ismerge(Fm3,Gm) A second segmentation prediction graph F representing the training image corresponding to a third-level prediction sub-networkm3Corresponding loss function, λ33Represents Lmerge(Fm3,Gm) A corresponding weight; wherein λ is31、λ32And λ33For superparameters, e.g. λ31=λ32=λ331, of course, those skilled in the art can flexibly set λ according to the requirements of practical application scenarios31、λ32And λ33The size of (2) is not limited herein.
The loss function corresponding to the non-edge prediction graph of the training image corresponding to any level of the prediction sub-network and the loss function corresponding to the second segmentation prediction graph of the training image corresponding to any level of the prediction sub-network can adopt a cross entropy loss function, and the loss function corresponding to the second edge prediction graph of the training image corresponding to any level of the prediction sub-network can adopt a booth (Dice) loss function. Of course, those skilled in the art can flexibly select the type of the loss function according to the requirements of the actual application scenario, and is not limited herein.
FIG. 7a shows a schematic of a segmentation truth map for a training image, FIG. 7b shows a schematic of a second edge prediction map for which the training image corresponds to a third-level prediction sub-network, and FIG. 7c shows a schematic of a second segmentation prediction map for which the training image corresponds to a third-level prediction sub-network.
In the application stage:
an image to be processed may be input into a feature extraction sub-network, and first shallow features of the image to be processed may be output via a first layer of the feature extraction sub-network. Via the ASPP layer of the feature extraction sub-network, the first to-be-processed feature of the image to be processed corresponding to the first-level prediction sub-network may be output.
The input of the first module of the first-level prediction subnetwork may comprise a first feature to be processed (i.e. a feature of the ASPP output) of the image to be processed corresponding to the first-level prediction subnetwork and a first shallow feature of the image to be processed; the output of the first module of the first-level prediction subnetwork may include a first to-be-processed feature of the to-be-processed image corresponding to the first-level prediction subnetwork and a first edge prediction graph of the to-be-processed image corresponding to the first-level prediction subnetwork; the input to the second module of the first-level prediction subnetwork may comprise a first to-be-processed feature of the to-be-processed image corresponding to the first-level prediction subnetwork and a first edge prediction graph of the to-be-processed image corresponding to the first-level prediction subnetwork; the output of the second module of the first-level prediction sub-network may include the adjusted first feature to be processed for which the image to be processed corresponds to the first-level prediction sub-network.
The input to the first module of the second-level prediction sub-network may include a first to-be-processed feature of the image to be processed corresponding to the second-level prediction sub-network (i.e., the image to be processed corresponds to the adjusted first to-be-processed feature of the first-level prediction sub-network) and a first shallow feature of the image to be processed; the output of the first module of the second level prediction subnetwork may comprise a first to-be-processed feature of the to-be-processed image corresponding to the second level prediction subnetwork and a first edge prediction graph of the to-be-processed image corresponding to the second level prediction subnetwork; the input to the second module of the second level prediction subnetwork may comprise a first to-be-processed feature for which the to-be-processed image corresponds to the second level prediction subnetwork and a first edge prediction graph for which the to-be-processed image corresponds to the second level prediction subnetwork; the output of the second module of the second level prediction sub-network may comprise the adjusted first feature to be processed for which the image to be processed corresponds to the second level prediction sub-network.
The input of the first module of the third-level prediction sub-network may include a first to-be-processed feature of the image to be processed corresponding to the third-level prediction sub-network (i.e., the image to be processed corresponds to the adjusted first to-be-processed feature of the second-level prediction sub-network) and a first shallow feature of the image to be processed; the output of the first module of the third level prediction subnetwork may include a first to-be-processed feature for which the to-be-processed image corresponds to the third level prediction subnetwork and a first edge prediction graph for which the to-be-processed image corresponds to the third level prediction subnetwork; the inputs to the second module of the third-level prediction subnetwork may include a first to-be-processed feature for which the to-be-processed image corresponds to the third-level prediction subnetwork and a first edge prediction graph for which the to-be-processed image corresponds to the third-level prediction subnetwork; the output of the second module of the third level prediction sub-network may include the adjusted first feature to be processed for which the image to be processed corresponds to the third level prediction sub-network; the input to the third module of the third level prediction sub-network may comprise the adjusted first feature to be processed for which the image to be processed corresponds to the third level prediction sub-network; the output of the third module of the third level prediction subnetwork may comprise a first segmentation prediction graph of the image to be processed corresponding to the third level prediction subnetwork.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides an image segmentation apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any image segmentation method provided by the present disclosure, and corresponding technical solutions and technical effects can be referred to in corresponding descriptions of the method sections, and are not described in detail again.
Fig. 8 shows a block diagram of an image segmentation apparatus provided in an embodiment of the present disclosure. As shown in fig. 8, the image segmentation apparatus includes:
a first obtaining module 21, configured to obtain a first feature to be processed of an image to be processed;
a first prediction module 22, configured to obtain a first edge prediction map of the image to be processed according to the first feature to be processed;
a first adjusting module 23, configured to adjust the first feature to be processed according to the first edge prediction graph to obtain an adjusted first feature to be processed;
and the second prediction module 24 is configured to obtain a first segmentation prediction map of the image to be processed according to the adjusted first feature to be processed.
In one possible implementation, the first prediction module 22 is configured to:
acquiring a first shallow feature of the image to be processed;
and obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed and the first shallow feature of the image to be processed.
In a possible implementation manner, the first adjusting module 23 is configured to:
determining K first key points according to the first edge prediction graph, wherein K is an integer larger than 1;
and adjusting the initial features of the K first key points in the first to-be-processed features to obtain the adjusted first to-be-processed features.
In a possible implementation manner, the first adjusting module 23 is configured to:
and determining K pixel points with the highest probability of belonging to the edge in the first edge prediction graph as K first key points.
In a possible implementation manner, the first adjusting module 23 is configured to:
obtaining initial features of the K first key points according to the first feature to be processed;
performing graph convolution operation on the initial features of the K first key points to obtain adjusted features of the K first key points;
and adjusting the initial characteristics of the K first key points in the first to-be-processed characteristic according to the adjusted characteristics of the K first key points to obtain the adjusted first to-be-processed characteristic.
In one possible implementation, the image segmentation method employs a neural network for processing, where the neural network includes N-level prediction subnetworks, where N is an integer greater than or equal to 1; any one of the N-level prediction subnetworks comprises a first module;
the first prediction module 22 is configured to:
for any one level of the N levels of the prediction sub-networks, inputting the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network and the first shallow feature of the image to be processed into the first module of the level of the prediction sub-network, and outputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network through the first module of the level of the prediction sub-network.
In one possible implementation, the apparatus further includes:
the second acquisition module is used for acquiring an edge true value image of a training image and a non-edge true value image of the training image;
the third prediction module is used for processing a second feature to be processed of the training image corresponding to the level of the prediction sub-network and a second shallow feature of the training image through the first module of the level of the prediction sub-network to obtain a second edge prediction graph of the training image corresponding to the level of the prediction sub-network and a non-edge prediction graph of the training image corresponding to the level of the prediction sub-network;
and the first training module is used for training the neural network according to the second edge prediction graph of the training image corresponding to the level prediction sub-network, the non-edge prediction graph of the training image corresponding to the level prediction sub-network, the edge true value graph of the training image and the non-edge true value graph of the training image.
In one possible implementation, the third prediction module is configured to:
processing a second feature to be processed of the training image corresponding to the level prediction sub-network and a second shallow feature of the training image through a first module of the level prediction sub-network to obtain an edge feature of the training image corresponding to the level prediction sub-network;
obtaining a second edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the edge characteristics of the training image corresponding to the level of the prediction sub-network;
obtaining non-edge features of the training image corresponding to the level of the prediction sub-network according to the second to-be-processed features of the training image corresponding to the level of the prediction sub-network and the edge features of the training image corresponding to the level of the prediction sub-network;
and obtaining a non-edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the non-edge characteristics of the training image corresponding to the level of the prediction sub-network.
In one possible implementation, the third prediction module is configured to:
acquiring the middle layer characteristics of the training image corresponding to the level of the prediction sub-network;
and obtaining a non-edge prediction graph of the training image corresponding to the level prediction sub-network according to the non-edge characteristics of the training image corresponding to the level prediction sub-network and the intermediate layer characteristics of the training image corresponding to the level prediction sub-network.
In one possible implementation, any one of the N-level prediction subnetworks includes a second module;
the first adjusting module 23 is configured to:
and for any one level of the N levels of the prediction sub-networks, inputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network and the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network into the second module of the level of the prediction sub-network, and outputting the adjusted first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network through the second module of the level of the prediction sub-network.
In one possible implementation, any one of the N-level prediction subnetworks further includes a third module;
the device further comprises:
the second adjusting module is used for processing a second edge prediction image of a training image corresponding to the level prediction sub-network and a second to-be-processed feature of the training image corresponding to the level prediction sub-network through the second module of the level prediction sub-network to obtain an adjusted second to-be-processed feature of the training image corresponding to the level prediction sub-network;
the fourth prediction module is used for processing the adjusted second feature to be processed of the training image corresponding to the level of the prediction sub-network through the third module of the level of the prediction sub-network to obtain a second segmentation prediction graph of the training image corresponding to the level of the prediction sub-network;
and the second training module is used for training the neural network according to the segmentation true value graph of the training image and a second segmentation prediction graph of the training image corresponding to the level of the prediction sub-network.
In one possible implementation, N is greater than 1, the neural network further comprising a feature extraction subnetwork;
the first obtaining module 21 is configured to:
for any one level of prediction sub-network in the N-level prediction sub-network, in response to the level of prediction sub-network being a first level of prediction sub-network of the N-level prediction sub-network, extracting deep features of the image to be processed through the feature extraction sub-network to obtain a first feature to be processed of the image to be processed corresponding to the level of prediction sub-network;
and/or the presence of a gas in the gas,
and for any one of the N-level prediction sub-networks, in response to the fact that the level prediction sub-network is not the first-level prediction sub-network, obtaining a first to-be-processed feature of the to-be-processed image corresponding to the level prediction sub-network according to the adjusted first to-be-processed feature of the to-be-processed image corresponding to the previous-level prediction sub-network of the level prediction sub-network.
In one possible implementation, the second prediction module 24 is configured to:
and processing the adjusted first to-be-processed feature of the to-be-processed image corresponding to the last-stage prediction sub-network through the last-stage prediction sub-network in the N-stage prediction sub-networks to obtain a first segmentation prediction graph of the to-be-processed image.
In one possible implementation, the neural network is trained based on a weighted sum of the loss functions corresponding to the N-th prediction subnetworks.
In the embodiment of the disclosure, a first feature to be processed of an image to be processed is obtained, a first edge prediction graph of the image to be processed is obtained according to the first feature to be processed, the first feature to be processed is adjusted according to the first edge prediction graph to obtain an adjusted first feature to be processed, and a first segmentation prediction graph of the image to be processed is obtained according to the adjusted first feature to be processed, so that the accuracy of image segmentation of the image to be processed can be improved by enhancing processing of edge information.
In some embodiments, functions or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementations and technical effects thereof may refer to the description of the above method embodiments, which are not described herein again for brevity.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-described method. The computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
The embodiment of the present disclosure also provides a computer program, which includes computer readable code, and when the computer readable code runs in an electronic device, a processor in the electronic device executes the computer program to implement the method described above.
The embodiments of the present disclosure also provide a computer program product for storing computer readable instructions, which when executed cause a computer to execute the operations of the image segmentation method provided in any one of the above embodiments.
An embodiment of the present disclosure further provides an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke the memory-stored executable instructions to perform the above-described method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 9 illustrates a block diagram of an electronic device 800 provided by an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 9, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as a wireless network (Wi-Fi), a second generation mobile communication technology (2G), a third generation mobile communication technology (3G), a fourth generation mobile communication technology (4G)/long term evolution of universal mobile communication technology (LTE), a fifth generation mobile communication technology (5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 10 shows a block diagram of an electronic device 1900 provided by an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 10, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as the Microsoft Server operating system (Windows Server), stored in the memory 1932TM) Apple Inc. of the present application based on the graphic user interface operating System (Mac OS X)TM) Multi-user, multi-process computer operating system (Unix)TM) Free and open native code Unix-like operating System (Linux)TM) Open native code Unix-like operating System (FreeBSD)TM) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (17)

1. An image segmentation method, comprising:
acquiring a first to-be-processed feature of an image to be processed;
obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed;
adjusting the first feature to be processed according to the first edge prediction graph to obtain an adjusted first feature to be processed;
and obtaining a first segmentation prediction graph of the image to be processed according to the adjusted first feature to be processed.
2. The method according to claim 1, wherein obtaining the first edge prediction map of the image to be processed according to the first feature to be processed comprises:
acquiring a first shallow feature of the image to be processed;
and obtaining a first edge prediction graph of the image to be processed according to the first feature to be processed and the first shallow feature of the image to be processed.
3. The method according to claim 1 or 2, wherein the adjusting the first to-be-processed feature according to the first edge prediction graph to obtain the adjusted first to-be-processed feature comprises:
determining K first key points according to the first edge prediction graph, wherein K is an integer larger than 1;
and adjusting the initial features of the K first key points in the first to-be-processed features to obtain the adjusted first to-be-processed features.
4. The method of claim 3, wherein determining K first keypoints from the first edge prediction graph comprises:
and determining K pixel points with the highest probability of belonging to the edge in the first edge prediction graph as K first key points.
5. The method according to claim 3 or 4, wherein the adjusting initial features of the K first keypoints in the first to-be-processed feature to obtain an adjusted first to-be-processed feature includes:
obtaining initial features of the K first key points according to the first feature to be processed;
performing graph convolution operation on the initial features of the K first key points to obtain adjusted features of the K first key points;
and adjusting the initial characteristics of the K first key points in the first to-be-processed characteristic according to the adjusted characteristics of the K first key points to obtain the adjusted first to-be-processed characteristic.
6. The method according to any one of claims 1 to 5, wherein the image segmentation method is processed by using a neural network, wherein the neural network comprises N-level prediction sub-networks, wherein N is an integer greater than or equal to 1; any one of the N-level prediction subnetworks comprises a first module;
the obtaining of the first edge prediction graph of the image to be processed according to the first feature to be processed includes:
for any one level of the N levels of the prediction sub-networks, inputting the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network and the first shallow feature of the image to be processed into the first module of the level of the prediction sub-network, and outputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network through the first module of the level of the prediction sub-network.
7. The method of claim 6, wherein before entering, for any one of the N-level prediction subnetworks, the first feature to be processed of the image to be processed corresponding to the level prediction subnetwork and the first shallow feature of the image to be processed into the first module of the level prediction subnetwork, the method further comprises:
acquiring an edge true value image of a training image and a non-edge true value image of the training image;
processing a second feature to be processed of the training image corresponding to the level prediction sub-network and a second shallow feature of the training image through a first module of the level prediction sub-network to obtain a second edge prediction graph of the training image corresponding to the level prediction sub-network and a non-edge prediction graph of the training image corresponding to the level prediction sub-network;
and training the neural network according to the second edge prediction graph of the training image corresponding to the level of the prediction sub-network, the non-edge prediction graph of the training image corresponding to the level of the prediction sub-network, the edge true value graph of the training image and the non-edge true value graph of the training image.
8. The method of claim 7, wherein the processing, by the first module of the class prediction sub-network, the second feature to be processed of the training image corresponding to the class prediction sub-network and the second shallow feature of the training image to obtain the second edge prediction graph of the training image corresponding to the class prediction sub-network and the non-edge prediction graph of the training image corresponding to the class prediction sub-network comprises:
processing a second feature to be processed of the training image corresponding to the level prediction sub-network and a second shallow feature of the training image through a first module of the level prediction sub-network to obtain an edge feature of the training image corresponding to the level prediction sub-network;
obtaining a second edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the edge characteristics of the training image corresponding to the level of the prediction sub-network;
obtaining non-edge features of the training image corresponding to the level of the prediction sub-network according to the second to-be-processed features of the training image corresponding to the level of the prediction sub-network and the edge features of the training image corresponding to the level of the prediction sub-network;
and obtaining a non-edge prediction graph of the training image corresponding to the level of the prediction sub-network according to the non-edge characteristics of the training image corresponding to the level of the prediction sub-network.
9. The method of claim 8, wherein obtaining the non-edge prediction graph of the training image corresponding to the class prediction sub-network based on the non-edge features of the training image corresponding to the class prediction sub-network comprises:
acquiring the middle layer characteristics of the training image corresponding to the level of the prediction sub-network;
and obtaining a non-edge prediction graph of the training image corresponding to the level prediction sub-network according to the non-edge characteristics of the training image corresponding to the level prediction sub-network and the intermediate layer characteristics of the training image corresponding to the level prediction sub-network.
10. The method of any of claims 6 to 9, wherein any of the N-class prediction subnetworks comprises a second module;
the adjusting the first to-be-processed feature according to the first edge prediction graph to obtain an adjusted first to-be-processed feature includes:
and for any one level of the N levels of the prediction sub-networks, inputting the first edge prediction graph of the image to be processed corresponding to the level of the prediction sub-network and the first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network into the second module of the level of the prediction sub-network, and outputting the adjusted first to-be-processed feature of the image to be processed corresponding to the level of the prediction sub-network through the second module of the level of the prediction sub-network.
11. The method of claim 10, wherein any of the N-class prediction subnetworks further comprises a third module;
before, for any one of the N-level prediction subnetworks, inputting the first edge prediction graph of the to-be-processed image corresponding to the level prediction subnetwork and the first to-be-processed feature of the to-be-processed image corresponding to the level prediction subnetwork into the second module of the level prediction subnetwork, the method further includes:
processing a second edge prediction image of a training image corresponding to the level prediction sub-network and a second to-be-processed feature of the training image corresponding to the level prediction sub-network through a second module of the level prediction sub-network to obtain an adjusted second to-be-processed feature of the training image corresponding to the level prediction sub-network;
processing the adjusted second feature to be processed of the training image corresponding to the level prediction sub-network through a third module of the level prediction sub-network to obtain a second segmentation prediction graph of the training image corresponding to the level prediction sub-network;
and training the neural network according to the segmentation true value graph of the training image and a second segmentation prediction graph of the training image corresponding to the level of the prediction sub-network.
12. The method of any one of claims 6 to 11, wherein N is greater than 1, the neural network further comprising a feature extraction sub-network;
the acquiring of the first feature to be processed of the image to be processed includes:
for any one level of prediction sub-network in the N-level prediction sub-network, in response to the level of prediction sub-network being a first level of prediction sub-network of the N-level prediction sub-network, extracting deep features of the image to be processed through the feature extraction sub-network to obtain a first feature to be processed of the image to be processed corresponding to the level of prediction sub-network;
and/or the presence of a gas in the gas,
and for any one of the N-level prediction sub-networks, in response to the fact that the level prediction sub-network is not the first-level prediction sub-network, obtaining a first to-be-processed feature of the to-be-processed image corresponding to the level prediction sub-network according to the adjusted first to-be-processed feature of the to-be-processed image corresponding to the previous-level prediction sub-network of the level prediction sub-network.
13. The method according to claim 12, wherein obtaining the first segmentation prediction map of the image to be processed according to the adjusted first feature to be processed comprises:
and processing the adjusted first to-be-processed feature of the to-be-processed image corresponding to the last-stage prediction sub-network through the last-stage prediction sub-network in the N-stage prediction sub-networks to obtain a first segmentation prediction graph of the to-be-processed image.
14. The method of claim 12 or 13, wherein the neural network is trained on a weighted sum of the loss functions corresponding to the N-th prediction subnetworks.
15. An image segmentation apparatus, comprising:
the first acquisition module is used for acquiring a first to-be-processed feature of an image to be processed;
the first prediction module is used for obtaining a first edge prediction image of the image to be processed according to the first feature to be processed;
the first adjusting module is used for adjusting the first feature to be processed according to the first edge prediction graph to obtain an adjusted first feature to be processed;
and the second prediction module is used for obtaining a first segmentation prediction graph of the image to be processed according to the adjusted first feature to be processed.
16. An electronic device, comprising:
one or more processors;
a memory for storing executable instructions;
wherein the one or more processors are configured to invoke the memory-stored executable instructions to perform the method of any one of claims 1 to 14.
17. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 14.
CN202110024811.5A 2021-01-08 2021-01-08 Image segmentation method and device, electronic equipment and storage medium Active CN112669338B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110024811.5A CN112669338B (en) 2021-01-08 2021-01-08 Image segmentation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110024811.5A CN112669338B (en) 2021-01-08 2021-01-08 Image segmentation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112669338A true CN112669338A (en) 2021-04-16
CN112669338B CN112669338B (en) 2023-04-07

Family

ID=75413790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110024811.5A Active CN112669338B (en) 2021-01-08 2021-01-08 Image segmentation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112669338B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116612288A (en) * 2023-07-19 2023-08-18 南京信息工程大学 Multi-scale lightweight real-time semantic segmentation method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10482603B1 (en) * 2019-06-25 2019-11-19 Artificial Intelligence, Ltd. Medical image segmentation using an integrated edge guidance module and object segmentation network
CN110782468A (en) * 2019-10-25 2020-02-11 北京达佳互联信息技术有限公司 Training method and device of image segmentation model and image segmentation method and device
CN111062924A (en) * 2019-12-17 2020-04-24 腾讯科技(深圳)有限公司 Image processing method, device, terminal and storage medium
CN111445493A (en) * 2020-03-27 2020-07-24 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN111523548A (en) * 2020-04-24 2020-08-11 北京市商汤科技开发有限公司 Image semantic segmentation and intelligent driving control method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10482603B1 (en) * 2019-06-25 2019-11-19 Artificial Intelligence, Ltd. Medical image segmentation using an integrated edge guidance module and object segmentation network
CN110782468A (en) * 2019-10-25 2020-02-11 北京达佳互联信息技术有限公司 Training method and device of image segmentation model and image segmentation method and device
CN111062924A (en) * 2019-12-17 2020-04-24 腾讯科技(深圳)有限公司 Image processing method, device, terminal and storage medium
CN111445493A (en) * 2020-03-27 2020-07-24 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN111523548A (en) * 2020-04-24 2020-08-11 北京市商汤科技开发有限公司 Image semantic segmentation and intelligent driving control method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
XIANGTAI LI等: "Improving Semantic Segmentation via Decoupled Body and Edge Supervision", 《ARXIV》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116612288A (en) * 2023-07-19 2023-08-18 南京信息工程大学 Multi-scale lightweight real-time semantic segmentation method and system
CN116612288B (en) * 2023-07-19 2023-11-07 南京信息工程大学 Multi-scale lightweight real-time semantic segmentation method and system

Also Published As

Publication number Publication date
CN112669338B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN110378976B (en) Image processing method and device, electronic equipment and storage medium
CN110287874B (en) Target tracking method and device, electronic equipment and storage medium
CN110647834B (en) Human face and human hand correlation detection method and device, electronic equipment and storage medium
CN109522910B (en) Key point detection method and device, electronic equipment and storage medium
CN111340766B (en) Target object detection method, device, equipment and storage medium
CN111310616B (en) Image processing method and device, electronic equipment and storage medium
CN112241673B (en) Video processing method and device, electronic equipment and storage medium
US11301726B2 (en) Anchor determination method and apparatus, electronic device, and storage medium
CN109544560B (en) Image processing method and device, electronic equipment and storage medium
CN111507408B (en) Image processing method and device, electronic equipment and storage medium
CN110798630B (en) Image processing method and device, electronic equipment and storage medium
CN110889469A (en) Image processing method and device, electronic equipment and storage medium
CN110674719A (en) Target object matching method and device, electronic equipment and storage medium
CN111340048B (en) Image processing method and device, electronic equipment and storage medium
CN109145970B (en) Image-based question and answer processing method and device, electronic equipment and storage medium
CN111414963B (en) Image processing method, device, equipment and storage medium
CN111553864A (en) Image restoration method and device, electronic equipment and storage medium
CN110675355B (en) Image reconstruction method and device, electronic equipment and storage medium
CN113841179A (en) Image generation method and device, electronic device and storage medium
CN111311588B (en) Repositioning method and device, electronic equipment and storage medium
CN111882558A (en) Image processing method and device, electronic equipment and storage medium
CN111523555A (en) Image processing method and device, electronic equipment and storage medium
CN109635926B (en) Attention feature acquisition method and device for neural network and storage medium
CN111369482A (en) Image processing method and device, electronic equipment and storage medium
CN113052874B (en) Target tracking method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant