CN110415258B - Image processing method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN110415258B
CN110415258B CN201910691280.8A CN201910691280A CN110415258B CN 110415258 B CN110415258 B CN 110415258B CN 201910691280 A CN201910691280 A CN 201910691280A CN 110415258 B CN110415258 B CN 110415258B
Authority
CN
China
Prior art keywords
feature
network
image
features
processing
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.)
Active
Application number
CN201910691280.8A
Other languages
Chinese (zh)
Other versions
CN110415258A (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.)
Shenzhen Sensetime Technology Co Ltd
Original Assignee
Shenzhen Sensetime Technology 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 Shenzhen Sensetime Technology Co Ltd filed Critical Shenzhen Sensetime Technology Co Ltd
Priority to CN201910691280.8A priority Critical patent/CN110415258B/en
Publication of CN110415258A publication Critical patent/CN110415258A/en
Application granted granted Critical
Publication of CN110415258B publication Critical patent/CN110415258B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The present disclosure relates to an image processing method and apparatus, an electronic device, and a storage medium, the method including: performing feature extraction processing on an image to be processed to obtain at least two first features; performing first fusion processing on the first characteristic to obtain a second characteristic; and obtaining a segmentation coefficient map according to the second characteristic and the image to be processed. According to the image processing method disclosed by the embodiment of the disclosure, the segmentation coefficient graph can be obtained to guide segmentation processing, manual labeling is not needed, the manual workload is reduced, and the working efficiency is improved. And moreover, the first features are fused to obtain second features, and a segmentation coefficient map comprising the first image area and the second image area is obtained through the second features and the image to be processed, so that uncertain areas are reduced, errors in the segmentation coefficient map are reduced, and the segmentation effect is improved.

Description

Image processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
Background
Dividing a target object in an image from a background and extracting an area where the target object is located generally requires using a three-segment map, which is a guide map for marking a determined target object in an original image and determining the background and an uncertain area. In the related art, segmentation by the trimap image generally has some errors in an uncertain region, resulting in poor segmentation effect.
Disclosure of Invention
The disclosure provides an image processing method and device, an electronic device and a storage medium.
According to an aspect of the present disclosure, there is provided an image processing method including:
performing feature extraction processing on an image to be processed to obtain at least two first features, wherein different first features are used for expressing different attributes of a target object in the image to be processed;
performing first fusion processing on the at least two first characteristics to obtain second characteristics;
and obtaining a segmentation coefficient map according to the second feature and the image to be processed, wherein the segmentation coefficient map is used for distinguishing a first image area where the target object is located in the image to be processed and a second image area outside the first image area.
According to the image processing method disclosed by the embodiment of the disclosure, the segmentation coefficient graph can be obtained to guide segmentation processing, manual labeling is not needed, the manual workload is reduced, and the working efficiency is improved. And moreover, the first features are fused to obtain second features, and a segmentation coefficient map comprising the first image area and the second image area is obtained through the second features and the image to be processed, so that uncertain areas are reduced, errors in the segmentation coefficient map are reduced, and the segmentation effect is improved.
In a possible implementation manner, performing a first fusion process on the at least two first features to obtain a second feature includes:
performing first convolution processing on each first feature to obtain a third feature corresponding to each first feature;
performing interpolation processing on each third feature to obtain a fourth feature corresponding to each third feature, wherein the size of each fourth feature is the same;
and performing feature transformation processing on the fourth feature to obtain the second feature.
In a possible implementation manner, performing feature transformation processing on the fourth feature to obtain the second feature includes:
combining at least two of the fourth features to obtain a fifth feature;
and activating and performing second convolution processing on the fifth feature to obtain the second feature.
In a possible implementation manner, the combining at least two of the fourth features to obtain the fifth feature includes at least one of the following manners:
merging the at least two fourth features to obtain a fifth feature;
and averaging the corresponding pixel points of the at least two fourth characteristics respectively to obtain the fifth characteristics.
By the method, the first features corresponding to the multiple hierarchies of the first network can be subjected to feature fusion, the semantic information of the first features can be reserved by the fused second features, and the accuracy of segmenting the coefficient graph is improved.
In one possible implementation, the method further includes:
and processing the image to be processed according to the segmentation coefficient map to obtain a target image.
In a possible implementation manner, processing the image to be processed according to the segmentation coefficient map to obtain a target image includes:
and multiplying each pixel point of the segmentation coefficient graph and the corresponding pixel point in the image to be processed respectively to obtain the target image.
In a possible implementation manner, the performing feature extraction processing on the image to be processed to obtain at least two first features includes:
the image to be processed is input to a first network, and at least two first features output by at least two levels in the first network are obtained.
In a possible implementation manner, the obtaining a segmentation coefficient map according to the second feature and the image to be processed includes:
extracting a sixth feature according to the image to be processed;
performing second fusion processing on the sixth characteristic and the second characteristic to obtain a seventh characteristic;
and obtaining a segmentation coefficient map according to the seventh feature.
In a possible implementation manner, the extracting a sixth feature according to the image to be processed includes:
inputting the image to be processed into a second network, and obtaining a sixth feature output by a preset level of the second network, wherein the sixth feature has the same feature dimension as the second feature, and the second network comprises at least two levels arranged in sequence;
said deriving a partition coefficient map according to said seventh feature comprises:
processing the seventh feature through a level subsequent to a preset level of the second network to obtain a partition coefficient map.
In one possible implementation, the second network includes an encoding subnetwork and a decoding subnetwork, wherein the encoding subnetwork includes at least one level, the decoding subnetwork includes at least one level, and the preset level includes at least one level in the encoding subnetwork and at least one level in the decoding subnetwork.
In one possible implementation, the method is implemented by a neural network comprising a first network, a second network and a feature fusion network,
wherein the method further comprises:
training at least one of the second network and the feature fusion network through the trained first network, a sample image, and a sample segmentation coefficient map corresponding to the sample image.
In one possible implementation, the training at least one of the second network and the feature fusion network by the trained first network, a sample image, and a sample segmentation coefficient map corresponding to the sample image includes:
inputting the sample images into the trained first network and the trained second network respectively to obtain a training segmentation coefficient graph output by the second network;
determining a loss function of the second network and the feature fusion network according to the segmentation coefficient map and the sample segmentation coefficient map;
and adjusting at least one of the second network and the feature fusion network according to the loss function, wherein the feature fusion network is used for fusing the features output by the trained first network and inputting the fused features into the second network.
In a possible implementation manner, the inputting the sample image to the trained first network and the trained second network respectively to obtain a training segmentation coefficient map output by the second network includes:
inputting the sample image into the trained first network to obtain at least two first training features output by at least two levels in the trained first network;
inputting the at least two first training features into the feature fusion network to obtain second training features;
and inputting the second training feature and the sample image into the second network to obtain a training segmentation coefficient graph output by the second network.
According to another aspect of the present disclosure, there is provided an image processing apparatus including:
the extraction module is used for carrying out feature extraction processing on the image to be processed to obtain at least two first features, wherein different first features are used for expressing different attributes of a target object in the image to be processed;
the fusion module is used for carrying out first fusion processing on the at least two first characteristics to obtain second characteristics;
and the obtaining module is used for obtaining a segmentation coefficient map according to the second feature and the image to be processed, wherein the segmentation coefficient map is used for distinguishing a first image area where the target object is located in the image to be processed and a second image area outside the first image area.
In one possible implementation, the fusion module is further configured to:
performing first convolution processing on each first feature to obtain a third feature corresponding to each first feature;
performing interpolation processing on each third feature to obtain a fourth feature corresponding to each third feature, wherein the size of each fourth feature is the same;
and performing feature transformation processing on the fourth feature to obtain the second feature.
In one possible implementation, the fusion module is further configured to:
combining at least two of the fourth features to obtain a fifth feature;
and activating and performing second convolution processing on the fifth feature to obtain the second feature.
In one possible implementation, the fusion module is further configured to:
merging the at least two fourth features to obtain a fifth feature;
and averaging the corresponding pixel points of the at least two fourth characteristics respectively to obtain the fifth characteristics.
In one possible implementation, the apparatus further includes:
and the processing module is used for processing the image to be processed according to the segmentation coefficient map to obtain a target image.
In one possible implementation, the processing module is further configured to:
and multiplying each pixel point of the segmentation coefficient graph and the corresponding pixel point in the image to be processed respectively to obtain the target image.
In one possible implementation, the extraction module is further configured to:
the image to be processed is input to a first network, and at least two first features output by at least two levels in the first network are obtained.
In one possible implementation, the obtaining module is further configured to:
extracting a sixth feature according to the image to be processed;
performing second fusion processing on the sixth characteristic and the second characteristic to obtain a seventh characteristic;
and obtaining a segmentation coefficient map according to the seventh feature.
In one possible implementation, the obtaining module is further configured to:
inputting the image to be processed into a second network, and obtaining a sixth feature output by a preset level of the second network, wherein the sixth feature has the same feature dimension as the second feature, and the second network comprises at least two levels arranged in sequence;
the obtaining module is further configured to:
processing the seventh feature through a level subsequent to a preset level of the second network to obtain a partition coefficient map.
In one possible implementation, the second network includes an encoding subnetwork and a decoding subnetwork, wherein the encoding subnetwork includes at least one level, the decoding subnetwork includes at least one level, and the preset level includes at least one level in the encoding subnetwork and at least one level in the decoding subnetwork.
In one possible implementation, the function of the apparatus is implemented by a neural network, the neural network comprising a first network, a second network and a feature fusion network,
wherein the apparatus further comprises:
and the training module is used for training at least one network in the second network and the characteristic fusion network through the trained first network, the sample image and the sample segmentation coefficient graph corresponding to the sample image.
In one possible implementation, the training module is further configured to:
inputting the sample images into the trained first network and the trained second network respectively to obtain a training segmentation coefficient graph output by the second network;
determining a loss function of the second network and the feature fusion network according to the segmentation coefficient map and the sample segmentation coefficient map;
and adjusting at least one of the second network and the feature fusion network according to the loss function, wherein the feature fusion network is used for fusing the features output by the trained first network and inputting the fused features into the second network.
In one possible implementation, the training module is further configured to:
inputting the sample image into the trained first network to obtain at least two first training features output by at least two levels in the trained first network;
inputting the at least two first training features into the feature fusion network to obtain second training features;
and inputting the second training feature and the sample image into the second network to obtain a training segmentation coefficient graph output by the second network.
According to an aspect of the present disclosure, there is provided an electronic device including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: the above-described image processing method is performed.
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 image processing method.
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 flow diagram of an image processing method according to an embodiment of the present disclosure;
FIG. 2 shows a schematic diagram of a feature fusion process according to an embodiment of the present disclosure;
FIG. 3 shows a flow diagram of an image processing method according to an embodiment of the present disclosure;
FIG. 4 shows a flow diagram of an image processing method according to an embodiment of the present disclosure;
fig. 5 shows an application diagram of an image processing method according to an embodiment of the present disclosure;
fig. 6 shows a block diagram of an image processing apparatus according to an embodiment of the present disclosure;
FIG. 7 shows a block diagram of an electronic device according to an embodiment of the disclosure;
fig. 8 illustrates a block diagram of an electronic device in accordance with 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.
Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure, as shown in fig. 1, the method comprising:
in step S11, performing feature extraction processing on the image to be processed to obtain at least two first features, where different first features are used to express different attributes of the target object in the image to be processed;
in step S12, performing a first fusion process on the at least two first features to obtain a second feature;
in step S13, a segmentation coefficient map for distinguishing a first image area in the image to be processed where the target object is located and a second image area outside the first image area is obtained according to the second feature and the image to be processed.
According to the image processing method disclosed by the embodiment of the disclosure, the segmentation coefficient graph can be obtained to guide segmentation processing, manual labeling is not needed, the manual workload is reduced, and the working efficiency is improved. And moreover, the first features are fused to obtain second features, and a segmentation coefficient map comprising the first image area and the second image area is obtained through the second features and the image to be processed, so that uncertain areas are reduced, errors in the segmentation coefficient map are reduced, and the segmentation effect is improved.
The main body of the image processing method may be an image processing apparatus, for example, the image processing method may be executed by a terminal device or a server or other processing device, wherein 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, a wearable device, or the like. In some possible implementations, the image processing method may be implemented by a processor calling computer readable instructions stored in a memory.
In one possible implementation manner, in step S11, the image to be processed includes at least one target object, for example, a human, an animal, or the like. And in the image to be processed, the area outside the area where the target object is located is a background area. The feature extraction process may extract features that may express different attributes of the target object from the image to be processed, for example, extracting facial features of a human face in the image to be processed, extracting a region where a background in the image to be processed is located, and the like, which is not limited herein.
In one possible implementation, the feature extraction process may be implemented by a first network, which may be a neural network for semantic segmentation, e.g., a human image segmentation network for segmenting a human image from a background. The first network may also be a neural network that determines keypoints of the target object, e.g., a keypoint estimation network. The first network may also be a network that determines the pose of the target object, e.g., a pose estimation network. The present disclosure does not limit the type of the first network. In other examples, the feature extraction processing may also be to detect a key point of the target object based on the pixel point, so as to implement the feature extraction processing of the image to be processed.
In a possible implementation manner, the performing feature extraction processing on the image to be processed to obtain at least two first features includes: the image to be processed is input to a first network, and at least two first features output by at least two levels in the first network are obtained. The image to be processed may be input to the first network, and the first network may process the image to be processed through each network level, respectively, to obtain features corresponding to each level, respectively. For example, a first level of the first network may perform convolution processing or the like on the image to be processed to obtain features corresponding to the first level, the size of the features corresponding to the first level may be smaller than or equal to the image to be processed, a second level of the first network may perform convolution processing or the like on the features corresponding to the first level to obtain features corresponding to the second level, the size of the features corresponding to the second level may be smaller than or equal to the features … … corresponding to the first level, and the features corresponding to the respective levels of the first network may be obtained respectively. At least two levels may be selected from the levels, and the feature corresponding to the selected level is the first feature, i.e., at least two first features are obtained. In an example, features corresponding to at least two bottom levels of the first network may be selected as the first features, i.e., at least two levels proximate to an output layer of the first network may be selected and features corresponding to the selected at least two levels may be selected as the first features. In an example, one or more target objects may be included in the image to be processed, if a plurality of target objects are included in the image to be processed, each target object corresponds to at least two first features, and a different first feature corresponding to each target object represents a different attribute of the target object, for example, a certain first feature may represent an eye keypoint feature of the target object, another first feature may represent an ear keypoint feature of the target object, and the like. If the image to be processed comprises a target object, the at least two first features can respectively represent features of different attributes of the target object.
In one possible implementation manner, in step S12, the sizes of the first features respectively corresponding to the at least two levels may be inconsistent, and the first fusion process may be performed on the at least two first features to obtain the second features. The first fusion processing may fuse at least two first features to obtain a second feature, where each first feature corresponds to one channel of the second feature, so that the second feature of multiple channels may be obtained, and all feature information of the first features may be retained. For example, at least two first features may be combined into a second feature having at least two feature channels. Step S12 may include: performing convolution processing on each first feature respectively to obtain a third feature corresponding to each first feature; respectively carrying out interpolation processing on the third features to obtain fourth features corresponding to the third features, wherein the fourth features are the same in size; and carrying out transformation processing on the fourth characteristic to obtain the second characteristic.
In one possible implementation, the first feature fusion processing may be performed on the plurality of first features through a feature fusion network. The feature fusion network may include a plurality of channels, the number of the channels may be consistent with the number of the first features, and each of the first features may be input into each of the channels of the feature fusion network, respectively. Each channel of the feature fusion network may include convolutional layers, e.g., 1 x 1 convolutional layers, which may be used to convolve the first feature. In an example where the first features have redundant information, the 1 × 1 convolutional layer may downsample the first features to filter the redundant information to obtain third features corresponding to each first feature.
In a possible implementation manner, the feature fusion network may perform interpolation processing on each third feature to obtain fourth features corresponding to the third features, respectively, and the sizes of the fourth features are the same. In an example, for a third feature that is smaller in size than the fourth feature, one or more pixel points may be inserted between neighboring pixel points of the third feature, the pixel values of the one or more pixel points being determined by the neighboring pixel points. For the third feature with the size larger than that of the fourth feature, the pixel values of one or more adjacent pixels can be averaged to obtain an average pixel value, and one or more pixels are replaced by one pixel with the average pixel value, so that the number of pixels is reduced, and the size is reduced.
In a possible implementation manner, the feature transformation processing may be performed on the fourth feature to obtain the second feature, and the method includes: combining at least two of the fourth features to obtain a fifth feature; and activating and performing second convolution processing on the fifth feature to obtain the second feature.
In a possible implementation manner, the obtaining of the fifth feature from at least two of the fourth features includes at least one of the following manners: merging the at least two fourth features to obtain a fifth feature; and averaging the corresponding pixel points of the at least two fourth characteristics respectively to obtain the fifth characteristics.
In an example, the pixel points corresponding to the fourth features may be averaged, for example, parameters of the pixel points with the same coordinate in each fourth feature may be averaged, for example, the chroma value of the pixel point with the coordinate of (1, 1) in each fourth feature may be averaged to obtain the chroma value of the pixel point with the coordinate of (1, 1) in the fifth feature, the chroma value of the pixel point with the coordinate of (1, 2) in each fourth feature may be averaged to obtain the chroma value … … of the pixel point with the coordinate of (1, 2) in the fifth feature, and the chroma value of the pixel point corresponding to each coordinate in the fourth feature may be averaged according to this manner to obtain the chroma value of each pixel point in the fifth feature. Further, parameters such as brightness, gray scale, depth, RGB values, and the like of each pixel point in each fourth feature may also be averaged to obtain parameter values of pixel points at corresponding positions in the fifth feature.
In an example, all the fourth features may also be retained, that is, at least two fourth features are subjected to a merging process, and a fifth feature having at least two feature channels is obtained. The fifth feature retains all feature information of the fourth feature.
In one possible implementation, the fifth feature may be activated by an activation layer (e.g., a ReLU activation layer) of the feature fusion network, and convolved by a convolution layer (e.g., a 3 × 3 convolution layer) of the feature fusion network, and the second feature is obtained. Through the processing of the convolutional layer and the active layer, the fifth feature can be processed into a second feature with a preset size and a preset number of feature channels, that is, a second feature consistent with the size and the number of feature channels output by a preset level in the second network, so that the accuracy of fusion of the second feature is ensured.
Fig. 2 shows a schematic diagram of a feature fusion process according to an embodiment of the present disclosure. In an example, three levels may be selected from among the levels of the first network, and the first features corresponding to the three levels may be subjected to 1 × 1 convolution processing and interpolation processing, respectively, to obtain fourth features having the same size.
In an example, the fourth features may be fused, for example, the fourth features may be merged, and the fifth features of three channels may be obtained. In an example, the fifth feature may be processed sequentially through the ReLU active layer, the 3 × 3 convolutional layer, the ReLU active layer, and the 3 × 3 convolutional layer, to obtain the second feature of at least one preset size.
By the method, the first features corresponding to the multiple hierarchies of the first network can be subjected to feature fusion, the semantic information of the first features can be reserved by the fused second features, and the accuracy of segmenting the coefficient graph is improved.
In one possible implementation manner, in step S13, a segmentation coefficient map may be obtained according to the second feature and the image to be processed. The size of the segmentation coefficient map may be consistent with the size of the image to be processed. In an example, the partition coefficient map may be obtained over a second network. The second network may be an image processing network, for example, a convolutional neural network or the like that may process the image.
In one possible implementation, step S13 may include: extracting a sixth feature according to the image to be processed; performing second fusion processing on the sixth characteristic and the second characteristic to obtain a seventh characteristic; and obtaining a segmentation coefficient map according to the seventh feature.
Wherein, the extracting the sixth feature according to the image to be processed includes: inputting the image to be processed into a second network, and obtaining a sixth feature output by a preset level of the second network, wherein the sixth feature has the same feature dimension as the second feature, and the second network comprises at least two levels arranged in sequence; said deriving a partition coefficient map according to said seventh feature comprises: processing the seventh feature through a level subsequent to a preset level of the second network to obtain a partition coefficient map.
In a possible implementation manner, the image to be processed is input into a second network, and a sixth feature corresponding to a preset hierarchy of the second network is obtained, wherein the feature dimension of the sixth feature is the same as that of the second feature; performing second fusion processing on the sixth feature and the second feature to obtain a seventh feature; processing the seventh feature through a level subsequent to a preset level of the second network to obtain the partition coefficient map.
In a possible implementation manner, the second network may be a deep learning neural network having a plurality of levels, and after the image to be processed is input into the second network, the image may be sequentially processed through the levels of the second network, for example, a certain level may perform downsampling processing on the feature output by the previous level to obtain a feature corresponding to the level, the size of the feature output by the level may be smaller than or equal to the feature output by the previous level, and the number of the features output by the level (i.e., the number of output channels) may be larger than or equal to the feature output by the previous level.
In a possible implementation manner, an arbitrary level of the second network may be determined as the preset level, and the number of output channels of the feature fusion network may be consistent with the number of output channels of the preset level, that is, the number of second features output by the feature fusion network is consistent with the number of sixth features output by the preset level, and the sixth features are the same as the second features in size (that is, the second features are the same as the sixth features in dimension), that is, the features output by the preset level of the feature fusion network are the same as the preset size of the second features.
In a possible implementation manner, the sixth feature and the second feature may be subjected to a second fusion process to obtain a seventh feature. In an example, the second feature and the sixth feature may be sequentially fused, for example, the second feature output by the first output channel of the feature fusion network and the sixth feature output by the first output channel of the preset hierarchy may be fused (for example, averaging, maximum value taking, or splicing may be performed on corresponding pixel points of the second feature and the sixth feature, where the averaging is to average pixel values of corresponding pixel points of the sixth feature and the second feature, and an obtained average value is used as a pixel value of a corresponding pixel point of the seventh feature, the maximum value taking is to select a maximum value of pixel values of corresponding pixel points of the sixth feature and the second feature, and an obtained maximum value is used as a pixel value of a corresponding pixel point of the seventh feature, and the splicing is to reserve all feature channels of the second feature and the sixth feature, that is, the number of feature channels of the obtained seventh feature is equal to the sum of the number of feature channels of the second feature and the sixth feature), and the fusion processing … … of the second feature output by the second output channel of the feature fusion network and the sixth feature output by the second output channel of the preset hierarchy may perform the fusion processing on each of the second feature and the sixth feature in this manner to obtain a plurality of seventh features.
In a possible implementation manner, the second feature and the sixth feature may also be retained, and both the second feature and the sixth feature are input into a next level of the preset level for processing.
In a possible implementation, the seventh feature may be processed at a level subsequent to the predetermined level, and the partition coefficient map may be obtained.
In a possible implementation manner, multiple groups of second features obtained by multiple feature fusion networks are respectively fused with sixth features output by multiple preset levels of the corresponding second networks, so as to respectively obtain multiple groups of seventh features. For example, the second feature obtained by the first feature fusion network may be fused with the sixth feature output by the fifth level (preset level) of the second network to obtain a set of seventh features, and the set of seventh features may be processed further by a level after the preset level of the second network. When the processing proceeds to the tenth level (preset level), another set of sixth features is generated, and the second features generated by another feature fusion network may be subjected to fusion processing with the another set of sixth features to obtain another set of seventh features. Further, processing of the further set of seventh features may continue through levels subsequent to the tenth level, the partition coefficient map may be obtained. The present disclosure does not limit the number of feature fusion networks.
In an example, the second network includes an encoding sub-network and a decoding sub-network, where the encoding network is configured to perform encoding processing on the input features to obtain features with a larger receptive field and a smaller size relative to the input features, and the decoding network is configured to perform decoding processing on the encoded features to reduce the receptive field and enlarge the size, and finally obtain an output result of the second network through a full connection layer and other layers. Wherein the encoding subnetwork comprises at least one level, the decoding subnetwork comprises at least one level, and the preset levels comprise at least one level in the encoding subnetwork and at least one level in the decoding subnetwork. For example, two sets of second features may be obtained through two feature fusion networks, the preset levels corresponding to the two feature fusion networks are located in the encoding subnetwork and the decoding subnetwork in the second network, respectively, and the two sets of second features may be subjected to second fusion processing with the sixth feature output by the preset level of the encoding subnetwork and the sixth feature output by the preset level of the decoding subnetwork, respectively, to obtain two sets of seventh features. And respectively carrying out second fusion processing on the two groups of second features and the sixth feature output by the preset level of the coding subnetwork and the sixth feature output by the preset level of the decoding subnetwork, so that fused feature information can be obtained in the coding and decoding processes, the feature information obtained in the coding process and the decoding process is richer, and the accuracy of obtaining the segmentation coefficient graph is improved.
In one possible implementation, the segmentation coefficient map may be used to process an image to be processed.
Fig. 3 shows a flow chart of an image processing method according to an embodiment of the present disclosure, as shown in fig. 3, the method further comprising:
in step S14, the image to be processed is processed according to the segmentation coefficient map, and a target image is obtained.
In a possible implementation manner, the partition coefficient map and the corresponding pixel points of the image to be processed may be processed separately, for example, parameters such as gray values and chrominance values of the pixel points of the image to be processed and the partition coefficients of the corresponding pixel points in the partition coefficient map may be processed.
In one possible implementation, step S14 may include: and multiplying the corresponding pixel points of the segmentation coefficient graph and the image to be processed respectively to obtain the target image. Wherein the division coefficient of the first image region in the division coefficient map is 1, and the division coefficient of the second image region is 0.
In a possible implementation manner, in the segmentation coefficient map, a position of a first image region where the target object is located is consistent with a position of a region where the target object is located in the image to be processed, and a position of a second image region outside the first image region in the segmentation coefficient map is consistent with a position of a background region in the image to be processed. The partition coefficient of each pixel in the partition coefficient map can be used to multiply the parameters (such as brightness, gray scale, depth, RGB value, etc.) of the corresponding pixel in the image to be processed. The parameters of the pixel points in the first image area (the area where the target object is located) in the image to be processed are multiplied by the partition coefficient 1, so that the parameters of the pixel points in the first image area are not changed. The parameters of the pixel points in the second image area (background area) in the image to be processed are multiplied by the partition coefficient 0, and then the parameters of the pixel points in the first image area are 0. In an example, if the RGB value of the pixel point in the first image region is multiplied by 1, the RGB value of the pixel point in the first image region is not changed, and if the RGB value of the pixel point in the second image region is multiplied by 0, the RGB value of the pixel point in the second image region is changed to (0, 0, 0), that is, the region where the target object is located is retained, and the background is changed to black (the background is removed).
In one possible implementation, the target image may be further processed. In an example, an arbitrary background may be added to a background region of the target image, and a new image may be formed with the region where the target object is located.
In one possible implementation, the second network and the feature fusion network may be trained prior to generating the segmentation coefficient map using the second network and the feature fusion network. The second network and the feature fusion network may be trained using the trained first network, the sample image, and a sample segmentation coefficient map corresponding to the sample image.
Fig. 4 shows a flowchart of an image processing method according to an embodiment of the present disclosure, as shown in fig. 4, the method further comprising:
in step S15, at least one of the second network and the feature fusion network is trained by the trained first network, a sample image, and a sample segmentation coefficient map corresponding to the sample image.
In one possible implementation, step S15 may include: inputting the sample images into the trained first network and the trained second network respectively to obtain a training segmentation coefficient graph output by the second network; determining a loss function of the second network and the feature fusion network according to the segmentation coefficient map and the sample segmentation coefficient map; and adjusting at least one of the second network and the feature fusion network according to the loss function, wherein the feature fusion network is used for fusing the features output by the trained first network and inputting the fused features into the second network.
In a possible implementation manner, the inputting the sample image to the trained first network and the trained second network respectively to obtain a training segmentation coefficient map output by the second network includes: inputting the sample image into the trained first network to obtain at least two first training features output by at least two levels in the trained first network; inputting the at least two first training features into the feature fusion network to obtain second training features; and inputting the second training feature and the sample image into the second network to obtain a training segmentation coefficient graph output by the second network.
In one possible implementation, the sample image may be input into a first network, and at least two first training features may be obtained at least two preset levels of the first network. And the first training characteristics can be input into the characteristic fusion network for characteristic fusion processing to obtain second training characteristics. Further, the sample image may be input into a second network, and a sixth feature output by a preset level of the second network and the second feature may be fused to obtain a seventh training feature, and the seventh training feature may be processed by a level after the preset level of the second network to obtain a training segmentation coefficient map.
In a possible implementation manner, during the training process, the training segmentation coefficient map output by the second network may have errors, and the real-time sample segmentation coefficient map is an artificially labeled error-free segmentation coefficient map, and the loss functions of the second network and the feature fusion network may be determined according to the difference between the segmentation coefficient map output by the second network and the sample segmentation coefficient map.
In one possible implementation, the loss function may be determined according to the following equation (1):
Figure BDA0002147956740000111
wherein the content of the first and second substances,
Figure BDA0002147956740000112
for the penalty function corresponding to the ith (i is a positive integer) pixel point,
Figure BDA0002147956740000113
for the segmentation coefficient corresponding to the ith pixel point in the sample segmentation coefficient map,
Figure BDA0002147956740000114
and the division coefficient corresponding to the ith pixel point in the division coefficient graph output by the second network. OmegaiAs a weight coefficient, if the ith pixel point is located in the first image region in the sample segmentation coefficient map, ω isiIs large (e.g., ωi5), if the ith pixel point is located in the second image region in the sample division coefficient map, ω isiIs small (e.g., ωi1) and e is a control variable, e.g. 10-6. In an example, the loss functions corresponding to all the pixel points may be summed, and the loss functions of the second network and the feature fusion network may be obtained.
In one possible implementation, the network parameters of the second network and the feature fusion network may be adjusted according to the loss function of the second network and the feature fusion network, and in an example, the network parameters may be adjusted in a direction that minimizes the loss function, for example, the loss function may be propagated backwards using a gradient descent method to adjust the network parameters of the second network and the feature fusion network. And when the training condition is met, obtaining a second network and a feature fusion network after training. The training condition may be an adjustment number, and the network parameters of the second network and the feature fusion network may be adjusted by a predetermined number. For example, the training condition may be the size or convergence of the loss function, and when the loss function decreases to a certain degree or converges within a certain threshold, the adjustment may be stopped, the trained second network and feature fusion network may be obtained, and the trained second network and feature fusion network may be used in the process of generating the division coefficient map.
According to the image processing method disclosed by the embodiment of the disclosure, the segmentation coefficient graph with the size consistent with that of the image to be processed can be obtained to guide segmentation processing, manual labeling is not needed, the manual workload is reduced, and the working efficiency is improved. The first features corresponding to multiple levels of the first network can be subjected to feature fusion, the semantic information of the first features can be reserved in the fused second features, the accuracy of the segmentation coefficient graph is improved, uncertain areas are reduced, errors in the segmentation coefficient graph are reduced, and the segmentation effect is improved.
Fig. 5 is a schematic application diagram of an image processing method according to an embodiment of the present disclosure, and as shown in fig. 5, an image to be processed may be input into the first network, and the first network may process the image to be processed through each network hierarchy level, so as to obtain first features corresponding to each hierarchy level. In an example, a plurality of hierarchies proximate to an output layer of the first network may be selected, and features output by the selected plurality of hierarchies may be selected as the first features.
In one possible implementation, a preset hierarchy may be selected in the second network, and in an example, a fifth hierarchy and a tenth hierarchy of the second network may be selected as the preset hierarchy, so that the number of output channels of the two feature fusion networks is respectively consistent with the output channels of the fifth hierarchy and the tenth hierarchy of the second network (for example, 256 output channels and 64 output channels are respectively provided), and the size of the second feature output by the two feature fusion networks is respectively consistent with the size of the sixth feature output by the fifth hierarchy and the tenth hierarchy of the second network and the number of feature channels.
In one possible implementation manner, a plurality of first features may be input into the feature fusion network (for example, the first features corresponding to the fifth level, the sixth level, and the seventh level of the first network are input into the first feature fusion network, and the first features corresponding to the eighth level, the ninth level, and the tenth level of the first network are input into the second feature fusion network), and the 1 × 1 convolution layer of the feature fusion network may down-sample the first features to filter redundant information to obtain third features corresponding to the first features, and may perform interpolation processing on each third feature to obtain fourth features corresponding to the third features, respectively, and the sizes of the fourth features are the same. Further, the feature fusion network may perform average processing on corresponding pixels of each fourth feature to obtain a fifth feature, and may perform processing on the fifth feature sequentially through the ReLU active layer, the 3 × 3 convolutional layer, the ReLU active layer, and the 3 × 3 convolutional layer to obtain a plurality of second features of a preset size (for example, the first feature fusion network may obtain 256 second features, and the second feature fusion network may obtain 64 second features).
In a possible implementation manner, the image to be processed may be input into the second network, and after the processing of the 3 × 3 convolutional layer and the preset hierarchy and the previous hierarchy, the sixth feature corresponding to the preset hierarchy (e.g., the fifth hierarchy and the tenth hierarchy) of the second network is obtained, the 256 second features output by the first feature fusion network and the sixth feature output by the fifth hierarchy of the second network are subjected to fusion processing (e.g., corresponding pixel points of the second feature and the sixth feature are subjected to average processing), 256 seventh features may be obtained, and the 256 seventh features are continuously processed through the hierarchy after the fifth hierarchy of the second network. When the processing is performed to the tenth level, 64 sixth features are generated, the 64 second features output by the second feature fusion network can be fused with the 64 sixth features, 64 seventh features can be obtained, and further, the processing of the 64 seventh features can be continued through the level after the tenth level. In the last layer of the second network, 1 × 1 convolution processing is performed, activation processing can also be performed through a sigmoid activation function, and finally a division coefficient map is obtained.
In a possible implementation manner, the division coefficient map and corresponding pixel points of the image to be processed may be multiplied respectively to obtain the target image, that is, only the region where the target object is located is reserved, and the RGB value of the background region is set to be (0, 0, 0).
In one possible implementation, the target image may be further processed, for example, the background of the model's picture may be removed and a desired background may be added to produce various advertisements. Alternatively, the weather forecast program can be made by removing the background from the host's video segment frame by frame, and adding a map as the background. Alternatively, the background of a missing person photo is removed and the gathering photo is added as background, i.e. the missing person can be added to the photo. Alternatively, the target object such as a person may be extracted from the image, and then the background or the person may be subjected to other image processing, such as filtering, stylizing, blurring, etc., and fused again to generate a new effect graph. The application scenario of the image processing method is not limited by the present disclosure.
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.
In addition, the present disclosure also provides an image processing apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the image processing methods provided by the present disclosure, and the descriptions and corresponding descriptions of the corresponding technical solutions and the corresponding descriptions in the methods section are omitted for brevity.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Fig. 6 illustrates a block diagram of an image processing apparatus according to an embodiment of the present disclosure, which includes, as illustrated in fig. 6:
the extraction module 11 is configured to perform feature extraction processing on an image to be processed to obtain at least two first features, where the image to be processed includes at least one target object, and different first features are used to express different attributes of the target object;
a fusion module 12, configured to perform a first fusion process on the at least two first features to obtain a second feature;
an obtaining module 13, configured to obtain a segmentation coefficient map according to the second feature and the to-be-processed image, where the segmentation coefficient map is used to distinguish a first image area where the target object is located in the to-be-processed image and a second image area outside the first image area.
In one possible implementation, the fusion module is further configured to:
performing first convolution processing on each first feature to obtain a third feature corresponding to each first feature;
performing interpolation processing on each third feature to obtain a fourth feature corresponding to each third feature, wherein the size of each fourth feature is the same;
and performing feature transformation processing on the fourth feature to obtain the second feature.
In one possible implementation, the fusion module is further configured to:
combining at least two of the fourth features to obtain a fifth feature;
and activating and performing second convolution processing on the fifth feature to obtain the second feature.
In one possible implementation, the fusion module is further configured to:
merging the at least two fourth features to obtain a fifth feature;
and averaging the corresponding pixel points of the at least two fourth characteristics respectively to obtain the fifth characteristics.
In one possible implementation, the apparatus further includes:
and the processing module is used for processing the image to be processed according to the segmentation coefficient map to obtain a target image.
In one possible implementation, the processing module is further configured to:
and multiplying each pixel point of the segmentation coefficient graph and the corresponding pixel point in the image to be processed respectively to obtain the target image.
In one possible implementation, the extraction module is further configured to:
the image to be processed is input to a first network, and at least two first features output by at least two levels in the first network are obtained.
In one possible implementation, the obtaining module is further configured to:
extracting a sixth feature according to the image to be processed;
performing second fusion processing on the sixth characteristic and the second characteristic to obtain a seventh characteristic;
and obtaining a segmentation coefficient map according to the seventh feature.
In one possible implementation, the obtaining module is further configured to:
inputting the image to be processed into a second network, and obtaining a sixth feature output by a preset level of the second network, wherein the sixth feature has the same feature dimension as the second feature, and the second network comprises at least two levels arranged in sequence;
the obtaining module is further configured to:
processing the seventh feature through a level subsequent to a preset level of the second network to obtain a partition coefficient map.
In one possible implementation, the second network includes an encoding subnetwork and a decoding subnetwork, wherein the encoding subnetwork includes at least one level, the decoding subnetwork includes at least one level, and the preset level includes at least one level in the encoding subnetwork and at least one level in the decoding subnetwork.
In one possible implementation, the function of the apparatus is implemented by a neural network, the neural network comprising a first network, a second network and a feature fusion network,
wherein the apparatus further comprises:
and the training module is used for training at least one network in the second network and the characteristic fusion network through the trained first network, the sample image and the sample segmentation coefficient graph corresponding to the sample image.
In one possible implementation, the training module is further configured to:
inputting the sample images into the trained first network and the trained second network respectively to obtain a training segmentation coefficient graph output by the second network;
determining a loss function of the second network and the feature fusion network according to the segmentation coefficient map and the sample segmentation coefficient map;
and adjusting at least one of the second network and the feature fusion network according to the loss function, wherein the feature fusion network is used for fusing the features output by the trained first network and inputting the fused features into the second network.
In one possible implementation, the training module is further configured to:
inputting the sample image into the trained first network to obtain at least two first training features output by at least two levels in the trained first network;
inputting the at least two first training features into the feature fusion network to obtain second training features;
and inputting the second training feature and the sample image into the second network to obtain a training segmentation coefficient graph output by the second network.
In some embodiments, functions of 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 for specific implementation, reference may be made to the description of the above method embodiments, and for brevity, details are not described here again
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-mentioned method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured as the above method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 7 is a block diagram illustrating an electronic device 800 in accordance with an example embodiment. 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. 7, 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 CMOS or 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 WiFi, 2G or 3G, 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. 8 is a block diagram illustrating an electronic device 1900 in accordance with an example embodiment. For example, the electronic device 1900 may be provided as a server. Referring to fig. 8, 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 stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, 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.
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 terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (24)

1. An image processing method, comprising:
performing feature extraction processing on an image to be processed to obtain at least two first features, wherein different first features are used for expressing different attributes of a target object in the image to be processed;
performing first fusion processing on the at least two first characteristics to obtain second characteristics;
according to the second feature and the image to be processed, obtaining a segmentation coefficient map, wherein the segmentation coefficient map is used for distinguishing a first image area where the target object is located in the image to be processed and a second image area outside the first image area;
obtaining a segmentation coefficient map according to the second feature and the image to be processed, including:
inputting the image to be processed into a second network, and obtaining a sixth feature output by a preset level of the second network, wherein the second network comprises at least two levels which are sequentially arranged, and the feature dimension of the sixth feature is the same as that of the second feature;
performing second fusion processing on the sixth characteristic and the second characteristic to obtain a seventh characteristic;
and obtaining a segmentation coefficient map according to the seventh feature.
2. The method according to claim 1, wherein performing a first fusion process on the at least two first features to obtain a second feature comprises:
performing first convolution processing on each first feature to obtain a third feature corresponding to each first feature;
performing interpolation processing on each third feature to obtain a fourth feature corresponding to each third feature, wherein the size of each fourth feature is the same;
and performing feature transformation processing on the fourth feature to obtain the second feature.
3. The method according to claim 2, wherein performing feature transformation processing on the fourth feature to obtain the second feature comprises:
combining at least two of the fourth features to obtain a fifth feature;
and activating and performing second convolution processing on the fifth feature to obtain the second feature.
4. The method of claim 3, wherein combining at least two of the fourth features to obtain a fifth feature comprises at least one of:
merging the at least two fourth features to obtain a fifth feature;
and averaging the corresponding pixel points of the at least two fourth characteristics respectively to obtain the fifth characteristics.
5. The method of claim 1, further comprising:
and processing the image to be processed according to the segmentation coefficient map to obtain a target image.
6. The method according to claim 5, wherein processing the image to be processed according to the segmentation coefficient map to obtain a target image comprises:
and multiplying each pixel point of the segmentation coefficient graph and the corresponding pixel point in the image to be processed respectively to obtain the target image.
7. The method according to any one of claims 1 to 6, wherein the performing feature extraction processing on the image to be processed to obtain at least two first features comprises:
the image to be processed is input to a first network, and at least two first features output by at least two levels in the first network are obtained.
8. The method of claim 1, wherein obtaining a partition coefficient map according to the seventh feature comprises:
processing the seventh feature through a level subsequent to a preset level of the second network to obtain a partition coefficient map.
9. The method of claim 8, wherein the second network comprises an encoding subnetwork and a decoding subnetwork, wherein the encoding subnetwork comprises at least one level, wherein the decoding subnetwork comprises at least one level, and wherein the predetermined level comprises at least one level in the encoding subnetwork and at least one level in the decoding subnetwork.
10. The method according to any one of claims 1-6, wherein the method is implemented by a neural network comprising a first network, a second network, and a feature fusion network,
wherein the method further comprises:
training at least one of the second network and the feature fusion network through the trained first network, a sample image, and a sample segmentation coefficient map corresponding to the sample image,
wherein the training of at least one of the second network and the feature fusion network through the trained first network, a sample image, and a sample segmentation coefficient map corresponding to the sample image comprises:
inputting the sample images into the trained first network and the trained second network respectively to obtain a training segmentation coefficient graph output by the second network;
determining a loss function of the second network and the feature fusion network according to the segmentation coefficient map and the sample segmentation coefficient map;
and adjusting at least one of the second network and the feature fusion network according to the loss function, wherein the feature fusion network is used for fusing the features output by the trained first network and inputting the fused features into the second network.
11. The method of claim 10, wherein the inputting the sample images into the trained first network and the trained second network respectively to obtain a training segmentation coefficient map output by the second network comprises:
inputting the sample image into the trained first network to obtain at least two first training features output by at least two levels in the trained first network;
inputting the at least two first training features into the feature fusion network to obtain second training features;
and inputting the second training feature and the sample image into the second network to obtain a training segmentation coefficient graph output by the second network.
12. An image processing apparatus characterized by comprising:
the extraction module is used for carrying out feature extraction processing on the image to be processed to obtain at least two first features, wherein different first features are used for expressing different attributes of a target object in the image to be processed;
the fusion module is used for carrying out first fusion processing on the at least two first characteristics to obtain second characteristics;
an obtaining module, configured to obtain a segmentation coefficient map according to the second feature and the to-be-processed image, where the segmentation coefficient map is used to distinguish a first image area where the target object is located in the to-be-processed image and a second image area outside the first image area;
the obtaining module is further configured to:
inputting the image to be processed into a second network, and obtaining a sixth feature output by a preset level of the second network, wherein the second network comprises at least two levels which are sequentially arranged, and the feature dimension of the sixth feature is the same as that of the second feature;
performing second fusion processing on the sixth characteristic and the second characteristic to obtain a seventh characteristic;
and obtaining a segmentation coefficient map according to the seventh feature.
13. The apparatus of claim 12, wherein the fusion module is further configured to:
performing first convolution processing on each first feature to obtain a third feature corresponding to each first feature;
performing interpolation processing on each third feature to obtain a fourth feature corresponding to each third feature, wherein the size of each fourth feature is the same;
and performing feature transformation processing on the fourth feature to obtain the second feature.
14. The apparatus of claim 13, wherein the fusion module is further configured to:
combining at least two of the fourth features to obtain a fifth feature;
and activating and performing second convolution processing on the fifth feature to obtain the second feature.
15. The apparatus of claim 14, wherein the fusion module is further configured to:
merging the at least two fourth features to obtain a fifth feature;
and averaging the corresponding pixel points of the at least two fourth characteristics respectively to obtain the fifth characteristics.
16. The apparatus of claim 13, further comprising:
and the processing module is used for processing the image to be processed according to the segmentation coefficient map to obtain a target image.
17. The apparatus of claim 16, wherein the processing module is further configured to:
and multiplying each pixel point of the segmentation coefficient graph and the corresponding pixel point in the image to be processed respectively to obtain the target image.
18. The apparatus of any of claims 12-17, wherein the extraction module is further configured to:
the image to be processed is input to a first network, and at least two first features output by at least two levels in the first network are obtained.
19. The apparatus of claim 12, wherein the obtaining module is further configured to:
processing the seventh feature through a level subsequent to a preset level of the second network to obtain a partition coefficient map.
20. The apparatus of claim 19, wherein the second network comprises an encoding subnetwork and a decoding subnetwork, wherein the encoding subnetwork comprises at least one level, wherein the decoding subnetwork comprises at least one level, and wherein the predetermined level comprises at least one level in the encoding subnetwork and at least one level in the decoding subnetwork.
21. The apparatus according to any of claims 12-17, wherein the function of the apparatus is implemented by a neural network comprising a first network, a second network and a feature fusion network,
wherein the apparatus further comprises:
a training module for training at least one of the second network and the feature fusion network through the trained first network, a sample image, and a sample segmentation coefficient map corresponding to the sample image,
wherein the training module is further configured to:
inputting the sample images into the trained first network and the trained second network respectively to obtain a training segmentation coefficient graph output by the second network;
determining a loss function of the second network and the feature fusion network according to the segmentation coefficient map and the sample segmentation coefficient map;
and adjusting at least one of the second network and the feature fusion network according to the loss function, wherein the feature fusion network is used for fusing the features output by the trained first network and inputting the fused features into the second network.
22. The apparatus of claim 21, wherein the training module is further configured to:
inputting the sample image into the trained first network to obtain at least two first training features output by at least two levels in the trained first network;
inputting the at least two first training features into the feature fusion network to obtain second training features;
and inputting the second training feature and the sample image into the second network to obtain a training segmentation coefficient graph output by the second network.
23. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 11.
24. 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 11.
CN201910691280.8A 2019-07-29 2019-07-29 Image processing method and device, electronic equipment and storage medium Active CN110415258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910691280.8A CN110415258B (en) 2019-07-29 2019-07-29 Image processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910691280.8A CN110415258B (en) 2019-07-29 2019-07-29 Image processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110415258A CN110415258A (en) 2019-11-05
CN110415258B true CN110415258B (en) 2022-04-29

Family

ID=68364123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910691280.8A Active CN110415258B (en) 2019-07-29 2019-07-29 Image processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110415258B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191662B (en) * 2019-12-31 2023-06-30 网易(杭州)网络有限公司 Image feature extraction method, device, equipment, medium and object matching method
CN111340085B (en) * 2020-02-20 2024-03-08 深圳市商汤科技有限公司 Data processing method and device, processor, electronic equipment and storage medium
CN111325851B (en) * 2020-02-28 2023-05-05 腾讯科技(深圳)有限公司 Image processing method and device, electronic equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493350A (en) * 2018-11-09 2019-03-19 重庆中科云丛科技有限公司 Portrait dividing method and device
CN109829520A (en) * 2019-01-31 2019-05-31 北京字节跳动网络技术有限公司 Image processing method and device
CN110033003A (en) * 2019-03-01 2019-07-19 华为技术有限公司 Image partition method and image processing apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10635927B2 (en) * 2017-03-06 2020-04-28 Honda Motor Co., Ltd. Systems for performing semantic segmentation and methods thereof
US10783640B2 (en) * 2017-10-30 2020-09-22 Beijing Keya Medical Technology Co., Ltd. Systems and methods for image segmentation using a scalable and compact convolutional neural network
CN109615593A (en) * 2018-11-29 2019-04-12 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN109829920B (en) * 2019-02-25 2021-06-15 上海商汤智能科技有限公司 Image processing method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493350A (en) * 2018-11-09 2019-03-19 重庆中科云丛科技有限公司 Portrait dividing method and device
CN109829520A (en) * 2019-01-31 2019-05-31 北京字节跳动网络技术有限公司 Image processing method and device
CN110033003A (en) * 2019-03-01 2019-07-19 华为技术有限公司 Image partition method and image processing apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《基于卷积神经网络的低参数量实时图像分割算法》;谭光鸿等;《激光与光电子学进展》;20181206;全文 *

Also Published As

Publication number Publication date
CN110415258A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN110348537B (en) Image processing method and device, electronic equipment and storage medium
CN110287874B (en) Target tracking method and device, electronic equipment and storage medium
CN110378976B (en) Image processing method and device, electronic equipment and storage medium
CN109816764B (en) Image generation method and device, electronic equipment and storage medium
CN109522910B (en) Key point detection method and device, electronic equipment and storage medium
CN109257645B (en) Video cover generation method and device
CN111553864B (en) Image restoration method and device, electronic equipment and storage medium
CN109859144B (en) Image processing method and device, electronic equipment and storage medium
CN111340731B (en) Image processing method and device, electronic equipment and storage medium
CN112465843A (en) Image segmentation method and device, electronic equipment and storage medium
CN110458218B (en) Image classification method and device and classification network training method and device
CN110415258B (en) Image processing method and device, electronic equipment and storage medium
CN109165738B (en) Neural network model optimization method and device, electronic device and storage medium
CN110909861B (en) Neural network optimization method and device, electronic equipment and storage medium
CN109145970B (en) Image-based question and answer processing method and device, electronic equipment and storage medium
CN110619610B (en) Image processing method and device
CN113139947B (en) Image processing method and device, electronic equipment and storage medium
CN111583142B (en) Image noise reduction method and device, electronic equipment and storage medium
CN111369482B (en) Image processing method and device, electronic equipment and storage medium
CN110675355B (en) Image reconstruction method and device, electronic equipment and storage medium
CN109840890B (en) Image processing method and device, electronic equipment and storage medium
CN109903252B (en) Image processing method and device, electronic equipment and storage medium
CN109447258B (en) Neural network model optimization method and device, electronic device and storage medium
CN107730443B (en) Image processing method and device and user equipment
CN113538310A (en) Image processing 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