WO2021189913A1 - Method and apparatus for target object segmentation in image, and electronic device and storage medium - Google Patents

Method and apparatus for target object segmentation in image, and electronic device and storage medium Download PDF

Info

Publication number
WO2021189913A1
WO2021189913A1 PCT/CN2020/131993 CN2020131993W WO2021189913A1 WO 2021189913 A1 WO2021189913 A1 WO 2021189913A1 CN 2020131993 W CN2020131993 W CN 2020131993W WO 2021189913 A1 WO2021189913 A1 WO 2021189913A1
Authority
WO
WIPO (PCT)
Prior art keywords
segmentation
image
strongly
annotated image
annotated
Prior art date
Application number
PCT/CN2020/131993
Other languages
French (fr)
Chinese (zh)
Inventor
叶苓
李楠楠
刘新卉
黄凌云
刘玉宇
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021189913A1 publication Critical patent/WO2021189913A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • 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/10116X-ray image
    • 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]

Definitions

  • This application relates to the field of image processing technology, and in particular to a method, device, electronic device, and computer-readable storage medium for segmenting a target in an image.
  • the existing processing method When performing lesion segmentation on a large number of medical imaging pictures, the existing processing method usually trains different neural network models for the same lesion to use multiple neural network models to jointly achieve the lesion segmentation.
  • the segmentation of lesions in X-ray chest radiographs requires training of the exclusion model of the external position of the lesion, the detection model of the location of the lesion, the outline model of the edge of the lesion, and so on.
  • the inventor realized that if a large amount of high-precision annotation data cannot be obtained, the trained model has poor accuracy in segmenting the lesion, that is, when the number of high-precision annotation data is less than the number of low-precision annotation data, the accuracy of the lesion segmentation is The degree is poor.
  • a method for segmenting a target in an image provided by this application includes:
  • the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
  • annotated image set Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
  • the shared coding submodel uses the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset.
  • segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result
  • the image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
  • the present application also provides a device for segmenting a target in an image, and the device includes:
  • a model acquisition module for acquiring a target object segmentation model, wherein the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
  • Annotated image acquisition module for acquiring annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the strongly annotated image subset quantity;
  • An annotated image preprocessing module configured to perform image preprocessing on the annotated image set by using the preprocessing sub-model
  • the annotated image encoding module is configured to encode the preprocessed annotated image set by using the shared coding submodel to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes strong annotation The first encoding feature of the strongly annotated image in the image subset and the second encoding feature of the weakly annotated image in the weakly annotated image subset;
  • the feature classification module is configured to use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly annotated image and a classification result of a weakly annotated image;
  • a feature segmentation module configured to use the segmentation submodel to perform segmentation processing on the first encoding feature of the strongly annotated image in the strongly annotated image subset to obtain a strongly annotated image segmentation result;
  • a loss function acquisition module configured to construct a segmentation loss function based on the strongly labeled image classification result and the strongly labeled image segmentation result, and construct a classification loss function based on the weakly labeled image classification result;
  • a model optimization module is used to optimize the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model
  • the image segmentation module is used to obtain an image to be segmented, and use the standard target segmentation model to perform target segmentation on the image to be segmented to obtain a segmentation result.
  • This application also provides an electronic device, which includes:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the following steps:
  • the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
  • annotated image set Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
  • the shared coding submodel uses the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset.
  • segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result
  • the image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
  • the present application also provides a computer-readable storage medium, including a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein, When the computer program is executed by the processor, the following steps are implemented:
  • the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
  • annotated image set Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
  • the shared coding submodel uses the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset.
  • segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result
  • the image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
  • FIG. 1 is a schematic flowchart of a method for segmenting a target in an image provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of a process of classifying a first encoded feature through a classification sub-model according to an embodiment of the application;
  • FIG. 3 is a schematic diagram of a process of performing segmentation processing on a first encoded feature through a segmentation sub-model according to an embodiment of the application;
  • FIG. 4 is a schematic flowchart of optimizing the target object segmentation model provided by an embodiment of the application
  • FIG. 5 is a schematic diagram of modules of a device for segmenting a target in an image provided by an embodiment of the application;
  • FIG. 6 is a schematic diagram of the internal structure of an electronic device for implementing a method for segmenting a target in an image provided by an embodiment of the application;
  • the execution subject of the method for segmenting a target object in an image provided by the embodiment of the present application includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiment of the present application, such as a server and a terminal.
  • the method for segmenting the target in the image can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
  • This application provides a method for segmenting a target in an image.
  • FIG. 1 it is a schematic flowchart of a method for segmenting a target in an image provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the method for segmenting the target in the image includes:
  • the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model.
  • the target segmentation model is a convolutional neural network with image classification and image segmentation functions
  • the convolutional neural network includes a convolutional layer, a pooling layer, and a fully connected layer.
  • the target object segmentation model includes a combination of the following one or more layers:
  • the convolutional layer is used to convolve the image. For each feature in the picture, it is first localized, and then a higher level is performed on the local integrated operation to obtain global information;
  • Pooling layer which performs pooling processing on the convolved image for feature dimensionality reduction, which is conducive to reducing the number of data and parameters, and improving the fault tolerance of the model;
  • the fully connected layer is used for linear classification, specifically used to perform linear combination on the extracted high-level feature vectors and output the final image classification result.
  • the target segmentation model includes a preprocessing submodel, a shared coding submodel, a classification submodel, and a segmentation submodel.
  • the pre-processing sub-model is used to pre-process the input image
  • the shared coding sub-model is used to code the input image
  • the classification sub-model is used to determine whether the image input by the model contains the target lesion, so
  • the segmentation sub-model is used to segment the image that is determined by the classification sub-model to contain the target lesion.
  • annotated image set wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets.
  • the labeled image set includes medical images of biological tissues with labels.
  • the annotated image set is a medical image (such as an X-ray image) produced by a medical institution.
  • a python sentence with a data capture function can be used to obtain annotated image set from a blockchain node for storing medical images, and the high data throughput of the blockchain can be used to improve the efficiency of obtaining annotated image set.
  • the annotated image set includes a weakly annotated image subset (a set of weakly annotated images) and a strongly annotated image subset (a set of strongly annotated images), and the images in the weakly annotated image subset
  • the number of is greater than the number of images in the strongly annotated image subset.
  • the number of weakly annotated images is 80% of the annotated image set, and the number of strongly annotated images is 20% of the annotated image set.
  • the weakly annotated images included in the weakly annotated image subset are annotated data with low annotation accuracy
  • the strongly annotated images included in the strongly annotated image subset are annotated data with high annotation accuracy
  • the weakly annotated images in the weakly annotated image subset only indicate whether the image contains a target
  • the strongly annotated images in the strongly annotated image subset indicate the location of the target
  • the image preprocessing on the annotated image set includes:
  • the embodiment of the present application uses the following normalization algorithm to perform pixel normalization processing on the annotated images in the annotated image collection:
  • P x is the original pixel value in the annotated image
  • P g is the normalized pixel value in the annotated image
  • the acquired annotated images in the annotated image set may not meet the conditions of medical image analysis. Therefore, the preprocessing sub-model is used to normalize the annotated images in the annotated image set, and the normalization operation is used. Remove the noise pixels in the annotated image and improve the accuracy of subsequent segmentation or classification of the annotated image.
  • the encoding the preprocessed annotated image set by using the shared coding submodel to obtain the encoding feature of the annotated image set includes:
  • Pooling is performed on all convolutional images in the convolutional image set to obtain the coding feature of the annotated image set.
  • the encoding feature of the annotated image set includes a first encoding feature of a strongly annotated image in the strongly annotated image subset and a second encoding feature of a weakly annotated image in the weakly annotated image subset.
  • the number of the first coding feature is multiple, and the number of the second coding feature is also multiple.
  • the implementation of this application to encode the annotated image set is conducive to reducing the amount of useless data in the annotated image set and improving the efficiency of data processing.
  • S5. Use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image.
  • the classification sub-model is used to classify the first encoding feature to obtain the classification result of each strongly annotated image in the strongly annotated image subset; the classification sub-model is used to classify the second encoding feature to obtain the weak The classification result of each weakly annotated image in the annotated image subset.
  • Fig. 2 is a schematic diagram of a process of classifying a first encoded feature through a classification sub-model according to an embodiment of the application.
  • the classification processing of the first coding feature using the classification sub-model to obtain a classification result of a strongly labeled image includes:
  • S51 Perform full connection processing on the first encoding feature of the strongly labeled image in the strongly labeled image subset by using the classification sub-model to obtain a fully connected feature;
  • S52 Calculate the first category probability that the fully connected feature belongs to the first preset category by using the first activation function
  • the first preset category includes a plurality of preset categories, and the first coding feature of a strongly annotated image in the strongly annotated image subset is classified according to the first category probability to obtain a strongly annotated image
  • the image classification result that is, it is determined that the preset category with the largest probability value of the first category is the strongly labeled image classification result.
  • the first preset category includes category A, category B, and category C
  • the probability that the fully connected feature belongs to category A in the first preset category is 50%
  • the probability that the fully connected feature belongs to category B in the first preset category It is 80%
  • the probability that the fully connected feature belongs to category C in the first preset category is 30%, and it is determined that the strongly labeled image classification result is category B.
  • the second coding feature is subjected to the same classification processing as the first coding feature to obtain a weakly labeled image classification result.
  • the first activation function includes, but is not limited to, a softmax activation function.
  • the activation function can be used to calculate the first category probability that the fully connected feature is the first preset category.
  • FIG. 3 is a schematic diagram of a process of performing segmentation processing on a first encoding feature through a segmentation submodel according to an embodiment of the application.
  • the segmentation processing of the first coding feature of the strongly annotated image in the strongly annotated image subset by using the segmentation submodel to obtain the strongly annotated image segmentation result includes:
  • S61 Up-sampling the first coding feature of the strongly annotated image in the strongly annotated image subset by a first threshold multiple to obtain an intermediate feature map;
  • S63 Calculate the second category probability of each pixel in the restored image belonging to the second preset category by using the second activation function
  • the segmentation processing includes classifying pixels in the restored image, the second preset category includes a plurality of preset categories, and the first encoding feature is segmented according to the second category probability
  • the strongly labeled image segmentation result is obtained, that is, it is determined that the preset category with the largest probability value of the second category is the strongly labeled image segmentation result.
  • the first preset category includes category D, category E, and category F
  • the probability that the target pixel in the restored image is category D in the second preset category is 20%
  • the target pixel in the restored image is the second preset
  • the probability of category E in the category is 70%
  • the probability that the target pixel in the restored image is category F in the second preset category is 40%
  • the first encoded feature is up-sampled by a first threshold multiple to obtain an intermediate feature map
  • the intermediate feature map is up-sampled by a second threshold multiple to obtain a restored image, avoiding directly uploading the first encoded feature
  • the up-sampling factor is too large, which leads to the loss of image features in the restored image, which improves the integrity of the feature information in the restored image.
  • the segmentation loss function is:
  • L cls is a classification sub-function constructed based on the strongly-annotated image classification result
  • L seg is a segmentation sub-function constructed based on the strongly-annotated image segmentation result
  • ⁇ 1 2 and ⁇ 2 2 are preset parameters.
  • classification sub-function L cls constructed based on the strongly-labeled image classification result and the segmentation sub-function L seg constructed based on the strongly-labeled image segmentation result are respectively:
  • M is the number of strongly annotated images in the strongly annotated image subset
  • y i is the preset standard label of the i-th strongly annotated image in the strongly annotated image subset
  • p i is the first strongly annotated image in the strongly annotated image subset.
  • Strongly annotated image classification results of i strongly annotated images T represents the total pixel value of each strongly annotated image
  • p ij is the strongly annotated image segmentation result of the jth pixel of the i-th image in the strongly annotated image subset
  • g ij is The pre-set standard segmentation result of the j-th pixel of the i-th image in the strongly-labeled image set.
  • the classification loss function is a classification sub-function L cls constructed based on the strongly labeled image classification result.
  • the target segmentation model is optimized, that is, the values of the preset hyperparameters in the target segmentation model are adjusted to obtain a new target segmentation model, that is, the standard target segmentation model.
  • FIG. 4 is a schematic flowchart of optimizing the target object segmentation model provided by an embodiment of the application.
  • the use of the segmentation loss function and the classification loss function to optimize the target segmentation model includes:
  • the number of target iterations of the target segmentation model is 8000, the first time the gradient descent algorithm is used to update the parameters of the target segmentation model based on the classification loss value; the second time the gradient descent algorithm is used based on the segmentation loss value The parameters of the target object segmentation model are updated; the third time the gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value; the fourth time the gradient descent algorithm is used to update the parameters of the target object segmentation model based on the segmentation loss value.
  • the parameters of the target segmentation model are updated, and so on, based on the classification loss value and the segmentation loss value, the parameters of the target segmentation model are updated in turn until the number of iterations of the target segmentation model reaches 8000 times to obtain the standard Target segmentation model.
  • the classification loss function and the segmentation loss function are used to limit the target segmentation model, which improves the accuracy of the target segmentation model for classifying and segmenting images.
  • the gradient descent algorithm is used in turn based on the classification loss value and the result.
  • the segmentation loss value updates the parameters of the target object segmentation model, which avoids the situation that the classification loss function and the segmentation loss function update the target object segmentation model at the same time to cause parameter contradictions, which is beneficial to improve the accuracy of the model.
  • the gradient descent algorithm is continuously used to iteratively update the parameters of the network, so that the target loss function is continuously reduced until the value of the target loss function is stable and reaches the convergence condition, and the standard lesion segmentation model is obtained.
  • the joint learning of the classification loss function and the segmentation loss function can increase the amount of information extracted by the target object segmentation model from the labeled image set, which overcomes the small amount of high-precision strongly labeled images in the training process.
  • the classification loss function and the segmentation loss function jointly determine the parameters of the target segmentation model, which can avoid overfitting of the target segmentation model, and make the target segmentation model have stronger generalization ability.
  • the image to be segmented may be uploaded by a user. After the image to be segmented is obtained, the image to be segmented is input to the standard lesion segmentation model for target segmentation, and the segmentation result is obtained.
  • a target segmentation model including a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model is obtained to realize the use of the target segmentation model to segment the target in the image without separate training Multiple models to segment the image, to avoid the inconsistency of the efficiency between different separate models, resulting in inefficient target segmentation, and to improve the efficiency of target segmentation in the image; segmentation of the target through a large number of weakly annotated images and a small number of strongly annotated images
  • the model is trained, and the segmentation loss function and the classification loss function are used to optimize the model according to the training results, which improves the accuracy of the model, thereby improving the accuracy of the target object segmentation model in the image segmentation. Therefore, the method for segmenting a target in an image proposed in this application can improve the efficiency and accuracy of lesion segmentation when the number of low-precision labeled data is larger than that of high-precision labeled data.
  • FIG. 5 it is a schematic diagram of the module of the device for segmenting the object in the image of the present application.
  • the device 100 for segmenting the object in the image described in this application can be installed in an electronic device.
  • the device for segmenting the target in the image may include a model acquisition module 101, an annotated image acquisition module 102, an annotated image preprocessing module 103, an annotated image encoding module 104, a feature classification module 105, a feature segmentation module 106, The loss function acquisition module 107, the model optimization module 108, and the image segmentation module 109.
  • the module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the model acquisition module 101 is configured to acquire a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
  • the annotated image acquisition module 102 is configured to acquire an annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of the weakly annotated image subsets is greater than that of the strongly annotated image subsets The number of image subsets;
  • the annotated image preprocessing module 103 is configured to perform image preprocessing on the annotated image set by using the preprocessing sub-model;
  • the annotated image encoding module 104 is configured to use the shared encoding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set Including the first encoding feature of the strongly annotated image in the strongly annotated image subset and the second encoding feature of the weakly annotated image in the weakly annotated image subset;
  • the feature classification module 105 is configured to use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly annotated image and a classification result of a weakly annotated image;
  • the feature segmentation module 106 is configured to use the segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset to obtain a strongly annotated image segmentation result;
  • the loss function acquisition module 107 is configured to construct a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and construct a classification loss function according to the weakly annotated image classification result;
  • the model optimization module 108 is configured to use the segmentation loss function and the classification loss function to optimize the target object segmentation model to obtain a standard target object segmentation model;
  • the image segmentation module 109 is configured to obtain an image to be segmented, and use the standard target segmentation model to perform target segmentation on the image to be segmented to obtain a segmentation result.
  • each module of the device for segmenting the object in the image is as follows:
  • the model acquisition module 101 is configured to acquire a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model.
  • the target segmentation model is a convolutional neural network with image classification and image segmentation functions
  • the convolutional neural network includes a convolutional layer, a pooling layer, and a fully connected layer.
  • the target object segmentation model includes a combination of the following one or more layers:
  • the convolutional layer is used to convolve the image. For each feature in the picture, it is first localized, and then a higher level is performed on the local integrated operation to obtain global information;
  • Pooling layer which performs pooling processing on the convolved image for feature dimensionality reduction, which is conducive to reducing the number of data and parameters, and improving the fault tolerance of the model;
  • the fully connected layer is used for linear classification, specifically used to perform linear combination on the extracted high-level feature vectors and output the final image classification result.
  • the target segmentation model includes a preprocessing submodel, a shared coding submodel, a classification submodel, and a segmentation submodel.
  • the pre-processing sub-model is used to pre-process the input image
  • the shared coding sub-model is used to code the input image
  • the classification sub-model is used to determine whether the image input by the model contains the target lesion, so
  • the segmentation sub-model is used to segment the image that is determined by the classification sub-model to contain the target lesion.
  • the annotated image acquisition module 102 is configured to acquire an annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of the weakly annotated image subsets is greater than that of the strongly annotated image subsets The number of image subsets.
  • the labeled image set includes medical images of biological tissues with labels.
  • the annotated image set is a medical image (such as an X-ray image) produced by a medical institution.
  • a python sentence with a data capture function can be used to obtain annotated image set from a blockchain node for storing medical images, and the high data throughput of the blockchain can be used to improve the efficiency of obtaining annotated image set.
  • the annotated image set includes a weakly annotated image subset (a set of weakly annotated images) and a strongly annotated image subset (a set of strongly annotated images), and the images in the weakly annotated image subset
  • the number of is greater than the number of images in the strongly annotated image subset.
  • the number of weakly annotated images is 80% of the annotated image set, and the number of strongly annotated images is 20% of the annotated image set.
  • the weakly annotated images included in the weakly annotated image subset are annotated data with low annotation accuracy
  • the strongly annotated images included in the strongly annotated image subset are annotated data with high annotation accuracy
  • the weakly annotated images in the weakly annotated image subset only indicate whether the image contains a target
  • the strongly annotated images in the strongly annotated image subset indicate the location of the target
  • the annotated image preprocessing module 103 is configured to perform image preprocessing on the annotated image set by using the preprocessing sub-model.
  • the annotated image preprocessing module 103 is specifically configured to:
  • the embodiment of the present application uses the following normalization algorithm to perform pixel normalization processing on the annotated images in the annotated image collection:
  • P x is the original pixel value in the annotated image
  • P g is the normalized pixel value in the annotated image
  • the annotated images in the annotated image set acquired may not meet the conditions of medical image analysis. Therefore, the preprocessing sub-model is used to perform normalization preprocessing on the annotated images in the annotated image set, and normalization is used.
  • the transformation operation removes the noise pixels in the annotated image and improves the accuracy of subsequent segmentation or classification of the annotated image.
  • the annotated image encoding module 104 is configured to use the shared encoding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set It includes the first encoding feature of the strongly annotated image in the strongly annotated image subset and the second encoding feature of the weakly annotated image in the weakly annotated image subset.
  • the annotated image encoding module 104 is specifically configured to:
  • Pooling is performed on all convolutional images in the convolutional image set to obtain the coding feature of the annotated image set.
  • the encoding feature of the annotated image set includes a first encoding feature of a strongly annotated image in the strongly annotated image subset and a second encoding feature of a weakly annotated image in the weakly annotated image subset.
  • the number of the first coding feature is multiple, and the number of the second coding feature is also multiple.
  • the implementation of this application to encode the annotated image set is conducive to reducing the amount of useless data in the annotated image set and improving the efficiency of data processing.
  • the feature classification module 105 is configured to use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly annotated image and a classification result of a weakly annotated image.
  • the classification sub-model is used to classify the first encoding feature to obtain the classification result of each strongly annotated image in the strongly annotated image subset; the classification sub-model is used to classify the second encoding feature to obtain the weak The classification result of each weakly annotated image in the annotated image subset.
  • the feature classification module 105 is specifically configured to:
  • the first preset category includes a plurality of preset categories, and the first coding feature of a strongly annotated image in the strongly annotated image subset is classified according to the first category probability to obtain a strongly annotated image
  • the image classification result that is, it is determined that the preset category with the largest probability value of the first category is the strongly labeled image classification result.
  • the first preset category includes category A, category B, and category C
  • the probability that the fully connected feature belongs to category A in the first preset category is 50%
  • the probability that the fully connected feature belongs to category B in the first preset category It is 80%
  • the probability that the fully connected feature belongs to category C in the first preset category is 30%, and it is determined that the strongly labeled image classification result is category B.
  • the second coding feature is subjected to the same classification processing as the first coding feature to obtain a weakly labeled image classification result.
  • the first activation function includes, but is not limited to, a softmax activation function.
  • the activation function can be used to calculate the first category probability that the fully connected feature is the first preset category.
  • the feature segmentation module 106 is configured to use the segmentation submodel to perform segmentation processing on the first encoding feature of the strongly annotated image in the strongly annotated image subset to obtain a strongly annotated image segmentation result.
  • the feature segmentation module 106 is specifically configured to:
  • the segmentation process includes classifying pixels in the restored image, the second preset category includes a plurality of preset categories, and the first encoding feature is segmented according to the second category probability
  • the strongly labeled image segmentation result is obtained, that is, it is determined that the preset category with the largest probability value of the second category is the strongly labeled image segmentation result.
  • the first preset category includes category D, category E, and category F
  • the probability that the target pixel in the restored image is category D in the second preset category is 20%
  • the target pixel in the restored image is the second preset
  • the probability of category E in the category is 70%
  • the probability that the target pixel in the restored image is category F in the second preset category is 40%
  • the first encoded feature is up-sampled by a first threshold multiple to obtain an intermediate feature map
  • the intermediate feature map is up-sampled by a second threshold multiple to obtain a restored image, avoiding directly uploading the first encoded feature
  • the up-sampling factor is too large, which leads to the loss of image features in the restored image, which improves the integrity of the feature information in the restored image.
  • the loss function acquisition module 107 is configured to construct a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and construct a classification loss function according to the weakly annotated image classification result.
  • the segmentation loss function is:
  • L cls is a classification sub-function constructed based on the strongly-annotated image classification result
  • L seg is a segmentation sub-function constructed based on the strongly-annotated image segmentation result
  • ⁇ 1 2 and ⁇ 2 2 are preset parameters.
  • classification sub-function L cls constructed based on the strongly-labeled image classification result and the segmentation sub-function L seg constructed based on the strongly-labeled image segmentation result are respectively:
  • M is the number of strongly annotated images in the strongly annotated image subset
  • y i is the preset standard label of the i-th strongly annotated image in the strongly annotated image subset
  • p i is the first strongly annotated image in the strongly annotated image subset.
  • Strongly annotated image classification results of i strongly annotated images T represents the total pixel value of each strongly annotated image
  • p ij is the strongly annotated image segmentation result of the jth pixel of the i-th image in the strongly annotated image subset
  • g ij is The pre-set standard segmentation result of the j-th pixel of the i-th image in the strongly-labeled image set.
  • the classification loss function is a classification sub-function L cls constructed based on the strongly labeled image classification result.
  • the model optimization module 108 is configured to use the segmentation loss function and the classification loss function to optimize the target object segmentation model to obtain a standard target object segmentation model.
  • the target segmentation model is optimized, that is, the values of the preset hyperparameters in the target segmentation model are adjusted to obtain a new target segmentation model, that is, the standard target segmentation model.
  • model optimization module 108 is specifically configured to:
  • a gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value and the segmentation loss value in turn, until the number of iterations of the target object segmentation model reaches the target number of iterations.
  • the number of target iterations of the target segmentation model is 8000, the first time the gradient descent algorithm is used to update the parameters of the target segmentation model based on the classification loss value; the second time the gradient descent algorithm is used based on the segmentation loss value The parameters of the target object segmentation model are updated; the third time the gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value; the fourth time the gradient descent algorithm is used to update the parameters of the target object segmentation model based on the segmentation loss value.
  • the parameters of the target segmentation model are updated, and so on, based on the classification loss value and the segmentation loss value, the parameters of the target segmentation model are updated in turn until the number of iterations of the target segmentation model reaches 8000 times to obtain the standard Target segmentation model.
  • the classification loss function and the segmentation loss function are used to limit the target segmentation model, which improves the accuracy of the target segmentation model for classifying and segmenting images.
  • the gradient descent algorithm is used in turn based on the classification loss value and the result.
  • the segmentation loss value updates the parameters of the target object segmentation model, which avoids the situation that the classification loss function and the segmentation loss function update the target object segmentation model at the same time to cause parameter contradictions, which is beneficial to improve the accuracy of the model.
  • the gradient descent algorithm is continuously used to iteratively update the parameters of the network, so that the target loss function is continuously reduced until the value of the target loss function is stable and reaches the convergence condition, and the standard lesion segmentation model is obtained.
  • the joint learning of the classification loss function and the segmentation loss function can increase the amount of information extracted by the target object segmentation model from the labeled image set, which overcomes the small amount of high-precision strongly labeled images in the training process.
  • the classification loss function and the segmentation loss function jointly determine the parameters of the target segmentation model, which can avoid overfitting of the target segmentation model, and make the target segmentation model have stronger generalization ability.
  • the image segmentation module 109 is configured to obtain an image to be segmented, and use the standard target segmentation model to perform target segmentation on the image to be segmented to obtain a segmentation result.
  • the image to be segmented may be uploaded by a user. After the image to be segmented is obtained, the image to be segmented is input to the standard lesion segmentation model for target segmentation, and the segmentation result is obtained.
  • a target segmentation model including a preprocessing submodel, a shared coding submodel, a classification submodel, and a segmentation submodel is obtained, so as to realize the use of the target segmentation model to segment the target in the image without separate training.
  • the device for segmenting a target in an image proposed in the present application can improve the efficiency and accuracy of lesion segmentation when the number of low-precision labeled data is larger than that of high-precision labeled data.
  • FIG. 6 it is a schematic structural diagram of an electronic device that implements a method for segmenting a target in an image according to the present application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a segmentation program 12 for a target in an image.
  • the memory 11 may be volatile or non-volatile.
  • the memory 11 includes at least one type of readable storage medium.
  • the readable storage medium includes flash memory, mobile hard disk, and multimedia card.
  • Card-type memory for example: SD or DX memory, etc.
  • magnetic memory magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1.
  • SD Secure Digital
  • flash Card Flash Card
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the segmentation program 12 of the target in the image, etc., but also to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc.
  • the processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as executing The segmentation program of the target in the image, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 6 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 6 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the segmentation program 12 of the target object in the image stored in the memory 11 in the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can realize:
  • the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
  • annotated image set Acquiring an annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of the weakly annotated image subsets is greater than the number of the strongly annotated image subsets;
  • the shared coding submodel uses the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset.
  • segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result
  • the image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
  • the integrated module/unit of the electronic device 1 can be stored in a computer-readable storage medium. It can be volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store a block chain node Use the created data, etc.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

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

Abstract

A method and apparatus for target object segmentation in an image, and a device and a storage medium. The method comprises: coding a labeled image set to obtain a first coding feature and a second coding feature (S4); respectively performing classification processing on the first coding feature and the second coding feature (S5); performing segmentation processing on the first coding feature (S6); constructing a segmentation loss function and a classification loss function according to a classification processing result and a segmentation processing result, and optimizing a target object segmentation model, to obtain a standard target object segmentation model; and performing target object segmentation on an image to be subjected to segmentation using the standard target object segmentation model, so as to obtain a segmentation result (S9). The method can be applied to lung lesion segmentation, and improve the efficiency and accuracy of target object segmentation in an image when the amount of low-precision labeled data is greater than the amount of high-precision labeled data.

Description

图像中目标物的分割方法、装置、电子设备及存储介质Method, device, electronic equipment and storage medium for segmentation of target in image
本申请要求于2020年09月24日提交中国专利局、申请号为CN202011015764.X、名称为“图像中目标物的分割方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on September 24, 2020, with the application number CN202011015764.X, titled "Methods, devices, electronic equipment and storage media for segmentation of objects in images", which The entire content is incorporated into this application by reference.
技术领域Technical field
本申请涉及图像处理技术领域,尤其涉及一种图像中目标物的分割方法、装置、电子设备及计算机可读存储介质。This application relates to the field of image processing technology, and in particular to a method, device, electronic device, and computer-readable storage medium for segmenting a target in an image.
背景技术Background technique
目前通过医学影像图片(如X光胸片)将病灶分割出来以进行疾病的早期判断,是提高患者健康最有效的途径。目前,随着人们健康意识的提升,各大医院与医疗机构的医学影像图片的数量呈***式增长。At present, segmenting the lesions through medical imaging pictures (such as X-ray chest radiographs) for early diagnosis of the disease is the most effective way to improve the health of patients. At present, with the improvement of people's health awareness, the number of medical imaging pictures in major hospitals and medical institutions has exploded.
在对海量的医学影像图片进行病灶分割时,现有的处理方法通常是针对同一病灶分别训练不同的神经网络模型以利用多个神经网络模型共同实现病灶的分割。例如,X光胸片中病灶的分割需要训练病灶外部位排阴模型、病灶位置的检测模型、病灶边缘的勾勒模型等。然而,发明人意识到,若无法获得大量高精度标注数据,训练出来的模型对病灶进行分割的精确度较差,即高精度标注数据的数量小于低精度标注数据的数量时,病灶分割的精确度较差。并且,多个单独的模型分别对图像进行不同操作以共同实现病灶分割时会出现每个模型的效率不一致造成总体分割过程中分割的效率不高。因此,如何在低精度标注数据数量多于高精度标注数据时进行高效和准确的病灶分割,成为亟待解决的问题。When performing lesion segmentation on a large number of medical imaging pictures, the existing processing method usually trains different neural network models for the same lesion to use multiple neural network models to jointly achieve the lesion segmentation. For example, the segmentation of lesions in X-ray chest radiographs requires training of the exclusion model of the external position of the lesion, the detection model of the location of the lesion, the outline model of the edge of the lesion, and so on. However, the inventor realized that if a large amount of high-precision annotation data cannot be obtained, the trained model has poor accuracy in segmenting the lesion, that is, when the number of high-precision annotation data is less than the number of low-precision annotation data, the accuracy of the lesion segmentation is The degree is poor. In addition, when multiple separate models perform different operations on the image to jointly achieve lesion segmentation, the efficiency of each model is inconsistent, resulting in inefficient segmentation in the overall segmentation process. Therefore, how to perform efficient and accurate lesion segmentation when the number of low-precision labeled data is larger than that of high-precision labeled data has become an urgent problem to be solved.
发明内容Summary of the invention
本申请提供的一种图像中目标物的分割方法,包括:A method for segmenting a target in an image provided by this application includes:
获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型;Acquiring a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
利用所述预处理子模型对所述标注图像集进行图像预处理;Using the preprocessing submodel to perform image preprocessing on the annotated image set;
利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;Use the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset. The first encoding feature and the second encoding feature of the weakly annotated images in the weakly annotated image subset;
利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;Performing classification processing on the first coding feature and the second coding feature by using the classification sub-model to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image;
利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;Using the segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result;
根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;Constructing a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and constructing a classification loss function according to the weakly annotated image classification result;
利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;Optimizing the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
本申请还提供一种图像中目标物的分割装置,所述装置包括:The present application also provides a device for segmenting a target in an image, and the device includes:
模型获取模块,用于获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型;A model acquisition module for acquiring a target object segmentation model, wherein the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
标注图像获取模块,用于获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;Annotated image acquisition module for acquiring annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the strongly annotated image subset quantity;
标注图像预处理模块,用于利用所述预处理子模型对所述标注图像集进行图像预处理;An annotated image preprocessing module, configured to perform image preprocessing on the annotated image set by using the preprocessing sub-model;
标注图像编码模块,用于利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;The annotated image encoding module is configured to encode the preprocessed annotated image set by using the shared coding submodel to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes strong annotation The first encoding feature of the strongly annotated image in the image subset and the second encoding feature of the weakly annotated image in the weakly annotated image subset;
特征分类模块,用于利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;The feature classification module is configured to use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly annotated image and a classification result of a weakly annotated image;
特征分割模块,用于利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;A feature segmentation module, configured to use the segmentation submodel to perform segmentation processing on the first encoding feature of the strongly annotated image in the strongly annotated image subset to obtain a strongly annotated image segmentation result;
损失函数获取模块,用于根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;A loss function acquisition module, configured to construct a segmentation loss function based on the strongly labeled image classification result and the strongly labeled image segmentation result, and construct a classification loss function based on the weakly labeled image classification result;
模型优化模块,用于利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;A model optimization module is used to optimize the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
图像分割模块,用于获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image segmentation module is used to obtain an image to be segmented, and use the standard target segmentation model to perform target segmentation on the image to be segmented to obtain a segmentation result.
本申请还提供一种电子设备,所述电子设备包括:This application also provides an electronic device, which includes:
至少一个处理器;以及,At least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the following steps:
获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型;Acquiring a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
利用所述预处理子模型对所述标注图像集进行图像预处理;Using the preprocessing submodel to perform image preprocessing on the annotated image set;
利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;Use the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset. The first encoding feature and the second encoding feature of the weakly annotated images in the weakly annotated image subset;
利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;Performing classification processing on the first coding feature and the second coding feature by using the classification sub-model to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image;
利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;Using the segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result;
根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;Constructing a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and constructing a classification loss function according to the weakly annotated image classification result;
利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;Optimizing the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
为了解决上述问题,本申请还提供一种计算机可读存储介质,包括存储数据区和存储程序区,其中,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:In order to solve the above-mentioned problems, the present application also provides a computer-readable storage medium, including a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein, When the computer program is executed by the processor, the following steps are implemented:
获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子 模型、分类子模型和分割子模型;Acquiring a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
利用所述预处理子模型对所述标注图像集进行图像预处理;Using the preprocessing submodel to perform image preprocessing on the annotated image set;
利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;Use the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset. The first encoding feature and the second encoding feature of the weakly annotated images in the weakly annotated image subset;
利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;Performing classification processing on the first coding feature and the second coding feature by using the classification sub-model to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image;
利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;Using the segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result;
根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;Constructing a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and constructing a classification loss function according to the weakly annotated image classification result;
利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;Optimizing the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
附图说明Description of the drawings
图1为本申请一实施例提供的图像中目标物的分割方法的流程示意图;FIG. 1 is a schematic flowchart of a method for segmenting a target in an image provided by an embodiment of the application;
图2为本申请一实施例提供的通过分类子模型对第一编码特征进行分类处理的流程示意图;FIG. 2 is a schematic diagram of a process of classifying a first encoded feature through a classification sub-model according to an embodiment of the application;
图3为本申请一实施例提供的通过分割子模型对第一编码特征进行分割处理的流程示意图;FIG. 3 is a schematic diagram of a process of performing segmentation processing on a first encoded feature through a segmentation sub-model according to an embodiment of the application; FIG.
图4为本申请一实施例提供的对所述目标物分割模型进行优化的流程示意图;FIG. 4 is a schematic flowchart of optimizing the target object segmentation model provided by an embodiment of the application;
图5为本申请一实施例提供的图像中目标物的分割装置的模块示意图;5 is a schematic diagram of modules of a device for segmenting a target in an image provided by an embodiment of the application;
图6为本申请一实施例提供的实现图像中目标物的分割方法的电子设备的内部结构示意图;6 is a schematic diagram of the internal structure of an electronic device for implementing a method for segmenting a target in an image provided by an embodiment of the application;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请实施例提供的图像中目标物的分割方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述图像中目标物的分割方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。The execution subject of the method for segmenting a target object in an image provided by the embodiment of the present application includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiment of the present application, such as a server and a terminal. In other words, the method for segmenting the target in the image can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
本申请提供一种图像中目标物的分割方法。参照图1所示,为本申请一实施例提供的图像中目标物的分割方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。This application provides a method for segmenting a target in an image. Referring to FIG. 1, it is a schematic flowchart of a method for segmenting a target in an image provided by an embodiment of this application. The method can be executed by a device, and the device can be implemented by software and/or hardware.
在本实施例中,图像中目标物的分割方法包括:In this embodiment, the method for segmenting the target in the image includes:
S1、获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型。S1. Obtain a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model.
本申请实施例中,所述目标物分割模型为具有图像分类与图像分割功能的卷积神经网络,所述卷积神经网络包括卷积层、池化层和全连接层。In the embodiment of the present application, the target segmentation model is a convolutional neural network with image classification and image segmentation functions, and the convolutional neural network includes a convolutional layer, a pooling layer, and a fully connected layer.
具体的,所述目标物分割模型包括以下一层或多层的组合:Specifically, the target object segmentation model includes a combination of the following one or more layers:
卷积层,用于对图像进行卷积处理,对于图片中的每一个特征首先局部感知,然后更高层次对局部进行综合操作,从而得到全局信息;The convolutional layer is used to convolve the image. For each feature in the picture, it is first localized, and then a higher level is performed on the local integrated operation to obtain global information;
池化层,对卷积后的图像进行池化处理,用于特征降维,有利于减小数据和参数的数量,以及提高模型的容错性;Pooling layer, which performs pooling processing on the convolved image for feature dimensionality reduction, which is conducive to reducing the number of data and parameters, and improving the fault tolerance of the model;
全连接层,用于线性分类,具体用于在提取的高层特征向量上进行线性组合并且输出最后的图像分类结果。The fully connected layer is used for linear classification, specifically used to perform linear combination on the extracted high-level feature vectors and output the final image classification result.
较佳地,本申请实施例中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型。其中,所述预处理子模型用于对输入的图像进行预处理,共享编码子模型用于对输入的图像进行编码,所述分类子模型用于判定模型输入的图像中是否含有目标病灶,所述分割子模型用于对分类子模型判定为含有目标病灶的图像进行病灶分割。Preferably, in the embodiment of the present application, the target segmentation model includes a preprocessing submodel, a shared coding submodel, a classification submodel, and a segmentation submodel. Wherein, the pre-processing sub-model is used to pre-process the input image, the shared coding sub-model is used to code the input image, and the classification sub-model is used to determine whether the image input by the model contains the target lesion, so The segmentation sub-model is used to segment the image that is determined by the classification sub-model to contain the target lesion.
S2、获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量。S2. Obtain an annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets.
本申请实施例中,所述标注图像集包括带有标签的生物体组织的医学图像。In the embodiment of the present application, the labeled image set includes medical images of biological tissues with labels.
例如,标注图像集为医疗机构所产生的医疗图像(如X光片图像)。For example, the annotated image set is a medical image (such as an X-ray image) produced by a medical institution.
本申请实施例可利用具有数据抓取功能的python语句从用于存储医疗图像的区块链节点中获取标注图像集,利用区块链的数据高吞吐性,可提高获取标注图像集的效率。In the embodiment of the application, a python sentence with a data capture function can be used to obtain annotated image set from a blockchain node for storing medical images, and the high data throughput of the blockchain can be used to improve the efficiency of obtaining annotated image set.
进一步地,本申请实施例中,所述标注图像集包括弱标注图像子集(弱标注图像的集合)和强标注图像子集(强标注图像的集合),且所述弱标注图像子集中图像的数量大于所述强标注图像子集中图像的数量,例如,弱标注图像的数量为标注图像集的80%,强标注图像的数量为标注图像集的20%。Further, in the embodiment of the present application, the annotated image set includes a weakly annotated image subset (a set of weakly annotated images) and a strongly annotated image subset (a set of strongly annotated images), and the images in the weakly annotated image subset The number of is greater than the number of images in the strongly annotated image subset. For example, the number of weakly annotated images is 80% of the annotated image set, and the number of strongly annotated images is 20% of the annotated image set.
其中,弱标注图像子集包含的弱标注图像为标注精度低的标注数据,强标注图像子集包含的强标注图像为标注精度高的标注数据。Among them, the weakly annotated images included in the weakly annotated image subset are annotated data with low annotation accuracy, and the strongly annotated images included in the strongly annotated image subset are annotated data with high annotation accuracy.
例如,所述弱标注图像子集中的弱标注图像只标注出图像内是否含有目标物,所述强标注图像子集中的强标注图像标注出目标物所在的位置。For example, the weakly annotated images in the weakly annotated image subset only indicate whether the image contains a target, and the strongly annotated images in the strongly annotated image subset indicate the location of the target.
实际应用中,强标注图像子集需要大量人力去精准地标注目标物,因此很难获取,导致所述弱标注图像的数量大于所述强标注图像的数量。In practical applications, a subset of strongly annotated images requires a lot of manpower to accurately annotate the target object, so it is difficult to obtain, resulting in the number of weakly annotated images being larger than the number of strongly annotated images.
S3、利用所述预处理子模型对所述标注图像集进行图像预处理。S3. Perform image preprocessing on the labeled image set by using the preprocessing sub-model.
本申请实施例中,所述对所述标注图像集进行图像预处理,包括:In the embodiment of the present application, the image preprocessing on the annotated image set includes:
利用所述预处理子模型将所述标注图像集进行像素归一化处理。Using the preprocessing sub-model to perform pixel normalization processing on the annotated image set.
详细地,本申请实施例利用如下归一化算法将所述标注图像集中标注图像进行像素归一化处理:In detail, the embodiment of the present application uses the following normalization algorithm to perform pixel normalization processing on the annotated images in the annotated image collection:
Figure PCTCN2020131993-appb-000001
Figure PCTCN2020131993-appb-000001
其中,P x为所述标注图像中原始像素值,P g为标注图像中归一化后的像素值。 Wherein, P x is the original pixel value in the annotated image, and P g is the normalized pixel value in the annotated image.
本申请实施例中,获取的所述标注图像集中的标注图像可能无法满足医学图像分析的条件,因此利用预处理子模型对所述标注图像集中的标注图像进行归一化,利用归一化操作去除标注图像中的噪点像素,提高后续对标注图像进行分割或分类的精确度。In the embodiments of the present application, the acquired annotated images in the annotated image set may not meet the conditions of medical image analysis. Therefore, the preprocessing sub-model is used to normalize the annotated images in the annotated image set, and the normalization operation is used. Remove the noise pixels in the annotated image and improve the accuracy of subsequent segmentation or classification of the annotated image.
S4、利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征。S4. Use the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes a strong annotation in a strongly annotated image subset The first encoding feature of the image and the second encoding feature of the weakly annotated image in the weakly annotated image subset.
本申请实施例中,所述利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,包括:In the embodiment of the present application, the encoding the preprocessed annotated image set by using the shared coding submodel to obtain the encoding feature of the annotated image set includes:
利用所述共享编码子模型对预处理后的所述标注图像集中的所有标注图像进行卷积 处理,得到卷积图像集;Using the shared coding sub-model to perform convolution processing on all the annotated images in the preprocessed annotated image set to obtain a convolutional image set;
对所述卷积图像集中的所有卷积图像进行池化处理,得到所述标注图像集的编码特征。Pooling is performed on all convolutional images in the convolutional image set to obtain the coding feature of the annotated image set.
详细地,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征。In detail, the encoding feature of the annotated image set includes a first encoding feature of a strongly annotated image in the strongly annotated image subset and a second encoding feature of a weakly annotated image in the weakly annotated image subset.
具体的,第一编码特征的数量为多个,第二编码特征的数量也为多个。Specifically, the number of the first coding feature is multiple, and the number of the second coding feature is also multiple.
本申请实施对标注图像集进行编码,有利于减少标注图像集中无用的数据量,提高数据处理的效率。The implementation of this application to encode the annotated image set is conducive to reducing the amount of useless data in the annotated image set and improving the efficiency of data processing.
S5、利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果。S5. Use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image.
本申请实施例利用分类子模型对所述第一编码特征进行分类处理可得到强标注图像子集中每张强标注图像的分类结果;利用分类子模型对所述第二编码特征进行分类处理可得到弱标注图像子集中每张弱标注图像的分类结果。In this embodiment of the application, the classification sub-model is used to classify the first encoding feature to obtain the classification result of each strongly annotated image in the strongly annotated image subset; the classification sub-model is used to classify the second encoding feature to obtain the weak The classification result of each weakly annotated image in the annotated image subset.
图2为本申请一实施例提供的通过分类子模型对第一编码特征进行分类处理的流程示意图。Fig. 2 is a schematic diagram of a process of classifying a first encoded feature through a classification sub-model according to an embodiment of the application.
本申请实施例中,参图2所示,所述利用所述分类子模型对所述第一编码特征进行分类处理,得到强标注图像分类结果,包括:In the embodiment of the present application, as shown in FIG. 2, the classification processing of the first coding feature using the classification sub-model to obtain a classification result of a strongly labeled image includes:
S51、利用所述分类子模型对所述强标注图像子集中强标注图像的第一编码特征进行全连接处理,得到全连接特征;S51: Perform full connection processing on the first encoding feature of the strongly labeled image in the strongly labeled image subset by using the classification sub-model to obtain a fully connected feature;
S52、利用第一激活函数计算所述全连接特征属于第一预设类别的第一类别概率;S52: Calculate the first category probability that the fully connected feature belongs to the first preset category by using the first activation function;
S53、根据所述第一类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分类处理,得到强标注图像分类结果。S53. Perform classification processing on the first coding feature of the strongly annotated images in the strongly annotated image subset according to the first category probability to obtain a strongly annotated image classification result.
详细地,所述第一预设类别中包括多个预设类别,根据所述第一类别概率对所述强标注图像子集中某一强标注图像的第一编码特征进行分类处理,得到强标注图像分类结果,即确定所述第一类别概率值最大的预设类别为强标注图像分类结果。In detail, the first preset category includes a plurality of preset categories, and the first coding feature of a strongly annotated image in the strongly annotated image subset is classified according to the first category probability to obtain a strongly annotated image The image classification result, that is, it is determined that the preset category with the largest probability value of the first category is the strongly labeled image classification result.
例如,第一预设类别中包括类别A、类别B与类别C,全连接特征属于第一预设类别中类别A的概率为50%,全连接特征属于第一预设类别中类别B的概率为80%,全连接特征属于第一预设类别中类别C的概率为30%,则确定强标注图像分类结果为类别B。For example, the first preset category includes category A, category B, and category C, the probability that the fully connected feature belongs to category A in the first preset category is 50%, and the probability that the fully connected feature belongs to category B in the first preset category It is 80%, and the probability that the fully connected feature belongs to category C in the first preset category is 30%, and it is determined that the strongly labeled image classification result is category B.
进一步地,对所述第二编码特征进行与所述第一编码特征相同的分类处理,得到弱标注图像分类结果。Further, the second coding feature is subjected to the same classification processing as the first coding feature to obtain a weakly labeled image classification result.
详细地,所述第一激活函数包括但不限于softmax激活函数,利用激活函数可计算得到全连接特征为第一预设类别的第一类别概率。In detail, the first activation function includes, but is not limited to, a softmax activation function. The activation function can be used to calculate the first category probability that the fully connected feature is the first preset category.
S6、利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果。S6. Perform segmentation processing on the first coding feature of the strongly annotated images in the strongly annotated image subset by using the segmentation submodel, to obtain a strongly annotated image segmentation result.
图3为本申请一实施例提供的通过分割子模型对第一编码特征进行分割处理的流程示意图。FIG. 3 is a schematic diagram of a process of performing segmentation processing on a first encoding feature through a segmentation submodel according to an embodiment of the application.
本申请实施例中,参图3所示,所述利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果,包括:In the embodiment of the present application, as shown in FIG. 3, the segmentation processing of the first coding feature of the strongly annotated image in the strongly annotated image subset by using the segmentation submodel to obtain the strongly annotated image segmentation result includes:
S61、将所述强标注图像子集中强标注图像的第一编码特征进行第一阈值倍数的上采样,得到中间特征图;S61: Up-sampling the first coding feature of the strongly annotated image in the strongly annotated image subset by a first threshold multiple to obtain an intermediate feature map;
S62、将所述中间特征图进行第二阈值倍数的上采样,得到复原图像;S62: Up-sampling the intermediate feature map by a second threshold multiple to obtain a restored image;
S63、利用第二激活函数计算所述复原图像中各像素点属于第二预设类别的第二类别概率;S63: Calculate the second category probability of each pixel in the restored image belonging to the second preset category by using the second activation function;
S64、根据所述第二类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果。S64. Perform segmentation processing on the first coding feature of the strongly annotated images in the strongly annotated image subset according to the second category probability to obtain a strongly annotated image segmentation result.
详细地,所述分割处理包括对复原图像中像素点进行分类,所述第二预设类别中包括 多个预设类别,所述根据所述第二类别概率对所述第一编码特征进行分割处理,得到强标注图像分割结果,即确定所述第二类别概率值最大的预设类别为强标注图像分割结果。In detail, the segmentation processing includes classifying pixels in the restored image, the second preset category includes a plurality of preset categories, and the first encoding feature is segmented according to the second category probability Through processing, the strongly labeled image segmentation result is obtained, that is, it is determined that the preset category with the largest probability value of the second category is the strongly labeled image segmentation result.
例如,第一预设类别中包括类别D、类别E与类别F,复原图像中目标像素点为第二预设类别中类别D的概率为20%,复原图像中目标像素点为第二预设类别中类别E的概率为70%,复原图像中目标像素点为第二预设类别中类别F的概率为40%,则确定复原图像中目标像素点为类别E,当所述复原图像中所有像素点均完成所述分割操作,得到强标注图像分割结果。For example, the first preset category includes category D, category E, and category F, the probability that the target pixel in the restored image is category D in the second preset category is 20%, and the target pixel in the restored image is the second preset The probability of category E in the category is 70%, and the probability that the target pixel in the restored image is category F in the second preset category is 40%, then it is determined that the target pixel in the restored image is category E. All pixels complete the segmentation operation, and a strongly labeled image segmentation result is obtained.
本申请实施例中将第一编码特征进行第一阈值倍数的上采样,得到中间特征图,再将中间特征图进行第二阈值倍数的上采样,得到复原图像,避免直接将第一编码特征上采样至复原图像时上采样倍数过大导致复原图像中图像特征的丢失,提高了复原图像中特征信息的完整性。In the embodiment of this application, the first encoded feature is up-sampled by a first threshold multiple to obtain an intermediate feature map, and then the intermediate feature map is up-sampled by a second threshold multiple to obtain a restored image, avoiding directly uploading the first encoded feature When sampling to the restored image, the up-sampling factor is too large, which leads to the loss of image features in the restored image, which improves the integrity of the feature information in the restored image.
S7、根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数。S7. Construct a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and construct a classification loss function according to the weakly annotated image classification result.
本申请实施例中,所述分割损失函数为:In this embodiment of the application, the segmentation loss function is:
Figure PCTCN2020131993-appb-000002
Figure PCTCN2020131993-appb-000002
其中,L cls为基于所述强标注图像分类结果构建的分类子函数,L seg为基于所述强标注图像分割结果构建的分割子函数,σ 1 2与σ 2 2为预设参数。 Wherein, L cls is a classification sub-function constructed based on the strongly-annotated image classification result, L seg is a segmentation sub-function constructed based on the strongly-annotated image segmentation result, and σ 1 2 and σ 2 2 are preset parameters.
详细地,所述基于所述强标注图像分类结果构建的分类子函数L cls与基于所述强标注图像分割结果构建的分割子函数L seg分别为: In detail, the classification sub-function L cls constructed based on the strongly-labeled image classification result and the segmentation sub-function L seg constructed based on the strongly-labeled image segmentation result are respectively:
Figure PCTCN2020131993-appb-000003
Figure PCTCN2020131993-appb-000003
Figure PCTCN2020131993-appb-000004
Figure PCTCN2020131993-appb-000004
其中,M为所述强标注图像子集中强标注图像的数量;y i为所述强标注图像子集中第i个强标注图像的预设标准标签,p i为所述强标注图像子集中第i个强标注图像的强标注图像分类结果;T表示每张强标注图像的总像素值,p ij为强标注图像子集中第i张图像的第j个像素的强标注图像分割结果,g ij为强标注图像集中第i张图像的第j个像素的预设标准分割结果。 Where M is the number of strongly annotated images in the strongly annotated image subset; y i is the preset standard label of the i-th strongly annotated image in the strongly annotated image subset, and p i is the first strongly annotated image in the strongly annotated image subset. Strongly annotated image classification results of i strongly annotated images; T represents the total pixel value of each strongly annotated image, p ij is the strongly annotated image segmentation result of the jth pixel of the i-th image in the strongly annotated image subset, g ij is The pre-set standard segmentation result of the j-th pixel of the i-th image in the strongly-labeled image set.
具体地,所述分类损失函数即为基于所述强标注图像分类结果构建的分类子函数L clsSpecifically, the classification loss function is a classification sub-function L cls constructed based on the strongly labeled image classification result.
S8、利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型。S8. Use the segmentation loss function and the classification loss function to optimize the target object segmentation model to obtain a standard target object segmentation model.
本申请实施例中,对目标物分割模型进行优化,即调整目标物分割模型中预设的超参数的值,从而得到新的目标物分割模型,即标准目标物分割模型。In the embodiment of the present application, the target segmentation model is optimized, that is, the values of the preset hyperparameters in the target segmentation model are adjusted to obtain a new target segmentation model, that is, the standard target segmentation model.
图4为本申请一实施例提供的对所述目标物分割模型进行优化的流程示意图。FIG. 4 is a schematic flowchart of optimizing the target object segmentation model provided by an embodiment of the application.
进一步地,参图4所示,所述利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,包括:Further, as shown in FIG. 4, the use of the segmentation loss function and the classification loss function to optimize the target segmentation model includes:
S81、确定所述目标物分割模型的目标迭代次数;S81. Determine the number of target iterations of the target object segmentation model;
S82、计算所述分类损失函数的分类损失值;S82. Calculate the classification loss value of the classification loss function;
S83、计算所述分割损失函数的分割损失值;S83. Calculate the segmentation loss value of the segmentation loss function;
S84、利用梯度下降算***流基于所述分类损失值与所述分割损失值对所述目标物分割模型的参数进行更新,直至目标物分割模型的迭代次数达到所述目标迭代次数。S84. Use a gradient descent algorithm to update the parameters of the target object segmentation model based on the classification loss value and the segmentation loss value in turn, until the number of iterations of the target object segmentation model reaches the target number of iterations.
例如,目标物分割模型的目标迭代次数为8000次,第一次利用梯度下降算法基于分 类损失值对所述目标物分割模型的参数进行更新;第二次利用梯度下降算法基于所述分割损失值对所述目标物分割模型的参数进行更新;第三次利用梯度下降算法基于分类损失值对所述目标物分割模型的参数进行更新;第四次利用梯度下降算法基于所述分割损失值对所述目标物分割模型的参数进行更新,以此类推,基于所述分类损失值和所述分割损失值轮流对目标物分割模型的参数进行更新直至目标物分割模型的迭代次数达到8000次,得到标准目标物分割模型。For example, the number of target iterations of the target segmentation model is 8000, the first time the gradient descent algorithm is used to update the parameters of the target segmentation model based on the classification loss value; the second time the gradient descent algorithm is used based on the segmentation loss value The parameters of the target object segmentation model are updated; the third time the gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value; the fourth time the gradient descent algorithm is used to update the parameters of the target object segmentation model based on the segmentation loss value. The parameters of the target segmentation model are updated, and so on, based on the classification loss value and the segmentation loss value, the parameters of the target segmentation model are updated in turn until the number of iterations of the target segmentation model reaches 8000 times to obtain the standard Target segmentation model.
本申请实施例利用分类损失函数与分割损失函数共同对目标物分割模型进行限制,提高了目标物分割模型对图像进行分类与分割的精确度,利用梯度下降算***流基于所述分类损失值与所述分割损失值对所述目标物分割模型的参数进行更新,避免了分类损失函数与分割损失函数同时对目标物分割模型进行更新导致出现参数矛盾的情况,有利于提高模型的准确性。In the embodiment of the application, the classification loss function and the segmentation loss function are used to limit the target segmentation model, which improves the accuracy of the target segmentation model for classifying and segmenting images. The gradient descent algorithm is used in turn based on the classification loss value and the result. The segmentation loss value updates the parameters of the target object segmentation model, which avoids the situation that the classification loss function and the segmentation loss function update the target object segmentation model at the same time to cause parameter contradictions, which is beneficial to improve the accuracy of the model.
本申请实施例中,不断利用梯度下降算法迭代更新网络的参数,使得目标损失函数不断减小,直到目标损失函数数值稳定达到收敛条件,得到标准病灶分割模型。In the embodiments of the present application, the gradient descent algorithm is continuously used to iteratively update the parameters of the network, so that the target loss function is continuously reduced until the value of the target loss function is stable and reaches the convergence condition, and the standard lesion segmentation model is obtained.
本申请实施例中,通过分类损失函数与分割损失函数的共同学习,能增加目标物分割模型从标注图像集中提取到的信息量,克服了训练过程中高精度的强标注图像的数据量较少的问题;通过分类损失函数与分割损失函数共同确定目标物分割模型的参数,可以避免目标物分割模型过拟合,使得目标物分割模型具有更强的泛化能力。In the embodiments of the present application, the joint learning of the classification loss function and the segmentation loss function can increase the amount of information extracted by the target object segmentation model from the labeled image set, which overcomes the small amount of high-precision strongly labeled images in the training process. Problem: The classification loss function and the segmentation loss function jointly determine the parameters of the target segmentation model, which can avoid overfitting of the target segmentation model, and make the target segmentation model have stronger generalization ability.
S9、获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。S9. Obtain an image to be segmented, and perform target segmentation on the image to be segmented using the standard target segmentation model to obtain a segmentation result.
本申请实施例中,所述待分割图像可以是由用户上传的,当获取到待分割图像后,将所述待分割图像输入至标准病灶分割模型进行目标物分割,得到分割结果。In the embodiment of the present application, the image to be segmented may be uploaded by a user. After the image to be segmented is obtained, the image to be segmented is input to the standard lesion segmentation model for target segmentation, and the segmentation result is obtained.
本申请实施例中,获取包含预处理子模型、共享编码子模型、分类子模型和分割子模型的目标物分割模型,以实现利用目标物分割模型对图像中的目标物进行分割,无需单独训练多个模型对图像进行分割,避免了不同单独模型之间效率的不一致造成目标物分割效率低下,提高图像中目标物分割的效率;通过大量的弱标注图像和少量的强标注图像对目标物分割模型进行训练,根据训练结果利用分割损失函数和分类损失函数共同对模型进行优化,提高了模型的精确度,从而提高了目标物分割模型对图像中目标物进行分割的准确率。因此本申请提出的图像中目标物的分割方法,可以提高低精度标注数据数量多于高精度标注数据时病灶分割的效率和准确率。In the embodiment of this application, a target segmentation model including a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model is obtained to realize the use of the target segmentation model to segment the target in the image without separate training Multiple models to segment the image, to avoid the inconsistency of the efficiency between different separate models, resulting in inefficient target segmentation, and to improve the efficiency of target segmentation in the image; segmentation of the target through a large number of weakly annotated images and a small number of strongly annotated images The model is trained, and the segmentation loss function and the classification loss function are used to optimize the model according to the training results, which improves the accuracy of the model, thereby improving the accuracy of the target object segmentation model in the image segmentation. Therefore, the method for segmenting a target in an image proposed in this application can improve the efficiency and accuracy of lesion segmentation when the number of low-precision labeled data is larger than that of high-precision labeled data.
如图5所示,是本申请图像中目标物的分割装置的模块示意图。As shown in FIG. 5, it is a schematic diagram of the module of the device for segmenting the object in the image of the present application.
本申请所述图像中目标物的分割装置100可以安装于电子设备中。根据实现的功能,所述图像中目标物的分割装置可以包括模型获取模块101、标注图像获取模块102、标注图像预处理模块103、标注图像编码模块104、特征分类模块105、特征分割模块106、损失函数获取模块107、模型优化模块108和图像分割模块109。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The device 100 for segmenting the object in the image described in this application can be installed in an electronic device. According to the realized functions, the device for segmenting the target in the image may include a model acquisition module 101, an annotated image acquisition module 102, an annotated image preprocessing module 103, an annotated image encoding module 104, a feature classification module 105, a feature segmentation module 106, The loss function acquisition module 107, the model optimization module 108, and the image segmentation module 109. The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述模型获取模块101,用于获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型;The model acquisition module 101 is configured to acquire a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
所述标注图像获取模块102,用于获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;The annotated image acquisition module 102 is configured to acquire an annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of the weakly annotated image subsets is greater than that of the strongly annotated image subsets The number of image subsets;
所述标注图像预处理模块103,用于利用所述预处理子模型对所述标注图像集进行图像预处理;The annotated image preprocessing module 103 is configured to perform image preprocessing on the annotated image set by using the preprocessing sub-model;
所述标注图像编码模块104,用于利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;The annotated image encoding module 104 is configured to use the shared encoding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set Including the first encoding feature of the strongly annotated image in the strongly annotated image subset and the second encoding feature of the weakly annotated image in the weakly annotated image subset;
所述特征分类模块105,用于利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;The feature classification module 105 is configured to use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly annotated image and a classification result of a weakly annotated image;
所述特征分割模块106,用于利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;The feature segmentation module 106 is configured to use the segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset to obtain a strongly annotated image segmentation result;
所述损失函数获取模块107,用于根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;The loss function acquisition module 107 is configured to construct a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and construct a classification loss function according to the weakly annotated image classification result;
所述模型优化模块108,用于利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;The model optimization module 108 is configured to use the segmentation loss function and the classification loss function to optimize the target object segmentation model to obtain a standard target object segmentation model;
所述图像分割模块109,用于获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image segmentation module 109 is configured to obtain an image to be segmented, and use the standard target segmentation model to perform target segmentation on the image to be segmented to obtain a segmentation result.
详细地,所述图像中目标物的分割装置各模块的具体实施方式如下:In detail, the specific implementation of each module of the device for segmenting the object in the image is as follows:
所述模型获取模块101,用于获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型。The model acquisition module 101 is configured to acquire a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model.
本申请实施例中,所述目标物分割模型为具有图像分类与图像分割功能的卷积神经网络,所述卷积神经网络包括卷积层、池化层和全连接层。In the embodiment of the present application, the target segmentation model is a convolutional neural network with image classification and image segmentation functions, and the convolutional neural network includes a convolutional layer, a pooling layer, and a fully connected layer.
具体的,所述目标物分割模型包括以下一层或多层的组合:Specifically, the target object segmentation model includes a combination of the following one or more layers:
卷积层,用于对图像进行卷积处理,对于图片中的每一个特征首先局部感知,然后更高层次对局部进行综合操作,从而得到全局信息;The convolutional layer is used to convolve the image. For each feature in the picture, it is first localized, and then a higher level is performed on the local integrated operation to obtain global information;
池化层,对卷积后的图像进行池化处理,用于特征降维,有利于减小数据和参数的数量,以及提高模型的容错性;Pooling layer, which performs pooling processing on the convolved image for feature dimensionality reduction, which is conducive to reducing the number of data and parameters, and improving the fault tolerance of the model;
全连接层,用于线性分类,具体用于在提取的高层特征向量上进行线性组合并且输出最后的图像分类结果。The fully connected layer is used for linear classification, specifically used to perform linear combination on the extracted high-level feature vectors and output the final image classification result.
较佳地,本申请实施例中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型。其中,所述预处理子模型用于对输入的图像进行预处理,共享编码子模型用于对输入的图像进行编码,所述分类子模型用于判定模型输入的图像中是否含有目标病灶,所述分割子模型用于对分类子模型判定为含有目标病灶的图像进行病灶分割。Preferably, in the embodiment of the present application, the target segmentation model includes a preprocessing submodel, a shared coding submodel, a classification submodel, and a segmentation submodel. Wherein, the pre-processing sub-model is used to pre-process the input image, the shared coding sub-model is used to code the input image, and the classification sub-model is used to determine whether the image input by the model contains the target lesion, so The segmentation sub-model is used to segment the image that is determined by the classification sub-model to contain the target lesion.
所述标注图像获取模块102,用于获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量。The annotated image acquisition module 102 is configured to acquire an annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of the weakly annotated image subsets is greater than that of the strongly annotated image subsets The number of image subsets.
本申请实施例中,所述标注图像集包括带有标签的生物体组织的医学图像。In the embodiment of the present application, the labeled image set includes medical images of biological tissues with labels.
例如,标注图像集为医疗机构所产生的医疗图像(如X光片图像)。For example, the annotated image set is a medical image (such as an X-ray image) produced by a medical institution.
本申请实施例可利用具有数据抓取功能的python语句从用于存储医疗图像的区块链节点中获取标注图像集,利用区块链的数据高吞吐性,可提高获取标注图像集的效率。In the embodiment of the application, a python sentence with a data capture function can be used to obtain annotated image set from a blockchain node for storing medical images, and the high data throughput of the blockchain can be used to improve the efficiency of obtaining annotated image set.
进一步地,本申请实施例中,所述标注图像集包括弱标注图像子集(弱标注图像的集合)和强标注图像子集(强标注图像的集合),且所述弱标注图像子集中图像的数量大于所述强标注图像子集中图像的数量,例如,弱标注图像的数量为标注图像集的80%,强标注图像的数量为标注图像集的20%。Further, in the embodiment of the present application, the annotated image set includes a weakly annotated image subset (a set of weakly annotated images) and a strongly annotated image subset (a set of strongly annotated images), and the images in the weakly annotated image subset The number of is greater than the number of images in the strongly annotated image subset. For example, the number of weakly annotated images is 80% of the annotated image set, and the number of strongly annotated images is 20% of the annotated image set.
其中,弱标注图像子集包含的弱标注图像为标注精度低的标注数据,强标注图像子集包含的强标注图像为标注精度高的标注数据。Among them, the weakly annotated images included in the weakly annotated image subset are annotated data with low annotation accuracy, and the strongly annotated images included in the strongly annotated image subset are annotated data with high annotation accuracy.
例如,所述弱标注图像子集中的弱标注图像只标注出图像内是否含有目标物,所述强 标注图像子集中的强标注图像标注出目标物所在的位置。For example, the weakly annotated images in the weakly annotated image subset only indicate whether the image contains a target, and the strongly annotated images in the strongly annotated image subset indicate the location of the target.
实际应用中,强标注图像子集需要大量人力去精准地标注目标物,因此很难获取,导致所述弱标注图像的数量大于所述强标注图像的数量。In practical applications, a subset of strongly annotated images requires a lot of manpower to accurately annotate the target object, so it is difficult to obtain, resulting in the number of weakly annotated images being larger than the number of strongly annotated images.
所述标注图像预处理模块103,用于利用所述预处理子模型对所述标注图像集进行图像预处理。The annotated image preprocessing module 103 is configured to perform image preprocessing on the annotated image set by using the preprocessing sub-model.
本申请实施例中,所述标注图像预处理模块103具体用于:In the embodiment of the present application, the annotated image preprocessing module 103 is specifically configured to:
利用所述预处理子模型将所述标注图像集进行像素归一化处理。Using the preprocessing sub-model to perform pixel normalization processing on the annotated image set.
详细地,本申请实施例利用如下归一化算法将所述标注图像集中标注图像进行像素归一化处理:In detail, the embodiment of the present application uses the following normalization algorithm to perform pixel normalization processing on the annotated images in the annotated image collection:
Figure PCTCN2020131993-appb-000005
Figure PCTCN2020131993-appb-000005
其中,P x为所述标注图像中原始像素值,P g为标注图像中归一化后的像素值。 Wherein, P x is the original pixel value in the annotated image, and P g is the normalized pixel value in the annotated image.
本申请实施例中,获取的所述标注图像集中的标注图像可能无法满足医学图像分析的条件,因此利用预处理子模型对所述标注图像集中的标注图像进行归一化预处理,利用归一化操作去除标注图像中的噪点像素,提高后续对标注图像进行分割或分类的精确度。In the embodiment of this application, the annotated images in the annotated image set acquired may not meet the conditions of medical image analysis. Therefore, the preprocessing sub-model is used to perform normalization preprocessing on the annotated images in the annotated image set, and normalization is used. The transformation operation removes the noise pixels in the annotated image and improves the accuracy of subsequent segmentation or classification of the annotated image.
所述标注图像编码模块104,用于利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征。The annotated image encoding module 104 is configured to use the shared encoding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set It includes the first encoding feature of the strongly annotated image in the strongly annotated image subset and the second encoding feature of the weakly annotated image in the weakly annotated image subset.
本申请实施例中,所述标注图像编码模块104具体用于:In the embodiment of the present application, the annotated image encoding module 104 is specifically configured to:
利用所述共享编码子模型对预处理后的所述标注图像集中的所有标注图像进行卷积处理,得到卷积图像集;Using the shared coding sub-model to perform convolution processing on all the annotated images in the preprocessed annotated image set to obtain a convolutional image set;
对所述卷积图像集中的所有卷积图像进行池化处理,得到所述标注图像集的编码特征。Pooling is performed on all convolutional images in the convolutional image set to obtain the coding feature of the annotated image set.
详细地,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征。In detail, the encoding feature of the annotated image set includes a first encoding feature of a strongly annotated image in the strongly annotated image subset and a second encoding feature of a weakly annotated image in the weakly annotated image subset.
具体的,第一编码特征的数量为多个,第二编码特征的数量也为多个。Specifically, the number of the first coding feature is multiple, and the number of the second coding feature is also multiple.
本申请实施对标注图像集进行编码,有利于减少标注图像集中无用的数据量,提高数据处理的效率。The implementation of this application to encode the annotated image set is conducive to reducing the amount of useless data in the annotated image set and improving the efficiency of data processing.
所述特征分类模块105,用于利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果。The feature classification module 105 is configured to use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly annotated image and a classification result of a weakly annotated image.
本申请实施例利用分类子模型对所述第一编码特征进行分类处理可得到强标注图像子集中每张强标注图像的分类结果;利用分类子模型对所述第二编码特征进行分类处理可得到弱标注图像子集中每张弱标注图像的分类结果。In this embodiment of the application, the classification sub-model is used to classify the first encoding feature to obtain the classification result of each strongly annotated image in the strongly annotated image subset; the classification sub-model is used to classify the second encoding feature to obtain the weak The classification result of each weakly annotated image in the annotated image subset.
本申请实施例中,所述特征分类模块105具体用于:In the embodiment of the present application, the feature classification module 105 is specifically configured to:
利用所述分类子模型对所述强标注图像子集中强标注图像的第一编码特征进行全连接处理,得到全连接特征;Using the classification sub-model to perform full connection processing on the first coding feature of the strongly labeled image in the strongly labeled image subset to obtain a fully connected feature;
利用第一激活函数计算所述全连接特征属于第一预设类别的第一类别概率;Calculating the first category probability of the fully connected feature belonging to the first preset category by using the first activation function;
根据所述第一类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分类处理,得到强标注图像分类结果。Perform classification processing on the first coding feature of the strongly-annotated images in the strongly-annotated image subset according to the first category probability to obtain a strongly-annotated image classification result.
详细地,所述第一预设类别中包括多个预设类别,根据所述第一类别概率对所述强标注图像子集中某一强标注图像的第一编码特征进行分类处理,得到强标注图像分类结果,即确定所述第一类别概率值最大的预设类别为强标注图像分类结果。In detail, the first preset category includes a plurality of preset categories, and the first coding feature of a strongly annotated image in the strongly annotated image subset is classified according to the first category probability to obtain a strongly annotated image The image classification result, that is, it is determined that the preset category with the largest probability value of the first category is the strongly labeled image classification result.
例如,第一预设类别中包括类别A、类别B与类别C,全连接特征属于第一预设类别中类别A的概率为50%,全连接特征属于第一预设类别中类别B的概率为80%,全连接特征属于第一预设类别中类别C的概率为30%,则确定强标注图像分类结果为类别B。For example, the first preset category includes category A, category B, and category C, the probability that the fully connected feature belongs to category A in the first preset category is 50%, and the probability that the fully connected feature belongs to category B in the first preset category It is 80%, and the probability that the fully connected feature belongs to category C in the first preset category is 30%, and it is determined that the strongly labeled image classification result is category B.
进一步地,对所述第二编码特征进行与所述第一编码特征相同的分类处理,得到弱标注图像分类结果。Further, the second coding feature is subjected to the same classification processing as the first coding feature to obtain a weakly labeled image classification result.
详细地,所述第一激活函数包括但不限于softmax激活函数,利用激活函数可计算得到全连接特征为第一预设类别的第一类别概率。In detail, the first activation function includes, but is not limited to, a softmax activation function. The activation function can be used to calculate the first category probability that the fully connected feature is the first preset category.
所述特征分割模块106,用于利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果。The feature segmentation module 106 is configured to use the segmentation submodel to perform segmentation processing on the first encoding feature of the strongly annotated image in the strongly annotated image subset to obtain a strongly annotated image segmentation result.
本申请实施例中,所述特征分割模块106具体用于:In the embodiment of the present application, the feature segmentation module 106 is specifically configured to:
将所述强标注图像子集中强标注图像的第一编码特征进行第一阈值倍数的上采样,得到中间特征图;Performing up-sampling of the first encoding feature of the strongly annotated image in the strongly annotated image subset by a first threshold multiple to obtain an intermediate feature map;
将所述中间特征图进行第二阈值倍数的上采样,得到复原图像;Up-sampling the intermediate feature map by a second threshold multiple to obtain a restored image;
利用第二激活函数计算所述复原图像中各像素点属于第二预设类别的第二类别概率;Calculating the second category probability of each pixel in the restored image belonging to the second preset category by using the second activation function;
根据所述第二类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果。Perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset according to the second category probability to obtain a strongly annotated image segmentation result.
详细地,所述分割处理包括对复原图像中像素点进行分类,所述第二预设类别中包括多个预设类别,所述根据所述第二类别概率对所述第一编码特征进行分割处理,得到强标注图像分割结果,即确定所述第二类别概率值最大的预设类别为强标注图像分割结果。In detail, the segmentation process includes classifying pixels in the restored image, the second preset category includes a plurality of preset categories, and the first encoding feature is segmented according to the second category probability Through processing, the strongly labeled image segmentation result is obtained, that is, it is determined that the preset category with the largest probability value of the second category is the strongly labeled image segmentation result.
例如,第一预设类别中包括类别D、类别E与类别F,复原图像中目标像素点为第二预设类别中类别D的概率为20%,复原图像中目标像素点为第二预设类别中类别E的概率为70%,复原图像中目标像素点为第二预设类别中类别F的概率为40%,则确定复原图像中目标像素点为类别E,当所述复原图像中所有像素点均完成所述分割操作,得到强标注图像分割结果。For example, the first preset category includes category D, category E, and category F, the probability that the target pixel in the restored image is category D in the second preset category is 20%, and the target pixel in the restored image is the second preset The probability of category E in the category is 70%, and the probability that the target pixel in the restored image is category F in the second preset category is 40%, then it is determined that the target pixel in the restored image is category E. All pixels complete the segmentation operation, and a strongly labeled image segmentation result is obtained.
本申请实施例中将第一编码特征进行第一阈值倍数的上采样,得到中间特征图,再将中间特征图进行第二阈值倍数的上采样,得到复原图像,避免直接将第一编码特征上采样至复原图像时上采样倍数过大导致复原图像中图像特征的丢失,提高了复原图像中特征信息的完整性。In the embodiment of this application, the first encoded feature is up-sampled by a first threshold multiple to obtain an intermediate feature map, and then the intermediate feature map is up-sampled by a second threshold multiple to obtain a restored image, avoiding directly uploading the first encoded feature When sampling to the restored image, the up-sampling factor is too large, which leads to the loss of image features in the restored image, which improves the integrity of the feature information in the restored image.
所述损失函数获取模块107,用于根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数。The loss function acquisition module 107 is configured to construct a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and construct a classification loss function according to the weakly annotated image classification result.
本申请实施例中,所述分割损失函数为:In this embodiment of the application, the segmentation loss function is:
Figure PCTCN2020131993-appb-000006
Figure PCTCN2020131993-appb-000006
其中,L cls为基于所述强标注图像分类结果构建的分类子函数,L seg为基于所述强标注图像分割结果构建的分割子函数,σ 1 2与σ 2 2为预设参数。 Wherein, L cls is a classification sub-function constructed based on the strongly-annotated image classification result, L seg is a segmentation sub-function constructed based on the strongly-annotated image segmentation result, and σ 1 2 and σ 2 2 are preset parameters.
详细地,所述基于所述强标注图像分类结果构建的分类子函数L cls与基于所述强标注图像分割结果构建的分割子函数L seg分别为: In detail, the classification sub-function L cls constructed based on the strongly-labeled image classification result and the segmentation sub-function L seg constructed based on the strongly-labeled image segmentation result are respectively:
Figure PCTCN2020131993-appb-000007
Figure PCTCN2020131993-appb-000007
Figure PCTCN2020131993-appb-000008
Figure PCTCN2020131993-appb-000008
其中,M为所述强标注图像子集中强标注图像的数量;y i为所述强标注图像子集中第i个强标注图像的预设标准标签,p i为所述强标注图像子集中第i个强标注图像的强标注图像分类结果;T表示每张强标注图像的总像素值,p ij为强标注图像子集中第i张图像的第j个像素的强标注图像分割结果,g ij为强标注图像集中第i张图像的第j个像素的预设标准分割结果。 Where M is the number of strongly annotated images in the strongly annotated image subset; y i is the preset standard label of the i-th strongly annotated image in the strongly annotated image subset, and p i is the first strongly annotated image in the strongly annotated image subset. Strongly annotated image classification results of i strongly annotated images; T represents the total pixel value of each strongly annotated image, p ij is the strongly annotated image segmentation result of the jth pixel of the i-th image in the strongly annotated image subset, g ij is The pre-set standard segmentation result of the j-th pixel of the i-th image in the strongly-labeled image set.
具体地,所述分类损失函数即为基于所述强标注图像分类结果构建的分类子函数L clsSpecifically, the classification loss function is a classification sub-function L cls constructed based on the strongly labeled image classification result.
所述模型优化模块108,用于利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型。The model optimization module 108 is configured to use the segmentation loss function and the classification loss function to optimize the target object segmentation model to obtain a standard target object segmentation model.
本申请实施例中,对目标物分割模型进行优化,即调整目标物分割模型中预设的超参数的值,从而得到新的目标物分割模型,即标准目标物分割模型。In the embodiment of the present application, the target segmentation model is optimized, that is, the values of the preset hyperparameters in the target segmentation model are adjusted to obtain a new target segmentation model, that is, the standard target segmentation model.
进一步地,所述模型优化模块108具体用于:Further, the model optimization module 108 is specifically configured to:
确定所述目标物分割模型的目标迭代次数;Determining the number of target iterations of the target object segmentation model;
计算所述分类损失函数的分类损失值;Calculating the classification loss value of the classification loss function;
计算所述分割损失函数的分割损失值;Calculating the segmentation loss value of the segmentation loss function;
利用梯度下降算***流基于所述分类损失值与所述分割损失值对所述目标物分割模型的参数进行更新,直至目标物分割模型的迭代次数达到所述目标迭代次数。A gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value and the segmentation loss value in turn, until the number of iterations of the target object segmentation model reaches the target number of iterations.
例如,目标物分割模型的目标迭代次数为8000次,第一次利用梯度下降算法基于分类损失值对所述目标物分割模型的参数进行更新;第二次利用梯度下降算法基于所述分割损失值对所述目标物分割模型的参数进行更新;第三次利用梯度下降算法基于分类损失值对所述目标物分割模型的参数进行更新;第四次利用梯度下降算法基于所述分割损失值对所述目标物分割模型的参数进行更新,以此类推,基于所述分类损失值和所述分割损失值轮流对目标物分割模型的参数进行更新直至目标物分割模型的迭代次数达到8000次,得到标准目标物分割模型。For example, the number of target iterations of the target segmentation model is 8000, the first time the gradient descent algorithm is used to update the parameters of the target segmentation model based on the classification loss value; the second time the gradient descent algorithm is used based on the segmentation loss value The parameters of the target object segmentation model are updated; the third time the gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value; the fourth time the gradient descent algorithm is used to update the parameters of the target object segmentation model based on the segmentation loss value. The parameters of the target segmentation model are updated, and so on, based on the classification loss value and the segmentation loss value, the parameters of the target segmentation model are updated in turn until the number of iterations of the target segmentation model reaches 8000 times to obtain the standard Target segmentation model.
本申请实施例利用分类损失函数与分割损失函数共同对目标物分割模型进行限制,提高了目标物分割模型对图像进行分类与分割的精确度,利用梯度下降算***流基于所述分类损失值与所述分割损失值对所述目标物分割模型的参数进行更新,避免了分类损失函数与分割损失函数同时对目标物分割模型进行更新导致出现参数矛盾的情况,有利于提高模型的准确性。In the embodiment of the application, the classification loss function and the segmentation loss function are used to limit the target segmentation model, which improves the accuracy of the target segmentation model for classifying and segmenting images. The gradient descent algorithm is used in turn based on the classification loss value and the result. The segmentation loss value updates the parameters of the target object segmentation model, which avoids the situation that the classification loss function and the segmentation loss function update the target object segmentation model at the same time to cause parameter contradictions, which is beneficial to improve the accuracy of the model.
本申请实施例中,不断利用梯度下降算法迭代更新网络的参数,使得目标损失函数不断减小,直到目标损失函数数值稳定达到收敛条件,得到标准病灶分割模型。In the embodiments of the present application, the gradient descent algorithm is continuously used to iteratively update the parameters of the network, so that the target loss function is continuously reduced until the value of the target loss function is stable and reaches the convergence condition, and the standard lesion segmentation model is obtained.
本申请实施例中,通过分类损失函数与分割损失函数的共同学习,能增加目标物分割模型从标注图像集中提取到的信息量,克服了训练过程中高精度的强标注图像的数据量较少的问题;通过分类损失函数与分割损失函数共同确定目标物分割模型的参数,可以避免目标物分割模型过拟合,使得目标物分割模型具有更强的泛化能力。In the embodiments of the present application, the joint learning of the classification loss function and the segmentation loss function can increase the amount of information extracted by the target object segmentation model from the labeled image set, which overcomes the small amount of high-precision strongly labeled images in the training process. Problem: The classification loss function and the segmentation loss function jointly determine the parameters of the target segmentation model, which can avoid overfitting of the target segmentation model, and make the target segmentation model have stronger generalization ability.
所述图像分割模块109,用于获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image segmentation module 109 is configured to obtain an image to be segmented, and use the standard target segmentation model to perform target segmentation on the image to be segmented to obtain a segmentation result.
本申请实施例中,所述待分割图像可以是由用户上传的,当获取到待分割图像后,将所述待分割图像输入至标准病灶分割模型进行目标物分割,得到分割结果。In the embodiment of the present application, the image to be segmented may be uploaded by a user. After the image to be segmented is obtained, the image to be segmented is input to the standard lesion segmentation model for target segmentation, and the segmentation result is obtained.
本申请实施例中,获取包含预处理子模型、共享编码子模型、分类子模型和分割子模型的目标物分割模型,以实现利用目标物分割模型对图像中的目标物进行分割,无需单独训练多个模型对图像进行分割,避免了不同单独模型之间效率的不一致造成目标物分割效率低下,提高图像中目标物分割的效率;通过大量的弱标注图像和少量的强标注图像对目标物分割模型进行训练,根据训练结果利用分割损失函数和分类损失函数共同对模型进行优化,提高了模型的精确度,从而提高了目标物分割模型对图像中目标物进行分割的精确度。因此本申请提出的图像中目标物的分割装置,可以提高低精度标注数据数量多于高精度标注数据时病灶分割的效率和准确率。In the embodiment of the present application, a target segmentation model including a preprocessing submodel, a shared coding submodel, a classification submodel, and a segmentation submodel is obtained, so as to realize the use of the target segmentation model to segment the target in the image without separate training. Multiple models are used to segment the image, avoiding the inconsistency of efficiency between different individual models, resulting in low target segmentation efficiency, and improving the efficiency of target segmentation in the image; segmenting the target through a large number of weakly annotated images and a small number of strongly annotated images The model is trained, and the segmentation loss function and the classification loss function are used to optimize the model according to the training results, which improves the accuracy of the model, thereby improving the accuracy of the target segmentation model for segmenting the target in the image. Therefore, the device for segmenting a target in an image proposed in the present application can improve the efficiency and accuracy of lesion segmentation when the number of low-precision labeled data is larger than that of high-precision labeled data.
如图6所示,是本申请实现图像中目标物的分割方法的电子设备的结构示意图。As shown in FIG. 6, it is a schematic structural diagram of an electronic device that implements a method for segmenting a target in an image according to the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如图像中目标物的分割程序12。The electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a segmentation program 12 for a target in an image.
其中,所述存储器11可以是易失性的,也可以是非易失性的,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如图像中目标物的分割程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 11 may be volatile or non-volatile. The memory 11 includes at least one type of readable storage medium. The readable storage medium includes flash memory, mobile hard disk, and multimedia card. , Card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the segmentation program 12 of the target in the image, etc., but also to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行图像中目标物的分割程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。The processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc. The processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as executing The segmentation program of the target in the image, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
图6仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图6示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 6 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 6 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power The device implements functions such as charge management, discharge management, and power consumption management. The power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and/or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may also include a user interface. The user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only for illustrative purposes, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的图像中目标物的分割程序12是多个计算机程序的组合,在所述处理器10中运行时,可以实现:The segmentation program 12 of the target object in the image stored in the memory 11 in the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can realize:
获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型;Acquiring a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且 所述弱标注图像子集的数量大于所述强标注图像子集的数量;Acquiring an annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of the weakly annotated image subsets is greater than the number of the strongly annotated image subsets;
利用所述预处理子模型对所述标注图像集进行图像预处理;Using the preprocessing submodel to perform image preprocessing on the annotated image set;
利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;Use the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset. The first encoding feature and the second encoding feature of the weakly annotated images in the weakly annotated image subset;
利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;Performing classification processing on the first coding feature and the second coding feature by using the classification sub-model to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image;
利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;Using the segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result;
根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;Constructing a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and constructing a classification loss function according to the weakly annotated image classification result;
利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;Optimizing the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中,所述计算机可读存储介质可以是易失性的,也可以是非易失性的。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. It can be volatile or non-volatile. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
进一步地,所述计算机可用存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store a block chain node Use the created data, etc.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed equipment, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any associated diagrams in the claims should not be regarded as limiting the claims involved.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。***权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用 来表示名称,而并不表示任何特定的顺序。In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The second class words are used to denote names, and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.

Claims (20)

  1. 一种图像中目标物的分割方法,其中,所述方法包括:A method for segmenting a target in an image, wherein the method includes:
    获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型;Acquiring a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
    获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
    利用所述预处理子模型对所述标注图像集进行图像预处理;Using the preprocessing submodel to perform image preprocessing on the annotated image set;
    利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;Use the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset. The first encoding feature and the second encoding feature of the weakly annotated images in the weakly annotated image subset;
    利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;Performing classification processing on the first coding feature and the second coding feature by using the classification sub-model to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image;
    利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;Using the segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result;
    根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;Constructing a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and constructing a classification loss function according to the weakly annotated image classification result;
    利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;Optimizing the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
    获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
  2. 如权利要求1所述的图像中目标物的分割方法,其中,所述利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,包括:The method for segmenting a target in an image according to claim 1, wherein said using said shared coding sub-model to encode said preprocessed annotated image set to obtain the encoding features of said annotated image set, comprising :
    利用所述共享编码子模型对预处理后的所述标注图像集中的所有标注图像进行卷积处理,得到卷积图像集;Using the shared coding sub-model to perform convolution processing on all the annotated images in the preprocessed annotated image set to obtain a convolutional image set;
    对所述卷积图像集中的所有卷积图像进行池化处理,得到所述标注图像集的编码特征。Pooling is performed on all convolutional images in the convolutional image set to obtain the coding feature of the annotated image set.
  3. 如权利要求1所述的图像中目标物的分割方法,其中,所述利用所述分类子模型对所述第一编码特征进行分类处理,得到强标注图像分类结果,包括:5. The method for segmenting a target in an image according to claim 1, wherein said using said classification sub-model to perform classification processing on said first coding feature to obtain a strongly labeled image classification result comprises:
    利用所述分类子模型对所述强标注图像子集中强标注图像的第一编码特征进行全连接处理,得到全连接特征;Using the classification sub-model to perform full connection processing on the first coding feature of the strongly labeled image in the strongly labeled image subset to obtain a fully connected feature;
    利用第一激活函数计算所述全连接特征属于第一预设类别的第一类别概率;Calculating the first category probability that the fully connected feature belongs to the first preset category by using the first activation function;
    根据所述第一类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分类处理,得到强标注图像分类结果。Perform classification processing on the first coding feature of the strongly-annotated images in the strongly-annotated image subset according to the first category probability to obtain a strongly-annotated image classification result.
  4. 如权利要求1所述的图像中目标物的分割方法,其中,所述利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果,包括:The method for segmenting a target in an image according to claim 1, wherein the segmentation sub-model is used to perform segmentation processing on the first encoding feature of the strongly annotated image in the strongly annotated image subset to obtain strongly annotated image segmentation The results include:
    将所述强标注图像子集中强标注图像的第一编码特征进行第一阈值倍数的上采样,得到中间特征图;Performing up-sampling of the first encoding feature of the strongly annotated image in the strongly annotated image subset by a first threshold multiple to obtain an intermediate feature map;
    将所述中间特征图进行第二阈值倍数的上采样,得到复原图像;Up-sampling the intermediate feature map by a second threshold multiple to obtain a restored image;
    利用第二激活函数计算所述复原图像中各像素点属于第二预设类别的第二类别概率;Calculating the second category probability of each pixel in the restored image belonging to the second preset category by using the second activation function;
    根据所述第二类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果。Perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset according to the second category probability to obtain a strongly annotated image segmentation result.
  5. 如权利要求1所述的图像中目标物的分割方法,其中,所述利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,包括:5. The method for segmenting a target in an image according to claim 1, wherein the optimizing the target segmentation model by using the segmentation loss function and the classification loss function comprises:
    确定所述目标物分割模型的目标迭代次数;Determining the number of target iterations of the target object segmentation model;
    计算所述分类损失函数的分类损失值;Calculating the classification loss value of the classification loss function;
    计算所述分割损失函数的分割损失值;Calculating the segmentation loss value of the segmentation loss function;
    利用梯度下降算***流基于所述分类损失值与所述分割损失值对所述目标物分割模型的参数进行更新,直至目标物分割模型的迭代次数达到所述目标迭代次数。A gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value and the segmentation loss value in turn, until the number of iterations of the target object segmentation model reaches the target number of iterations.
  6. 如权利要求1至5中任一项所述的图像中目标物的分割方法,其中,所述分割损失函数为:The method for segmenting a target in an image according to any one of claims 1 to 5, wherein the segmentation loss function is:
    Figure PCTCN2020131993-appb-100001
    Figure PCTCN2020131993-appb-100001
    其中,L cls为基于所述强标注图像分类结果构建的分类子函数,L seg为基于所述强标注图像分割结果构建的分割子函数,σ 1 2与σ 2 2为预设参数。 Wherein, L cls is a classification sub-function constructed based on the strongly-annotated image classification result, L seg is a segmentation sub-function constructed based on the strongly-annotated image segmentation result, and σ 1 2 and σ 2 2 are preset parameters.
  7. 如权利要求1所述的图像中目标物的分割方法,其中,所述标注图像集包括带有标签的生物体组织的医学图像。The method for segmenting a target in an image according to claim 1, wherein the labeled image set includes medical images of labeled biological tissues.
  8. 一种图像中目标物的分割装置,其中,所述装置包括:A device for segmenting a target in an image, wherein the device includes:
    模型获取模块,用于获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型;A model acquisition module for acquiring a target object segmentation model, wherein the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
    标注图像获取模块,用于获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;Annotated image acquisition module for acquiring annotated image set, wherein the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the strongly annotated image subset quantity;
    标注图像预处理模块,用于利用所述预处理子模型对所述标注图像集进行图像预处理;An annotated image preprocessing module, configured to perform image preprocessing on the annotated image set by using the preprocessing sub-model;
    标注图像编码模块,用于利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;The annotated image encoding module is configured to encode the preprocessed annotated image set by using the shared coding submodel to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes strong annotation The first encoding feature of the strongly annotated image in the image subset and the second encoding feature of the weakly annotated image in the weakly annotated image subset;
    特征分类模块,用于利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;The feature classification module is configured to use the classification sub-model to perform classification processing on the first coding feature and the second coding feature, respectively, to obtain a classification result of a strongly annotated image and a classification result of a weakly annotated image;
    特征分割模块,用于利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;A feature segmentation module, configured to use the segmentation submodel to perform segmentation processing on the first encoding feature of the strongly annotated image in the strongly annotated image subset to obtain a strongly annotated image segmentation result;
    损失函数获取模块,用于根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;A loss function acquisition module, configured to construct a segmentation loss function based on the strongly labeled image classification result and the strongly labeled image segmentation result, and construct a classification loss function based on the weakly labeled image classification result;
    模型优化模块,用于利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;A model optimization module is used to optimize the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
    图像分割模块,用于获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image segmentation module is used to obtain an image to be segmented, and use the standard target segmentation model to perform target segmentation on the image to be segmented to obtain a segmentation result.
  9. 一种电子设备,其中,所述电子设备包括:至少一个处理器,以及与所述至少一个处理器通信连接的存储器,其中:An electronic device, wherein the electronic device includes: at least one processor, and a memory communicatively connected with the at least one processor, wherein:
    所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the following steps:
    获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子模型、分类子模型和分割子模型;Acquiring a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
    获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
    利用所述预处理子模型对所述标注图像集进行图像预处理;Using the preprocessing submodel to perform image preprocessing on the annotated image set;
    利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;Use the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset. The first encoding feature and the second encoding feature of the weakly annotated images in the weakly annotated image subset;
    利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;Performing classification processing on the first coding feature and the second coding feature by using the classification sub-model to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image;
    利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割 处理,得到强标注图像分割结果;Using the segmentation sub-model to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result;
    根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;Constructing a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and constructing a classification loss function according to the weakly annotated image classification result;
    利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;Optimizing the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
    获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
  10. 如权利要求9所述的电子设备,其中,所述利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,包括:9. The electronic device according to claim 9, wherein said using said shared coding submodel to encode said preprocessed annotated image set to obtain the encoding features of said annotated image set, comprising:
    利用所述共享编码子模型对预处理后的所述标注图像集中的所有标注图像进行卷积处理,得到卷积图像集;Using the shared coding sub-model to perform convolution processing on all the annotated images in the preprocessed annotated image set to obtain a convolutional image set;
    对所述卷积图像集中的所有卷积图像进行池化处理,得到所述标注图像集的编码特征。Pooling is performed on all convolutional images in the convolutional image set to obtain the coding feature of the annotated image set.
  11. 如权利要求9所述的电子设备,其中,所述利用所述分类子模型对所述第一编码特征进行分类处理,得到强标注图像分类结果,包括:9. The electronic device according to claim 9, wherein said using said classification sub-model to perform classification processing on said first coding feature to obtain a strongly labeled image classification result comprises:
    利用所述分类子模型对所述强标注图像子集中强标注图像的第一编码特征进行全连接处理,得到全连接特征;Using the classification sub-model to perform full connection processing on the first coding feature of the strongly labeled image in the strongly labeled image subset to obtain a fully connected feature;
    利用第一激活函数计算所述全连接特征属于第一预设类别的第一类别概率;Calculating the first category probability that the fully connected feature belongs to the first preset category by using the first activation function;
    根据所述第一类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分类处理,得到强标注图像分类结果。Perform classification processing on the first coding feature of the strongly-annotated images in the strongly-annotated image subset according to the first category probability to obtain a strongly-annotated image classification result.
  12. 如权利要求9所述的电子设备,其中,所述利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果,包括:9. The electronic device of claim 9, wherein the segmentation process is performed on the first coding feature of the strongly annotated image in the strongly annotated image subset by using the segmentation submodel to obtain a strongly annotated image segmentation result, comprising:
    将所述强标注图像子集中强标注图像的第一编码特征进行第一阈值倍数的上采样,得到中间特征图;Performing up-sampling of the first encoding feature of the strongly annotated image in the strongly annotated image subset by a first threshold multiple to obtain an intermediate feature map;
    将所述中间特征图进行第二阈值倍数的上采样,得到复原图像;Up-sampling the intermediate feature map by a second threshold multiple to obtain a restored image;
    利用第二激活函数计算所述复原图像中各像素点属于第二预设类别的第二类别概率;Calculating the second category probability of each pixel in the restored image belonging to the second preset category by using the second activation function;
    根据所述第二类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果。Perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset according to the second category probability to obtain a strongly annotated image segmentation result.
  13. 如权利要求9所述的电子设备,其中,所述利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,包括:9. The electronic device according to claim 9, wherein said using said segmentation loss function and classification loss function to optimize said target object segmentation model comprises:
    确定所述目标物分割模型的目标迭代次数;Determining the number of target iterations of the target object segmentation model;
    计算所述分类损失函数的分类损失值;Calculating the classification loss value of the classification loss function;
    计算所述分割损失函数的分割损失值;Calculating the segmentation loss value of the segmentation loss function;
    利用梯度下降算***流基于所述分类损失值与所述分割损失值对所述目标物分割模型的参数进行更新,直至目标物分割模型的迭代次数达到所述目标迭代次数。A gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value and the segmentation loss value in turn, until the number of iterations of the target object segmentation model reaches the target number of iterations.
  14. 如权利要求9至13中任一项所述的电子设备,其中,所述分割损失函数为:The electronic device according to any one of claims 9 to 13, wherein the segmentation loss function is:
    Figure PCTCN2020131993-appb-100002
    Figure PCTCN2020131993-appb-100002
    其中,L cls为基于所述强标注图像分类结果构建的分类子函数,L seg为基于所述强标注图像分割结果构建的分割子函数,σ 1 2与σ 2 2为预设参数。 Wherein, L cls is a classification sub-function constructed based on the strongly-annotated image classification result, L seg is a segmentation sub-function constructed based on the strongly-annotated image segmentation result, and σ 1 2 and σ 2 2 are preset parameters.
  15. 如权利要求9所述的电子设备,其中,所述标注图像集包括带有标签的生物体组织的医学图像。9. The electronic device of claim 9, wherein the labeled image set includes medical images of labeled biological tissues.
  16. 一种计算机可读存储介质,包括存储数据区和存储程序区,其中,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium includes a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein, when the computer program is executed by a processor To achieve the following steps:
    获取目标物分割模型,其中,所述目标物分割模型中包含预处理子模型、共享编码子 模型、分类子模型和分割子模型;Acquiring a target object segmentation model, where the target object segmentation model includes a preprocessing sub-model, a shared coding sub-model, a classification sub-model, and a segmentation sub-model;
    获取标注图像集,其中,所述标注图像集包括弱标注图像子集和强标注图像子集,且所述弱标注图像子集的数量大于所述强标注图像子集的数量;Acquiring an annotated image set, where the annotated image set includes a weakly annotated image subset and a strongly annotated image subset, and the number of weakly annotated image subsets is greater than the number of strongly annotated image subsets;
    利用所述预处理子模型对所述标注图像集进行图像预处理;Using the preprocessing submodel to perform image preprocessing on the annotated image set;
    利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,其中,所述标注图像集的编码特征包括强标注图像子集中强标注图像的第一编码特征和弱标注图像子集中弱标注图像的第二编码特征;Use the shared coding submodel to encode the preprocessed annotated image set to obtain the encoding feature of the annotated image set, wherein the encoding feature of the annotated image set includes the strongly annotated image subset in the strongly annotated image subset. The first encoding feature and the second encoding feature of the weakly annotated images in the weakly annotated image subset;
    利用所述分类子模型对所述第一编码特征和所述第二编码特征分别进行分类处理,得到强标注图像分类结果以及弱标注图像分类结果;Performing classification processing on the first coding feature and the second coding feature by using the classification sub-model to obtain a classification result of a strongly labeled image and a classification result of a weakly labeled image;
    利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果;Using the segmentation submodel to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset, to obtain a strongly annotated image segmentation result;
    根据所述强标注图像分类结果与所述强标注图像分割结果构建分割损失函数,根据所述弱标注图像分类结果构建分类损失函数;Constructing a segmentation loss function according to the strongly annotated image classification result and the strongly annotated image segmentation result, and constructing a classification loss function according to the weakly annotated image classification result;
    利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,得到标准目标物分割模型;Optimizing the target segmentation model by using the segmentation loss function and the classification loss function to obtain a standard target segmentation model;
    获取待分割图像,利用所述标准目标物分割模型对所述待分割图像进行目标物分割,得到分割结果。The image to be segmented is acquired, and the standard object segmentation model is used to perform object segmentation on the image to be segmented to obtain a segmentation result.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述共享编码子模型对预处理后的所述标注图像集进行编码,得到所述标注图像集的编码特征,包括:15. The computer-readable storage medium according to claim 16, wherein the encoding the preprocessed annotated image set using the shared encoding submodel to obtain the encoding feature of the annotated image set comprises:
    利用所述共享编码子模型对预处理后的所述标注图像集中的所有标注图像进行卷积处理,得到卷积图像集;Using the shared coding sub-model to perform convolution processing on all the annotated images in the preprocessed annotated image set to obtain a convolutional image set;
    对所述卷积图像集中的所有卷积图像进行池化处理,得到所述标注图像集的编码特征。Pooling is performed on all convolutional images in the convolutional image set to obtain the coding feature of the annotated image set.
  18. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述分类子模型对所述第一编码特征进行分类处理,得到强标注图像分类结果,包括:15. The computer-readable storage medium according to claim 16, wherein said using said classification sub-model to perform classification processing on said first coding feature to obtain a strongly labeled image classification result comprises:
    利用所述分类子模型对所述强标注图像子集中强标注图像的第一编码特征进行全连接处理,得到全连接特征;Using the classification sub-model to perform full connection processing on the first coding feature of the strongly labeled image in the strongly labeled image subset to obtain a fully connected feature;
    利用第一激活函数计算所述全连接特征属于第一预设类别的第一类别概率;Calculating the first category probability that the fully connected feature belongs to the first preset category by using the first activation function;
    根据所述第一类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分类处理,得到强标注图像分类结果。Perform classification processing on the first coding feature of the strongly-annotated images in the strongly-annotated image subset according to the first category probability to obtain a strongly-annotated image classification result.
  19. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述分割子模型对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果,包括:15. The computer-readable storage medium of claim 16, wherein the segmentation submodel is used to perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset to obtain a strongly annotated image segmentation result, include:
    将所述强标注图像子集中强标注图像的第一编码特征进行第一阈值倍数的上采样,得到中间特征图;Performing up-sampling of the first encoding feature of the strongly annotated image in the strongly annotated image subset by a first threshold multiple to obtain an intermediate feature map;
    将所述中间特征图进行第二阈值倍数的上采样,得到复原图像;Up-sampling the intermediate feature map by a second threshold multiple to obtain a restored image;
    利用第二激活函数计算所述复原图像中各像素点属于第二预设类别的第二类别概率;Calculating the second category probability of each pixel in the restored image belonging to the second preset category by using the second activation function;
    根据所述第二类别概率对所述强标注图像子集中强标注图像的第一编码特征进行分割处理,得到强标注图像分割结果。Perform segmentation processing on the first coding feature of the strongly annotated image in the strongly annotated image subset according to the second category probability to obtain a strongly annotated image segmentation result.
  20. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述分割损失函数及分类损失函数对所述目标物分割模型进行优化,包括:15. The computer-readable storage medium according to claim 16, wherein said using said segmentation loss function and classification loss function to optimize said target object segmentation model comprises:
    确定所述目标物分割模型的目标迭代次数;Determining the number of target iterations of the target object segmentation model;
    计算所述分类损失函数的分类损失值;Calculating the classification loss value of the classification loss function;
    计算所述分割损失函数的分割损失值;Calculating the segmentation loss value of the segmentation loss function;
    利用梯度下降算***流基于所述分类损失值与所述分割损失值对所述目标物分割模型的参数进行更新,直至目标物分割模型的迭代次数达到所述目标迭代次数。A gradient descent algorithm is used to update the parameters of the target object segmentation model based on the classification loss value and the segmentation loss value in turn, until the number of iterations of the target object segmentation model reaches the target number of iterations.
PCT/CN2020/131993 2020-09-24 2020-11-27 Method and apparatus for target object segmentation in image, and electronic device and storage medium WO2021189913A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011015764.XA CN111932547B (en) 2020-09-24 2020-09-24 Method and device for segmenting target object in image, electronic device and storage medium
CN202011015764.X 2020-09-24

Publications (1)

Publication Number Publication Date
WO2021189913A1 true WO2021189913A1 (en) 2021-09-30

Family

ID=73334146

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/131993 WO2021189913A1 (en) 2020-09-24 2020-11-27 Method and apparatus for target object segmentation in image, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN111932547B (en)
WO (1) WO2021189913A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116309963A (en) * 2023-05-18 2023-06-23 太初(无锡)电子科技有限公司 Batch labeling method and device for images, electronic equipment and storage medium
TWI826316B (en) * 2023-05-11 2023-12-11 宏碁股份有限公司 Image segmentation model training method and electronic device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111932547B (en) * 2020-09-24 2021-06-11 平安科技(深圳)有限公司 Method and device for segmenting target object in image, electronic device and storage medium
CN112465060A (en) * 2020-12-10 2021-03-09 平安科技(深圳)有限公司 Method and device for detecting target object in image, electronic equipment and readable storage medium
CN112925938A (en) * 2021-01-28 2021-06-08 上海商汤智能科技有限公司 Image annotation method and device, electronic equipment and storage medium
CN113222890B (en) * 2021-03-30 2023-09-15 平安科技(深圳)有限公司 Small target object detection method and device, electronic equipment and storage medium
CN114170481B (en) * 2022-02-10 2022-06-17 北京字节跳动网络技术有限公司 Method, apparatus, storage medium, and program product for image processing

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109636805A (en) * 2018-11-19 2019-04-16 浙江大学山东工业技术研究院 A kind of uterine neck image lesion region segmenting device and method based on classification priori
US20190205638A1 (en) * 2017-12-28 2019-07-04 Baidu Online Network Technology (Beijing) Co., Ltd . Method and apparatus for training a character detector based on weak supervision, system and medium
CN110009623A (en) * 2019-04-10 2019-07-12 腾讯科技(深圳)有限公司 A kind of image recognition model training and image-recognizing method, apparatus and system
CN111598900A (en) * 2020-05-18 2020-08-28 腾讯科技(深圳)有限公司 Image region segmentation model training method, segmentation method and device
CN111932547A (en) * 2020-09-24 2020-11-13 平安科技(深圳)有限公司 Method and device for segmenting target object in image, electronic device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10699412B2 (en) * 2017-03-23 2020-06-30 Petuum Inc. Structure correcting adversarial network for chest X-rays organ segmentation
CN110543911B (en) * 2019-08-31 2022-12-16 华南理工大学 Weak supervision target segmentation method combined with classification task
CN111160367B (en) * 2019-12-23 2024-03-01 上海联影智能医疗科技有限公司 Image classification method, apparatus, computer device, and readable storage medium
CN111178364A (en) * 2019-12-31 2020-05-19 北京奇艺世纪科技有限公司 Image identification method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190205638A1 (en) * 2017-12-28 2019-07-04 Baidu Online Network Technology (Beijing) Co., Ltd . Method and apparatus for training a character detector based on weak supervision, system and medium
CN109636805A (en) * 2018-11-19 2019-04-16 浙江大学山东工业技术研究院 A kind of uterine neck image lesion region segmenting device and method based on classification priori
CN110009623A (en) * 2019-04-10 2019-07-12 腾讯科技(深圳)有限公司 A kind of image recognition model training and image-recognizing method, apparatus and system
CN111598900A (en) * 2020-05-18 2020-08-28 腾讯科技(深圳)有限公司 Image region segmentation model training method, segmentation method and device
CN111932547A (en) * 2020-09-24 2020-11-13 平安科技(深圳)有限公司 Method and device for segmenting target object in image, electronic device and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI826316B (en) * 2023-05-11 2023-12-11 宏碁股份有限公司 Image segmentation model training method and electronic device
CN116309963A (en) * 2023-05-18 2023-06-23 太初(无锡)电子科技有限公司 Batch labeling method and device for images, electronic equipment and storage medium
CN116309963B (en) * 2023-05-18 2023-08-18 太初(无锡)电子科技有限公司 Batch labeling method and device for images, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111932547B (en) 2021-06-11
CN111932547A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
WO2021189913A1 (en) Method and apparatus for target object segmentation in image, and electronic device and storage medium
WO2021217851A1 (en) Abnormal cell automatic labeling method and apparatus, electronic device, and storage medium
Qayyum et al. Medical image retrieval using deep convolutional neural network
WO2022121156A1 (en) Method and apparatus for detecting target object in image, electronic device and readable storage medium
US10496884B1 (en) Transformation of textbook information
WO2021189912A1 (en) Method and apparatus for detecting target object in image, and electronic device and storage medium
WO2021189909A1 (en) Lesion detection and analysis method and apparatus, and electronic device and computer storage medium
US10692602B1 (en) Structuring free text medical reports with forced taxonomies
WO2022213465A1 (en) Neural network-based image recognition method and apparatus, electronic device, and medium
WO2021151338A1 (en) Medical imagery analysis method, apparatus, electronic device and readable storage medium
WO2021151275A1 (en) Image segmentation method and apparatus, device, and storage medium
CN110853739B (en) Image management display method, device, computer equipment and storage medium
CN111933274B (en) Disease classification diagnosis method, device, electronic equipment and storage medium
JP7503213B2 (en) Systems and methods for evaluating pet radiological images
WO2021184576A1 (en) Medical image generation method and apparatus, electronic device and medium
WO2022222943A1 (en) Department recommendation method and apparatus, electronic device and storage medium
US20230005138A1 (en) Lumbar spine annatomical annotation based on magnetic resonance images using artificial intelligence
CN113298159A (en) Target detection method and device, electronic equipment and storage medium
CN115938563A (en) Medical diagnosis method and device based on cross-modal semantic hashing
CN113052236A (en) Pneumonia image classification method based on NASN
CN114511569B (en) Tumor marker-based medical image identification method, device, equipment and medium
CN115100103A (en) Tumor prediction method and device based on bacterial data
CN112580505B (en) Method and device for identifying network point switch door state, electronic equipment and storage medium
CN112233194B (en) Medical picture optimization method, device, equipment and computer readable storage medium
CN114049676A (en) Fatigue state detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20927913

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20927913

Country of ref document: EP

Kind code of ref document: A1