WO2023030427A1 - Training method for generative model, polyp identification method and apparatus, medium, and device - Google Patents

Training method for generative model, polyp identification method and apparatus, medium, and device Download PDF

Info

Publication number
WO2023030427A1
WO2023030427A1 PCT/CN2022/116426 CN2022116426W WO2023030427A1 WO 2023030427 A1 WO2023030427 A1 WO 2023030427A1 CN 2022116426 W CN2022116426 W CN 2022116426W WO 2023030427 A1 WO2023030427 A1 WO 2023030427A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
training
polyp
generated
distribution
Prior art date
Application number
PCT/CN2022/116426
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 WO2023030427A1 publication Critical patent/WO2023030427A1/en

Links

Images

Classifications

    • 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
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • 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/10068Endoscopic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30028Colon; Small intestine
    • G06T2207/30032Colon polyp

Definitions

  • the present disclosure relates to the field of image processing, and in particular, relates to a training method for generating a model, a method for identifying polyps, a device, a medium, and equipment.
  • Endoscopes are widely used for colon screening and polyp detection, but the detection accuracy of endoscopes largely depends on the experience of endoscopists. However, because the characteristics of polyps are difficult to identify, and many polyps are small in size, the missed detection rate of polyp detection is relatively high, which greatly increases the difficulty of early polyp screening.
  • the deep learning method can be used for model training to be used in a computer-aided diagnosis system for polyp identification and segmentation.
  • the out-of-sample data has a large domain shift through the above method, there may be a large performance gap in these trained networks, and it is difficult to ensure the generalization of the model through limited sample data, making the trained model
  • the detection accuracy of out-of-sample data is insufficient to achieve accurate polyp detection.
  • the present disclosure provides a method for training a polyp image generation model, the method comprising:
  • each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
  • the training image and the image generation model a generated image and a restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator, and the first generator is used to The training image is used to generate the generated image, and the second generator is used to generate the restored image according to the generated image;
  • the training image and the generated image determine a first distribution distance corresponding to the training image and the generated image, wherein the first distribution distance is used to represent the distribution of the training image and the generated image The difference between the distributions of ;
  • the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image determine the target loss of the image generation model, wherein the target loss includes The first distribution loss determined according to the first distribution distance, the first distribution loss and the first distribution distance are negatively correlated;
  • the parameters of the image generation model are updated according to the target loss.
  • the present disclosure provides a polyp identification method, the method comprising:
  • the training sample set corresponding to the polyp recognition model includes an original sample, and according to the original sample and the first generated image in the image generation model
  • the generation sample generated by the machine, the image generation model is obtained by training based on the polyp image generation model training method described in the first aspect, the original sample includes the original image and the polyp label category corresponding to the original image, so The generated samples include a generated image generated based on an original image and a polyp labeling category corresponding to the original image.
  • the present disclosure provides a training device for a polyp image generation model, the device comprising:
  • An acquisition module configured to acquire a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
  • a generation module configured to obtain a generated image and a restored image corresponding to the training image according to the training image and the image generation model, wherein the image generation model includes a first generator and a second generator, and the first The generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image;
  • a first determining module configured to determine a first distribution distance corresponding to the training image and the generated image according to the training image and the generated image, wherein the first distribution distance is used to represent the training image The difference between the distribution of and the distribution of the generated images;
  • the second determination module is configured to determine the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, wherein, the target loss includes a first distribution loss determined according to the first distribution distance, and the first distribution loss is negatively correlated with the first distribution distance;
  • An update module configured to update the parameters of the image generation model according to the target loss when an update condition is met.
  • a polyp identification device comprising:
  • a receiving module configured to receive an image of a polyp to be identified
  • An identification module configured to input the polyp image into a polyp identification model to obtain an identification result of the polyp image, wherein the training sample set corresponding to the polyp identification model includes original samples, and a model is generated according to the original samples and images
  • the generation sample generated by the first generator in the first aspect, the image generation model is obtained by training based on the training method of the polyp image generation model described in the first aspect, and the original sample includes the original image and the corresponding
  • the polyp labeling category, the generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
  • a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first or second aspect are implemented.
  • an electronic device including:
  • a processing device configured to execute the computer program in the storage device to implement the steps of the method in the first or second aspect.
  • a new image can be generated based on the training image and the image generation model, and the generated image and the restored image can be obtained.
  • the style transfer method of the network imitates and generates the training images to ensure the semantic consistency between the generated images generated based on the image generation model and the original images, so that the generated images generated by the image generation model and the training images belong to the same polyp classification, Furthermore, there is no need to perform data labeling on the generated images, and effectively labeled samples for polyp recognition model training can be automatically generated.
  • the first distribution distance between the training image and the generated image is also determined, then the first distribution distance can be further combined on the basis of combining the training sample, the generated image and the restored image to determine the target loss for image generation models. Therefore, through the first distribution loss, more data with diversity can be obtained on the basis of not obtaining additional polyp categories in the generated image obtained based on the image generation model, so that it can be guaranteed that based on the generated image and the training image
  • the generalization of the model being trained such as the polyp recognition model.
  • the polyp image is generated by the image generation model, so that more training data for training the polyp recognition model can be obtained based on limited sample data, which can reduce the manpower and time spent on polyp recognition model training, and can further improve polyp recognition
  • the detection accuracy and robustness of the model ensure the accuracy of polyp detection and effectively reduce the missed detection rate of polyp detection.
  • FIG. 1 is a flowchart of a training method for a polyp image generation model provided according to an embodiment of the present disclosure
  • Fig. 2 is a schematic diagram of an image generation model provided according to an embodiment of the present disclosure
  • Fig. 3 is a block diagram of a training device for a polyp image generation model provided according to an embodiment of the present disclosure
  • FIG. 4 shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure.
  • the term “comprise” and its variations are open-ended, ie “including but not limited to”.
  • the term “based on” is “based at least in part on”.
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
  • the present disclosure provides the following embodiments, by training the image generation model to generate more diverse training data based on the existing training data, thereby improving the generalization and detection accuracy of the polyp recognition model trained based on the training data Spend.
  • FIG. 1 it is a flowchart of a training method for a polyp image generation model provided according to an embodiment of the present disclosure. As shown in FIG. 1, the method includes:
  • step 11 a training sample set is acquired, wherein each training sample in the training sample set includes a training image and a labeled category of polyps corresponding to the training image.
  • endoscopic images (such as gastroscopic images, colonoscopic images, etc.) of multiple patients including polyps can be collected as training images under real conditions.
  • data collection can be performed on patients to obtain detection data containing polyps, and then in order to ensure uniform processing of training images, the detection data can be standardized, for example, the obtained detection data contains white light endoscopic images of polyps as the training image.
  • the resolution and size of the training image can be standardized to obtain a training image of uniform size, which facilitates the subsequent training process.
  • an experienced gastrointestinal endoscopist may mark the corresponding polyp label, that is, the polyp label category.
  • step 12 according to the training image and the image generation model, the generated image and restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator, and the first generator is used to The training image generates the generated image, and the second generator is configured to generate the restoration image according to the generated image.
  • the image generation model includes a first generator and a second generator, and the first generator is used to The training image generates the generated image, and the second generator is configured to generate the restoration image according to the generated image.
  • the image generation model can be realized based on the CycleGAN network, including two generators in the CycleGAN network, as shown in Figure 2, the image generation model can include a first generator 21 and a second generator 22, as shown in Figure 2
  • the training image can be input to the first generator 21, so that the first generator 21 can generate the corresponding generated image X k ' and the corresponding polyp of the generated image according to the training image X k and the polyp labeling category k corresponding to the training image.
  • Category k' wherein, in the process of image generation, based on the style transfer method of the confrontation generation network, the polyp label category in the training sample set is used as a condition to generate a new generated image based on the original image, such as:
  • X k' is used to represent the generated image
  • k' is used to represent the polyp category corresponding to the generated image
  • the polyp label category k corresponding to the training image X k can be directly used as the polyp category corresponding to the generated image
  • G (,) is used to represent the image generation operation of the first generator.
  • the image generation model contains two generators, which constitute a ring network, that is , the second generator can further generate a training image X k corresponding to the generated image X k' and the polyp category corresponding to the generated image
  • the restored image X′ k' is used to represent the generated image
  • k' is used to represent the polyp category corresponding to the generated image
  • the polyp label category k corresponding to the training image X k can be directly used as the polyp category corresponding to the generated image
  • G (,) is used to represent the image generation operation of the first generator.
  • the image generation model contains two generators, which constitute a ring network, that is
  • F(,) is used to represent the image generation operation of the second generator. Therefore, through the above steps, more diverse training images can be generated based on the image generation model without adding additional types of polyps.
  • step 13 according to the training image and the generated image, the first distribution distance corresponding to the training image and the generated image is determined, wherein the first distribution distance is used to represent the difference between the distribution of the training image and the distribution of the generated image difference between.
  • the purpose of generating a new image based on the training image is to generate more diverse data corresponding to the training image. Therefore, in this step, two parameters can be determined based on the distribution of the training image and the distribution of the generated image. distribution distance between them.
  • the generated image itself is generated based on the training image and the polyp label category of the training image as a constraint condition. Therefore, the generated image and the polyp category corresponding to the training image are the same category.
  • the distribution distance between the training image and the generated image can be increased to make the distribution of the newly generated image different from the training image, so as to ensure the diversity of the new generated image.
  • the target loss of the image generation model is determined according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, wherein the target loss includes
  • the determined first distribution loss has a negative correlation with the first distribution distance, and the larger the first distribution distance is, the smaller the first distribution loss is.
  • step 15 if the update condition is satisfied, the parameters of the image generation model are updated according to the target loss.
  • the update condition may be that the target loss is greater than a preset loss threshold, which means that the accuracy of the image generation model is insufficient.
  • the update condition may be that the number of iterations is less than a preset number threshold, at this time, it is considered that the number of iterations of the image generation model is small, and its accuracy is insufficient.
  • the parameters of the image generation model can be updated according to the target loss.
  • the manner of updating the parameters based on the determined target loss may adopt an updating manner commonly used in the art, so that the target loss can gradually converge, and will not be repeated here.
  • the update condition is not met, it can be considered that the accuracy of the image generation model meets the training requirements, and at this time the training process can be stopped to obtain a trained image generation model.
  • a new image can be generated based on the training image and the image generation model, and the generated image and the restored image can be obtained.
  • the style transfer method based on the confrontation generation network imitates and generates the training image to ensure the semantic consistency between the generated image generated based on the image generation model and the original image, so that the generated image generated by the image generation model and the training image belong to the same Polyp classification, so that there is no need to label the generated images, and effective labeled samples for polyp recognition model training can be automatically generated.
  • the target loss when determining the target loss, according to the training image and the generated image, determine the first distribution distance between the two, then you can further combine the first distribution distance on the basis of combining the training sample, the generated image and the restored image to determine the target loss for image generation models. Therefore, through the first distribution loss, more data with diversity can be obtained on the basis of not obtaining additional polyp categories in the generated image obtained based on the image generation model, so that it can be guaranteed that based on the generated image and the training image
  • the generalization of the model being trained such as the polyp recognition model.
  • the polyp image is generated by the image generation model, so that more training data for training the polyp recognition model can be obtained based on limited sample data, which can reduce the manpower and time spent on polyp recognition model training, and can further improve polyp recognition
  • the detection accuracy and robustness of the model ensure the accuracy of polyp detection and effectively reduce the missed detection rate of polyp detection.
  • step 13 according to the training image and the generated image, an exemplary implementation manner of determining the first distribution distance corresponding to the training image and the generated image is as follows, and this step may include:
  • the transmission distance between the training images, the transmission distance between the generated images, and the transmission distance between the training images and the generated images are determined.
  • the transmission distance can be used to measure the distance between two distributions, specifically, the transmission distance is determined by the following formula:
  • W c (X 1 , X 2 ) is used to represent the transmission distance between image X 1 and image X 2 ;
  • ⁇ (X 1 ) is used to represent the feature image extracted from the image X 1 ;
  • ⁇ (X 2 ) is used to represent the feature image extracted from the image X 2 ;
  • P 1 is used to represent the distribution corresponding to the image X 1
  • P 2 is used to represent the distribution corresponding to the image X 2 ;
  • ⁇ (P 1 , P 2 ) is used to represent all joint distributions formed by distribution P 1 and distribution P 2 ;
  • c(X 1 , X 2 ) is used to represent the transmission cost between the image X 1 and the image X 2 .
  • image X 1 and image X 2 are two training images sampled from the training image
  • image X 1 and image X 2 is two generated images sampled from the generated image.
  • the image X 1 and the image X 2 are respectively collected from the training image and the generated image.
  • image X 1 is a training image
  • image X 2 is a generated image.
  • all the joint distributions formed by the distribution P1 of the training image and the distribution P2 of the generated image can be determined first.
  • one sample image X 1 and one sample image X 2 can be obtained by sampling X 1 , X 2 ⁇ , and the transportation cost c(X 1 ,X 2 ).
  • feature extraction can be performed on the image based on CNN (Convolutional Neural Networks, convolutional neural network), that is, the feature extraction can be performed on the training image X1 through CNN, and the corresponding feature corresponding to the training image X1 can be obtained
  • image ⁇ (X 1 ) feature extraction is performed on the generated image X 2 through CNN to obtain the feature image ⁇ (X 2 ) corresponding to the generated image X 2 .
  • the above formula can be used to calculate based on the extracted feature image to obtain the corresponding transportation cost.
  • 2 is used to represent calculation in the second normal form, and the calculation method in the second normal form is the prior art, and will not be repeated here.
  • the expected value of the sample image for the transportation cost under the joint distribution ⁇ can be calculated A lower bound on the expected value under all possible joint distributions That is the transmission distance.
  • the first distribution distance may be determined according to the transmission distance between the training image and the generated image, the transmission distance between the training images, and the transmission distance between the generated images.
  • d(P 1 , P 2 ) is used to represent the first distribution distance between the distribution P 1 corresponding to the training image and the second distribution P 2 corresponding to the generated image; for example, X 1 and X′ 1 can be used for Represents two sample images in the training image; X 2 and X' 2 can be used to represent two sample images in the generated image, so that the first distribution distance can be further determined.
  • the transmission cost between the images can be calculated to further determine the transmission distance between the training image and the generated image based on the transmission cost, so as to characterize the difference between the distribution of the training image and the generated image , so as to facilitate the adjustment in the direction of increasing the difference when adjusting the model parameters in the future, and provide data support to ensure the difference between the distribution of the training image and the generated image, thereby effectively ensuring that the image generated based on the trained image generation model Variety of generated images.
  • step 14 according to the first distribution distance, the training image, the generated image, the restored image, and the polyp label category corresponding to the training image, an exemplary implementation of determining the target loss of the image generation model is as follows , this step can include:
  • a generation loss of the image generation model is determined according to the training image and the restored image corresponding to the training image.
  • the generated images in the present disclosure are generated based on the training images through style transfer, which can generate generated images with diversity.
  • the first normal form calculation is performed according to the training image and the restoration image corresponding to the training image to obtain the generation loss, wherein the restoration image corresponding to the training image is based on The generated image corresponding to the training image is generated.
  • the generation loss L cycle can be expressed as:
  • the semantic consistency between the generated image and the training image can be ensured by calculating the difference between the training image and the restoration image.
  • the prediction loss of the image generation model is determined.
  • the generated image may be input into a discriminator corresponding to the first generator, so that a polyp prediction category corresponding to the generated image may be obtained.
  • the first generator when the first generator generates a new image, it is constrained by the polyp labeling category of the training image, so the generated image generated by the first generator should belong to the same polyp labeling category as the training image. Therefore, the difference between the polyp labeling category corresponding to the training image and the polyp prediction category corresponding to the generated image can be calculated to ensure that the newly generated generated image and the original image belong to the same category of images, which can be expanded through the method of style transfer.
  • the diversity of the data set is enhanced, and the polyp category of the generated image can be automatically marked to further ensure the semantic consistency between the generated image and the training image.
  • the prediction loss may be calculated as the cross entropy between the polyp labeled category and the polyp predicted category, and the calculation method of the cross entropy is the prior art, which will not be repeated here.
  • the parameters of the discriminator corresponding to the first generator can be adjusted synchronously with the parameters of the first generator.
  • the negative value of the prediction loss can be used as the loss of the discriminator, so as to adjust the parameters of the discriminator according to the loss, so that the accuracy of the discriminator can be improved, and the first generator can be further improved by confrontation generation. image generation accuracy.
  • the target loss is determined based on the generation loss, the prediction loss, and the first distribution loss.
  • a weighted sum of generation loss, the prediction loss and the first distribution loss may be determined as the target loss.
  • the weights respectively corresponding to the generation loss, the prediction loss and the first distribution loss may be set according to specific application scenarios, which is not limited in the present disclosure.
  • the difference between the training image and the restoration image can be calculated to ensure the semantic consistency between the generated image and the training image, and further Considering the difference between the polyp prediction category corresponding to the generated image and the polyp labeling category corresponding to the training image, the accuracy of the semantic information of the generated image is further ensured, and reliable data support is provided for automatically labeling the polyp category on the generated image.
  • the first distribution loss can also be combined in the target loss, so that the image generation model obtained by training can generate a variety of generated images, while ensuring the semantic consistency between the generated image and the training image, ensuring certainty the reliability of the generated samples.
  • the training sample set includes training samples corresponding to multiple labeled categories of polyps, so that generated images of multiple categories can be generated based on the trained image generation model.
  • this step may also include:
  • the generated images under various polyp labeling categories determine the second distribution distance corresponding to the generated images under the two polyp labeling categories, wherein the second distribution distance is used to represent the difference between distributions of generated images belonging to different polyp annotation categories.
  • the image generation model can be trained by training samples under various categories.
  • the difference between generated images of different categories can be ensured by determining the second distribution distance.
  • the generated images under the two polyp label categories can be arbitrarily selected to calculate the distribution distance, wherein, the calculation method of the second distribution distance between the generated images of different categories is the same as The above calculation method for determining the first distribution distance between the training image and the generated image is the same, and will not be repeated here.
  • an exemplary implementation manner of determining the target loss according to the generation loss, the prediction loss and the distribution loss is as follows, and this step may include:
  • a weighted sum of the generation loss, the prediction loss, the first distribution loss, and the second distribution loss is determined as the target loss.
  • the first distribution loss can be the negative value of the sum of the determined first distribution distances between the training image and the generated image under each category, so that the first distribution loss can be used to represent Differences between generated images and training images under the multiple polyp labeling categories.
  • the present disclosure also provides a method of polyp identification, the method comprising:
  • An image of a polyp to be identified is received, and the image of the polyp may be an image including a polyp obtained during detection.
  • the training sample set corresponding to the polyp recognition model includes an original sample, and according to the original sample and the first generated image in the image generation model
  • the generated sample generated by the machine, the image generated model is obtained by training based on any of the above polyp image generated model training methods, the original sample includes the original image and the corresponding polyp labeling category of the original image,
  • the generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
  • the image generation model trained according to any of the above-mentioned polyp image generation model training methods can perform image Generated, so that more accurate generated samples can be obtained based on the original samples, which can effectively expand the training sample set used for polyp recognition model training, thereby improving the accuracy and efficiency of the polyp recognition model obtained by draft training, and can effectively Improve the generalization and robustness of the polyp recognition model, effectively reduce the missed detection rate of polyp recognition, and improve the accuracy of polyp recognition to a certain extent.
  • the polyp recognition model is trained in the following manner:
  • Preprocessing the target training image in the training sample set to obtain a processed image wherein the preprocessing includes nonlinear transformation and/or local pixel shuffling, and the target training image includes the original image and the generated image.
  • intensity information can be used as pixel-level supervisory information.
  • a smooth and monotonous transformation function Bezier curve can be used for nonlinear changes.
  • a unique value can be matched for each pixel in the image to ensure a one-to-one mapping relationship in the nonlinear transformation.
  • the transformation can be performed as follows:
  • B(t) is used to represent the conversion value of the conversion function
  • p 0 and p 3 are two predefined nodes
  • p 1 and p 2 are two predefined control points
  • t is the fraction of the extension line length
  • the value can be set according to the actual application scenario, which is not limited in the present disclosure.
  • the nonlinear transformation processing of the target training image can be realized through the above method.
  • a window may be randomly selected from the target training image, and then the sequence of pixels in the window may be disturbed, so that a processed image corresponding to the target training image may be obtained.
  • the size of the window can be set to be smaller than the size of the corresponding receptive field in the polyp identification model.
  • the target training image can be preprocessed by any of the above methods to obtain the processed image, and the two methods can also be combined for preprocessing.
  • the target training image can be nonlinearly converted first and then local pixel shuffling is performed to obtain the processed image.
  • the target training image can be subjected to local pixel shuffling and nonlinear transformation to obtain the processed image.
  • the polyp recognition model is pre-trained by using the processed image as a model input and using the target training image as a target output to obtain a pre-trained polyp recognition model.
  • the processed image can be used as input, so that the image recovered by the polyp recognition model can be used for loss calculation with the target training image, and the polyp recognition model can be pre-trained based on the calculated loss.
  • the pre-training process is ended to obtain a pre-trained polyp recognition model.
  • the target training image is used as a model input, and the polyp labeling category corresponding to the target training image is used as a target output to train the pre-trained polyp recognition model to obtain a trained polyp recognition model.
  • the target training image can be used as input, so that the predicted category output by the polyp recognition model and the polyp label category corresponding to the target training image can be used for loss calculation, and the polyp recognition model can be trained based on the calculated loss.
  • the loss is less than the threshold or the number of iterations meets a certain number of times, the training process is ended to obtain a trained polyp recognition model.
  • the training image can be preprocessed first, and the preprocessed image can be restored by the polyp recognition model as the training task, Pre-training the polyp recognition model can improve the feature learning ability in the polyp recognition model and improve the adaptability to subsequent model training tasks. Afterwards, the pre-trained polyp recognition model is trained based on the training sample set to obtain the polyp recognition model, so that the application scenarios of the polyp recognition model can be effectively broadened, and the accuracy and applicability of the polyp recognition model can be improved at the same time.
  • the present disclosure also provides a training device for a polyp image generation model, as shown in FIG. 3 , the device 40 includes:
  • An acquisition module 41 configured to acquire a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
  • the generation module 42 is configured to obtain a generated image and a restored image corresponding to the training image according to the training image and the image generation model, wherein the image generation model includes a first generator and a second generator, and the first A generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image;
  • the first determining module 43 is configured to determine a first distribution distance corresponding to the training image and the generated image according to the training image and the generated image, wherein the first distribution distance is used to represent the training the difference between the distribution of images and the distribution of said generated images;
  • the second determination module 44 is configured to determine the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image , wherein the target loss includes a first distribution loss determined according to the first distribution distance, and the first distribution loss is negatively correlated with the first distribution distance;
  • the update module 45 is configured to update the parameters of the image generation model according to the target loss when an update condition is met.
  • the second determination module includes:
  • a first determination submodule configured to determine the generation loss of the image generation model according to the training image and the restored image corresponding to the training image
  • the second determining submodule is used to determine the prediction loss of the image generation model based on the polyp labeling category corresponding to the training image and the polyp prediction category corresponding to the generated image generated based on the training image;
  • a third determining submodule configured to determine a negative value of the first distribution distance as the first distribution loss
  • a fourth determination submodule configured to determine the target loss according to the generation loss, the prediction loss and the first distribution loss.
  • the training sample set includes training samples corresponding to multiple labeled categories of polyps
  • the second determination module also includes:
  • the fifth determining sub-module is used to determine the second distribution distance corresponding to the generated images under the two polyp labeling categories for the generated images under any two polyp labeling categories according to the generated images under various polyp labeling categories, wherein , the second distribution distance is used to represent the difference between the distributions of generated images belonging to different polyp annotation categories;
  • the fourth determining submodule includes:
  • a sixth determining submodule configured to determine a second distribution difference of the image generation model according to the second distribution distance
  • a seventh determination submodule configured to determine a weighted sum of the generation loss, the prediction loss, the first distribution loss, and the second distribution loss as the target loss.
  • the first determination module includes:
  • the eighth determining submodule is used to determine the transmission distance between the training images, the transmission distance between the generated images, and the training images and the generated images for the training images and generated images under the same polyp labeling category.
  • a ninth determining submodule configured to determine the first distribution according to the transmission distance between the training image and the generated image, the transmission distance between the training images, and the transmission distance between the generated images distance.
  • the transmission distance is determined by the following formula:
  • W c (X 1 , X 2 ) is used to represent the transmission distance between image X 1 and image X 2 ;
  • ⁇ (X 1 ) is used to represent the feature image extracted from the image X 1 ;
  • ⁇ (X 2 ) is used to represent the feature image extracted from the image X 2 ;
  • P 1 is used to represent the distribution corresponding to the image X 1
  • P 2 is used to represent the distribution corresponding to the image X 2 ;
  • ⁇ (P 1 , P 2 ) is used to represent all joint distributions formed by distribution P 1 and distribution P 2 ;
  • c(X 1 , X 2 ) is used to represent the transmission cost between the image X 1 and the image X 2 .
  • the present disclosure also provides a polyp identification device, the device comprising:
  • a receiving module configured to receive an image of a polyp to be identified
  • An identification module configured to input the polyp image into a polyp identification model to obtain an identification result of the polyp image, wherein the training sample set corresponding to the polyp identification model includes original samples, and a model is generated according to the original samples and images
  • the generation sample generated by the first generator in the above, the image generation model is obtained by training based on any of the above polyp image generation model training methods, and the original sample includes the original image corresponding to the original image polyp labeling category, the generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
  • the polyp recognition model is trained in the following manner:
  • Preprocessing the target training image in the training sample set to obtain a processed image wherein the preprocessing includes nonlinear transformation and/or local pixel shuffling, and the target training image includes the original image and the generated image;
  • Pre-training the polyp recognition model by using the processed image as a model input and using the target training image as a target output to obtain a pre-trained polyp recognition model;
  • the target training image is used as a model input, and the polyp label category corresponding to the target training image is used as a target output to train the pre-trained polyp recognition model to obtain a trained polyp recognition model.
  • FIG. 4 it shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure.
  • the terminal equipment in the embodiments of the present disclosure may include but not limited to mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle-mounted terminals (such as mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers and the like.
  • the electronic device shown in FIG. 4 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
  • an electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may be randomly accessed according to a program stored in a read-only memory (ROM) 602 or loaded from a storage device 608. Various appropriate actions and processes are executed by programs in the memory (RAM) 603 . In the RAM 603, various programs and data necessary for the operation of the electronic device 600 are also stored.
  • the processing device 601, ROM 602, and RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604 .
  • the following devices can be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 607 such as a computer; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609.
  • the communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 4 shows electronic device 600 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602.
  • the processing device 601 When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
  • HTTP HyperText Transfer Protocol
  • the communication eg, communication network
  • Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: acquires a training sample set, wherein each training sample in the training sample set contains A training image and a polyp labeling category corresponding to the training image; according to the training image and the image generation model, a generated image and a restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator Two generators, the first generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image; according to the training image and the generated image , determine the first distribution distance corresponding to the training image and the generated image, wherein the first distribution distance is used to represent the difference between the distribution of the training image and the distribution of the generated image; according to the The first distribution distance, the training image, the generated image, the restored image, and the polyp label category corresponding to the training image determine the target loss of the image
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: receives the polyp image to be identified; inputs the polyp image into the polyp identification model , to obtain the recognition result of the polyp image, wherein the training sample set corresponding to the polyp recognition model includes the original sample and the generated sample generated according to the original sample and the first generator in the image generation model, the image The generation model is obtained by training based on the training method of the polyp image generation model described in the first aspect, the original sample includes the original image and the polyp label category corresponding to the original image, and the generation sample includes the polyp generated based on the original image Generate an image and annotate the polyp category corresponding to the original image.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as "C" or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, using an Internet service provider to connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to connected via the Internet.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the module does not constitute a limitation of the module itself under certain circumstances, for example, the obtaining module may also be described as "a module for obtaining the training sample set".
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs System on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • Example 1 provides a method for training a polyp image generation model, the method comprising:
  • each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
  • the training image and the image generation model a generated image and a restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator, and the first generator is used to The training image is used to generate the generated image, and the second generator is used to generate the restored image according to the generated image;
  • the training image and the generated image determine a first distribution distance corresponding to the training image and the generated image, wherein the first distribution distance is used to represent the distribution of the training image and the generated image The difference between the distributions of ;
  • the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image determine the target loss of the image generation model, wherein the target loss includes The first distribution loss determined according to the first distribution distance, the first distribution loss and the first distribution distance are negatively correlated;
  • the parameters of the image generation model are updated according to the target loss.
  • Example 2 provides the method of Example 1, wherein, according to the first distribution distance, the training image, the generated image, the restored image, and the training
  • the polyp annotation category corresponding to the image determines the target loss of the image generation model, including:
  • the target loss is determined based on the generation loss, the prediction loss, and the first distribution loss.
  • Example 3 provides the method of Example 2, wherein the training sample set contains training samples corresponding to multiple polyp labeling categories;
  • the determining the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image further includes:
  • the generated images under various polyp labeling categories determine the second distribution distance corresponding to the generated images under the two polyp labeling categories, wherein the second distribution distance is used to represent the difference between distributions of generated images belonging to different polyp annotation categories;
  • the determining the target loss according to the generation loss, the prediction loss and the distribution loss includes:
  • a weighted sum of the generation loss, the prediction loss, the first distribution loss, and the second distribution loss is determined as the target loss.
  • Example 4 provides the method of Example 1, wherein, according to the training image and the generated image, determining the first distribution corresponding to the training image and the generated image distance, including:
  • For training images and generated images under the same polyp labeling category determine the transmission distance between the training images, the transmission distance between the generated images, and the transmission distance between the training images and the generated images;
  • the first distribution distance is determined according to the transmission distance between the training image and the generated image, the transmission distance between the training images, and the transmission distance between the generated images.
  • Example 5 provides the method of Example 4, wherein the transmission distance is determined by the following formula:
  • W c (X 1 , X 2 ) is used to represent the transmission distance between image X 1 and image X 2 ;
  • ⁇ (X 1 ) is used to represent the feature image extracted from the image X 1 ;
  • ⁇ (X 2 ) is used to represent the feature image extracted from the image X 2 ;
  • P 1 is used to represent the distribution corresponding to the image X 1
  • P 2 is used to represent the distribution corresponding to the image X 2 ;
  • ⁇ (P 1 , P 2 ) is used to represent all joint distributions formed by distribution P 1 and distribution P 2 ;
  • c(X 1 , X 2 ) is used to represent the transmission cost between the image X 1 and the image X 2 .
  • Example 6 provides a polyp identification method, wherein the method includes:
  • the training sample set corresponding to the polyp recognition model includes an original sample, and according to the original sample and the first generated image in the image generation model
  • the generation sample generated by the machine, the image generation model is obtained by training based on the training method of the polyp image generation model described in any one of examples 1-5, and the original sample includes the original image and the corresponding image of the original image.
  • the polyp labeling category, the generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
  • Example 7 provides the method of Example 6, wherein the polyp recognition model is trained in the following manner:
  • Preprocessing the target training image in the training sample set to obtain a processed image wherein the preprocessing includes nonlinear transformation and/or local pixel shuffling, and the target training image includes the original image and the generated image;
  • Pre-training the polyp recognition model by using the processed image as a model input and using the target training image as a target output to obtain a pre-trained polyp recognition model;
  • the target training image is used as a model input, and the polyp label category corresponding to the target training image is used as a target output to train the pre-trained polyp recognition model to obtain a trained polyp recognition model.
  • Example 8 provides a training device for a polyp image generation model, the device comprising:
  • An acquisition module configured to acquire a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
  • a generation module configured to obtain a generated image and a restored image corresponding to the training image according to the training image and the image generation model, wherein the image generation model includes a first generator and a second generator, and the first The generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image;
  • a first determining module configured to determine a first distribution distance corresponding to the training image and the generated image according to the training image and the generated image, wherein the first distribution distance is used to represent the training image The difference between the distribution of and the distribution of the generated images;
  • the second determination module is configured to determine the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, wherein, the target loss includes a first distribution loss determined according to the first distribution distance, and the first distribution loss is negatively correlated with the first distribution distance;
  • An update module configured to update the parameters of the image generation model according to the target loss when an update condition is satisfied.
  • Example 9 provides a polyp identification device, the device comprising:
  • a receiving module configured to receive an image of a polyp to be identified
  • An identification module configured to input the polyp image into a polyp identification model to obtain an identification result of the polyp image, wherein the training sample set corresponding to the polyp identification model includes original samples, and a model is generated according to the original samples and images
  • the generation sample generated by the first generator in the above, the image generation model is obtained by training based on the training method of the polyp image generation model described in any one of examples 1-5, and the original sample includes the original image and the The polyp labeling category corresponding to the original image, the generated sample includes a generated image generated based on the original image and the polyp labeling category corresponding to the original image.
  • Example 10 provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of any one of the methods described in Examples 1-7 are implemented .
  • Example 11 provides an electronic device, including:
  • a processing device configured to execute the computer program in the storage device to implement the steps of any one of the methods in Examples 1-7.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

A training method for a generative model, a polyp identification method and apparatus, a medium, and a device, the method comprising: acquiring a training sample set, each training sample in the training sample set comprising a training image and a polyp labeling category corresponding to the training image; according to the training image and an image generation model, obtaining a generated image and a restored image corresponding to the training image; according to the training image and the generated image, determining a first distribution distance corresponding to the training image and the generated image; determining target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image and a polyp labeling category corresponding to the training image, wherein the target loss comprises first distribution loss determined according to the first distribution distance, and the first distribution loss and the first distribution distance have a negative correlation relationship; and insofar as an updating condition is met, updating parameters of the image generation model according to the target loss.

Description

生成模型的训练方法、息肉识别方法、装置、介质及设备Training method for generative model, polyp identification method, device, medium and equipment
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202111028344.X、申请日为2021年09月02日,名称为“生成模型的训练方法、息肉识别方法、装置、介质及设备”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with the application number 202111028344.X and the filing date of September 02, 2021, entitled "Generative model training method, polyp identification method, device, medium and equipment", and requires the Chinese patent The priority of the application, the entire content of the Chinese patent application is hereby incorporated into this application as a reference.
技术领域technical field
本公开涉及图像处理领域,具体地,涉及一种生成模型的训练方法、息肉识别方法、装置、介质及设备。The present disclosure relates to the field of image processing, and in particular, relates to a training method for generating a model, a method for identifying polyps, a device, a medium, and equipment.
背景技术Background technique
内窥镜广泛用于结肠筛查和息肉检测,但是内窥镜的检测精准度很大程度上取决于内镜医师的经验。而由于息肉的特征较难识别,且许多息肉的体积较小,而导致息肉检测的漏检率较大,这大大增加了息肉早期筛查的难度。Endoscopes are widely used for colon screening and polyp detection, but the detection accuracy of endoscopes largely depends on the experience of endoscopists. However, because the characteristics of polyps are difficult to identify, and many polyps are small in size, the missed detection rate of polyp detection is relatively high, which greatly increases the difficulty of early polyp screening.
相关技术中,可以通过深度学习的方法进行模型训练,以用于息肉识别和分割的计算机辅助诊断系统。而通过上述方式当样本外数据具有较大的域转移时,这些经过训练的网络中都可能会出现较大的性能差距,难以通过有限的样本数据保证模型的泛化性,使得训练出的模型对样本外数据的检测准确度不足,从而无法实现准确的息肉检测效果。In related technologies, the deep learning method can be used for model training to be used in a computer-aided diagnosis system for polyp identification and segmentation. However, when the out-of-sample data has a large domain shift through the above method, there may be a large performance gap in these trained networks, and it is difficult to ensure the generalization of the model through limited sample data, making the trained model The detection accuracy of out-of-sample data is insufficient to achieve accurate polyp detection.
发明内容Contents of the invention
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。This Summary is provided to introduce a simplified form of concepts that are described in detail later in the Detailed Description. This summary of the invention is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to be used to limit the scope of the claimed technical solution.
第一方面,本公开提供一种息肉图像生成模型的训练方法,所述方法包括:In a first aspect, the present disclosure provides a method for training a polyp image generation model, the method comprising:
获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别;Obtaining a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
根据所述训练图像和图像生成模型,获得所述训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像;According to the training image and the image generation model, a generated image and a restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator, and the first generator is used to The training image is used to generate the generated image, and the second generator is used to generate the restored image according to the generated image;
根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,其中,所述第一分布距离用于表示所述训练图像的分布和所述生成图像的分布之间的差异;According to the training image and the generated image, determine a first distribution distance corresponding to the training image and the generated image, wherein the first distribution distance is used to represent the distribution of the training image and the generated image The difference between the distributions of ;
根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系;According to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, determine the target loss of the image generation model, wherein the target loss includes The first distribution loss determined according to the first distribution distance, the first distribution loss and the first distribution distance are negatively correlated;
在满足更新条件的情况下,根据所述目标损失对所述图像生成模型的参数进行更新。If the updating condition is met, the parameters of the image generation model are updated according to the target loss.
第二方面,本公开提供一种息肉识别方法,所述方法包括:In a second aspect, the present disclosure provides a polyp identification method, the method comprising:
接收待识别的息肉图像;receiving the polyp image to be identified;
将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于第一方面所述的息肉图像生成模型的训练方法进行训练所得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。Inputting the polyp image into a polyp recognition model to obtain a recognition result of the polyp image, wherein the training sample set corresponding to the polyp recognition model includes an original sample, and according to the original sample and the first generated image in the image generation model The generation sample generated by the machine, the image generation model is obtained by training based on the polyp image generation model training method described in the first aspect, the original sample includes the original image and the polyp label category corresponding to the original image, so The generated samples include a generated image generated based on an original image and a polyp labeling category corresponding to the original image.
第三方面,本公开提供一种息肉图像生成模型的训练装置,所述装置包括:In a third aspect, the present disclosure provides a training device for a polyp image generation model, the device comprising:
获取模块,用于获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别;An acquisition module, configured to acquire a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
生成模块,用于根据所述训练图像和图像生成模型,获得所述训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像;A generation module, configured to obtain a generated image and a restored image corresponding to the training image according to the training image and the image generation model, wherein the image generation model includes a first generator and a second generator, and the first The generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image;
第一确定模块,用于根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,其中,所述第一分布距离用于表示所述训练图像的分布和所述生成图像的分布之间的差异;A first determining module, configured to determine a first distribution distance corresponding to the training image and the generated image according to the training image and the generated image, wherein the first distribution distance is used to represent the training image The difference between the distribution of and the distribution of the generated images;
第二确定模块,用于根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系;The second determination module is configured to determine the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, Wherein, the target loss includes a first distribution loss determined according to the first distribution distance, and the first distribution loss is negatively correlated with the first distribution distance;
更新模块,用于在满足更新条件的情况下,根据所述目标损失对所述图像生成模型的参数进行更新。An update module, configured to update the parameters of the image generation model according to the target loss when an update condition is met.
第四方面,提供一种息肉识别装置,所述装置包括:In a fourth aspect, a polyp identification device is provided, the device comprising:
接收模块,用于接收待识别的息肉图像;A receiving module, configured to receive an image of a polyp to be identified;
识别模块,用于将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于第一方面所述的息肉图像生成模型的训练方法进行训练所得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。An identification module, configured to input the polyp image into a polyp identification model to obtain an identification result of the polyp image, wherein the training sample set corresponding to the polyp identification model includes original samples, and a model is generated according to the original samples and images The generation sample generated by the first generator in the first aspect, the image generation model is obtained by training based on the training method of the polyp image generation model described in the first aspect, and the original sample includes the original image and the corresponding The polyp labeling category, the generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
第五方面,提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现第一或第二方面所述方法的步骤。In a fifth aspect, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first or second aspect are implemented.
第六方面,提供一种电子设备,包括:In a sixth aspect, an electronic device is provided, including:
存储装置,其上存储有计算机程序;a storage device on which a computer program is stored;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现第一或第二方面所述方法的步骤。A processing device configured to execute the computer program in the storage device to implement the steps of the method in the first or second aspect.
通过上述技术方案,可以基于训练图像和图像生成模型进行新图像的生成,获得生成图像和还原图像,在确定图像生成模型的目标损失时,通过还原图像以及息肉标注类别的约束,可以基于对抗生成网络的风格迁移方法对训练图像进行模仿生成,保证基于该图像生成模型生成的生成图像与原始图像之间的语义一致性,使得图像生成模型生成的生成图像与训练图像之间属于同一息肉分类,进而无需对生成图像进行数据标注,可以自动生成用于进行息肉识别模型训练的有效标注样本。并且在确定目标损失时还根据训练图像和生成图像,确定该两者之间的第一分布距离,则可以以在结合训练样本、 生成图像和还原图像的基础上,进一步结合该第一分布距离以确定图像生成模型的目标损失。由此,通过第一分布损失可以使得基于图像生成模型获得的生成图像中不得到额外的息肉类别的基础上,得出更多的具备多样性的数据,从而可以保证基于该生成图像以及训练图像进行训练的模型,如息肉识别模型等的泛化性。通过该图像生成模型对息肉图像进行生成,从而可以基于有限的样本数据获得更多用于训练息肉识别模型的训练数据,可以减少进行息肉识别模型训练耗费的人力和时间,也能够进一步提高息肉识别模型的检测准确性和鲁棒性,保证息肉检测的准确性,有效降低息肉检测的漏检率。Through the above technical solution, a new image can be generated based on the training image and the image generation model, and the generated image and the restored image can be obtained. When determining the target loss of the image generation model, through the constraints of the restored image and the polyp labeling category, it can be generated based on confrontation The style transfer method of the network imitates and generates the training images to ensure the semantic consistency between the generated images generated based on the image generation model and the original images, so that the generated images generated by the image generation model and the training images belong to the same polyp classification, Furthermore, there is no need to perform data labeling on the generated images, and effectively labeled samples for polyp recognition model training can be automatically generated. And when determining the target loss, the first distribution distance between the training image and the generated image is also determined, then the first distribution distance can be further combined on the basis of combining the training sample, the generated image and the restored image to determine the target loss for image generation models. Therefore, through the first distribution loss, more data with diversity can be obtained on the basis of not obtaining additional polyp categories in the generated image obtained based on the image generation model, so that it can be guaranteed that based on the generated image and the training image The generalization of the model being trained, such as the polyp recognition model. The polyp image is generated by the image generation model, so that more training data for training the polyp recognition model can be obtained based on limited sample data, which can reduce the manpower and time spent on polyp recognition model training, and can further improve polyp recognition The detection accuracy and robustness of the model ensure the accuracy of polyp detection and effectively reduce the missed detection rate of polyp detection.
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。Other features and advantages of the present disclosure will be described in detail in the detailed description that follows.
附图说明Description of drawings
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中:The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale. In the attached picture:
图1是根据本公开的一种实施方式提供的一种息肉图像生成模型的训练方法的流程图;FIG. 1 is a flowchart of a training method for a polyp image generation model provided according to an embodiment of the present disclosure;
图2是根据本公开的一种实施方式提供的图像生成模型的示意图;Fig. 2 is a schematic diagram of an image generation model provided according to an embodiment of the present disclosure;
图3是根据本公开的一种实施方式提供的一种息肉图像生成模型的训练装置的框图;Fig. 3 is a block diagram of a training device for a polyp image generation model provided according to an embodiment of the present disclosure;
图4示出了适于用来实现本公开实施例的电子设备的结构示意图。FIG. 4 shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the drawings, it should be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein; A more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for exemplary purposes only, and are not intended to limit the protection scope of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺 序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method implementations of the present disclosure may be executed in different orders, and/or executed in parallel. Additionally, method embodiments may include additional steps and/or omit performing illustrated steps. The scope of the present disclosure is not limited in this respect.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。As used herein, the term "comprise" and its variations are open-ended, ie "including but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one further embodiment"; the term "some embodiments" means "at least some embodiments." Relevant definitions of other terms will be given in the description below.
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that concepts such as "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the sequence of functions performed by these devices, modules or units or interdependence.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more" multiple".
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of messages or information exchanged between multiple devices in the embodiments of the present disclosure are used for illustrative purposes only, and are not used to limit the scope of these messages or information.
正如背景技术中所示,相关技术中已经提出将基于卷积神经网络的深度学习模型应用在息肉的自动检测识别中。但是,此种方式中在模型使用中往往会遇到泛化能力低导致的性能下降的问题,难以保证对息肉检测的精准度。基于此,本公开提供以下实施例,通过训练图像生成模型,以基于已有的训练数据生成更加多样化的训练数据,从而提高基于该训练数据进行训练所得息肉识别模型的泛化性和检测准确度。As shown in the background art, it has been proposed in the related art to apply a convolutional neural network-based deep learning model to the automatic detection and identification of polyps. However, in the use of the model in this way, the problem of performance degradation caused by low generalization ability is often encountered, and it is difficult to guarantee the accuracy of polyp detection. Based on this, the present disclosure provides the following embodiments, by training the image generation model to generate more diverse training data based on the existing training data, thereby improving the generalization and detection accuracy of the polyp recognition model trained based on the training data Spend.
图1所示,为根据本公开的一种实施方式提供的一种息肉图像生成模型的训练方法的流程图,如图1所示,所述方法包括:As shown in FIG. 1, it is a flowchart of a training method for a polyp image generation model provided according to an embodiment of the present disclosure. As shown in FIG. 1, the method includes:
在步骤11中,获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别。In step 11, a training sample set is acquired, wherein each training sample in the training sample set includes a training image and a labeled category of polyps corresponding to the training image.
示例地,可以采集真实情况下多个病人包括息肉的内窥镜图像(比如胃 镜图像、结肠镜图像等)作为训练图像。作为示例,可以对病人进行数据采集,以获得包含息肉的检测数据,之后为了保证训练图像的统一处理,可以对该检测数据进行标准化处理,例如将获得到的检测数据含有息肉的白光内镜图像作为该训练图像。进一步地,可以对该训练图像的分辨率和尺寸进行标准化处理以获得统一尺寸的训练图像,便于后续的训练过程。针对每一训练图像,可以由经验丰富的胃肠内镜医师标记对应息肉标签,即该息肉标注类别。Illustratively, endoscopic images (such as gastroscopic images, colonoscopic images, etc.) of multiple patients including polyps can be collected as training images under real conditions. As an example, data collection can be performed on patients to obtain detection data containing polyps, and then in order to ensure uniform processing of training images, the detection data can be standardized, for example, the obtained detection data contains white light endoscopic images of polyps as the training image. Further, the resolution and size of the training image can be standardized to obtain a training image of uniform size, which facilitates the subsequent training process. For each training image, an experienced gastrointestinal endoscopist may mark the corresponding polyp label, that is, the polyp label category.
在步骤12中,根据训练图像和图像生成模型,获得训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像。In step 12, according to the training image and the image generation model, the generated image and restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator, and the first generator is used to The training image generates the generated image, and the second generator is configured to generate the restoration image according to the generated image.
其中,该图像生成模型可以基于CycleGAN网络实现,在CycleGAN网络中包含两个生成器,如图2所示,该图像生成模型可以包含第一生成器21和第二生成器22,如图2所示,可以训练图像输入第一生成器21,以由该第一生成器21根据该训练图像X k以及训练图像对应的息肉标注类别k生成对应的生成图像X k'以及该生成图像对应的息肉类别k',其中,在生成图像过程中,可以基于对抗生成网络的风格迁移方法,以训练样本集中的息肉标注类别作为条件,基于原始图像生成新的生成图像,如: Wherein, the image generation model can be realized based on the CycleGAN network, including two generators in the CycleGAN network, as shown in Figure 2, the image generation model can include a first generator 21 and a second generator 22, as shown in Figure 2 As shown, the training image can be input to the first generator 21, so that the first generator 21 can generate the corresponding generated image X k ' and the corresponding polyp of the generated image according to the training image X k and the polyp labeling category k corresponding to the training image. Category k', wherein, in the process of image generation, based on the style transfer method of the confrontation generation network, the polyp label category in the training sample set is used as a condition to generate a new generated image based on the original image, such as:
X k'=G(X k,k') X k' = G(X k ,k')
其中,X k'用于表示所述生成图像,k'用于表示所述生成图像对应的息肉类别,可以直接将训练图像X k对应的息肉标注类别k作为该生成图像对应的息肉类别,G(,)用于表示所述第一生成器的图像生成操作。如图2所示,图像生成模型中包含两个生成器,构成了一个环形网络,即进一步地可以通过第二生成器基于生成图像X k'和生成图像对应的息肉类别生成训练图像 X k对应的还原图像X′ k'Wherein, X k' is used to represent the generated image, k' is used to represent the polyp category corresponding to the generated image, and the polyp label category k corresponding to the training image X k can be directly used as the polyp category corresponding to the generated image, G (,) is used to represent the image generation operation of the first generator. As shown in Figure 2, the image generation model contains two generators, which constitute a ring network, that is , the second generator can further generate a training image X k corresponding to the generated image X k' and the polyp category corresponding to the generated image The restored image X′ k' :
X′ k'=F(G(X k,k'),k); X'k' = F(G(X k ,k'),k);
其中,F(,)用于表示所述第二生成器的图像生成操作。由此,通过上述步骤可以基于该图像生成模型在不增加额外息肉类别的情况下,生成更多样性的训练图像。Wherein, F(,) is used to represent the image generation operation of the second generator. Therefore, through the above steps, more diverse training images can be generated based on the image generation model without adding additional types of polyps.
在步骤13中,根据训练图像和生成图像,确定训练图像和生成图像对应的第一分布距离,其中,所述第一分布距离用于表示所述训练图像的分布和所述生成图像的分布之间的差异。In step 13, according to the training image and the generated image, the first distribution distance corresponding to the training image and the generated image is determined, wherein the first distribution distance is used to represent the difference between the distribution of the training image and the distribution of the generated image difference between.
其中,在本公开实施例中基于训练图像进行新图像生成的目的是生成与该训练图像对应的更加多样化的数据,因此,在该步骤中可以基于训练图像的分布和生成图像的分布确定两者之间的分布距离。需要进行说明的时,该生成图像本身是基于训练图像以及训练图像的息肉标注类别作为约束条件进行生成的,因此,该生成图像与该训练图像对应的息肉类别为同一类别,在该实施例中,可以通过增加训练图像和生成图像之间的分布距离以使得新生成的图像与训练图像的分布不同,以保证新的生成图像的多样性。Among them, in the embodiment of the present disclosure, the purpose of generating a new image based on the training image is to generate more diverse data corresponding to the training image. Therefore, in this step, two parameters can be determined based on the distribution of the training image and the distribution of the generated image. distribution distance between them. When it needs to be explained, the generated image itself is generated based on the training image and the polyp label category of the training image as a constraint condition. Therefore, the generated image and the polyp category corresponding to the training image are the same category. In this embodiment , the distribution distance between the training image and the generated image can be increased to make the distribution of the newly generated image different from the training image, so as to ensure the diversity of the new generated image.
在步骤14中,根据第一分布距离、训练图像、生成图像、还原图像以及训练图像对应的息肉标注类别,确定图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系,则该第一分布距离越大,该第一分布损失越小。In step 14, the target loss of the image generation model is determined according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, wherein the target loss includes The determined first distribution loss has a negative correlation with the first distribution distance, and the larger the first distribution distance is, the smaller the first distribution loss is.
在步骤15中,在满足更新条件的情况下,根据目标损失对图像生成模型的参数进行更新。In step 15, if the update condition is satisfied, the parameters of the image generation model are updated according to the target loss.
作为示例,该更新条件可以为目标损失大于预设的损失阈值,此时表示图像生成模型的准确性不足。作为另一示例,该更新条件可以是迭代次数小 于预设的次数阈值,此时认为图像生成模型迭代次数较少,其准确性不足。As an example, the update condition may be that the target loss is greater than a preset loss threshold, which means that the accuracy of the image generation model is insufficient. As another example, the update condition may be that the number of iterations is less than a preset number threshold, at this time, it is considered that the number of iterations of the image generation model is small, and its accuracy is insufficient.
相应地,在满足更新条件的情况下,可以根据该目标损失对图像生成模型的参数进行更新。其中,基于确定出的目标损失对参数进行更新的方式可以采用本领域中常用的更新方式,以使得该目标损失可以逐渐收敛,在此不再赘述。Correspondingly, when the update condition is met, the parameters of the image generation model can be updated according to the target loss. Wherein, the manner of updating the parameters based on the determined target loss may adopt an updating manner commonly used in the art, so that the target loss can gradually converge, and will not be repeated here.
在不满足该更新条件的情况下,则可以认为该图像生成模型的准确度达到训练要求,此时可以停止训练过程,获得训练完成的图像生成模型。If the update condition is not met, it can be considered that the accuracy of the image generation model meets the training requirements, and at this time the training process can be stopped to obtain a trained image generation model.
由此,通过上述技术方案,可以基于训练图像和图像生成模型进行新图像的生成,获得生成图像和还原图像,在确定图像生成模型的目标损失时,通过还原图像以及息肉标注类别的约束,可以基于对抗生成网络的风格迁移方法对训练图像进行模仿生成,保证基于该图像生成模型生成的生成图像与原始图像之间的语义一致性,使得图像生成模型生成的生成图像与训练图像之间属于同一息肉分类,进而无需对生成图像进行数据标注,可以自动生成用于进行息肉识别模型训练的有效标注样本。并且在确定目标损失时还根据训练图像和生成图像,确定该两者之间的第一分布距离,则可以以在结合训练样本、生成图像和还原图像的基础上,进一步结合该第一分布距离以确定图像生成模型的目标损失。由此,通过第一分布损失可以使得基于图像生成模型获得的生成图像中不得到额外的息肉类别的基础上,得出更多的具备多样性的数据,从而可以保证基于该生成图像以及训练图像进行训练的模型,如息肉识别模型等的泛化性。通过该图像生成模型对息肉图像进行生成,从而可以基于有限的样本数据获得更多用于训练息肉识别模型的训练数据,可以减少进行息肉识别模型训练耗费的人力和时间,也能够进一步提高息肉识别模型的检测准确性和鲁棒性,保证息肉检测的准确性,有效降低息肉检测的漏检率。Thus, through the above technical solution, a new image can be generated based on the training image and the image generation model, and the generated image and the restored image can be obtained. When determining the target loss of the image generation model, through the constraints of the restored image and the polyp labeling category, it can be The style transfer method based on the confrontation generation network imitates and generates the training image to ensure the semantic consistency between the generated image generated based on the image generation model and the original image, so that the generated image generated by the image generation model and the training image belong to the same Polyp classification, so that there is no need to label the generated images, and effective labeled samples for polyp recognition model training can be automatically generated. And when determining the target loss, according to the training image and the generated image, determine the first distribution distance between the two, then you can further combine the first distribution distance on the basis of combining the training sample, the generated image and the restored image to determine the target loss for image generation models. Therefore, through the first distribution loss, more data with diversity can be obtained on the basis of not obtaining additional polyp categories in the generated image obtained based on the image generation model, so that it can be guaranteed that based on the generated image and the training image The generalization of the model being trained, such as the polyp recognition model. The polyp image is generated by the image generation model, so that more training data for training the polyp recognition model can be obtained based on limited sample data, which can reduce the manpower and time spent on polyp recognition model training, and can further improve polyp recognition The detection accuracy and robustness of the model ensure the accuracy of polyp detection and effectively reduce the missed detection rate of polyp detection.
为了使得本领域技术人员更加理解本公开提供的息肉检测模型的训练方 法,下面对上述各步骤进行详细举例说明。In order to make those skilled in the art better understand the training method of the polyp detection model provided by the present disclosure, the above-mentioned steps are described in detail below.
在一种可能的实施例中,在步骤13中,根据训练图像和生成图像,确定训练图像和生成图像对应的第一分布距离的示例性实现方式如下,该步骤可以包括:In a possible embodiment, in step 13, according to the training image and the generated image, an exemplary implementation manner of determining the first distribution distance corresponding to the training image and the generated image is as follows, and this step may include:
针对同一息肉标注类别下的训练图像和生成图像,确定所述训练图像之间的传输距离、所述生成图像之间的传输距离、以及所述训练图像和所述生成图像之间的传输距离。For the training images and generated images under the same polyp labeling category, the transmission distance between the training images, the transmission distance between the generated images, and the transmission distance between the training images and the generated images are determined.
其中,所述传输距离可以用于衡量两个分布之间的远近,具体地,所述传输距离通过如下公式确定:Wherein, the transmission distance can be used to measure the distance between two distributions, specifically, the transmission distance is determined by the following formula:
Figure PCTCN2022116426-appb-000001
Figure PCTCN2022116426-appb-000001
Figure PCTCN2022116426-appb-000002
Figure PCTCN2022116426-appb-000002
其中,W c(X 1,X 2)用于表示图像X 1和图像X 2之间的传输距离; Wherein, W c (X 1 , X 2 ) is used to represent the transmission distance between image X 1 and image X 2 ;
φ(X 1)用于表示从所述图像X 1中提取出的特征图像; φ(X 1 ) is used to represent the feature image extracted from the image X 1 ;
φ(X 2)用于表示从所述图像X 2中提取出的特征图像; φ(X 2 ) is used to represent the feature image extracted from the image X 2 ;
P 1用于表示所述图像X 1对应的分布;P 2用于表示所述图像X 2对应的分布; P 1 is used to represent the distribution corresponding to the image X 1 ; P 2 is used to represent the distribution corresponding to the image X 2 ;
∏(P 1,P 2)用于表示分布P 1和分布P 2形成的全部的联合分布; ∏(P 1 , P 2 ) is used to represent all joint distributions formed by distribution P 1 and distribution P 2 ;
c(X 1,X 2)用于表示所述图像X 1和图像X 2之间的传输成本。 c(X 1 , X 2 ) is used to represent the transmission cost between the image X 1 and the image X 2 .
相应的,在计算训练图像之间的传输距离时,图像X 1和图像X 2则为从训练图像中采样的两个训练图像,在计算生成图像之间的传输距离时,图像X 1和图像X 2则为从生成图像中采样的两个生成图像,在计算训练图像和生成图像之间的传输距离时,图像X 1和图像X 2则分别为从训练图像和生成图像中各自采集的一张图像,如图像X 1为训练图像,图像X 2为生成图像。 Correspondingly, when calculating the transmission distance between training images, image X 1 and image X 2 are two training images sampled from the training image, and when calculating the transmission distance between generated images, image X 1 and image X 2 is two generated images sampled from the generated image. When calculating the transmission distance between the training image and the generated image, the image X 1 and the image X 2 are respectively collected from the training image and the generated image. For example, image X 1 is a training image, and image X 2 is a generated image.
以下,以计算训练图像和所述生成图像之间的传输距离为例进行详细说明。Hereinafter, the calculation of the transmission distance between the training image and the generated image will be described in detail as an example.
其中,可以先确定训练图像的分布P 1和生成图像的分布P 2所形成的全部的联合分布。对于每一个可能的联合分布π,可以从中进行采样X 1,X 2~π得出一个样本图像X 1和一个样本图像X 2,并计算出这对样本图像之间的运输成本c(X 1,X 2)。其中,在本公开实施例中,可以基于CNN(Convolutional Neural Networks,卷积神经网络)对图像进行特征提取,即可以通过CNN对训练图像X 1进行特征提取,获得对应训练图像X 1对应的特征图像φ(X 1),通过CNN对生成图像X 2进行特征提取,获得对应生成图像X 2对应的特征图像φ(X 2)。之后可以通过上述公式基于该提取出的特征图像进行计算,获得对应的运输成本。其中,|||| 2用于表示进行第二范式计算,第二范式计算方式为现有技术,在此不再赘述。计算出该运输成本后,则可以计算该联合分布π下,样本图像对运输成本的期望值
Figure PCTCN2022116426-appb-000003
在所有可能的联合分布下能够对该期望值取到的下界
Figure PCTCN2022116426-appb-000004
即为该传输距离。
Among them, all the joint distributions formed by the distribution P1 of the training image and the distribution P2 of the generated image can be determined first. For each possible joint distribution π, one sample image X 1 and one sample image X 2 can be obtained by sampling X 1 , X 2 ~π, and the transportation cost c(X 1 ,X 2 ). Wherein, in the embodiment of the present disclosure, feature extraction can be performed on the image based on CNN (Convolutional Neural Networks, convolutional neural network), that is, the feature extraction can be performed on the training image X1 through CNN, and the corresponding feature corresponding to the training image X1 can be obtained For the image φ(X 1 ), feature extraction is performed on the generated image X 2 through CNN to obtain the feature image φ(X 2 ) corresponding to the generated image X 2 . Afterwards, the above formula can be used to calculate based on the extracted feature image to obtain the corresponding transportation cost. Wherein, |||| 2 is used to represent calculation in the second normal form, and the calculation method in the second normal form is the prior art, and will not be repeated here. After the transportation cost is calculated, the expected value of the sample image for the transportation cost under the joint distribution π can be calculated
Figure PCTCN2022116426-appb-000003
A lower bound on the expected value under all possible joint distributions
Figure PCTCN2022116426-appb-000004
That is the transmission distance.
相应地,针对训练图像之间的传输距离,以及生成图像之间的传输距离的计算方式与上文类似,在此不再赘述。Correspondingly, the calculation methods for the transmission distance between the training images and the transmission distance between the generated images are similar to the above, and will not be repeated here.
之后,则可以根据训练图像和生成图像之间的传输距离、训练图像之间的传输距离,以及生成图像之间的传输距离确定所述第一分布距离。Afterwards, the first distribution distance may be determined according to the transmission distance between the training image and the generated image, the transmission distance between the training images, and the transmission distance between the generated images.
示例地,可以通过如下公式进行计算:For example, it can be calculated by the following formula:
d(P 1,P 2)=2E[W c(X 1,X 2)]-E[W c(X 1,X′ 1)]-E[W c(X 2,X′ 2)] d(P 1 ,P 2 )=2E[W c (X 1 ,X 2 )]-E[W c (X 1 ,X′ 1 )]-E[W c (X 2 ,X′ 2 )]
其中,d(P 1,P 2)用于表示训练图像对应的分布P 1和生成图像对应的第二分布P 2之间的第一分布距离;示例地,X 1和X′ 1可以用于表示训练图像中的 两个样本图像;X 2和X' 2可以用于表示生成图像中的两个样本图像,由此可以进一步确定出该第一分布距离。 Among them, d(P 1 , P 2 ) is used to represent the first distribution distance between the distribution P 1 corresponding to the training image and the second distribution P 2 corresponding to the generated image; for example, X 1 and X′ 1 can be used for Represents two sample images in the training image; X 2 and X' 2 can be used to represent two sample images in the generated image, so that the first distribution distance can be further determined.
由此,通过上述技术方案,可以通过计算图像之间的传输成本,从而基于传输成本进一步确定训练图像和生成图像之间的传输距离,以对训练图像和生成图像的分布之间的差异进行表征,从而为后续进行模型参数调整时便于向增大该差异的方向进行调整,为保证训练图像和生成图像的分布之间的差异性提供数据支持,从而有效保证基于训练出的图像生成模型生成的生成图像的多样性。Therefore, through the above technical solution, the transmission cost between the images can be calculated to further determine the transmission distance between the training image and the generated image based on the transmission cost, so as to characterize the difference between the distribution of the training image and the generated image , so as to facilitate the adjustment in the direction of increasing the difference when adjusting the model parameters in the future, and provide data support to ensure the difference between the distribution of the training image and the generated image, thereby effectively ensuring that the image generated based on the trained image generation model Variety of generated images.
在一种可能的实施例中,在步骤14中,根据第一分布距离、训练图像、生成图像、还原图像以及训练图像对应的息肉标注类别,确定图像生成模型的目标损失的示例性实现方式如下,该步骤可以包括:In a possible embodiment, in step 14, according to the first distribution distance, the training image, the generated image, the restored image, and the polyp label category corresponding to the training image, an exemplary implementation of determining the target loss of the image generation model is as follows , this step can include:
根据所述训练图像和与所述训练图像对应的还原图像,确定所述图像生成模型的生成损失。A generation loss of the image generation model is determined according to the training image and the restored image corresponding to the training image.
由上文所述可知,本公开中生成图像是基于训练图像通过风格迁移生成的,其可以生成具有多样性的生成图像。在该实施例中,为了进一步保证图像的语义信息的准确性,根据训练图像和该训练图像对应的还原图像进行第一范式计算,获得该生成损失,其中,该训练图像对应的还原图像是基于该训练图像对应的生成图像进行生成的。示例地,该生成损失L cycle可以表示为: It can be seen from the above that the generated images in the present disclosure are generated based on the training images through style transfer, which can generate generated images with diversity. In this embodiment, in order to further ensure the accuracy of the semantic information of the image, the first normal form calculation is performed according to the training image and the restoration image corresponding to the training image to obtain the generation loss, wherein the restoration image corresponding to the training image is based on The generated image corresponding to the training image is generated. Exemplarily, the generation loss L cycle can be expressed as:
L cycle=||F(G(X k,k'),k)-X k|| 1 L cycle =||F(G(X k ,k'),k)-X k || 1
因此,在本公开实施例中可以通过计算训练图像和还原图像之间的差异,从而保证生成图像和训练图像之间的语义一致性。Therefore, in the embodiments of the present disclosure, the semantic consistency between the generated image and the training image can be ensured by calculating the difference between the training image and the restoration image.
基于所述训练图像对应的息肉标注类别、和基于该训练图像生成的生成图像所对应的息肉预测类别,确定所述图像生成模型的预测损失。Based on the polyp label category corresponding to the training image and the polyp prediction category corresponding to the generated image generated based on the training image, the prediction loss of the image generation model is determined.
示例地,可以将该生成图像输入与该第一生成器对应的判别器,从而可以获得基于该生成图像对应的息肉预测类别。在本公开中,在第一生成器进行新的图像生成时是以训练图像的息肉标注类别为约束进行生成的,因此第一生成器生成的生成图像应与训练图像属于同一息肉标注类别。由此,可以通过计算训练图像对应的息肉标注类别与生成图像对应的息肉预测类别之间的差异,以保证新生成的生成图像与原始图像属于同一类别的图像,从而可以通过风格迁移的方法扩充数据集的同时,增强数据集的多样性,并且可以自动标注生成图像的息肉类别,以进一步保证生成图像与训练图像的语义一致性。For example, the generated image may be input into a discriminator corresponding to the first generator, so that a polyp prediction category corresponding to the generated image may be obtained. In the present disclosure, when the first generator generates a new image, it is constrained by the polyp labeling category of the training image, so the generated image generated by the first generator should belong to the same polyp labeling category as the training image. Therefore, the difference between the polyp labeling category corresponding to the training image and the polyp prediction category corresponding to the generated image can be calculated to ensure that the newly generated generated image and the original image belong to the same category of images, which can be expanded through the method of style transfer. At the same time, the diversity of the data set is enhanced, and the polyp category of the generated image can be automatically marked to further ensure the semantic consistency between the generated image and the training image.
示例地,可以计算该息肉标注类别与该息肉预测类别之间的交叉熵作为该预测损失,交叉熵的计算方式为现有技术,在此不再赘述。For example, the prediction loss may be calculated as the cross entropy between the polyp labeled category and the polyp predicted category, and the calculation method of the cross entropy is the prior art, which will not be repeated here.
需要进行说明的是,该第一生成器对应的判别器的参数可以与该第一生成器的参数进行同步调整。示例地,可以将该预测损失的负值作为该判别器的损失,以根据该损失调整判别器的参数,从而可以提高判别器的准确性,并通过对抗生成的方式进一步提高该第一生成器的图像生成准确度。It should be noted that the parameters of the discriminator corresponding to the first generator can be adjusted synchronously with the parameters of the first generator. For example, the negative value of the prediction loss can be used as the loss of the discriminator, so as to adjust the parameters of the discriminator according to the loss, so that the accuracy of the discriminator can be improved, and the first generator can be further improved by confrontation generation. image generation accuracy.
将所述第一分布距离的负值确定为所述第一分布损失;determining a negative value of the first distribution distance as the first distribution loss;
根据所述生成损失、所述预测损失和所述第一分布损失确定所述目标损失。The target loss is determined based on the generation loss, the prediction loss, and the first distribution loss.
示例地,可以将生成损失、所述预测损失和所述第一分布损失的加权和确定为所述目标损失。示例地,该生成损失、预测损失和第一分布损失分别对应的权重可以根据具体应用场景进行设置,本公开对此不进行限定。Exemplarily, a weighted sum of generation loss, the prediction loss and the first distribution loss may be determined as the target loss. For example, the weights respectively corresponding to the generation loss, the prediction loss and the first distribution loss may be set according to specific application scenarios, which is not limited in the present disclosure.
由此,通过上述技术方案,在确定图像生成模型的目标损失时,既可以通过计算训练图像和还原图像之间的差异,从而保证生成图像和训练图像之间的语义一致性,并且可以进一步地考量生成图像对应的息肉预测类别和训练图像对应的息肉标注类别的差异性,进一步保证生成图像的语义信息的准 确性,为对生成图像自动标注息肉类别提供可靠的数据支持。同时在目标损失中还可以结合第一分布损失,从而可以使得训练得出的图像生成模型可以在生成多样化的生成图像的同时,保证该生成图像与训练图像之间的语义一致性,保证确定出的生成样本的可靠性。Therefore, through the above technical solution, when determining the target loss of the image generation model, the difference between the training image and the restoration image can be calculated to ensure the semantic consistency between the generated image and the training image, and further Considering the difference between the polyp prediction category corresponding to the generated image and the polyp labeling category corresponding to the training image, the accuracy of the semantic information of the generated image is further ensured, and reliable data support is provided for automatically labeling the polyp category on the generated image. At the same time, the first distribution loss can also be combined in the target loss, so that the image generation model obtained by training can generate a variety of generated images, while ensuring the semantic consistency between the generated image and the training image, ensuring certainty the reliability of the generated samples.
在一种可能的实施例中,所述训练样本集中包含对应于多种息肉标注类别的训练样本,从而可以基于训练完成的图像生成模型生成多种类别下生成图像。In a possible embodiment, the training sample set includes training samples corresponding to multiple labeled categories of polyps, so that generated images of multiple categories can be generated based on the trained image generation model.
相应地,所述根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失的示例性实现方式如下,在上文所述示例的基础上,该步骤还可以包括:Correspondingly, according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, an example of determining the target loss of the image generation model The implementation is as follows, and on the basis of the example described above, this step may also include:
根据各种息肉标注类别下的生成图像,针对任意两种息肉标注类别下的生成图像,确定该两种息肉标注类别下的生成图像对应的第二分布距离,其中,所述第二分布距离用于表示属于不同息肉标注类别下的生成图像的分布之间的差异。According to the generated images under various polyp labeling categories, for the generated images under any two polyp labeling categories, determine the second distribution distance corresponding to the generated images under the two polyp labeling categories, wherein the second distribution distance is used to represent the difference between distributions of generated images belonging to different polyp annotation categories.
其中,在本公开实施例中,可以通过多种类别下的训练样本对图像生成模型进行训练,为了进一步保证生成的数据具有更大的多样性,以及多种类别下的图像进行准确区分,本公开中可以通过确定该第二分布距离以保证不同类别下的生成图像之间的差异。Among them, in the embodiment of the present disclosure, the image generation model can be trained by training samples under various categories. In order to further ensure that the generated data has greater diversity and the images under various categories can be accurately distinguished, this In the disclosure, the difference between generated images of different categories can be ensured by determining the second distribution distance.
示例地,针对训练样本集中的各个息肉标注分类,可以任意选择两种息肉标注类别下的生成图像进行分布距离的计算,其中,不同类别的下生成图像之间的第二分布距离的计算方式与上文所述确定训练图像和生成图像之间的第一分布距离的计算方式相同,在此不再赘述。For example, for each polyp label classification in the training sample set, the generated images under the two polyp label categories can be arbitrarily selected to calculate the distribution distance, wherein, the calculation method of the second distribution distance between the generated images of different categories is the same as The above calculation method for determining the first distribution distance between the training image and the generated image is the same, and will not be repeated here.
之后,所述根据所述生成损失、所述预测损失和所述分布损失确定所述目标损失的示例性实现方式如下,该步骤可以包括:Afterwards, an exemplary implementation manner of determining the target loss according to the generation loss, the prediction loss and the distribution loss is as follows, and this step may include:
根据所述第二分布距离确定所述图像生成模型的第二分布差异,其中可以将确定出的各个不同类别下的生成图像之间的第二分布距离之和的负值确定为该图像生成模型的第二分布差异。Determine the second distribution difference of the image generation model according to the second distribution distance, wherein the determined negative value of the sum of the second distribution distances between generated images in different categories can be determined as the image generation model The difference in the second distribution of .
将所述生成损失、所述预测损失、所述第一分布损失和所述第二分布损失的加权和确定为所述目标损失。其中,在该实施例中,该第一分布损失可以是确定出的每一类别下的训练图像和生成图像之间的第一分布距离之和的负值,从而可以通过该第一分布损失表征该多个息肉标注类别下生成图像与训练图像的差异。A weighted sum of the generation loss, the prediction loss, the first distribution loss, and the second distribution loss is determined as the target loss. Wherein, in this embodiment, the first distribution loss can be the negative value of the sum of the determined first distribution distances between the training image and the generated image under each category, so that the first distribution loss can be used to represent Differences between generated images and training images under the multiple polyp labeling categories.
由此,通过上述技术方案,可以通过训练一个图像生成模型适用于多种息肉类别下的训练图像的图像扩展生成,通过保证不同息肉类别下的图像的分布之间的差异,保证该图像生成模型对各个息肉分类的适配性和准确性,从而可以有效保证基于训练完成后的图像生成模型生成的生成图像的准确性,为后续进行息肉识别模型的训练提高更多样化且准确的数据支持。Therefore, through the above-mentioned technical solution, it is possible to train an image generation model suitable for image extension generation of training images under multiple polyp categories, and by ensuring the difference between the distributions of images under different polyp categories, the image generation model can be guaranteed The adaptability and accuracy of each polyp classification can effectively ensure the accuracy of the generated image generated based on the image generation model after training, and provide more diverse and accurate data support for the subsequent training of the polyp recognition model .
本公开还提供一种息肉识别方法,所述方法包括:The present disclosure also provides a method of polyp identification, the method comprising:
接收待识别的息肉图像,该息肉图像则可以是检测过程中获得的包含息肉的图像。An image of a polyp to be identified is received, and the image of the polyp may be an image including a polyp obtained during detection.
将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于上文任一所述的息肉图像生成模型的训练方法进行训练所得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。Inputting the polyp image into a polyp recognition model to obtain a recognition result of the polyp image, wherein the training sample set corresponding to the polyp recognition model includes an original sample, and according to the original sample and the first generated image in the image generation model The generated sample generated by the machine, the image generated model is obtained by training based on any of the above polyp image generated model training methods, the original sample includes the original image and the corresponding polyp labeling category of the original image, The generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
由此,在该实施例中,在对息肉识别模型进行训练时,可以在原始训练样本的基础上,根据上文任一所述的息肉图像生成模型的训练方法训练出的图像生成模型进行图像生成,从而可以基于原始样本获得更多准确的生成样 本,从而可以有效扩展用于进行息肉识别模型训练的训练样本集,进而提高稿训练得出的息肉识别模型的准确度和效率,同时可以有效提高该息肉识别模型的泛化性和鲁棒性,有效降低息肉识别的漏检率,在一定程度上提高息肉识别的准确度。Thus, in this embodiment, when training the polyp recognition model, on the basis of the original training samples, the image generation model trained according to any of the above-mentioned polyp image generation model training methods can perform image Generated, so that more accurate generated samples can be obtained based on the original samples, which can effectively expand the training sample set used for polyp recognition model training, thereby improving the accuracy and efficiency of the polyp recognition model obtained by draft training, and can effectively Improve the generalization and robustness of the polyp recognition model, effectively reduce the missed detection rate of polyp recognition, and improve the accuracy of polyp recognition to a certain extent.
在一种可能的实施例中,所述息肉识别模型通过以下方式进行训练:In a possible embodiment, the polyp recognition model is trained in the following manner:
对所述训练样本集中的目标训练图像进行预处理,获得处理图像,其中,所述预处理包括非线性变换和/或局部像素洗牌,所述目标训练图像包括所述原始图像和所述生成图像。Preprocessing the target training image in the training sample set to obtain a processed image, wherein the preprocessing includes nonlinear transformation and/or local pixel shuffling, and the target training image includes the original image and the generated image.
示例地,通常医学图像中的相对强度值可以用于表达有关成像结构和器官的相关信息。因此,强度信息可以用作像素级别的监督信息,为了在图像转换中可以保留结构的相对强度,可以使用一种平滑且单调的转换函数Bezier曲线进行非线性变化。在该变换方式中可以为图像中的每一像素匹配唯一值,确保在该非线性转换中保证一一对应的映射关系。示例地,可以采用如下方式进行变换:For example, generally relative intensity values in medical images can be used to express relevant information about imaged structures and organs. Therefore, intensity information can be used as pixel-level supervisory information. In order to preserve the relative intensity of structures in image transformation, a smooth and monotonous transformation function Bezier curve can be used for nonlinear changes. In this transformation method, a unique value can be matched for each pixel in the image to ensure a one-to-one mapping relationship in the nonlinear transformation. For example, the transformation can be performed as follows:
B(t)=(1-t) 3p 0+3(1-t) 2tp 1+3(1-t)t 2p 2+t 3p 3,t∈[0,1] B(t)=(1-t) 3 p 0 +3(1-t) 2 tp 1 +3(1-t)t 2 p 2 +t 3 p 3 ,t∈[0,1]
其中,B(t)用于表示该转换函数的转换值,p 0、p 3为预先定义的两个节点,p 1、p 2为预先定义的两个控制点,t为延线长度的分数值,可以根据实际应用场景进行设置,本公开对此不进行限定。通过上述方式可以实现对目标训练图像的非线性变换处理。 Among them, B(t) is used to represent the conversion value of the conversion function, p 0 and p 3 are two predefined nodes, p 1 and p 2 are two predefined control points, t is the fraction of the extension line length The value can be set according to the actual application scenario, which is not limited in the present disclosure. The nonlinear transformation processing of the target training image can be realized through the above method.
作为另一示例,可以从目标训练图像中随机选择一个窗口,之后对该窗口内的像素顺序进行打乱,从而可以获得与该目标训练图像对应的处理图像。示例地,可以将该窗口的大小设置为小于息肉识别模型中对应的感受野的大小。As another example, a window may be randomly selected from the target training image, and then the sequence of pixels in the window may be disturbed, so that a processed image corresponding to the target training image may be obtained. For example, the size of the window can be set to be smaller than the size of the corresponding receptive field in the polyp identification model.
其中,针对目标训练图像可以通过上述任一方式进行预处理获得处理图 像,也可以结合两种方式进行预处理,如可以先对目标训练图像进行非线性转换之后进行局部像素洗牌获得处理图像,或者可以对目标训练图像进行局部像素洗牌之后进行非线性转换获得处理图像。Among them, the target training image can be preprocessed by any of the above methods to obtain the processed image, and the two methods can also be combined for preprocessing. For example, the target training image can be nonlinearly converted first and then local pixel shuffling is performed to obtain the processed image. Or the target training image can be subjected to local pixel shuffling and nonlinear transformation to obtain the processed image.
以所述处理图像作为模型输入,以所述目标训练图像作为目标输出对所述息肉识别模型进行预训练,以获得预训练后的息肉识别模型。The polyp recognition model is pre-trained by using the processed image as a model input and using the target training image as a target output to obtain a pre-trained polyp recognition model.
在该步骤中,可以以处理图像作为输入,从而可以将息肉识别模型恢复出的图像与该目标训练图像进行损失计算,基于计算出的损失对该息肉识别模型进行预训练,在该损失小于阈值或迭代次数满足一定次数时,结束预训练的过程,以获得预训练后的息肉识别模型。In this step, the processed image can be used as input, so that the image recovered by the polyp recognition model can be used for loss calculation with the target training image, and the polyp recognition model can be pre-trained based on the calculated loss. When the loss is less than the threshold Or when the number of iterations meets a certain number of times, the pre-training process is ended to obtain a pre-trained polyp recognition model.
以所述目标训练图像作为模型输入,以所述目标训练图像对应的息肉标注类别为目标输出,对所述预训练后的息肉识别模型进行训练,获得训练完成的息肉识别模型。The target training image is used as a model input, and the polyp labeling category corresponding to the target training image is used as a target output to train the pre-trained polyp recognition model to obtain a trained polyp recognition model.
在该步骤中,可以以目标训练图像作为输入,从而可以将息肉识别模型输出的预测类别与该目标训练图像对应的息肉标注类别进行损失计算,基于计算出的损失对该息肉识别模型进行训练,在该损失小于阈值或迭代次数满足一定次数时,结束训练的过程,以获得训练完成的息肉识别模型。In this step, the target training image can be used as input, so that the predicted category output by the polyp recognition model and the polyp label category corresponding to the target training image can be used for loss calculation, and the polyp recognition model can be trained based on the calculated loss. When the loss is less than the threshold or the number of iterations meets a certain number of times, the training process is ended to obtain a trained polyp recognition model.
由此,通过上述技术方案,在基于训练样本数据对该息肉识别模型进行训练时,可以先通过对训练图像进行预处理,以由息肉识别模型对该预处理后的图像进行恢复为训练任务,对息肉识别模型进行预训练,从而可以提高息肉识别模型中的特征学习能力,提高与后续模型训练任务的适配性。之后,在该预训练的息肉识别模型中基于训练样本集进行训练,以获得息肉识别模型,从而可以有效拓宽息肉识别模型的应用场景,同时可以提高息肉识别模型的准确性和适用性。Thus, through the above technical solution, when the polyp recognition model is trained based on the training sample data, the training image can be preprocessed first, and the preprocessed image can be restored by the polyp recognition model as the training task, Pre-training the polyp recognition model can improve the feature learning ability in the polyp recognition model and improve the adaptability to subsequent model training tasks. Afterwards, the pre-trained polyp recognition model is trained based on the training sample set to obtain the polyp recognition model, so that the application scenarios of the polyp recognition model can be effectively broadened, and the accuracy and applicability of the polyp recognition model can be improved at the same time.
本公开还提供一种息肉图像生成模型的训练装置,如图3所示,所述装置40包括:The present disclosure also provides a training device for a polyp image generation model, as shown in FIG. 3 , the device 40 includes:
获取模块41,用于获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别;An acquisition module 41, configured to acquire a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
生成模块42,用于根据所述训练图像和图像生成模型,获得所述训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像;The generation module 42 is configured to obtain a generated image and a restored image corresponding to the training image according to the training image and the image generation model, wherein the image generation model includes a first generator and a second generator, and the first A generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image;
第一确定模块43,用于根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,其中,所述第一分布距离用于表示所述训练图像的分布和所述生成图像的分布之间的差异;The first determining module 43 is configured to determine a first distribution distance corresponding to the training image and the generated image according to the training image and the generated image, wherein the first distribution distance is used to represent the training the difference between the distribution of images and the distribution of said generated images;
第二确定模块44,用于根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系;The second determination module 44 is configured to determine the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image , wherein the target loss includes a first distribution loss determined according to the first distribution distance, and the first distribution loss is negatively correlated with the first distribution distance;
更新模块45,用于在满足更新条件的情况下,根据所述目标损失对所述图像生成模型的参数进行更新。The update module 45 is configured to update the parameters of the image generation model according to the target loss when an update condition is met.
可选地,所述第二确定模块包括:Optionally, the second determination module includes:
第一确定子模块,用于根据所述训练图像和与所述训练图像对应的还原图像,确定所述图像生成模型的生成损失;A first determination submodule, configured to determine the generation loss of the image generation model according to the training image and the restored image corresponding to the training image;
第二确定子模块,用于基于所述训练图像对应的息肉标注类别、和基于该训练图像生成的生成图像所对应的息肉预测类别,确定所述图像生成模型的预测损失;The second determining submodule is used to determine the prediction loss of the image generation model based on the polyp labeling category corresponding to the training image and the polyp prediction category corresponding to the generated image generated based on the training image;
第三确定子模块,用于将所述第一分布距离的负值确定为所述第一分布损失;A third determining submodule, configured to determine a negative value of the first distribution distance as the first distribution loss;
第四确定子模块,用于根据所述生成损失、所述预测损失和所述第一分布损失确定所述目标损失。A fourth determination submodule, configured to determine the target loss according to the generation loss, the prediction loss and the first distribution loss.
可选地,所述训练样本集中包含对应于多种息肉标注类别的训练样本;Optionally, the training sample set includes training samples corresponding to multiple labeled categories of polyps;
所述第二确定模块还包括:The second determination module also includes:
第五确定子模块,用于根据各种息肉标注类别下的生成图像,针对任意两种息肉标注类别下的生成图像,确定该两种息肉标注类别下的生成图像对应的第二分布距离,其中,所述第二分布距离用于表示属于不同息肉标注类别下的生成图像的分布之间的差异;The fifth determining sub-module is used to determine the second distribution distance corresponding to the generated images under the two polyp labeling categories for the generated images under any two polyp labeling categories according to the generated images under various polyp labeling categories, wherein , the second distribution distance is used to represent the difference between the distributions of generated images belonging to different polyp annotation categories;
所述第四确定子模块包括:The fourth determining submodule includes:
第六确定子模块,用于根据所述第二分布距离确定所述图像生成模型的第二分布差异;A sixth determining submodule, configured to determine a second distribution difference of the image generation model according to the second distribution distance;
第七确定子模块,用于将所述生成损失、所述预测损失、所述第一分布损失和所述第二分布损失的加权和确定为所述目标损失。A seventh determination submodule, configured to determine a weighted sum of the generation loss, the prediction loss, the first distribution loss, and the second distribution loss as the target loss.
可选地,所述第一确定模块包括:Optionally, the first determination module includes:
第八确定子模块,用于针对同一息肉标注类别下的训练图像和生成图像,确定所述训练图像之间的传输距离、所述生成图像之间的传输距离、以及所述训练图像和所述生成图像之间的传输距离;The eighth determining submodule is used to determine the transmission distance between the training images, the transmission distance between the generated images, and the training images and the generated images for the training images and generated images under the same polyp labeling category. The transmission distance between generated images;
第九确定子模块,用于根据所述训练图像和所述生成图像之间的传输距离、所述训练图像之间的传输距离,以及所述生成图像之间的传输距离确定所述第一分布距离。A ninth determining submodule, configured to determine the first distribution according to the transmission distance between the training image and the generated image, the transmission distance between the training images, and the transmission distance between the generated images distance.
可选地,所述传输距离通过如下公式确定:Optionally, the transmission distance is determined by the following formula:
Figure PCTCN2022116426-appb-000005
Figure PCTCN2022116426-appb-000005
Figure PCTCN2022116426-appb-000006
Figure PCTCN2022116426-appb-000006
其中,W c(X 1,X 2)用于表示图像X 1和图像X 2之间的传输距离; Wherein, W c (X 1 , X 2 ) is used to represent the transmission distance between image X 1 and image X 2 ;
φ(X 1)用于表示从所述图像X 1中提取出的特征图像; φ(X 1 ) is used to represent the feature image extracted from the image X 1 ;
φ(X 2)用于表示从所述图像X 2中提取出的特征图像; φ(X 2 ) is used to represent the feature image extracted from the image X 2 ;
P 1用于表示所述图像X 1对应的分布;P 2用于表示所述图像X 2对应的分布; P 1 is used to represent the distribution corresponding to the image X 1 ; P 2 is used to represent the distribution corresponding to the image X 2 ;
∏(P 1,P 2)用于表示分布P 1和分布P 2形成的全部的联合分布; ∏(P 1 , P 2 ) is used to represent all joint distributions formed by distribution P 1 and distribution P 2 ;
c(X 1,X 2)用于表示所述图像X 1和图像X 2之间的传输成本。 c(X 1 , X 2 ) is used to represent the transmission cost between the image X 1 and the image X 2 .
本公开还提供一种息肉识别装置,所述装置包括:The present disclosure also provides a polyp identification device, the device comprising:
接收模块,用于接收待识别的息肉图像;A receiving module, configured to receive an image of a polyp to be identified;
识别模块,用于将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于上文任一所述的息肉图像生成模型的训练方法进行训练所得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。An identification module, configured to input the polyp image into a polyp identification model to obtain an identification result of the polyp image, wherein the training sample set corresponding to the polyp identification model includes original samples, and a model is generated according to the original samples and images The generation sample generated by the first generator in the above, the image generation model is obtained by training based on any of the above polyp image generation model training methods, and the original sample includes the original image corresponding to the original image polyp labeling category, the generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
可选地,所述息肉识别模型通过以下方式进行训练:Optionally, the polyp recognition model is trained in the following manner:
对所述训练样本集中的目标训练图像进行预处理,获得处理图像,其中,所述预处理包括非线性变换和/或局部像素洗牌,所述目标训练图像包括所述原始图像和所述生成图像;Preprocessing the target training image in the training sample set to obtain a processed image, wherein the preprocessing includes nonlinear transformation and/or local pixel shuffling, and the target training image includes the original image and the generated image;
以所述处理图像作为模型输入,以所述目标训练图像作为目标输出对所述息肉识别模型进行预训练,以获得预训练后的息肉识别模型;Pre-training the polyp recognition model by using the processed image as a model input and using the target training image as a target output to obtain a pre-trained polyp recognition model;
以所述目标训练图像作为模型输入,以所述目标训练图像对应的息肉标注类别为目标输出,对所述预训练后的息肉识别模型进行训练,以获得训练完成的息肉识别模型。The target training image is used as a model input, and the polyp label category corresponding to the target training image is used as a target output to train the pre-trained polyp recognition model to obtain a trained polyp recognition model.
下面参考图4,其示出了适于用来实现本公开实施例的电子设备600的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、 笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图4示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring now to FIG. 4 , it shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. The terminal equipment in the embodiments of the present disclosure may include but not limited to mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle-mounted terminals (such as mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers and the like. The electronic device shown in FIG. 4 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
如图4所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 4, an electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may be randomly accessed according to a program stored in a read-only memory (ROM) 602 or loaded from a storage device 608. Various appropriate actions and processes are executed by programs in the memory (RAM) 603 . In the RAM 603, various programs and data necessary for the operation of the electronic device 600 are also stored. The processing device 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to the bus 604 .
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图4示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices can be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 607 such as a computer; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 4 shows electronic device 600 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介 质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium The communication (eg, communication network) interconnections. Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别;根据所述训练图像和图像生成模型,获得所述训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像;根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,其中,所述第一分布距离用于表示所述训练图像的分布和所述生成图像的分布之间的差异;根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系;在满足更新条件的情况下,根据所述目标损失对所述图像生成模型的参数进行更新。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: acquires a training sample set, wherein each training sample in the training sample set contains A training image and a polyp labeling category corresponding to the training image; according to the training image and the image generation model, a generated image and a restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator Two generators, the first generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image; according to the training image and the generated image , determine the first distribution distance corresponding to the training image and the generated image, wherein the first distribution distance is used to represent the difference between the distribution of the training image and the distribution of the generated image; according to the The first distribution distance, the training image, the generated image, the restored image, and the polyp label category corresponding to the training image determine the target loss of the image generation model, wherein the target loss includes according to the The first distribution loss determined by the first distribution distance, the first distribution loss is negatively correlated with the first distribution distance; when the update condition is met, the image generation model is generated according to the target loss The parameters are updated.
或者,上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:接收待识别的息肉图像;将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于第一方面所述的息肉图像生成模型的训练方法进行训练所得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。Alternatively, the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: receives the polyp image to be identified; inputs the polyp image into the polyp identification model , to obtain the recognition result of the polyp image, wherein the training sample set corresponding to the polyp recognition model includes the original sample and the generated sample generated according to the original sample and the first generator in the image generation model, the image The generation model is obtained by training based on the training method of the polyp image generation model described in the first aspect, the original sample includes the original image and the polyp label category corresponding to the original image, and the generation sample includes the polyp generated based on the original image Generate an image and annotate the polyp category corresponding to the original image.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如 “C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as "C" or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, using an Internet service provider to connected via the Internet).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,获取模块还可以被描述为“获取训练样本集的模块”。The modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the module does not constitute a limitation of the module itself under certain circumstances, for example, the obtaining module may also be described as "a module for obtaining the training sample set".
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described herein above may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), System on Chips (SOCs), Complex Programmable Logical device (CPLD) and so on.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结 合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
根据本公开的一个或多个实施例,示例1提供了一种息肉图像生成模型的训练方法,所述方法包括:According to one or more embodiments of the present disclosure, Example 1 provides a method for training a polyp image generation model, the method comprising:
获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别;Obtaining a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
根据所述训练图像和图像生成模型,获得所述训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像;According to the training image and the image generation model, a generated image and a restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator, and the first generator is used to The training image is used to generate the generated image, and the second generator is used to generate the restored image according to the generated image;
根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,其中,所述第一分布距离用于表示所述训练图像的分布和所述生成图像的分布之间的差异;According to the training image and the generated image, determine a first distribution distance corresponding to the training image and the generated image, wherein the first distribution distance is used to represent the distribution of the training image and the generated image The difference between the distributions of ;
根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系;According to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, determine the target loss of the image generation model, wherein the target loss includes The first distribution loss determined according to the first distribution distance, the first distribution loss and the first distribution distance are negatively correlated;
在满足更新条件的情况下,根据所述目标损失对所述图像生成模型的参数进行更新。If the updating condition is met, the parameters of the image generation model are updated according to the target loss.
根据本公开的一个或多个实施例,示例2提供了示例1的方法,其中, 所述根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,包括:According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein, according to the first distribution distance, the training image, the generated image, the restored image, and the training The polyp annotation category corresponding to the image determines the target loss of the image generation model, including:
根据所述训练图像和与所述训练图像对应的还原图像,确定所述图像生成模型的生成损失;determining a generation loss of the image generation model according to the training image and a restored image corresponding to the training image;
基于所述训练图像对应的息肉标注类别、和基于该训练图像生成的生成图像所对应的息肉预测类别,确定所述图像生成模型的预测损失;Determine the prediction loss of the image generation model based on the polyp labeling category corresponding to the training image and the polyp prediction category corresponding to the generated image generated based on the training image;
将所述第一分布距离的负值确定为所述第一分布损失;determining a negative value of the first distribution distance as the first distribution loss;
根据所述生成损失、所述预测损失和所述第一分布损失确定所述目标损失。The target loss is determined based on the generation loss, the prediction loss, and the first distribution loss.
根据本公开的一个或多个实施例,示例3提供了示例2的方法,其中,所述训练样本集中包含对应于多种息肉标注类别的训练样本;According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein the training sample set contains training samples corresponding to multiple polyp labeling categories;
所述根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,还包括:The determining the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image further includes:
根据各种息肉标注类别下的生成图像,针对任意两种息肉标注类别下的生成图像,确定该两种息肉标注类别下的生成图像对应的第二分布距离,其中,所述第二分布距离用于表示属于不同息肉标注类别下的生成图像的分布之间的差异;According to the generated images under various polyp labeling categories, for the generated images under any two polyp labeling categories, determine the second distribution distance corresponding to the generated images under the two polyp labeling categories, wherein the second distribution distance is used to represent the difference between distributions of generated images belonging to different polyp annotation categories;
所述根据所述生成损失、所述预测损失和所述分布损失确定所述目标损失,包括:The determining the target loss according to the generation loss, the prediction loss and the distribution loss includes:
根据所述第二分布距离确定所述图像生成模型的第二分布差异;determining a second distribution difference of the image generation model according to the second distribution distance;
将所述生成损失、所述预测损失、所述第一分布损失和所述第二分布损失的加权和确定为所述目标损失。A weighted sum of the generation loss, the prediction loss, the first distribution loss, and the second distribution loss is determined as the target loss.
根据本公开的一个或多个实施例,示例4提供了示例1的方法,其中, 所述根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,包括:According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 1, wherein, according to the training image and the generated image, determining the first distribution corresponding to the training image and the generated image distance, including:
针对同一息肉标注类别下的训练图像和生成图像,确定所述训练图像之间的传输距离、所述生成图像之间的传输距离、以及所述训练图像和所述生成图像之间的传输距离;For training images and generated images under the same polyp labeling category, determine the transmission distance between the training images, the transmission distance between the generated images, and the transmission distance between the training images and the generated images;
根据所述训练图像和所述生成图像之间的传输距离、所述训练图像之间的传输距离,以及所述生成图像之间的传输距离确定所述第一分布距离。The first distribution distance is determined according to the transmission distance between the training image and the generated image, the transmission distance between the training images, and the transmission distance between the generated images.
根据本公开的一个或多个实施例,示例5提供了示例4的方法,其中,所述传输距离通过如下公式确定:According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, wherein the transmission distance is determined by the following formula:
Figure PCTCN2022116426-appb-000007
Figure PCTCN2022116426-appb-000007
Figure PCTCN2022116426-appb-000008
Figure PCTCN2022116426-appb-000008
其中,W c(X 1,X 2)用于表示图像X 1和图像X 2之间的传输距离; Wherein, W c (X 1 , X 2 ) is used to represent the transmission distance between image X 1 and image X 2 ;
φ(X 1)用于表示从所述图像X 1中提取出的特征图像; φ(X 1 ) is used to represent the feature image extracted from the image X 1 ;
φ(X 2)用于表示从所述图像X 2中提取出的特征图像; φ(X 2 ) is used to represent the feature image extracted from the image X 2 ;
P 1用于表示所述图像X 1对应的分布;P 2用于表示所述图像X 2对应的分布; P 1 is used to represent the distribution corresponding to the image X 1 ; P 2 is used to represent the distribution corresponding to the image X 2 ;
∏(P 1,P 2)用于表示分布P 1和分布P 2形成的全部的联合分布; ∏(P 1 , P 2 ) is used to represent all joint distributions formed by distribution P 1 and distribution P 2 ;
c(X 1,X 2)用于表示所述图像X 1和图像X 2之间的传输成本。 c(X 1 , X 2 ) is used to represent the transmission cost between the image X 1 and the image X 2 .
根据本公开的一个或多个实施例,示例6提供了一种息肉识别方法,其中,所述方法包括:According to one or more embodiments of the present disclosure, Example 6 provides a polyp identification method, wherein the method includes:
接收待识别的息肉图像;receiving the polyp image to be identified;
将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始 样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于示例1-5中任一项所述的息肉图像生成模型的训练方法进行训练所得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。Inputting the polyp image into a polyp recognition model to obtain a recognition result of the polyp image, wherein the training sample set corresponding to the polyp recognition model includes an original sample, and according to the original sample and the first generated image in the image generation model The generation sample generated by the machine, the image generation model is obtained by training based on the training method of the polyp image generation model described in any one of examples 1-5, and the original sample includes the original image and the corresponding image of the original image. The polyp labeling category, the generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
根据本公开的一个或多个实施例,示例7提供了示例6的方法,其中,所述息肉识别模型通过以下方式进行训练:According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein the polyp recognition model is trained in the following manner:
对所述训练样本集中的目标训练图像进行预处理,获得处理图像,其中,所述预处理包括非线性变换和/或局部像素洗牌,所述目标训练图像包括所述原始图像和所述生成图像;Preprocessing the target training image in the training sample set to obtain a processed image, wherein the preprocessing includes nonlinear transformation and/or local pixel shuffling, and the target training image includes the original image and the generated image;
以所述处理图像作为模型输入,以所述目标训练图像作为目标输出对所述息肉识别模型进行预训练,以获得预训练后的息肉识别模型;Pre-training the polyp recognition model by using the processed image as a model input and using the target training image as a target output to obtain a pre-trained polyp recognition model;
以所述目标训练图像作为模型输入,以所述目标训练图像对应的息肉标注类别为目标输出,对所述预训练后的息肉识别模型进行训练,以获得训练完成的息肉识别模型。The target training image is used as a model input, and the polyp label category corresponding to the target training image is used as a target output to train the pre-trained polyp recognition model to obtain a trained polyp recognition model.
根据本公开的一个或多个实施例,示例8提供了一种息肉图像生成模型的训练装置,所述装置包括:According to one or more embodiments of the present disclosure, Example 8 provides a training device for a polyp image generation model, the device comprising:
获取模块,用于获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别;An acquisition module, configured to acquire a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
生成模块,用于根据所述训练图像和图像生成模型,获得所述训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像;A generation module, configured to obtain a generated image and a restored image corresponding to the training image according to the training image and the image generation model, wherein the image generation model includes a first generator and a second generator, and the first The generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image;
第一确定模块,用于根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,其中,所述第一分布距离用于表 示所述训练图像的分布和所述生成图像的分布之间的差异;A first determining module, configured to determine a first distribution distance corresponding to the training image and the generated image according to the training image and the generated image, wherein the first distribution distance is used to represent the training image The difference between the distribution of and the distribution of the generated images;
第二确定模块,用于根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系;The second determination module is configured to determine the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, Wherein, the target loss includes a first distribution loss determined according to the first distribution distance, and the first distribution loss is negatively correlated with the first distribution distance;
更新模块,用于在满足更新条件的情况下,根据所述目标损失对所述图像生成模型的参数进行更新。An update module, configured to update the parameters of the image generation model according to the target loss when an update condition is satisfied.
根据本公开的一个或多个实施例,示例9提供了一种息肉识别装置,所述装置包括:According to one or more embodiments of the present disclosure, Example 9 provides a polyp identification device, the device comprising:
接收模块,用于接收待识别的息肉图像;A receiving module, configured to receive an image of a polyp to be identified;
识别模块,用于将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于示例1-5中任一项所述的息肉图像生成模型的训练方法进行训练所得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。An identification module, configured to input the polyp image into a polyp identification model to obtain an identification result of the polyp image, wherein the training sample set corresponding to the polyp identification model includes original samples, and a model is generated according to the original samples and images The generation sample generated by the first generator in the above, the image generation model is obtained by training based on the training method of the polyp image generation model described in any one of examples 1-5, and the original sample includes the original image and the The polyp labeling category corresponding to the original image, the generated sample includes a generated image generated based on the original image and the polyp labeling category corresponding to the original image.
根据本公开的一个或多个实施例,示例10提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现示例1-7中任一项所述方法的步骤。According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of any one of the methods described in Examples 1-7 are implemented .
根据本公开的一个或多个实施例,示例11提供了一种电子设备,包括:According to one or more embodiments of the present disclosure, Example 11 provides an electronic device, including:
存储装置,其上存储有计算机程序;a storage device on which a computer program is stored;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例1-7中任一项所述方法的步骤。A processing device configured to execute the computer program in the storage device to implement the steps of any one of the methods in Examples 1-7.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领 域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principles. Those skilled in the art should understand that the disclosure scope involved in this disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but also covers the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of equivalent features. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, while operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or performed in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while the above discussion contains several specific implementation details, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. Regarding the apparatus in the foregoing embodiments, the specific manner in which each module executes operations has been described in detail in the embodiments related to the method, and will not be described in detail here.

Claims (11)

  1. 一种息肉图像生成模型的训练方法,其特征在于,所述方法包括:A kind of training method of polyp image generation model, it is characterized in that, described method comprises:
    获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别;Obtaining a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
    根据所述训练图像和图像生成模型,获得所述训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像;According to the training image and the image generation model, a generated image and a restored image corresponding to the training image are obtained, wherein the image generation model includes a first generator and a second generator, and the first generator is used to The training image is used to generate the generated image, and the second generator is used to generate the restored image according to the generated image;
    根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,其中,所述第一分布距离用于表示所述训练图像的分布和所述生成图像的分布之间的差异;According to the training image and the generated image, determine a first distribution distance corresponding to the training image and the generated image, wherein the first distribution distance is used to represent the distribution of the training image and the generated image The difference between the distributions of ;
    根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系;According to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, determine the target loss of the image generation model, wherein the target loss includes The first distribution loss determined according to the first distribution distance, the first distribution loss and the first distribution distance are negatively correlated;
    在满足更新条件的情况下,根据所述目标损失对所述图像生成模型的参数进行更新。If the updating condition is met, the parameters of the image generation model are updated according to the target loss.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,包括:The method according to claim 1, wherein, according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, the determined Target losses for the image generation models described above, including:
    根据所述训练图像和与所述训练图像对应的还原图像,确定所述图像生成模型的生成损失;determining a generation loss of the image generation model according to the training image and a restored image corresponding to the training image;
    基于所述训练图像对应的息肉标注类别、和基于该训练图像生成的生成图像所对应的息肉预测类别,确定所述图像生成模型的预测损失;Determine the prediction loss of the image generation model based on the polyp labeling category corresponding to the training image and the polyp prediction category corresponding to the generated image generated based on the training image;
    将所述第一分布距离的负值确定为所述第一分布损失;determining a negative value of the first distribution distance as the first distribution loss;
    根据所述生成损失、所述预测损失和所述第一分布损失确定所述目标损失。The target loss is determined based on the generation loss, the prediction loss, and the first distribution loss.
  3. 根据权利要求2所述的方法,其特征在于,所述训练样本集中包含对应于多种息肉标注类别的训练样本;The method according to claim 2, wherein the training sample set includes training samples corresponding to multiple polyp labeling categories;
    所述根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,还包括:The determining the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image further includes:
    根据各种息肉标注类别下的生成图像,针对任意两种息肉标注类别下的生成图像,确定该两种息肉标注类别下的生成图像对应的第二分布距离,其中,所述第二分布距离用于表示属于不同息肉标注类别下的生成图像的分布之间的差异;According to the generated images under various polyp labeling categories, for the generated images under any two polyp labeling categories, determine the second distribution distance corresponding to the generated images under the two polyp labeling categories, wherein the second distribution distance is used to represent the difference between distributions of generated images belonging to different polyp annotation categories;
    所述根据所述生成损失、所述预测损失和所述分布损失确定所述目标损失,包括:The determining the target loss according to the generation loss, the prediction loss and the distribution loss includes:
    根据所述第二分布距离确定所述图像生成模型的第二分布差异;determining a second distribution difference of the image generation model according to the second distribution distance;
    将所述生成损失、所述预测损失、所述第一分布损失和所述第二分布损失的加权和确定为所述目标损失。A weighted sum of the generation loss, the prediction loss, the first distribution loss, and the second distribution loss is determined as the target loss.
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,包括:The method according to claim 1, wherein the determining the first distribution distance corresponding to the training image and the generated image according to the training image and the generated image comprises:
    针对同一息肉标注类别下的训练图像和生成图像,确定所述训练图像之 间的传输距离、所述生成图像之间的传输距离、以及所述训练图像和所述生成图像之间的传输距离;For training images and generated images under the same polyp labeling category, determine the transmission distance between the training images, the transmission distance between the generated images, and the transmission distance between the training images and the generated images;
    根据所述训练图像和所述生成图像之间的传输距离、所述训练图像之间的传输距离,以及所述生成图像之间的传输距离确定所述第一分布距离。The first distribution distance is determined according to the transmission distance between the training image and the generated image, the transmission distance between the training images, and the transmission distance between the generated images.
  5. 根据权利要求4所述的方法,其特征在于,所述传输距离通过如下公式确定:The method according to claim 4, wherein the transmission distance is determined by the following formula:
    Figure PCTCN2022116426-appb-100001
    Figure PCTCN2022116426-appb-100001
    Figure PCTCN2022116426-appb-100002
    Figure PCTCN2022116426-appb-100002
    其中,W c(X 1,X 2)用于表示图像X 1和图像X 2之间的传输距离; Wherein, W c (X 1 , X 2 ) is used to represent the transmission distance between image X 1 and image X 2 ;
    φ(X 1)用于表示从所述图像X 1中提取出的特征图像; φ(X 1 ) is used to represent the feature image extracted from the image X 1 ;
    φ(X 2)用于表示从所述图像X 2中提取出的特征图像; φ(X 2 ) is used to represent the feature image extracted from the image X 2 ;
    P 1用于表示所述图像X 1对应的分布;P 2用于表示所述图像X 2对应的分布; P 1 is used to represent the distribution corresponding to the image X 1 ; P 2 is used to represent the distribution corresponding to the image X 2 ;
    Π(P 1,P 2)用于表示分布P 1和分布P 2形成的全部的联合分布; Π(P 1 ,P 2 ) is used to represent the entire joint distribution formed by distribution P 1 and distribution P 2 ;
    c(X 1,X 2)用于表示所述图像X 1和图像X 2之间的传输成本。 c(X 1 , X 2 ) is used to represent the transmission cost between the image X 1 and the image X 2 .
  6. 一种息肉识别方法,其特征在于,所述方法包括:A polyp identification method, characterized in that the method comprises:
    接收待识别的息肉图像;receiving the polyp image to be identified;
    将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于权利要求1-5中任一项所述的息肉图像生成模型的训练方法进行训练所 得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。Inputting the polyp image into a polyp recognition model to obtain a recognition result of the polyp image, wherein the training sample set corresponding to the polyp recognition model includes an original sample, and according to the original sample and the first generated image in the image generation model The generation sample generated by the machine, the image generation model is obtained by training based on the training method of the polyp image generation model described in any one of claims 1-5, and the original sample includes the original image corresponding to the original image polyp labeling category, the generated samples include a generated image generated based on the original image and a polyp labeling category corresponding to the original image.
  7. 根据权利要求6所述的方法,其特征在于,所述息肉识别模型通过以下方式进行训练:The method according to claim 6, wherein the polyp recognition model is trained in the following manner:
    对所述训练样本集中的目标训练图像进行预处理,获得处理图像,其中,所述预处理包括非线性变换和/或局部像素洗牌,所述目标训练图像包括所述原始图像和所述生成图像;Preprocessing the target training image in the training sample set to obtain a processed image, wherein the preprocessing includes nonlinear transformation and/or local pixel shuffling, and the target training image includes the original image and the generated image;
    以所述处理图像作为模型输入,以所述目标训练图像作为目标输出对所述息肉识别模型进行预训练,以获得预训练后的息肉识别模型;Pre-training the polyp recognition model by using the processed image as a model input and using the target training image as a target output to obtain a pre-trained polyp recognition model;
    以所述目标训练图像作为模型输入,以所述目标训练图像对应的息肉标注类别为目标输出,对所述预训练后的息肉识别模型进行训练,以获得训练完成的息肉识别模型。The target training image is used as a model input, and the polyp label category corresponding to the target training image is used as a target output to train the pre-trained polyp recognition model to obtain a trained polyp recognition model.
  8. 一种息肉图像生成模型的训练装置,其特征在于,所述装置包括:A kind of training device of polyp image generation model, it is characterized in that, described device comprises:
    获取模块,用于获取训练样本集,其中,所述训练样本集中的每一训练样本包含训练图像以及所述训练图像对应的息肉标注类别;An acquisition module, configured to acquire a training sample set, wherein each training sample in the training sample set includes a training image and a polyp label category corresponding to the training image;
    生成模块,用于根据所述训练图像和图像生成模型,获得所述训练图像对应的生成图像和还原图像,其中,所述图像生成模型包括第一生成器和第二生成器,所述第一生成器用于根据所述训练图像生成所述生成图像,所述第二生成器用于根据所述生成图像生成所述还原图像;A generation module, configured to obtain a generated image and a restored image corresponding to the training image according to the training image and the image generation model, wherein the image generation model includes a first generator and a second generator, and the first The generator is used to generate the generated image according to the training image, and the second generator is used to generate the restored image according to the generated image;
    第一确定模块,用于根据所述训练图像和所述生成图像,确定所述训练图像和所述生成图像对应的第一分布距离,其中,所述第一分布距离用于表示所述训练图像的分布和所述生成图像的分布之间的差异;A first determining module, configured to determine a first distribution distance corresponding to the training image and the generated image according to the training image and the generated image, wherein the first distribution distance is used to represent the training image The difference between the distribution of and the distribution of the generated images;
    第二确定模块,用于根据所述第一分布距离、所述训练图像、所述生成图像、所述还原图像以及所述训练图像对应的息肉标注类别,确定所述图像生成模型的目标损失,其中,所述目标损失包括根据所述第一分布距离确定出的第一分布损失,所述第一分布损失与所述第一分布距离为负相关关系;The second determination module is configured to determine the target loss of the image generation model according to the first distribution distance, the training image, the generated image, the restored image, and the polyp labeling category corresponding to the training image, Wherein, the target loss includes a first distribution loss determined according to the first distribution distance, and the first distribution loss is negatively correlated with the first distribution distance;
    更新模块,用于在满足更新条件的情况下,根据所述目标损失对所述图像生成模型的参数进行更新。An update module, configured to update the parameters of the image generation model according to the target loss when an update condition is satisfied.
  9. 一种息肉识别装置,其特征在于,所述装置包括:A polyp identification device, characterized in that the device comprises:
    接收模块,用于接收待识别的息肉图像;A receiving module, configured to receive an image of a polyp to be identified;
    识别模块,用于将所述息肉图像输入息肉识别模型,获得所述息肉图像的识别结果,其中,所述息肉识别模型对应的训练样本集包含原始样本、以及根据所述原始样本和图像生成模型中的第一生成器生成的生成样本,所述图像生成模型是基于权利要求1-5中任一项所述的息肉图像生成模型的训练方法进行训练所得的,所述原始样本包括原始图像和所述原始图像对应的息肉标注类别,所述生成样本包括基于原始图像生成的生成图像以及该原始图像对应的息肉标注类别。An identification module, configured to input the polyp image into a polyp identification model to obtain an identification result of the polyp image, wherein the training sample set corresponding to the polyp identification model includes original samples, and a model is generated according to the original samples and images The generated sample generated by the first generator in the method, the image generation model is obtained by training based on the training method of the polyp image generation model described in any one of claims 1-5, and the original sample includes the original image and The polyp labeling category corresponding to the original image, and the generated sample includes a generated image generated based on the original image and the polyp labeling category corresponding to the original image.
  10. 一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理装置执行时实现权利要求1-7中任一项所述方法的步骤。A computer-readable medium, on which a computer program is stored, characterized in that, when the program is executed by a processing device, the steps of the method described in any one of claims 1-7 are implemented.
  11. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    存储装置,其上存储有计算机程序;a storage device on which a computer program is stored;
    处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求1-7中任一项所述方法的步骤。A processing device configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1-7.
PCT/CN2022/116426 2021-09-02 2022-09-01 Training method for generative model, polyp identification method and apparatus, medium, and device WO2023030427A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111028344.XA CN113469295B (en) 2021-09-02 2021-09-02 Training method for generating model, polyp recognition method, device, medium, and apparatus
CN202111028344.X 2021-09-02

Publications (1)

Publication Number Publication Date
WO2023030427A1 true WO2023030427A1 (en) 2023-03-09

Family

ID=77867407

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/116426 WO2023030427A1 (en) 2021-09-02 2022-09-01 Training method for generative model, polyp identification method and apparatus, medium, and device

Country Status (2)

Country Link
CN (1) CN113469295B (en)
WO (1) WO2023030427A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113469295B (en) * 2021-09-02 2021-12-03 北京字节跳动网络技术有限公司 Training method for generating model, polyp recognition method, device, medium, and apparatus
CN114549445A (en) * 2022-02-16 2022-05-27 上海商汤智能科技有限公司 Image detection and related model training method, related device, equipment and medium
CN114782390B (en) * 2022-04-29 2023-08-11 小荷医疗器械(海南)有限公司 Determination method of detection model, polyp detection method, polyp detection device, medium and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416059A (en) * 2018-03-22 2018-08-17 北京市商汤科技开发有限公司 Training method and device, equipment, medium, the program of image description model
CN109101602A (en) * 2018-08-01 2018-12-28 腾讯科技(深圳)有限公司 Image encrypting algorithm training method, image search method, equipment and storage medium
US20200356805A1 (en) * 2018-05-16 2020-11-12 Tencent Technology (Shenzhen)Company Limited Image recognition method, storage medium and computer device
CN112164026A (en) * 2020-09-01 2021-01-01 上海交通大学 Endoscope polyp real-time detection method, system and terminal
CN112733946A (en) * 2021-01-14 2021-04-30 北京市商汤科技开发有限公司 Training sample generation method and device, electronic equipment and storage medium
CN113469295A (en) * 2021-09-02 2021-10-01 北京字节跳动网络技术有限公司 Training method for generating model, polyp recognition method, device, medium, and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111985547A (en) * 2020-08-11 2020-11-24 华侨大学 Cross-resolution vehicle re-identification method based on attention-guided generation learning

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416059A (en) * 2018-03-22 2018-08-17 北京市商汤科技开发有限公司 Training method and device, equipment, medium, the program of image description model
US20200356805A1 (en) * 2018-05-16 2020-11-12 Tencent Technology (Shenzhen)Company Limited Image recognition method, storage medium and computer device
CN109101602A (en) * 2018-08-01 2018-12-28 腾讯科技(深圳)有限公司 Image encrypting algorithm training method, image search method, equipment and storage medium
CN112164026A (en) * 2020-09-01 2021-01-01 上海交通大学 Endoscope polyp real-time detection method, system and terminal
CN112733946A (en) * 2021-01-14 2021-04-30 北京市商汤科技开发有限公司 Training sample generation method and device, electronic equipment and storage medium
CN113469295A (en) * 2021-09-02 2021-10-01 北京字节跳动网络技术有限公司 Training method for generating model, polyp recognition method, device, medium, and apparatus

Also Published As

Publication number Publication date
CN113469295B (en) 2021-12-03
CN113469295A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
WO2023030427A1 (en) Training method for generative model, polyp identification method and apparatus, medium, and device
US20200042776A1 (en) Method and apparatus for recognizing body movement
WO2023030370A1 (en) Endoscope image detection method and apparatus, storage medium, and electronic device
WO2023030298A1 (en) Polyp typing method, model training method and related apparatus
WO2022252881A1 (en) Image processing method and apparatus, and readable medium and electronic device
WO2022105779A1 (en) Image processing method, model training method, and apparatus, medium, and device
WO2023030523A1 (en) Tissue cavity positioning method and apparatus for endoscope, medium and device
WO2022171036A1 (en) Video target tracking method, video target tracking apparatus, storage medium, and electronic device
WO2023061080A1 (en) Method and apparatus for recognizing tissue image, readable medium, and electronic device
WO2023030373A1 (en) Method and apparatus for positioning tissue cavity, and readable medium and electronic device
WO2023185516A1 (en) Method and apparatus for training image recognition model, and recognition method and apparatus, and medium and device
WO2023035877A1 (en) Video recognition method and apparatus, readable medium, and electronic device
WO2023125008A1 (en) Artificial intelligence-based endoscope image processing method and apparatus, medium and device
WO2023179310A1 (en) Image restoration method and apparatus, device, medium, and product
CN113610034B (en) Method and device for identifying character entities in video, storage medium and electronic equipment
CN113140012B (en) Image processing method, device, medium and electronic equipment
CN111311609B (en) Image segmentation method and device, electronic equipment and storage medium
WO2023130925A1 (en) Font recognition method and apparatus, readable medium, and electronic device
CN111797665B (en) Method and apparatus for converting video
WO2023165332A1 (en) Tissue cavity positioning method, apparatus, readable medium, and electronic device
JP2022526473A (en) Methods and devices for acquiring information, electronic devices, storage media and computer programs
WO2023143118A1 (en) Image processing method and apparatus, device, and medium
WO2023030426A1 (en) Polyp recognition method and apparatus, medium, and device
CN114937178B (en) Multi-modality-based image classification method and device, readable medium and electronic equipment
CN115115836B (en) Image recognition method, device, storage medium and electronic equipment

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE