CN112215853A - Image segmentation method and device, electronic equipment and computer readable medium - Google Patents

Image segmentation method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN112215853A
CN112215853A CN202011083931.4A CN202011083931A CN112215853A CN 112215853 A CN112215853 A CN 112215853A CN 202011083931 A CN202011083931 A CN 202011083931A CN 112215853 A CN112215853 A CN 112215853A
Authority
CN
China
Prior art keywords
image
processed
segmentation
target object
network
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.)
Pending
Application number
CN202011083931.4A
Other languages
Chinese (zh)
Inventor
李华夏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011083931.4A priority Critical patent/CN112215853A/en
Publication of CN112215853A publication Critical patent/CN112215853A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Biology (AREA)
  • Biophysics (AREA)
  • Human Computer Interaction (AREA)
  • Biomedical Technology (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the disclosure discloses an image segmentation method, an image segmentation device, electronic equipment and a computer readable medium. One embodiment of the method comprises: acquiring an image to be processed; carrying out feature extraction on an image to be processed to obtain image features; determining whether the target object is contained in the image to be processed based on the image characteristics; and in response to the fact that the target object is determined to be contained in the image to be processed, segmenting the image to be processed to obtain a segmentation result. This embodiment enables targeted image segmentation for a target object.

Description

Image segmentation method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to an image segmentation method, an image segmentation device, electronic equipment and a computer readable medium.
Background
Image segmentation may segment an image into a plurality of regions. Segmenting the face region in the image is a common image segmentation scene. When a specific object (for example, a human face) is segmented, the related image segmentation method often causes false detection of a background. For example, in a scene where a face is segmented, a cat face in an image may be segmented.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose an image segmentation method, apparatus, electronic device and computer readable medium to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide an image segmentation method, including: acquiring an image to be processed; carrying out feature extraction on an image to be processed to obtain image features; determining whether the target object is contained in the image to be processed based on the image characteristics; and in response to the fact that the target object is determined to be contained in the image to be processed, segmenting the image to be processed to obtain a segmentation result.
In a second aspect, some embodiments of the present disclosure provide an image segmentation apparatus, including: an acquisition unit configured to acquire an image to be processed; the image processing device comprises a feature extraction unit, a feature extraction unit and a processing unit, wherein the feature extraction unit is configured to perform feature extraction on an image to be processed to obtain image features; a determination unit configured to determine whether a target object is contained in the image to be processed based on the image feature; and the segmentation unit is configured to respond to the determination that the target object is contained in the image to be processed, and segment the image to be processed to obtain a segmentation result.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, where the program when executed by a processor implements a method as described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: and determining whether the target object is contained in the image to be processed based on the image characteristics so as to facilitate subsequent targeted processing. On the basis, in response to the fact that the target object is determined to be contained in the image to be processed, the image to be processed is segmented, and a segmentation result is obtained. In the process, due to the fact that the segmentation opportunity is clarified, background false detection caused by segmentation under the condition that the target object is not included is avoided. Thereby, targeted image segmentation for the target object is achieved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a schematic illustration of one application scenario of an image segmentation method according to some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of an image segmentation method according to the present disclosure;
FIG. 3 is a flow diagram of further embodiments of an image segmentation method according to the present disclosure;
FIG. 4 is a schematic diagram of the processing of the image segmentation network U-Net;
FIG. 5 is a schematic block diagram of some embodiments of an image segmentation apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of an image segmentation method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the computing device 101 may acquire a to-be-processed image 102. As an example, in a scenario where the computing device 101 is a smartphone, the image to be processed 102 may be an image taken by the smartphone. On this basis, the computing device 101 may perform feature extraction on the image to be processed 102, resulting in image features 103. As an example, the image features 103 may be extracted by a SIFT algorithm. The SIFT algorithm is an algorithm for extracting local features, and extracts image features by finding extreme points in a scale space.
Then, it is determined whether the target object is contained in the image to be processed 102 based on the image feature 103. In the context of this application, the target object may be a windmill. As an example, it may be determined that the image feature 103 is compared with an image feature of a preset windmill image to determine whether the object to be processed 102 includes a windmill.
In the present application scenario, in response to determining that the target object (windmill) is included in the image to be processed 102, segmentation may be performed based on the image features 103, resulting in a segmentation result 104. As an example, the image features may be passed through deconvolution layers to obtain a probability map 104. The probability map 104 may represent the probability that each pixel in the image to be processed 102 belongs to the region containing the target object. It should be noted that the probability values in the probability map 104 shown in the figure are merely exemplary. Optionally, the image region with the probability value greater than the preset probability threshold may be regarded as the region containing the target object.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 2, a flow 200 of some embodiments of an image segmentation method according to the present disclosure is shown. The image segmentation method comprises the following steps:
step 201, acquiring an image to be processed.
In some embodiments, the execution subject of the image segmentation method may acquire the image to be processed from various electronic devices in communication connection through a wired connection manner or a wireless connection manner. The image to be processed may be any image. According to actual needs, the image to be processed may be a designated image or an image obtained by screening under certain conditions. For example, the image to be processed may be the latest image captured by the user through the terminal device. As another example, it may be an image specified by the user in an album. In addition, the execution main body can directly acquire the image to be processed from the local.
Step 202, performing feature extraction on the image to be processed to obtain image features.
In some embodiments, the executing subject may perform feature extraction on the image to be processed, so as to obtain the image features. According to the difference of the features to be extracted, the executing body can use various image feature extraction algorithms to perform low-level visual feature (such as color, texture, shape) extraction, including but not limited to: SIFT algorithm, gray level co-occurrence matrix method, Fourier power spectrum method, histogram method, color clustering method, etc. In addition, the execution main body can also extract high-level semantic features through various neural network models. Of course, the above-mentioned low-level visual features can also be extracted by a neural network model. As an example, Convolutional Neural Networks (CNNs) are widely used for image feature extraction. The convolutional neural network includes a feature extractor consisting of convolutional and pooling layers. In the convolutional layer of the convolutional neural network, one neuron is connected to only part of the neighbor neurons. In a convolutional layer of CNN, usually several feature maps (feature maps) are included, and the neurons of the same feature Map share weights, where the shared weights are convolutional kernels. The convolution kernel is generally initialized in the form of a random decimal matrix, and the convolution kernel learns to obtain a reasonable weight in the training process of the network. Thus, it can be understood that, when feature extraction is performed by the neural network model, the obtained image features can be represented in the form of a feature map.
Step 203, determining whether the image to be processed contains the target object based on the image characteristics.
In some embodiments, the execution subject may determine whether the target object is included in the image to be processed based on the image feature. The target object may be any object, including but not limited to: people, animals, plants, real or virtual objects and parts thereof, and the like. For example, the target object may be a human face, a vehicle, an animated character, and the like.
In some embodiments, the execution subject may determine whether the target object is included in the image to be processed in various ways based on the image characteristics. As an example, the matching may be performed in a predetermined standard image feature library. And if the corresponding standard image characteristics are matched, determining that the target object is contained in the image to be processed. If the corresponding standard image features are not matched, it can be determined that the target object is not contained in the image to be processed. The standard image feature library comprises a large number of standard image features. These standard image features are obtained by feature extraction of a large number of images including the target image.
In some embodiments, the execution subject may also input image features into a pre-trained image classification model, such as VGG, ResNet, and the like. These image classification models may output classification information indicating whether a target object is included.
And 204, in response to the fact that the target object is determined to be contained in the image to be processed, segmenting the image to be processed to obtain a segmentation result.
In some embodiments, in response to determining that the target object is included in the image to be processed, the executing body may segment the image to be processed through each segmentation algorithm to obtain a segmentation result.
As examples, a graph theory based approach, a pixel clustering based approach, and a depth semantics based approach may be employed for segmentation. The method based on the graph theory utilizes the theory and the method in the graph theory field to map the image into a weighted undirected graph, takes the pixels as nodes, takes the image segmentation problem as the vertex division problem of the graph, and utilizes the minimum cutting criterion to obtain the optimal segmentation of the image. The general steps of the pixel-based clustering method are: initializing a rough cluster, clustering pixel points with similar characteristics such as color, brightness, texture and the like to the same superpixel by using an iteration mode, and iterating until convergence so as to obtain a final image segmentation result.
In some optional implementations of some embodiments, in response to determining that the image to be processed includes the target object, segmenting the image to be processed to obtain a segmentation result, including: and based on the image characteristics, segmenting the image to be processed to obtain a segmentation result.
In these implementations, it can be understood that, when feature extraction is performed by the neural network model, the obtained image features can be represented in the form of a feature map. On the basis, the segmentation of the image to be processed can be realized based on the feature map, and a segmentation result is obtained. Specifically, the feature map may be first up-sampled. Upsampling methods include, but are not limited to: bilinear interpolation, transposed convolution, and the like. Through the up-sampling, an image with the same size as the image to be processed is obtained. On the basis, the image with the same size as the image to be processed can be classified at the pixel level, so that a segmentation result is obtained.
Some embodiments of the present disclosure provide a method for determining whether a target object is included in an image to be processed based on image features, so as to perform subsequent targeted processing. On the basis, in response to the fact that the target object is determined to be contained in the image to be processed, the image to be processed is segmented, and a segmentation result is obtained. In the process, due to the fact that the segmentation opportunity is clarified, background false detection caused by segmentation under the condition that the target object is not included is avoided. Thereby, targeted image segmentation for the target object is achieved. For example, in a scene of segmenting a face, if the image to be processed does not include the face but is an image of a cat, the cat face in the image can be prevented from being segmented.
With further reference to fig. 3, the image segmentation method of some embodiments of the present disclosure may also be implemented by a neural network model, and fig. 3 illustrates a flow 300 of some embodiments of implementing the image segmentation method by an image segmentation network. As an example, the image segmentation network includes a feature extraction sub-network and a classification sub-network. Of course, the split network may also include necessary activation functions, etc., as desired. The flow 300 of the image segmentation method includes the following steps:
step 301, acquiring an image to be processed.
In some embodiments, the specific implementation of step 301 and the technical effect thereof may refer to step 201 in those embodiments corresponding to fig. 2, and are not described herein again.
Step 302, inputting the image to be processed into a feature extraction sub-network in the pre-trained image segmentation network to obtain the image features.
In some embodiments, the performing subject of the image segmentation method may input the image to be processed into a feature extraction sub-network in a pre-trained image segmentation network, resulting in image features.
The network structure of the image segmentation network can be built according to actual needs. For example, the image segmentation network may be obtained by connecting structures such as a feature extraction sub-network, a classification sub-network, and a necessary activation function as needed. The feature extraction sub-network may adopt a network structure such as a convolutional neural network. The classification sub-network may take various configurations, and may include network configurations such as ResNet, VGG, and the like, as examples. The image segmentation network may be obtained by adjusting the configuration of an existing image segmentation network.
The following will describe how to obtain the image segmentation network by adjustment, taking the image segmentation network U-Net as an example.
As shown in fig. 4, the processing of the image segmentation network U-Net is shown. Wherein, U-Net is an encoder-decoder structure. The encoder uses a plurality of convolutional layers, and corresponds to the feature extraction sub-network. On the basis, a classification sub-network can be added in the U-Net to obtain the image segmentation network. As an example, a classification sub-network may be added between the encoder and the decoder.
In practice, after the network structure is determined by means of building or adjusting and the like, an initial image segmentation network can be obtained. On this basis, the initial image segmentation network can be trained by using the training sample set. Specifically, network training methods such as directional propagation and random gradient descent can be adopted. And after the training is finished, obtaining the image segmentation network.
In some optional implementations of some embodiments, the training samples of the image segmentation network include sample images, sample classification results, and sample segmentation results; and loss values of the image segmentation network in the training process comprise classification loss values and segmentation loss values, wherein the classification loss values are used for representing the difference between a classification result obtained by inputting the sample image into the image segmentation network and a sample classification result, and the segmentation loss values are used for representing the difference between a segmentation result obtained by inputting the sample image into the image segmentation network and the sample segmentation result. Wherein, the classification loss value or the segmentation loss value may be calculated by various loss functions as necessary. E.g., mean square error, etc.
In these alternative implementations, the classification results may be supervised at the same time as the segmentation results by training with the two-part loss values. Thus, for images of different classification results, the features extracted by the image segmentation network can be separated as much as possible. For example, in a face segmentation scene, the features of an image with a face and an image without a face are separated as much as possible. Thereby further avoiding background false detections.
And 303, inputting the image characteristics into a classification sub-network to obtain a classification result, wherein the classification result is used for representing whether the image to be processed contains the target object.
In some embodiments, the execution subject may input the image features into a classification sub-network to obtain a classification result.
In some optional implementations of some embodiments, the classification subnetwork comprises a pooling layer and a fully connected layer. And inputting the image features into a classification sub-network to obtain a classification result, wherein the classification result comprises:
in a first step, image features are input into a pooling layer to obtain pooled image features.
And secondly, inputting the pooled image features into the full-link layer.
And thirdly, inputting the output result of the full connection into an activation function to obtain a classification result.
And 304, in response to the fact that the target object is determined to be contained in the image to be processed, segmenting the image to be processed to obtain a segmentation result.
In some optional implementations of some embodiments, in response to determining that the target object is not included in the image to be processed, prompt information for characterizing that the target object is not included in the image to be processed is output.
In some embodiments, in response to determining that the target object is not included in the image to be processed, prompt information for characterizing that the target object is not included in the image to be processed may be input.
As can be seen from fig. 3, compared with the description of some embodiments corresponding to fig. 2, the problem of background false detection in the image segmentation method implemented by the image segmentation network is solved. In addition, to solve the problem of background false detection, one possible way is to add training samples. For example, in training a face segmentation model, non-face images are added to the samples. However, this approach requires changing the training samples and controlling the ratio of the number of face images to non-face images in the training samples. Compared with the mode, the method provided by some embodiments of the disclosure does not need to change the training sample, and the workload of labeling the sample is reduced.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an image segmentation apparatus, which correspond to those shown in fig. 2, and which may be applied in particular in various electronic devices.
As shown in fig. 5, the image segmentation apparatus 500 of some embodiments includes: an image segmentation apparatus comprising: an acquisition unit 501, a feature extraction unit 502, a determination unit 503, and a segmentation unit 504. Wherein the acquisition unit 501 is configured to acquire an image to be processed. The feature extraction unit 502 is configured to perform feature extraction on the image to be processed, so as to obtain image features. A determination unit 503 configured to determine whether the target object is contained in the image to be processed based on the image feature. And a segmentation unit 504 configured to segment the image to be processed to obtain a segmentation result in response to determining that the target object is included in the image to be processed.
In an optional implementation of some embodiments, the feature extraction unit 502 may be further configured to: and inputting the image to be processed into a feature extraction sub-network in a pre-trained image segmentation network to obtain the image features.
In an optional implementation of some embodiments, the image segmentation network further comprises a classification subnetwork; and the determining unit 503 may be further configured to: and inputting the image characteristics into a classification sub-network to obtain a classification result, wherein the classification result is used for representing whether the image to be processed contains the target object or not.
In an alternative implementation of some embodiments, the classification subnetwork comprises a pooling layer and a fully connected layer; and the determining unit 503 may be further configured to: inputting the image features into a pooling layer to obtain pooled image features; inputting the pooled image features into the full-link layer; and inputting the output result of the full connection into an activation function to obtain a classification result.
In an optional implementation of some embodiments, the training samples of the image segmentation network include sample images, sample classification results, and sample segmentation results; and loss values used by the image segmentation network in the training process comprise classification loss values and segmentation loss values, wherein the classification loss values are used for representing the difference between a classification result obtained by inputting the sample image into the image segmentation network and the sample classification result, and the segmentation loss values are used for representing the difference between a segmentation result obtained by inputting the sample image into the image segmentation network and the sample segmentation result.
In an optional implementation of some embodiments, the segmentation unit 504 may be further configured to: and based on the image characteristics, segmenting the image to be processed to obtain a segmentation result.
In an optional implementation of some embodiments, the apparatus further comprises: an output unit configured to: and responding to the fact that the target object is not contained in the image to be processed, and outputting prompt information for representing that the target object is not contained in the image to be processed.
In some embodiments, whether the target object is included in the image to be processed is determined based on the image characteristics, so that targeted processing can be performed subsequently. On the basis, in response to the fact that the target object is determined to be contained in the image to be processed, the image to be processed is segmented, and a segmentation result is obtained. In the process, due to the fact that the segmentation opportunity is clarified, background false detection caused by segmentation under the condition that the target object is not included is avoided. Thereby, targeted image segmentation for the target object is achieved. For example, in a scene of segmenting a face, if the image to be processed does not include the face but is an image of a cat, the cat face in the image can be prevented from being segmented.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., the computing device of FIG. 1) 600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium of some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring an image to be processed; carrying out feature extraction on an image to be processed to obtain image features; determining whether the target object is contained in the image to be processed based on the image characteristics; and in response to the fact that the target object is determined to be contained in the image to be processed, segmenting the image to be processed to obtain a segmentation result.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code 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).
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 code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a feature extraction unit, a determination unit, and a segmentation unit. The names of these units do not in some cases constitute a limitation on the unit itself, and for example, the acquisition unit may also be described as a "unit that acquires an image to be processed".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
According to one or more embodiments of the present disclosure, there is provided an image segmentation method including: acquiring an image to be processed; carrying out feature extraction on an image to be processed to obtain image features; determining whether the target object is contained in the image to be processed based on the image characteristics; and in response to the fact that the target object is determined to be contained in the image to be processed, segmenting the image to be processed to obtain a segmentation result.
According to one or more embodiments of the present disclosure, performing feature extraction on an image to be processed to obtain an image feature includes: and inputting the image to be processed into a feature extraction sub-network in a pre-trained image segmentation network to obtain the image features.
According to one or more embodiments of the present disclosure, the image segmentation network further comprises a classification subnetwork; and determining whether the target object is contained in the image to be processed based on the image characteristics, including: and inputting the image characteristics into a classification sub-network to obtain a classification result, wherein the classification result is used for representing whether the image to be processed contains the target object or not.
According to one or more embodiments of the present disclosure, a classification subnetwork includes a pooling layer and a fully connected layer; and inputting the image features into a classification sub-network to obtain a classification result, wherein the classification result comprises: inputting the image features into a pooling layer to obtain pooled image features; inputting the pooled image features into the full-link layer; and inputting the output result of the full connection into an activation function to obtain a classification result.
According to one or more embodiments of the present disclosure, a training sample of an image segmentation network includes a sample image, a sample classification result, and a sample segmentation result; and loss values of the image segmentation network in the training process comprise classification loss values and segmentation loss values, wherein the classification loss values are used for representing the difference between a classification result obtained by inputting the sample image into the image segmentation network and a sample classification result, and the segmentation loss values are used for representing the difference between a segmentation result obtained by inputting the sample image into the image segmentation network and the sample segmentation result.
According to one or more embodiments of the present disclosure, in response to determining that a target object is included in an image to be processed, segmenting the image to be processed to obtain a segmentation result, including: and based on the image characteristics, segmenting the image to be processed to obtain a segmentation result.
In accordance with one or more embodiments of the present disclosure, a method further comprises: and responding to the fact that the target object is not contained in the image to be processed, and outputting prompt information for representing that the target object is not contained in the image to be processed.
According to one or more embodiments of the present disclosure, there is provided an image segmentation apparatus including: an acquisition unit configured to acquire an image to be processed; the image processing device comprises a feature extraction unit, a feature extraction unit and a processing unit, wherein the feature extraction unit is configured to perform feature extraction on an image to be processed to obtain image features; a determination unit configured to determine whether a target object is contained in the image to be processed based on the image feature; and the segmentation unit is configured to respond to the determination that the target object is contained in the image to be processed, and segment the image to be processed to obtain a segmentation result.
In an optional implementation of some embodiments, the feature extraction unit may be further configured to: and inputting the image to be processed into a feature extraction sub-network in a pre-trained image segmentation network to obtain the image features.
In an optional implementation of some embodiments, the image segmentation network further comprises a classification subnetwork; and the determining unit may be further configured to: and inputting the image characteristics into a classification sub-network to obtain a classification result, wherein the classification result is used for representing whether the image to be processed contains the target object or not.
In an alternative implementation of some embodiments, the classification subnetwork comprises a pooling layer and a fully connected layer; and the determining unit may be further configured to: inputting the image features into a pooling layer to obtain pooled image features; inputting the pooled image features into the full-link layer; and inputting the output result of the full connection into an activation function to obtain a classification result.
In an optional implementation of some embodiments, the training samples of the image segmentation network include sample images, sample classification results, and sample segmentation results; and loss values used by the image segmentation network in the training process comprise classification loss values and segmentation loss values, wherein the classification loss values are used for representing the difference between a classification result obtained by inputting the sample image into the image segmentation network and the sample classification result, and the segmentation loss values are used for representing the difference between a segmentation result obtained by inputting the sample image into the image segmentation network and the sample segmentation result.
In an alternative implementation of some embodiments, the segmentation unit may be further configured to: and based on the image characteristics, segmenting the image to be processed to obtain a segmentation result.
In an optional implementation of some embodiments, the apparatus further comprises: an output unit configured to: and responding to the fact that the target object is not contained in the image to be processed, and outputting prompt information for representing that the target object is not contained in the image to be processed.
In an alternative implementation of some embodiments, there is provided an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement any of the methods described above.
In an alternative implementation of some embodiments, a computer-readable medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as any one of the above.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. An image segmentation method comprising:
acquiring an image to be processed;
performing feature extraction on the image to be processed to obtain image features;
determining whether a target object is contained in the image to be processed based on the image characteristics;
and in response to the fact that the target object is contained in the image to be processed, segmenting the image to be processed to obtain a segmentation result.
2. The method according to claim 1, wherein the performing feature extraction on the image to be processed to obtain image features comprises:
and inputting the image to be processed into a feature extraction sub-network in a pre-trained image segmentation network to obtain the image features.
3. The method of claim 2, wherein the image segmentation network further comprises a classification sub-network; and
the determining whether the image to be processed contains the target object based on the image features comprises:
and inputting the image characteristics into the classification sub-network to obtain a classification result, wherein the classification result is used for representing whether the image to be processed contains the target object.
4. The method of claim 3, wherein the classification subnetwork comprises a pooling layer and a fully connected layer; and
inputting the image features into the classification sub-network to obtain a classification result, wherein the classification result comprises:
inputting the image features into the pooling layer to obtain pooled image features;
inputting the pooled image features into the fully-connected layer;
and inputting the output result of the full connection into an activation function to obtain the classification result.
5. The method of claim 3, wherein the training samples of the image segmentation network comprise sample images, sample classification results, and sample segmentation results; and
loss values of the image segmentation network in a training process comprise a classification loss value and a segmentation loss value, wherein the classification loss value is used for representing a difference between a classification result obtained by inputting the sample image into the image segmentation network and the sample classification result, and the segmentation loss value is used for representing a difference between a segmentation result obtained by inputting the sample image into the image segmentation network and the sample segmentation result.
6. The method of claim 1, wherein the segmenting the image to be processed in response to determining that the target object is included in the image to be processed, resulting in a segmentation result, comprises:
and segmenting the image to be processed based on the image characteristics to obtain a segmentation result.
7. The method according to any one of claims 1-6, wherein the method further comprises:
and in response to determining that the target object is not included in the image to be processed, outputting prompt information for representing that the target object is not included in the image to be processed.
8. An image segmentation apparatus comprising:
an acquisition unit configured to acquire an image to be processed;
the characteristic extraction unit is configured to extract the characteristics of the image to be processed to obtain image characteristics;
a determination unit configured to determine whether a target object is contained in the image to be processed based on the image feature;
and the segmentation unit is configured to respond to the determination that the target object is contained in the image to be processed, and segment the image to be processed to obtain a segmentation result.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN202011083931.4A 2020-10-12 2020-10-12 Image segmentation method and device, electronic equipment and computer readable medium Pending CN112215853A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011083931.4A CN112215853A (en) 2020-10-12 2020-10-12 Image segmentation method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011083931.4A CN112215853A (en) 2020-10-12 2020-10-12 Image segmentation method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN112215853A true CN112215853A (en) 2021-01-12

Family

ID=74054454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011083931.4A Pending CN112215853A (en) 2020-10-12 2020-10-12 Image segmentation method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112215853A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113283436A (en) * 2021-06-11 2021-08-20 北京有竹居网络技术有限公司 Picture processing method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020971A (en) * 2012-12-28 2013-04-03 青岛爱维互动信息技术有限公司 Method for automatically segmenting target objects from images
CN108920580A (en) * 2018-06-25 2018-11-30 腾讯科技(深圳)有限公司 Image matching method, device, storage medium and terminal
CN109636805A (en) * 2018-11-19 2019-04-16 浙江大学山东工业技术研究院 A kind of uterine neck image lesion region segmenting device and method based on classification priori
CN109977997A (en) * 2019-02-13 2019-07-05 中国科学院自动化研究所 Image object detection and dividing method based on convolutional neural networks fast robust
CN110543911A (en) * 2019-08-31 2019-12-06 华南理工大学 weak supervision target segmentation method combined with classification task
CN111429459A (en) * 2020-04-07 2020-07-17 上海极链网络科技有限公司 End-to-end joint classification medical image segmentation method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020971A (en) * 2012-12-28 2013-04-03 青岛爱维互动信息技术有限公司 Method for automatically segmenting target objects from images
CN108920580A (en) * 2018-06-25 2018-11-30 腾讯科技(深圳)有限公司 Image matching method, device, storage medium and terminal
CN109636805A (en) * 2018-11-19 2019-04-16 浙江大学山东工业技术研究院 A kind of uterine neck image lesion region segmenting device and method based on classification priori
CN109977997A (en) * 2019-02-13 2019-07-05 中国科学院自动化研究所 Image object detection and dividing method based on convolutional neural networks fast robust
CN110543911A (en) * 2019-08-31 2019-12-06 华南理工大学 weak supervision target segmentation method combined with classification task
CN111429459A (en) * 2020-04-07 2020-07-17 上海极链网络科技有限公司 End-to-end joint classification medical image segmentation method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113283436A (en) * 2021-06-11 2021-08-20 北京有竹居网络技术有限公司 Picture processing method and device and electronic equipment
CN113283436B (en) * 2021-06-11 2024-01-23 北京有竹居网络技术有限公司 Picture processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN113379627A (en) Training method of image enhancement model and method for enhancing image
CN111311480B (en) Image fusion method and device
WO2020093724A1 (en) Method and device for generating information
JP2023531350A (en) A method for incrementing a sample image, a method for training an image detection model and a method for image detection
WO2023082453A1 (en) Image processing method and device
WO2020062494A1 (en) Image processing method and apparatus
WO2022111387A1 (en) Data processing method and related apparatus
CN114359289A (en) Image processing method and related device
CN116452810A (en) Multi-level semantic segmentation method and device, electronic equipment and storage medium
JP2023131117A (en) Joint perception model training, joint perception method, device, and medium
CN110211017B (en) Image processing method and device and electronic equipment
CN114399814A (en) Deep learning-based obstruction removal and three-dimensional reconstruction method
CN112215853A (en) Image segmentation method and device, electronic equipment and computer readable medium
CN116402914A (en) Method, device and product for determining stylized image generation model
CN113688928B (en) Image matching method and device, electronic equipment and computer readable medium
CN115546554A (en) Sensitive image identification method, device, equipment and computer readable storage medium
CN114882308A (en) Biological feature extraction model training method and image segmentation method
CN114399590A (en) Face occlusion removal and three-dimensional model generation method based on face analysis graph
CN115700838A (en) Training method and device for image recognition model and image recognition method
CN113762279A (en) Target image recognition method, model training method, device, equipment and medium
CN112070888A (en) Image generation method, device, equipment and computer readable medium
CN115661238B (en) Method and device for generating travelable region, electronic equipment and computer readable medium
CN113239943B (en) Three-dimensional component extraction and combination method and device based on component semantic graph
CN115331077B (en) Training method of feature extraction model, target classification method, device and equipment
CN116612371B (en) Neural network reasoning method, device, equipment and medium based on Bian Yun decoupling

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.