WO2024083152A1 - Pathological image recognition method, pathological image recognition model training method and system therefor, and storage medium - Google Patents

Pathological image recognition method, pathological image recognition model training method and system therefor, and storage medium Download PDF

Info

Publication number
WO2024083152A1
WO2024083152A1 PCT/CN2023/125221 CN2023125221W WO2024083152A1 WO 2024083152 A1 WO2024083152 A1 WO 2024083152A1 CN 2023125221 W CN2023125221 W CN 2023125221W WO 2024083152 A1 WO2024083152 A1 WO 2024083152A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
neural network
loss function
pathological
network model
Prior art date
Application number
PCT/CN2023/125221
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 WO2024083152A1 publication Critical patent/WO2024083152A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • G06V10/7753Incorporation of unlabelled data, e.g. multiple instance learning [MIL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/03Recognition of patterns in medical or anatomical images

Definitions

  • the present invention relates to the field of image processing technology, and in particular to a pathological image recognition method and a model training method, system and storage medium thereof.
  • One of the purposes of the present invention is to provide a pathological image recognition model training method to solve the technical problems in the prior art that model training is too dependent on labeled data for supervised training, has low utilization rate, cannot fully utilize data for training, has poor training effect and high cost.
  • One of the purposes of the present invention is to provide a pathological image recognition model training system.
  • One of the objectives of the present invention is to provide a storage medium.
  • One of the objectives of the present invention is to provide a pathological image recognition method.
  • an embodiment of the present invention provides a pathological image recognition model training method, the method comprising: receiving a sample image set; based on the sample image set, calling a first neural network model to perform supervised training and traversal reasoning in sequence, and calling a second neural network model to perform supervised training based on the reasoning result, and calculating a first loss function; based on the sample image set, calling the second neural network model to perform supervised training and traversal reasoning in sequence, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating a second loss function; iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
  • the sample image set includes a labeled sample image set and an unlabeled sample image set.
  • the "calling the first neural network model to perform supervised training and traversal reasoning in sequence according to the sample image set, and calling the second neural network model to perform supervised training based on the reasoning result to calculate the first loss function" specifically includes: calling the first neural network model to perform supervised training according to the labeled sample image set, and then calling the first neural network model to perform traversal reasoning according to the unlabeled sample image set to obtain a first recognition pseudo-label set corresponding to the unlabeled sample image set; calling the second neural network model to perform supervised training according to the unlabeled sample image set and the first recognition pseudo-label set, and calculating the The first loss function; the "according to the sample image set, calling the second neural network model to perform supervised training and traversal reasoning in sequence, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating the second loss function" specifically includes: according to the labeled sample image set, calling the second neural network model to perform supervised training,
  • the method before the "receiving the sample image set", the method also includes: receiving a reference pathology image set; performing size normalization processing and color migration normalization processing on the reference pathology image set in sequence, and calculating to obtain a standard pathology image set; wherein the standard pathology image set includes a labeled pathology image set and an unlabeled pathology image set; grouping the labeled pathology image set, combining the first labeled image set with the unlabeled pathology image set to form a sample image training set, and forming a sample image verification set based on the second labeled image set; generating the sample image set based on the sample image training set and the sample image verification set.
  • the method specifically includes: receiving a precancerous lesion specimen image and a non-precancerous lesion specimen image; performing pixel annotation on some precancerous lesion specimen images to obtain a lesion annotation mask; generating the reference pathological image set according to the precancerous lesion specimen image, the corresponding lesion annotation mask, and the non-precancerous lesion specimen image; the “performing size normalization processing and color migration normalization processing on the reference pathological image set in sequence to obtain a standard pathological image set” specifically includes: performing size normalization processing and color migration normalization processing on all annotated lesion specimen images in sequence; The size standardization processing and the color migration standardization processing are performed, and the set of annotated pathological images is obtained by calculation based on the annotated lesion specimen images after the processing; wherein the annotated lesion specimen images correspond to the precancerous lesion specimen images with the corresponding lesion annotation masks;
  • the number of the labeled lesion specimen images accounts for 30% of the number of all precancerous lesion specimen images; the number of all non-precancerous lesion specimen images accounts for 20% of the number of all precancerous lesion specimen images.
  • the "obtaining a set of standard pathological images by calculation” specifically includes: performing sliding window area segmentation on a reference pathological image that has completed size standardization and color migration standardization, and obtaining and calculating the set of standard pathological images based on multiple groups of sliding window area image groups; wherein the sliding window area segmentation specifically includes: constructing an image area sliding window of a preset size, and causing the image area sliding window to perform traversal segmentation on the annotated standardized image and the corresponding lesion annotation mask according to a preset step size, and obtaining multiple groups of annotated sliding window image groups and annotated sliding window mask groups; wherein the annotated standardized image is an annotated lesion specimen image that has completed standardization processing; traversal, segmentation
  • the method comprises the following steps: analyzing and screening and updating the annotated sliding window image and the corresponding annotated sliding window mask according to the proportion of the lesion area of all the annotated sliding window masks in the annotated sliding window mask group;
  • the method specifically includes: performing random data augmentation processing on the annotated sliding window image and the corresponding annotated sliding window mask to obtain the set of annotated pathological images; after “traversing, analyzing and screening and updating the unannotated sliding window image and the non-lesion sliding window image according to the proportion of the tissue area of the unannotated sliding window image and the non-lesion sliding window image", the method specifically includes: performing random data augmentation processing on the unannotated sliding window image and the non-lesion sliding window image to obtain the set of unannotated pathological images; wherein the random data augmentation specifically includes: performing at least one of horizontal flipping, vertical flipping, preset angle rotation and transposition on the image matrix according to a preset probability.
  • the lesion annotation mask includes a one-hot encoding label corresponding to each pixel in the precancerous lesion specimen image, and the one-hot encoding label includes a first encoding bit, a second encoding bit and a third encoding bit that respectively represent the background judgment label, the intraepithelial neoplasia judgment label and the intestinal metaplasia judgment label.
  • the size standardization processing specifically includes: performing size standardization processing on the reference pathology image set to unify all reference pathology images to a preset magnification;
  • the color migration standardization processing specifically includes: receiving a baseline staining image, performing color space conversion on it, and calculating a baseline staining vector matrix; receiving a reference pathology image, performing color space conversion on it, and calculating a reference color density matrix; generating a color migration image corresponding to the reference pathology image based on the baseline staining vector matrix and the reference color density matrix.
  • the "receiving a reference staining image, performing color space conversion on it, and calculating a reference staining vector matrix” specifically includes: receiving a reference staining image, performing optical density matrix conversion processing, and obtaining a reference optical density matrix; performing singular value decomposition on the reference optical density matrix, selecting the first singular extreme value and the second singular extreme value to create a projection plane; determining at least one reference singular value and its reference plane axis on the projection plane, projecting the reference optical density matrix to the projection plane, fitting the connecting line between all numerical points on the projected reference optical density matrix and the origin of the projection plane, and calculating the angle between the connecting line and the reference plane axis, finding the maximum value among all angles, and obtaining maximum angle data; calculating the optical density matrix corresponding to the maximum angle data, and performing a normalization operation on the optical density matrix to obtain the reference staining vector matrix.
  • the "receiving a reference pathological image, performing color space conversion on it, and calculating a reference color density matrix” specifically includes: receiving a reference pathological image, performing optical density matrix conversion, singular value decomposition, plane projection and maximum angle data acquisition on it in sequence, and calculating a reference optical density matrix and a reference staining vector matrix corresponding to the reference pathological image; based on the reference staining vector matrix and the reference optical density matrix, calculating the reference color density matrix corresponding to the reference pathological image.
  • the method specifically comprises: performing downsampling interpolation on the reference pathological image, setting the The magnification of the reference pathological image is 10 times; wherein the downsampling interpolation is the nearest neighbor interpolation.
  • the method before the step of "after calling the first neural network model to perform supervised training according to the set of labeled sample images, calling the first neural network model to perform traversal reasoning according to the set of unlabeled sample images to obtain a first set of identification pseudo-labels corresponding to the set of unlabeled sample images", the method also includes: selecting a semantic segmentation backbone model based on a fully convolutional network as a basic backbone model; performing model initialization based on the basic backbone model according to first weight configuration parameters and second weight configuration parameters, respectively, to obtain the first neural network model and the second neural network model; wherein the first neural network model and the second neural network model are both equipped with a softmax activation function and are configured to have the same optimizer and learning rate adjustment strategy.
  • the basic backbone model is configured based on a U-Net network architecture, the first weight configuration parameter is set to be generated based on a Xavier parameter initialization strategy, and the second weight configuration parameter is set to be generated based on a Kaiming parameter initialization strategy; the first neural network model and the second neural network model are configured to include a stochastic gradient descent optimizer, and the learning rate adjustment strategy is configured so that the model learning rate value decreases with an increase in the number of iterations.
  • the model learning rate value is equal to the product of a preset exponential power of the ratio of the remaining number of iterations to the total number of iterations and a basic learning rate value.
  • the first loss function is configured as a weighted sum of a first supervised loss function and a first pseudo-label loss function, wherein the first supervised loss function refers to a supervised training process of the first neural network model based on a sample image set, and the first pseudo-label loss function refers to a supervised training process of the second neural network model based on an inference result;
  • the second loss function is configured as a weighted sum of a second supervised loss function and a second pseudo-label loss function, wherein the second supervised loss function refers to a supervised training process of the second neural network model based on the sample image set, and the second pseudo-label loss function refers to a supervised training process of the first neural network model based on the inference result.
  • the first supervised loss function is configured as the sum of a first supervised cross entropy loss function and a first supervised intersection-over-union loss function; wherein, the first supervised cross entropy loss function represents the gap between the known label data in the sample image set and the corresponding inference classification probability, and the first supervised intersection-over-union loss function represents the gap between the known label data in the sample image set and the corresponding inference classification category; the first pseudo-label loss function includes a first pseudo-label cross entropy loss function; wherein, the first pseudo-label cross entropy loss function represents the difference between the inference classification probability of the sample image set by the first neural network model and the inference classification category of the sample image set by the second neural network model.
  • the second supervised loss function is configured as the sum of a second supervised cross entropy loss function and a second supervised intersection-over-union loss function; wherein the second supervised cross entropy loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification probability, and the second supervised intersection-over-union loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification category;
  • the second pseudo-label loss function includes a second pseudo-label cross entropy loss function; wherein the second pseudo-label cross entropy loss function characterizes the gap between the inference classification probability of the sample image set by the second neural network model and the inference classification category of the sample image set by the first neural network model.
  • the sample image characterizes the intraepithelial neoplasia and intestinal metaplasia; the first supervised cross entropy loss function, the first pseudo-label cross entropy loss function, the second supervised cross entropy loss function and the second pseudo-label cross entropy loss function point to the background area, intraepithelial neoplasia area and intestinal metaplasia area in the sample image; the first supervised intersection-over-union loss function and the second supervised intersection-over-union loss function point to the intraepithelial neoplasia area and intestinal metaplasia area in the sample image.
  • the first pseudo-label loss function and the second pseudo-label loss function have equal preset weight values, and the preset weight values are configured to increase with an increase in the number of iterations.
  • the preset weight value is equal to the product of the maximum weight value and a preset increasing function, and the preset increasing function is configured so that the function value approaches 1 infinitely.
  • the sample image represents the intraepithelial neoplasia and intestinal metaplasia.
  • one embodiment of the present invention provides a pathological image recognition model training system, comprising: one or more processors; a memory for storing one or more computer programs, which, when the one or more computer programs are executed by the one or more processors, are configured to execute the pathological image recognition model training method described in any of the above-mentioned technical solutions.
  • one embodiment of the present invention provides a storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the pathological image recognition model training method described in any of the above-mentioned technical solutions is implemented.
  • an embodiment of the present invention provides a pathological image recognition method, which includes: executing the pathological image recognition model training method described in any of the above-mentioned technical solutions to obtain at least one of the first model training parameters and the second model training parameters; carrying the model training parameters into the corresponding neural network model to construct a pathological image recognition model; receiving the pathological image data to be tested and preprocessing it, and inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction to obtain pathological recognition data.
  • the "receiving pathological image data to be tested and preprocessing it, inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction, and obtaining pathological recognition data” specifically includes: performing size standardization processing and color migration standardization processing on the pathological image data to be tested in sequence, and calculating to obtain a set of pathological images to be tested; inputting the set of pathological images to be tested into the pathological image recognition model for traversal prediction, and obtaining a pathological recognition pixel area; and superimposing and displaying the pathological recognition pixel area on the pathological image to be tested to form a pathological judgment image.
  • the "calculation to obtain a set of pathological images to be tested” specifically includes: performing sliding window area segmentation on the pathological image data to be tested that has completed size standardization and color migration standardization, and screening to obtain the set of pathological images to be tested based on the proportion of low grayscale value areas in the sliding window image to be tested.
  • the pathology identification data includes precancerous lesion determination information
  • the "receiving the pathology image data to be tested and preprocessing it, inputting the preprocessed pathology image data to be tested into the pathology image recognition model for traversal prediction, and obtaining the pathology identification data" specifically includes: arranging the pixel values in the pathology identification pixel area respectively pointing to intraepithelial neoplasia and intestinal metaplasia in descending order, calculating the pixel average value within a preset number range, obtaining a first average value and a second average value, and judging the numerical relationship between the first average value and the second average value and a preset precancerous lesion determination threshold; if one of the first average value and the second average value is greater than the precancerous lesion determination threshold, it is judged that a precancerous lesion occurs at the position represented by the pathology image to be tested corresponding to the pathology identification pixel area, and outputting the pre
  • the pathological image recognition model training method constructs two parallel learning models, a first neural network model and a second neural network model, and uses the two sets of loss functions generated to train and optimize the models in comparison, thereby making full use of limited image data for training and making the performance of the neural network model more stable; using a sample image set to sequentially train the previous model to the next model, and using a sample image set to sequentially train the next model to the previous model, combining general supervised training and pseudo-label-based supervised training, can reduce dependence on scarce data types such as labeled data, and make unlabeled data equivalent to labeled data and participate in the model training process, thereby greatly improving the performance of the trained model, reducing costs and increasing training speed.
  • FIG1 is a schematic diagram of the structure of a pathological image recognition model training system according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of the steps of a pathological image recognition model training method according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of the steps of a first embodiment of a pathological image recognition model training method according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of some steps of a pathological image recognition model training method in another embodiment of the present invention.
  • FIG. 5 is a schematic diagram of some steps of a first embodiment of a pathological image recognition model training method in another embodiment of the present invention.
  • FIG. 6 is a schematic diagram of some steps of a specific example of the first embodiment of the pathological image recognition model training method in another embodiment of the present invention.
  • FIG. 7 is a schematic diagram of some steps of a pathological image recognition model training method in yet another embodiment of the present invention.
  • FIG8 is a schematic diagram of some steps of a first embodiment of a pathological image recognition model training method in yet another embodiment of the present invention.
  • FIG9 is a schematic diagram of the image data conversion process when executing the pathological image recognition model training method in another embodiment of the present invention.
  • FIG. 10 is a schematic diagram of the steps of a pathological image recognition method and a first embodiment thereof in one embodiment of the present invention.
  • the core technical route of the present invention is to construct two sets of parallel neural network models, alternately perform supervised training and supervised training based on the inference results after supervised training, so as to achieve the technical effects of making full use of the content of the sample image set, stabilizing the quality of the output training parameters, and improving the prediction accuracy of the model.
  • the additional technical features proposed in the following text of the present invention such as image standardization, grouping, sliding window segmentation, etc., can also further optimize the model training method from the aspects of the quality of the sample image set itself, the construction of the image set used for training, and resource occupation. It is worth emphasizing that the various implementation methods, embodiments or specific examples below can be combined with each other, and the new technical scheme formed thereby can be included in the protection scope of the present invention.
  • an embodiment of the present invention provides a storage medium, which can be specifically a computer-readable storage medium or a computer-readable signal medium or any combination of the above two, so that the storage medium can be set in a computer and store a computer program.
  • the computer storage medium can be any available medium that can be accessed by a computer, or can be a storage device such as a server or a data center that includes one or more available media.
  • the available medium can be a magnetic medium such as a floppy disk, a hard disk, a magnetic tape, or a DVD (Digital Video Recorder).
  • a computer-readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in combination with an instruction execution system, device or device.
  • the program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
  • a pathological image recognition model training method is implemented to at least perform: receiving a set of sample images, calling and training a first neural network model and a second neural network model, calculating a first loss function and a second loss function, and generating at least one of a first model training parameter and a second model training parameter.
  • One embodiment of the present invention further provides a pathological image recognition model training system 100 as shown in FIG1 , and the pathological image recognition model training system 100 includes a processor 11, a communication interface 12, a memory 13, and a communication bus 14.
  • the processor 11, the communication interface 12, and the memory 13 communicate with each other through the communication bus 14.
  • the following components are connected to the communication interface 12: input components including a keyboard, a mouse, etc.; output components including a cathode ray tube (CRT, Cathode Ray Tube), a liquid crystal display (LCD, Liquid Crystal Display), etc., and a speaker, etc.; a memory 13 including a hard disk, etc.; and a communication component including a network interface card such as a local area network card, a modem, etc.
  • the communication component performs communication processing via a network such as the Internet.
  • a drive can be connected to the communication interface 12 as needed.
  • Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor media, etc., are installed on the drive as needed so that the computer program read therefrom can be installed into the memory 13 as needed.
  • the process described in each method flow chart can be implemented as a computer software program.
  • an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flow chart.
  • the computer program can be downloaded and installed from a network through a communication component, and/or installed from a removable medium.
  • various functions defined in the system of the present application are executed.
  • the pathological image recognition model training system 100 is trained based on the pathological image recognition model training method provided below.
  • the memory 13 is used to store an application program; the processor 11 is used to execute the application program stored in the memory 13, and the application program may be the application program stored in the storage medium as described above, that is, the storage medium may be included in the memory 13.
  • the functions and steps as described above may also be implemented, and the corresponding technical effects may be achieved.
  • pathological image recognition model training system 100 can include a data acquisition module for acquiring a sample image set, a model construction module for constructing a first neural network model and a second neural network model, a data operation module for calculating a first loss function and a second loss function, and an iterative training module for iteratively training the first neural network model and the second neural network model.
  • One embodiment of the present invention provides a pathological image recognition model training method as shown in FIG2.
  • the program or instruction used in the method can be carried in the above-mentioned storage medium and/or the above-mentioned pathological image recognition model training system and/or the above-mentioned pathological image recognition model training device to achieve the technical effect of training the pathological image recognition model.
  • the pathological image recognition model training method specifically includes the following steps.
  • Step 21 Receive a sample image set.
  • Step 22 according to the sample image set, call the first neural network model to perform supervised training and traversal reasoning in sequence, and call the second neural network model to perform supervised training based on the reasoning result to calculate the first loss function.
  • Step 23 according to the sample image set, call the second neural network model to perform supervised training and traversal reasoning in sequence, and call the first neural network model to perform supervised training based on the reasoning result to calculate the second loss function.
  • Step 24 iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
  • the sample image set can be specifically interpreted as an image set or image data set for training a pathological image recognition model, and its content can point to any part that needs to be recognized and analyzed for pathological images.
  • the sample image set can point to the stomach, intestines, and other parts of the digestive system. Based on the limitations of its own use, the sample image set can at least include some images pointing to the lesion site or the pre-lesion site.
  • the sample images in the sample image set can be configured to characterize intraepithelial neoplasia and intestinal metaplasia.
  • intestinal metaplasia is generally considered to be an early manifestation of cancer, which can be divided into two types: small intestinal metaplasia and colonic metaplasia.
  • colonic metaplasia has a higher risk of malignant cancer
  • the number of sample images representing colonic metaplasia in the sample image set can be configured to be larger, or it can be given a higher weight in training.
  • the sample image set includes a set of labeled sample images and a set of unlabeled sample images.
  • the present invention does not limit the way of labeling sample images, which may be to provide a unified label for partial areas.
  • the present invention does not limit the form of sample image labeling.
  • the labeling of sample images may be to classify each pixel, and finally form a mask that is adapted to the size of the sample image, so that the sample image and the corresponding mask together constitute the set of labeled sample images.
  • the set of labeled sample images should at least include some sample images pointing to the lesion site and the pre-lesion site, while for the set of unlabeled sample images, it may include sample images pointing to the lesion site or the pre-lesion site, and may also include sample images that do not include lesion or pre-lesion features.
  • the first neural network model and the second neural network model can be any neural network model that can support supervised training and inference prediction.
  • the first loss function represents the deviation between the model inference and the actual classification in the process of calling the first neural network model and the second neural network model for training in sequence.
  • the second loss function represents the deviation between the model inference and the actual classification in the process of calling the second neural network model and the first neural network model for training in sequence.
  • the present invention provides a preferred embodiment, which aims to build a better neural network model to adapt to the application scenario of pathological image recognition and improve the efficiency of model training.
  • This embodiment specifically includes the steps of: selecting a semantic segmentation backbone model based on a fully convolutional network as a basic backbone model; performing model initialization based on the basic backbone model according to the first weight configuration parameter and the second weight configuration parameter, respectively, to obtain the first neural network model and the second neural network model.
  • the deconvolution operation can replace the last fully connected layer of the traditional convolutional neural network (CNN), so as to maintain the consistency of the image output size with the input size during training, inference and prediction to meet the needs of refined prediction (for example, prediction for each pixel).
  • CNN convolutional neural network
  • the selection of a backbone model that supports semantic segmentation as the basic backbone model can achieve pixel-level classification, so that when dealing with diverse classification needs, it can accurately segment the lesion or pre-lesion area from the background area, providing medical workers with a more accurate and reliable reference.
  • the first weight parameter and the second weight parameter are preferably configured to be generated based on different parameter initialization strategies, so that the corresponding first neural network model and the second neural network model have independent internal characteristics on the basis of maintaining parallel training. In this way, the generalization ability of the first model training parameters or the second model training parameters finally generated is improved. Because the first neural network model and the second neural network model are configured to be built based on the same basic backbone model, there is no need to make adaptive adjustments to the input sample image set for the model, and the form of the output data information is also similar, which makes it easier to compare with each other and calculate the overall loss function for performance evaluation.
  • the first neural network model and the second neural network model are both equipped with a softmax activation function and are configured to have the same optimizer and learning rate adjustment strategy.
  • the softmax activation function is used to adapt to a larger number of classification requirements. For example, a single pixel or pixel area can be identified and determined in three categories: background, intraepithelial neoplasia, and intestinal metaplasia.
  • the determination information can be in the form of a classification probability value.
  • the basic backbone model is configured based on the U-Net network architecture.
  • the U-Net network architecture chooses to superimpose features when resizing, thereby doubling the number of channels and taking into account both global and local features, thereby adapting to multi-scale prediction and deep supervision.
  • the first weight configuration parameter is preferably set to be generated based on the Xavier parameter initialization strategy
  • the second weight configuration parameter is preferably set to be generated based on the Kaiming parameter initialization strategy.
  • the former performs better when applied to the tanh activation function operation scenario, and can solve the problem of gradient disappearance caused by the Gaussian distribution as the depth of the neural network increases to a certain extent.
  • the latter focuses more on the ability of nonlinear activation functions such as the relu activation function, and can also improve the problem of data variance decreasing layer by layer to a certain extent.
  • the above parameter initialization strategy can be implemented based on the PyTorch learning library, and the above first weight configuration parameter and the second weight configuration parameter can be interpreted as having different tensor parameters (tensor). It can be seen that the two weight parameters are not necessarily limited to being generated using the above two parameter initialization strategies.
  • the first neural network model and the second neural network model can be configured to have the same stochastic gradient descent (SGD) optimizer, so that the performance of the neural network model can be evaluated in real time and give it a faster learning speed.
  • SGD stochastic gradient descent
  • the learning rate adjustment strategy is configured so that the model learning rate value decreases with the increase in the number of iterations, so that the performance of the neural network model gradually tends to be stable.
  • a maximum model learning rate value can be set as the basic learning rate value at the time of initialization.
  • the basic learning rate value is preferably 0.01.
  • the model learning rate value can be specifically configured to be equal to the product of the preset exponential power of the ratio of the remaining number of iterations to the total number of iterations and the basic learning rate value.
  • the model learning rate value is at least configured to satisfy:
  • the basic learning rate value can be configured as 0.01
  • the preset exponent value can be configured as 0.9
  • the model learning rate value can be configured as Minimum configuration is required to meet:
  • the present invention configures different training strategies for the first neural network model and the second neural network model according to the labeled sample image set and the unlabeled sample image set in the sample image set, mainly using supervised training and reasoning, taking the pseudo-label reasoning result as the basis for the second-level supervised training, and further making full use of the sample image set, especially the relatively scarce labeled sample image set, to improve the generalization recognition ability and prediction accuracy of the model.
  • the first embodiment specifically includes the following steps.
  • Step 21 Receive a sample image set.
  • Step 221 after calling the first neural network model to perform supervised training according to the labeled sample image set, calling the first neural network model to perform traversal reasoning according to the unlabeled sample image set to obtain a first recognition pseudo-label set corresponding to the unlabeled sample image set.
  • Step 222 Based on the unlabeled sample image set and the first recognition pseudo-label set, call the second neural network model to perform supervised training and calculate the first loss function.
  • Step 231 after calling the second neural network model to perform supervised training according to the labeled sample image set, calling the second neural network model to perform traversal reasoning according to the unlabeled sample image set to obtain a second recognition pseudo-label set corresponding to the unlabeled sample image set.
  • Step 232 Based on the unlabeled sample image set and the second recognition pseudo-label set, call the first neural network model to perform supervised training, and calculate the second loss function.
  • Step 24 iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
  • model training can be performed in two directions: "from the first neural network model to the second neural network model” and "from the second neural network model to the first neural network model”; on the other hand, the unlabeled sample image set can be inferred through the supervised training model, and the identified pseudo-labels and the unlabeled sample image set can be used as the "labeled sample image set" for further supervised training, thereby improving the performance of the model, and obtaining model training parameters with better accuracy and stability through iteration, and reducing the dependence on the demand for a large number of labeled sample image sets.
  • the first loss function and the second loss function may also have the following configuration.
  • the first loss function is configured as the weighted sum of the first supervised loss function and the first pseudo-label loss function
  • the second loss function is configured as the weighted sum of the second supervised loss function and the second pseudo-label loss function.
  • the first loss function and the second loss function can be used as overall model evaluation parameters for step 22 and step 23, respectively, covering the entire process of training in the above two directions and enhancing the effect of iterative training.
  • the first supervised loss function refers to the supervised training process of the first neural network model based on the sample image set
  • the first pseudo-label loss function refers to the supervised training process of the second neural network model based on the reasoning result.
  • the "based on the reasoning result" in the first embodiment of the above-mentioned implementation mode can be specifically interpreted as "based on the first identification pseudo-label set”.
  • the second supervised loss function refers to the supervised training process of the second neural network model based on the sample image set
  • the second pseudo-label loss function refers to the supervised training process of the first neural network model based on the reasoning result.
  • the "based on the reasoning result" in the first embodiment of the above-mentioned implementation mode can be specifically interpreted as "based on the second identification pseudo-label set”.
  • the supervised training process based on labeled data and pseudo-labeled data can be included to improve the generalization recognition ability of the model and reduce the demand for labeled data.
  • any of the above loss functions can be configured as a cross entropy loss function, or a combination of a cross entropy loss function and an intersection-over-union loss function.
  • the latter combination scheme can be used to configure the loss function, and in the case where the stability and certainty of the training process are given priority, the former single scheme can be used to configure the loss function.
  • the present invention provides a preferred solution to configure the loss function type according to the effects of the above-mentioned different loss functions.
  • the first supervised loss function is configured as the sum of the first supervised cross entropy loss function and the first supervised intersection-over-union loss function.
  • the first supervised cross entropy loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification probability
  • the first supervised intersection-over-union loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification category.
  • the known label data may be label data such as a mask in the labeled sample image set.
  • the inference classification probability corresponding to the known label data may be the inference classification probability of all pixels in the labeled sample image by the first neural network model.
  • the inference classification category corresponding to the known label data may be the inference classification category of all pixels in the labeled sample image by the first neural network model.
  • the first pseudo label loss function is configured to include a first pseudo label cross entropy loss function.
  • the invention relates to a method for characterizing the gap between the inference classification probability of the first neural network model for the sample image set and the inference classification category of the second neural network model for the sample image set.
  • the first pseudo-label cross entropy loss function can characterize the gap between the inferred classification probability of all pixels in the unlabeled sample images by the first neural network model and the inferred classification category of all pixels in the unlabeled sample images by the second neural network model.
  • the second supervised loss function is configured as the sum of a second supervised cross entropy loss function and a second supervised intersection-over-union loss function.
  • the second supervised cross entropy loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification probability.
  • the second supervised intersection-over-union loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification category.
  • the inference classification probability corresponding to the known label data may be the inference classification probability of the second neural network model for all pixels in the labeled sample image.
  • the inference classification category corresponding to the known label data may be the inference classification category of the second neural network model for all pixels in the labeled sample image.
  • the second pseudo-label loss function includes a second pseudo-label cross entropy loss function.
  • the second pseudo-label cross entropy loss function represents the difference between the inference classification probability of the second neural network model for the sample image set and the inference classification category of the first neural network model for the sample image set.
  • the second pseudo-label cross entropy loss function can represent the difference between the inference classification probability of all pixels in the unlabeled sample image by the second neural network model and the inference classification category of all pixels in the unlabeled sample image by the first neural network model.
  • the known label data corresponding to the labeled sample image (which may be the lesion annotation mask corresponding to the image, or the classification coding label corresponding to each pixel on the mask) as label L ; define the inference classification probability of all pixels in the labeled sample image by the first neural network model as out_prob_1 L , the inference classification category of all pixels in the labeled sample image by the first neural network model as out_class_1 L , the inference classification probability of all pixels in the unlabeled sample image by the first neural network model as out_prob_1 U , and the inference classification category of all pixels in the unlabeled sample image by the first neural network model as pseudo_label_1 U (that is, the first recognition pseudo label set); define the inference classification probability of all pixels in the labeled sample image by the second neural network model as out_prob_2 L , the inference classification category of all pixels in the labeled sample image by the first neural network model as out_class_2 L , the inference classification probability of
  • supervised_loss_1 ce_loss(out_prob_1 L ,label L )+dice_loss(out_class_1 L ,label L );
  • ce_loss(out_prob_1 L ,label L ) is the first supervised cross entropy loss function
  • dice_loss(out_class_1 L ,label L ) is the first supervised intersection-over-union loss function
  • pseudo_loss_1 ce_loss(out_prob_1 U ,pseu_label_2 U );
  • ce_loss(out_prob_1 U ,pseudo_label_2 U ) is the first pseudo-label cross entropy loss function.
  • the second supervised loss function at least satisfies:
  • supervised_loss_2 ce_loss(out_prob_2 L ,label L )+dice_loss(out_class_2 L ,label L );
  • ce_loss(out_prob_2 L ,label L ) is the second supervised cross entropy loss function
  • dice_loss(out_class_2 L ,label L ) is the second supervised intersection-over-union loss function
  • pseudo_loss_2 ce_loss(out_prob_2 U ,pseu_label_1 U );
  • ce_loss(out_prob_1 U ,pseudo_label_2 U ) is the second pseudo-label cross entropy loss function.
  • the sample images in the sample image set characterize the intraepithelial neoplasia and intestinal metaplasia.
  • the first supervised cross entropy loss function, the first pseudo-label cross entropy loss function, the second supervised cross entropy loss function and the second pseudo-label cross entropy loss function point to the background area, the intraepithelial neoplasia area and the intestinal metaplasia area in the sample image, that is, they are configured as a three-class average cross entropy loss (cross-entropy loss) function.
  • the first supervised intersection-of-union loss function and the second supervised intersection-of-union loss function point to the intraepithelial neoplasia area and the intestinal metaplasia area in the sample image, that is, they are configured as a two-class average intersection-of-union loss (dice loss) function.
  • the weight of the first pseudo-label loss function in the first loss function, and the weight of the second pseudo-label loss function in the second loss function it is preferred to configure them to have equal preset weight values, so as to enhance the consistency of model evaluation under the two training directions.
  • the preset weight value can be configured to increase with the increase in the number of training iterations, that is, the two are configured to be positively correlated. In this way, the confidence in the pseudo-label loss function is gradually improved, so that the model training process gradually tends to be stable.
  • the present invention does not exclude the technical solution of configuring the preset weight value as a fixed value, so that the degree of participation of the pseudo-label loss function in the model evaluation process can be kept within a stable range.
  • the present invention provides a preferred configuration mode, wherein the preset weight value is configured to be equal to the product of the maximum weight value and a preset increasing function, and the preset increasing function is configured so that the function value infinitely approaches 1.
  • the preset increasing function is configured to increase smoothly from 0 and infinitely approaches 1 with a smaller slope.
  • the Euler number can be used as the base to construct an exponential function that changes with the number of iterations, thereby realizing the above configuration.
  • the maximum weight value as ⁇ max
  • the current number of iterations is n
  • the preset weight value at least satisfies:
  • the symbol "//" represents the integer division downwards, and is used to return the integer part of the integer division result. Based on the above configuration, the preset weight value can have a more gentle change trend.
  • the maximum weight value ⁇ max is preferably 0.1.
  • the present invention can also use a linear function as the above-mentioned preset increasing function, define the current number of iterations as n, and the total number of iterations as max_iter, then the preset weight value at least satisfies:
  • the first 80% of the training steps can be configured incrementally for the preset weight values, and the last 20% can keep the preset weight values unchanged.
  • the present invention may also include a supplementary step after step 24: loading the first model training parameters to initialize the first neural network model, and/or loading the second model training parameters to initialize the second neural network model to obtain a pathological image recognition model.
  • termination condition of the above iterative training process can be specifically configured to stop when the loss function is reduced and stabilized within a preset range.
  • the reasoning test process of the pathological image recognition model training method provided by the present invention can be performed on a separate verification set, and is configured to verify the trained neural network model after completing each round of training, so as to obtain the loss function index corresponding to the above, so as to select the optimal node (that is, the model training parameters described above). It can be seen that the pathological image recognition model training method provided by the present invention is not only included in the iterative process on the training set, but also includes the process of model evaluation and selection on the verification set.
  • the total number of iterations is defined as epoch, and the total number of iterations max_iter can correspond to the product of the total number of iterations epoch and the number of iterations required to traverse all the data in the sample image set.
  • the present invention does not limit the step 21 to include other pre-steps.
  • a generation process of the sample image set is provided, and a reference pathological image set with different morphological characteristics is standardized and grouped into a training set and a validation set, so as to facilitate the subsequent training process.
  • the other embodiment specifically includes the following steps.
  • Step 31 Receive a reference pathology image set.
  • Step 32 performing size standardization processing and color migration standardization processing on the reference pathology image set in sequence, and calculating to obtain a standard pathology image set.
  • the standard pathology image set includes a labeled pathology image set and an unlabeled pathology image set.
  • Step 33 grouping the annotated pathological image sets, combining the first annotated image set with the unannotated pathological image set to form a sample image training set, and forming a sample image verification set based on the second annotated image set.
  • Step 34 Generate a sample image set based on the sample image training set and the sample image verification set.
  • Step 21 Receive a sample image set.
  • Step 22 according to the sample image set, call the first neural network model to perform supervised training and traversal reasoning in sequence, and call the second neural network model to perform supervised training based on the reasoning result to calculate the first loss function.
  • Step 23 according to the sample image set, call the second neural network model to perform supervised training and traversal reasoning in sequence, and call the first neural network model to perform supervised training based on the reasoning result to calculate the second loss function.
  • Step 24 iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
  • each group of images or image data in the reference pathological image set can be processed into images or image data with uniform size and staining conditions, avoiding the influence of external factors such as staining on the accuracy of subsequent model training process and model training parameters.
  • the sample image training set is configured to include both annotated pathological images and unannotated pathological images, which can adapt to the special configuration of the subsequent training process and reduce the demand for annotated pathological images.
  • the reference pathological images in the reference pathological image set can be interpreted as a reference image set that at least contains some labeled specimen images.
  • the reference image set is used to generate the sample image set and is put into model training. Based on the fact that the sample image set includes a sample image training set and a sample image verification set, any of the steps mentioned above regarding iterative training on the training set can be configured to be performed on the sample image training set, and any of the steps regarding evaluation and selection on the verification set can be configured to be performed on the sample image verification set, which is not described in detail in the present invention.
  • the present invention provides a first embodiment based on the above another embodiment, wherein the reference pathology image set is configured to be generated by selectively annotating pixels according to different types of lesion specimen images, and the multiple images thus formed are respectively standardized to obtain different components of the standard pathology image set.
  • the first embodiment specifically includes the following steps.
  • Step 301 receiving a precancerous lesion specimen image and a non-precancerous lesion specimen image.
  • Step 302 pixel-annotate some precancerous lesion specimen images to obtain lesion annotation masks.
  • Step 303 generating a reference pathology image set according to the precancerous lesion specimen image, the corresponding lesion annotation mask, and the non-precancerous lesion specimen image.
  • Step 31 Receive a reference pathology image set.
  • Step 32 performing size standardization and color migration standardization on the reference pathology image set in sequence, and calculating to obtain a standard pathology image set.
  • the step 32 specifically includes:
  • Step 321 performing size standardization processing and color migration standardization processing on all labeled lesion specimen images in sequence, and obtaining a set of labeled pathology images based on the processed labeled lesion specimen images; wherein the labeled lesion specimen images correspond to precancerous lesion specimen images with corresponding lesion annotation masks;
  • Step 322 size normalization processing and color migration normalization processing are performed on all unlabeled lesion specimen images and all non-precancerous lesion specimen images in sequence, and a set of unlabeled pathological images is obtained by calculation based on the processed unlabeled lesion specimen images and non-precancerous lesion specimen images; wherein the unlabeled lesion specimen images correspond to precancerous lesion specimen images without corresponding lesion annotation masks.
  • Step 33 grouping the annotated pathological image sets, combining the first annotated image set with the unannotated pathological image set to form a sample image training set, and forming a sample image verification set based on the second annotated image set.
  • Step 34 Generate a sample image set based on the sample image training set and the sample image verification set.
  • Step 21 Receive a sample image set.
  • Step 22 according to the sample image set, call the first neural network model to perform supervised training and traversal reasoning in sequence, and call the second neural network model to perform supervised training based on the reasoning result to calculate the first loss function.
  • Step 23 based on the sample image set, call the second neural network model to perform supervised training and traversal reasoning in sequence, and call the first neural network
  • the network model is supervisedly trained based on the inference results, and the second loss function is calculated.
  • Step 24 iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
  • the precancerous lesion specimen image can be interpreted as: a specimen image with intraepithelial neoplasia or intestinal metaplasia.
  • the non-precancerous lesion specimen image can be correspondingly interpreted as: a specimen image that does not contain the above-mentioned phenomenon.
  • the configuration of the number or amount of data of the above-mentioned images or image data can be specifically: the number of the labeled lesion specimen images accounts for 30% of the number of all precancerous lesion specimen images. Compared with the 100% required for fully supervised training, it can greatly reduce costs, improve efficiency and utilization of labeled data. In addition, the number of all non-precancerous lesion specimen images accounts for 20% of the number of all precancerous lesion specimen images, which can enhance the generalization recognition ability of the model.
  • step 32 specifically includes the steps of: performing sliding window region segmentation on the reference pathological image that has completed the size standardization processing and color migration standardization processing, and obtaining and calculating a standard pathological image set based on multiple groups of sliding window region image groups.
  • the reference pathological image can be cut into a size suitable for model input, thereby facilitating the traversal and iterative training of the model.
  • the sliding window region images in the sliding window region image group have a size of 256*256.
  • the step size for performing sliding window region segmentation can be any pixel size between 0.25 and 0.5 times of any side of the sliding window region image, for example, 128 pixels. Thus, a 50% overlap is formed during the traversal process, so that various edge features are effectively covered.
  • the “sliding window region segmentation” may include:
  • Step 3211 constructing an image area sliding window of a preset size, and making the image area sliding window perform traversal segmentation on the annotated standardized image and the corresponding lesion annotated mask according to a preset step length, to obtain multiple groups of annotated sliding window image groups and annotated sliding window mask groups;
  • Step 3212 traverse, analyze and filter and update the labeled sliding window image and the corresponding labeled sliding window mask according to the proportion of the lesion area of all labeled sliding window masks in the labeled sliding window mask group;
  • Step 3221 causing the image region sliding window to perform traversal segmentation on the unlabeled standardized image and the non-lesion standardized image according to a preset step length, to obtain multiple groups of unlabeled sliding window image groups and non-lesion sliding window image groups;
  • Step 3222 traverse, analyze and filter and update the unlabeled sliding window images and the non-lesion sliding window images according to the tissue area ratio of the unlabeled sliding window images and the non-lesion sliding window images.
  • the annotated standardized image is an annotated lesion specimen image after standardization.
  • the unannotated standardized image is an unannotated lesion specimen image after standardization.
  • the non-lesion standardized image is a non-precancerous lesion specimen image after standardization.
  • the sliding window area image in the above sliding window area image group can be an RGB image. Therefore, the data type input into the neural network model for iteration can be an RGB matrix corresponding to the RGB image, and specifically can be a multi-channel RGB matrix of (256, 256, T).
  • the blue color pointed to by the RGB value (0, 0, 255) can be used to represent the background
  • the red color pointed to by the RGB value (255, 0, 0) can be used to represent the intraepithelial neoplasia
  • the green color pointed to by the RGB value (0, 255, 0) can be used to represent the intestinal metaplasia.
  • the above specimen image can be specifically made by a unified staining method (for example, Hematoxylin-Hosin Staining) and saved in a unified format (for example, svs format or kfb format, etc.).
  • the corresponding generated annotation sliding window mask can be configured as a PNG (Portable Network Graphics) file.
  • the way of annotation can be specifically annotated by tools such as ASAP (Automated Slide Analysis Platform) or labelme.
  • the process of updating and screening the annotated sliding window image and the corresponding annotated sliding window mask can be specifically configured to screen according to the coverage of the lesion site in the central area, and screen and retain the annotated sliding window image and the annotated sliding window mask with a coverage higher than a preset percentage.
  • the sliding window image size is 256*256
  • an area of 64*64 pixels in size at the center position of the annotated sliding window mask can be intercepted.
  • the coverage area of any lesion is greater than or equal to one-third of the area, the annotated sliding window image and the annotated sliding window mask corresponding to the area are retained.
  • Any of the lesions can be interpreted as one of intraepithelial neoplasia or intestinal metaplasia. In this way, the amount of data processing in the screening and updating process can be reduced, and the central area that can better summarize the content of the annotated sliding window image can be selected for analysis, thereby speeding up the overall work efficiency.
  • the process of updating and screening the unlabeled sliding window images and the non-lesion sliding window images can be specifically configured to be performed according to the overall tissue area ratio, and the unlabeled sliding window images and the non-lesion sliding window images whose resistance area ratio is higher than a preset percentage are screened and retained.
  • the area with a lower grayscale value (such as a grayscale value lower than 210) is calculated as the tissue area, and the proportion of the area in the overall image is calculated and compared with a preset 30% or other value. If it is greater than 30%, it is retained.
  • the unlabeled sliding window image and the non-lesion sliding window image can be set as a background color (for example, blue) as a whole.
  • the above-mentioned data can also be augmented to further enhance the generalization recognition ability of the model.
  • the step 3212 may include step 3213: performing random data augmentation processing on the annotated sliding window image and the corresponding annotated sliding window mask to obtain a set of annotated pathology images.
  • the step 3222 may include step 3223: performing random data augmentation processing on the unannotated sliding window image and the non-lesion sliding window image to obtain a set of unannotated pathology images.
  • the "random data augmentation” may include the steps of: performing at least one of horizontal flipping, vertical flipping, rotation at a preset angle, and transposition on the image matrix according to a preset probability.
  • the preset probability is preferably 50%.
  • the preset angle is preferably 90°.
  • the content used to annotate pixels thereon can be specifically configured in the form of a unique hot coding label.
  • the lesion annotation mask includes a unique hot coding label corresponding to each pixel in the precancerous lesion specimen image.
  • the unique hot coding label includes a first coding bit, a second coding bit, and a third coding bit that respectively characterize the background judgment label, the intraepithelial neoplasia judgment label, and the intestinal metaplasia judgment label.
  • the unique hot coding label corresponding to a certain pixel is (0, 0, 1)
  • it represents that the pixel belongs to the background part if it is (1, 0, 0), it represents that the pixel belongs to the intraepithelial neoplasia part, and if it is (0, 1, 0), it represents that the pixel belongs to the intestinal metaplasia part.
  • the above-mentioned one-hot encoding label can be interpreted as obtained after normalization of the RGB image or RGB matrix. Based on this, the corresponding position of the present invention can also include a step of normalizing the lesion annotation mask or the annotation sliding window mask.
  • the present invention provides the following preferred scheme in another embodiment.
  • the size normalization process can be specifically configured to adjust the magnification of the reference pathology image, that is, the step 32 and its derivative steps can specifically include the steps of: performing size normalization on the reference pathology image set, unifying all reference pathology images to a preset magnification.
  • the preset magnification is 10 times
  • the initial magnification of the reference pathology image may be 5 times, 10 times, 20 times or 40 times.
  • the downsampling interpolation method may use the nearest neighbor interpolation method.
  • the color migration standardization process may include the refinement steps shown in FIG. 7 , that is, step 32 in FIG. 4 and its derivative steps, which may specifically include the following steps.
  • Step 41 receiving a reference dyeing image, performing color space conversion on it, and calculating a reference dyeing vector matrix.
  • Step 42 Receive a reference pathological image, perform color space conversion on it, and calculate a reference color density matrix.
  • Step 43 Generate a color migration image corresponding to the reference pathological image according to the reference staining vector matrix and the reference color density matrix.
  • the above step 41 may specifically include the following steps shown in FIG. 8 .
  • Step 411 receiving a reference staining image, performing optical density matrix conversion processing, and obtaining a reference optical density matrix.
  • Step 412 performing singular value decomposition on the reference optical density matrix, selecting the first singular extremum and the second singular extremum to create a projection plane.
  • Step 413 determine at least one reference singular value and its reference plane axis on the projection plane, project the reference optical density matrix onto the projection plane, fit the connecting lines of all numerical points on the projected reference optical density matrix and the origin of the projection plane, calculate the angle between the connecting line and the reference plane axis, find the maximum value among all the angles, and obtain the maximum angle data.
  • Step 414 calculate the optical density matrix corresponding to the maximum angle data, and perform a normalization operation on the optical density matrix to obtain a reference staining vector matrix.
  • the reference staining image formed by the hematoxylin-eosin staining method can be separated on the staining level with high efficiency, and the reference staining vector matrix representing the staining degree can be extracted, so as to be directly replaced in the subsequent steps to achieve the effect of color migration.
  • the reference staining image can be interpreted as a reference pathological image with better staining quality. Therefore, it can be used as a benchmark to perform color migration standardization processing on other reference pathological images.
  • the optical density matrix conversion processing can be interpreted as: converting the reference staining image in the RGB color domain into The optical density matrix is converted to a reference optical density matrix in the OD (Optical Density) optical density domain. In this process, the process of removing pixels whose optical density values are less than a preset optical density threshold value may also be included.
  • the singular value decomposition can be interpreted as: decomposing the reference optical density matrix into a unitary matrix U, an eigenvalue square root ⁇ and the transposed product of another unitary matrix V. Based on this, the present invention uses the eigenvalue square root ⁇ to establish a projection plane, and specifically, uses the more typical eigenvalues therein to characterize the staining tendency of the two dyes, thereby extracting the reference staining vector matrix. At this time, the two largest vectors in the singular value vector, that is, the first singular extreme value and the second singular extreme value, can be used as a reference for calculating the more typical eigenvalue.
  • the “projecting the reference optical density matrix onto the projection plane” may also include: normalizing the projected values. Calculating the angle extreme value thereafter can simplify the operation steps and reduce errors to a certain extent.
  • the “at least one reference singular value” may be any singular value on the projection plane, preferably one of the first singular extreme value and the second singular extreme value, and the “reference plane axis on the projection plane” may correspond to the number axis formed by the first singular extreme value on the projection plane or the number axis formed by the second singular extreme value on the projection plane.
  • the final generated reference staining vector matrix records the staining tendency of the reference staining image and removes other tissue region contents.
  • the vector elements in the reference staining vector matrix reflect the staining degree of the two staining agents, hematoxylin and eosin.
  • the above step 42 may specifically include the following steps shown in FIG. 8 .
  • Step 421 receiving a reference pathological image, and sequentially performing optical density matrix conversion, singular value decomposition, plane projection, and maximum angle data acquisition on it, to calculate a reference optical density matrix and a reference staining vector matrix corresponding to the reference pathological image.
  • Step 422 Calculate a reference color density matrix corresponding to the reference pathological image based on the reference staining vector matrix and the reference optical density matrix.
  • step 421 The parts of "optical density matrix conversion”, “singular value decomposition”, “plane projection” and “maximum angle data acquisition” in step 421 can be replaced by implementing the technical solutions and related explanations of the above steps 411 to 414, which will not be repeated here.
  • C source is the reference color density matrix of the reference staining image
  • S source is the reference staining vector matrix of the reference staining image.
  • the reference staining vector matrix can be extracted, and after step 422, the reference color density matrix can be calculated according to the above-mentioned operation relationship.
  • an inverse transformation relative to the color space conversion of step 41 is performed to restore the optical density matrix after color migration to the RGB color domain, and finally the color migration image is obtained.
  • FIG9 shows the conversion process of related images or image data when executing one of the better implementations.
  • the labeled lesion specimen image and the unlabeled lesion specimen image are correspondingly formed through the lesion area marking.
  • the labeled lesion specimen image also includes a corresponding lesion annotation mask.
  • the labeled lesion specimen image is processed by size standardization, color migration standardization, etc. to generate the labeled standardized image, and further subjected to sliding window area segmentation to generate the labeled sliding window image group.
  • the lesion annotation mask also undergoes the above corresponding steps to finally generate a labeled sliding window mask group corresponding to the labeled sliding window image group, and the two together constitute the labeled pathological image set.
  • the labeled pathological image set can be divided into a first labeled image set (or, labeled sample image set) and a second labeled image set, the former participating in the composition of the sample image training set, and the latter participating in the evaluation and selection link of the model as the sample image verification set.
  • the unlabeled lesion specimen image generated based on the precancerous lesion specimen image is processed by size standardization, color migration standardization, etc. to generate the unlabeled standardized image, and further processed by sliding window area segmentation to generate the unlabeled sliding window image group.
  • the non-lesion standardized image is generated after size standardization, color migration standardization, etc., and further processed by sliding window area segmentation to generate the non-lesion sliding window image group.
  • the unlabeled sliding window image group and the non-lesion sliding window image group together constitute the unlabeled pathology image set (or, unlabeled sample image set), thereby, together with the first labeled image set, constituting the sample image training set.
  • an embodiment of the present invention provides a pathological image recognition system and a pathological image recognition method as shown in FIG10 .
  • the present invention first provides a storage medium, which can have a corresponding pathological image recognition model training method.
  • the configuration scheme of the pathological image recognition system can be the same or similar to that of the pathological image recognition model training system, and even the application programs of the pathological image recognition method and the pathological image recognition model training method can be set in the same storage medium.
  • the configuration scheme of the pathological image recognition system can also have the same or similar configuration scheme as that of the pathological image recognition model training system, which will not be repeated here.
  • the pathological image recognition method provided in one embodiment of the present invention can also be installed in the above storage medium and/or the above pathological image recognition system.
  • the pathological image recognition method specifically includes the following steps.
  • Step 51 executing a pathological image recognition model training method to obtain at least one of a first model training parameter and a second model training parameter.
  • Step 52 load the model training parameters into the corresponding neural network model to build a pathological image recognition model.
  • Step 53 receiving the pathological image data to be tested and preprocessing it, inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction, and obtaining pathological recognition data.
  • the pathological image recognition model training method can be the model training method provided by any of the above-mentioned implementation modes, embodiments or specific examples. Those skilled in the art can refer to the above-mentioned description and generate a variety of derived implementation modes based on steps 51 to 53, which will not be repeated here.
  • the corresponding neural network model can be interpreted as: a neural network model corresponding to at least one of the first model training parameters and the second model training parameters.
  • the neural network model can be the first neural network model, then the first model training parameters obtained by training are loaded into the first neural network model to construct a pathological image recognition model.
  • the neural network model is the second neural network model.
  • the pathological image recognition model can also be configured to include a parallel first neural network model and a second neural network model at the same time.
  • the pathological image data to be tested may have a format and content configuration similar to that of the sample images in the sample image set, and may especially have a form similar to that of the unlabeled sample images in the unlabeled sample image set, which will not be described in detail here.
  • Step 53 in the first embodiment may specifically include the following steps.
  • Step 531 performing size standardization processing and color migration standardization processing on the pathological image data to be tested in sequence, and obtaining a set of pathological images to be tested by calculation.
  • Step 532 input the pathological image set to be tested into the pathological image recognition model for traversal prediction to obtain the pathological recognition pixel area.
  • Step 533 superimposing the pathology recognition pixel area on the pathology image to be detected to form a pathology judgment image.
  • the size standardization processing and the color migration standardization processing can refer to the technical solution provided above, and preferably adjust the size magnification ratio of the pathological image to be tested or its data, and unify the staining style tendency, so as to achieve the effect of improving the prediction accuracy.
  • the pathology identification pixel area can be interpreted as: the distribution of judgment results corresponding to each pixel on the pathology image to be tested.
  • the pathology identification pixel area can specifically include a background identification pixel area, an intraepithelial neoplasia identification pixel area and an intestinal metaplasia pixel area, and each pixel has a background judgment annotation, an intraepithelial neoplasia judgment annotation and an intestinal metaplasia judgment annotation in sequence.
  • the pathology identification pixel area can be expressed in the form of a mask similar to the lesion annotation mask, an image corresponding to the pathology image to be tested, or a data group that simply points to certain specific areas on the pathology image to be tested.
  • a pathology judgment image is generated, it is not limited to the pathology judgment image as the pathology identification data, and it can be presented as intermediate data.
  • the setting of step 533 can also be cancelled and replaced by other technical solutions.
  • segmentation and screening can also be performed on the pathological image data to be tested that has completed the standardization process, so as to obtain the pathological image set to be tested as the input of the neural network model.
  • the "obtaining the pathological image set to be tested by calculation” can specifically include the steps of: performing sliding window area segmentation on the pathological image data to be tested that has completed the size standardization process and the color migration standardization process, and screening the pathological image set to be tested according to the proportion of low gray value areas in the sliding window image to be tested.
  • the screening rules can refer to the technical solution for screening and updating unlabeled sliding window images and non-lesion sliding window images in the previous text.
  • the present invention does not exclude the difference from the technical solution provided above in the above-mentioned features.
  • the resulting technical solution should also be considered to fall within the scope protected by the present invention.
  • the step length for performing sliding window region segmentation can be configured to be equal to the side length of the image region sliding window, and preferably 256 pixels.
  • the pathological identification data in the first embodiment can be specifically configured to include precancerous lesion determination information. Based on this, the step 53 can further include the following steps.
  • Step 534 arrange the pixel values pointing to intraepithelial neoplasia and intestinal metaplasia in the pathological identification pixel area in descending order, calculate the average value of pixels within a preset number range, obtain a first average value and a second average value, and determine the numerical relationship between the first average value and the second average value and the preset precancerous lesion determination threshold.
  • Step 535 if one of the first average value and the second average value is greater than the precancerous lesion determination threshold, it is determined that a precancerous lesion occurs at the position represented by the pathological image to be detected corresponding to the pathological identification pixel area, and precancerous lesion determination information is output.
  • the precancerous lesion determination threshold is 0.5, and the preset number range is within 10,000 pixels or within 15,000 pixels.
  • the present invention also implicitly includes the step of: if both the first average value and the second average value are not greater than the precancerous lesion determination threshold, then the pathological recognition image is determined to be No precancerous lesions occur at the position represented by the pathological image to be tested corresponding to the element area, and precancerous lesion determination information is output.
  • the pathological image recognition model training method constructs two parallel learning models, the first neural network model and the second neural network model, and uses the two sets of loss functions generated to train and optimize the models in comparison, thereby making full use of limited image data for training and making the performance of the neural network model more stable; using a sample image set to sequentially train the previous model to the next model, and using a sample image set to sequentially train the next model to the previous model, combined with general supervised training and pseudo-label-based supervised training, it can reduce the dependence on scarce data types such as labeled data, and implicitly treat unlabeled data as labeled data to participate in the model training process, thereby greatly improving the performance of the trained model, reducing costs and increasing training speed.
  • the pathological image recognition method constructed by the pathological image recognition model (or model training data) generated based on the above training process can naturally take into account the advantages of high generalization recognition rate, low dependence on scarce data, as well as high cost and low performance.

Landscapes

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

Abstract

Disclosed in the present invention are a pathological image recognition method, a pathological image recognition model training method and system therefor, and a storage medium. The model training method comprises: receiving a sample image set; calling a first neural network model to perform traversal reasoning, calling a second neural network model to perform supervised training on the basis of a reasoning result, and calculating a first loss function; calling the second neural network model to perform traversal reasoning, calling the first neural network model to perform supervised training on the basis of a reasoning result, and calculating a second loss function; and performing iterative training according to the first loss function and the second loss function to obtain at least one of a first model training parameter and a second model training parameter. The model training method provided by the present invention can reduce the dependence on limited data, and enhance the stability and performance of models.

Description

病理图像识别方法及其模型训练方法、系统和存储介质Pathological image recognition method and model training method, system and storage medium thereof
本申请要求了申请日为2022年10月18日,申请号为202211272240.8,发明名称为“病理图像识别方法及其模型训练方法、系统和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application filed on October 18, 2022, with application number 202211272240.8, and invention name “Pathological image recognition method and model training method, system and storage medium thereof”, the entire contents of which are incorporated by reference into this application.
技术领域Technical Field
本发明涉及图像处理技术领域,尤其涉及一种病理图像识别方法及其模型训练方法、系统和存储介质。The present invention relates to the field of image processing technology, and in particular to a pathological image recognition method and a model training method, system and storage medium thereof.
背景技术Background technique
如何高效准确地分析病理影像数据,特别是分析消化道恶性肿瘤的病理图像数据,一直是医学领域备受关注的课题。当前,人工智能在病理影像分析方面的应用,大致可以分为定性诊断和病变识别两个大方向。由于计算机负载能力限制,建模思路通常为基于有监督学习(Supervised Learning)模型框架实现。此种情况下,模型算法的训练优化需要大量而丰富的标注数据;如要准确分割预测出目标病灶区域,则需要临床专业人员对训练数据标本图像进行像素级别的精细标注,也即需要投入大量的人力和时间成本。由此,人工智能和深度学习技术在病理影像数据分析上的应用受阻,特别是在对消化系统中已经产生的病灶进行识别、对消化系统癌前病变进行识别和预警等场景下,现有技术很难搭建得到合适的模型并快速输出运算结果。How to efficiently and accurately analyze pathological image data, especially the pathological image data of digestive tract malignant tumors, has always been a topic of great concern in the medical field. At present, the application of artificial intelligence in pathological image analysis can be roughly divided into two major directions: qualitative diagnosis and lesion identification. Due to the limitation of computer load capacity, the modeling idea is usually implemented based on the supervised learning model framework. In this case, the training and optimization of the model algorithm requires a large amount of rich labeled data; if the target lesion area is to be accurately segmented and predicted, clinical professionals are required to perform pixel-level fine annotation of the training data specimen image, which requires a lot of manpower and time costs. As a result, the application of artificial intelligence and deep learning technology in pathological image data analysis is hindered, especially in the scenarios of identifying lesions that have already occurred in the digestive system, identifying and warning precancerous lesions in the digestive system, etc., it is difficult for existing technologies to build a suitable model and quickly output the calculation results.
此外,现有技术中对于耗费高成本建立的多组有标记数据,通常只令其参与一轮模型的迭代训练过程,然而为了提升模型训练的准确度,又不得不将模型训练的迭代次数提高,导致单组有标记数据对模型训练过程的贡献和影响力弱,模型的素质有限,此时,为了提高模型素质,又需要工作者再次向模型输送有标记数据,造成了恶性循环。In addition, in the prior art, multiple sets of labeled data that are costly to establish are usually only used in one round of iterative training of the model. However, in order to improve the accuracy of model training, the number of iterations of model training has to be increased, resulting in a single set of labeled data having a weak contribution and influence on the model training process and limited model quality. At this time, in order to improve the quality of the model, workers are required to feed labeled data to the model again, creating a vicious cycle.
发明内容Summary of the invention
本发明的目的之一在于提供一种病理图像识别模型训练方法,以解决现有技术中模型训练对用于进行有监督训练的有标记数据的依赖性过高,对其使用率低下,无法充分利用数据进行训练、训练效果差、成本高的技术问题。One of the purposes of the present invention is to provide a pathological image recognition model training method to solve the technical problems in the prior art that model training is too dependent on labeled data for supervised training, has low utilization rate, cannot fully utilize data for training, has poor training effect and high cost.
本发明的目的之一在于提供一种病理图像识别模型训练系统。One of the purposes of the present invention is to provide a pathological image recognition model training system.
本发明的目的之一在于提供一种存储介质。One of the objectives of the present invention is to provide a storage medium.
本发明的目的之一在于提供一种病理图像识别方法。One of the objectives of the present invention is to provide a pathological image recognition method.
为实现上述发明目的之一,本发明一实施方式提供一种病理图像识别模型训练方法,所述方法包括:接收样本图像集合;根据所述样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数;根据所述样本图像集合,调用所述第二神经网络模型依次执行有监督训练和遍历推理,并调用所述第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数;根据所述第一损失函数和所述第二损失函数对所述第一神经网络模型和所述第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention provides a pathological image recognition model training method, the method comprising: receiving a sample image set; based on the sample image set, calling a first neural network model to perform supervised training and traversal reasoning in sequence, and calling a second neural network model to perform supervised training based on the reasoning result, and calculating a first loss function; based on the sample image set, calling the second neural network model to perform supervised training and traversal reasoning in sequence, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating a second loss function; iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
作为本发明一实施方式的进一步改进,所述样本图像集合包括有标注样本图像集合和无标注样本图像集合。As a further improvement of an embodiment of the present invention, the sample image set includes a labeled sample image set and an unlabeled sample image set.
作为本发明一实施方式的进一步改进,所述“根据所述样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数”具体包括:根据所述有标注样本图像集合,调用所述第一神经网络模型执行有监督训练后,根据所述无标注样本图像集合,调用所述第一神经网络模型执行遍历推理,得到对应于所述无标注样本图像集合的第一识别伪标签集合;根据所述无标注样本图像集合和所述第一识别伪标签集合,调用所述第二神经网络模型执行有监督训练,并计算得到所述第一损失函数;所述“根据所述样本图像集合,调用所述第二神经网络模型依次执行有监督训练和遍历推理,并调用所述第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数”具体包括:根据所述有标注样本图像集合,调用所述第二神经网络模型执行有监督训练后,根据所述无标注样本图像集合,调用所述第二神经网络模型执行遍历推理,得到对应于所述无标注样本图像集合的第二识别伪标签集合;根据所述无标注样本图像集合和所述第二识别伪标签集合,调用所述第一神经网络模型执行有监督训练,并计算得到所述第二损失函数。As a further improvement of an embodiment of the present invention, the "calling the first neural network model to perform supervised training and traversal reasoning in sequence according to the sample image set, and calling the second neural network model to perform supervised training based on the reasoning result to calculate the first loss function" specifically includes: calling the first neural network model to perform supervised training according to the labeled sample image set, and then calling the first neural network model to perform traversal reasoning according to the unlabeled sample image set to obtain a first recognition pseudo-label set corresponding to the unlabeled sample image set; calling the second neural network model to perform supervised training according to the unlabeled sample image set and the first recognition pseudo-label set, and calculating the The first loss function; the "according to the sample image set, calling the second neural network model to perform supervised training and traversal reasoning in sequence, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating the second loss function" specifically includes: according to the labeled sample image set, calling the second neural network model to perform supervised training, and then according to the unlabeled sample image set, calling the second neural network model to perform traversal reasoning to obtain a second recognition pseudo-label set corresponding to the unlabeled sample image set; according to the unlabeled sample image set and the second recognition pseudo-label set, calling the first neural network model to perform supervised training, and calculating the second loss function.
作为本发明一实施方式的进一步改进,在所述“接收样本图像集合”之前,所述方法还包括:接收参考病理图像集合;对所述参考病理图像集合依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到标准病理图像集合;其中,所述标准病理图像集合包括有标注病理图像集合和无标注病理图像集合;对所述有标注病理图像集合进行分组,将第一有标注图像集合与所述无标注病理图像集合组合构成样本图像训练集,并根据第二有标注图像集合形成样本图像验证集;根据所述样本图像训练集和所述样本图像验证集,生成所述样本图像集合。 As a further improvement of an embodiment of the present invention, before the "receiving the sample image set", the method also includes: receiving a reference pathology image set; performing size normalization processing and color migration normalization processing on the reference pathology image set in sequence, and calculating to obtain a standard pathology image set; wherein the standard pathology image set includes a labeled pathology image set and an unlabeled pathology image set; grouping the labeled pathology image set, combining the first labeled image set with the unlabeled pathology image set to form a sample image training set, and forming a sample image verification set based on the second labeled image set; generating the sample image set based on the sample image training set and the sample image verification set.
作为本发明一实施方式的进一步改进,在所述“接收参考病理图像集合”之前,所述方法具体包括:接收癌前病变标本图像和非癌前病变标本图像;对部分癌前病变标本图像进行像素标注,得到病变标注掩膜;根据所述癌前病变标本图像、对应的病变标注掩膜,以及所述非癌前病变标本图像,生成所述参考病理图像集合;所述“对所述参考病理图像集合依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到标准病理图像集合”具体包括:对所有标注病变标本图像依次执行尺寸标准化处理和颜色迁移标准化处理,并根据处理后的标注病变标本图像,运算得到所述有标注病理图像集合;其中,所述标注病变标本图像对应于具有对应病变标注掩膜的癌前病变标本图像;对所有无标注病变标本图像和所有非癌前病变标本图像,依次执行尺寸标准化处理和颜色迁移标准化处理,并根据处理后的无标注病变标本图像和非癌前病变标本图像,运算得到所述无标注病理图像集合;其中,所述无标注病变标本图像对应于不具有对应病变标注掩膜的癌前病变标本图像。As a further improvement of an embodiment of the present invention, before the “receiving a reference pathological image set”, the method specifically includes: receiving a precancerous lesion specimen image and a non-precancerous lesion specimen image; performing pixel annotation on some precancerous lesion specimen images to obtain a lesion annotation mask; generating the reference pathological image set according to the precancerous lesion specimen image, the corresponding lesion annotation mask, and the non-precancerous lesion specimen image; the “performing size normalization processing and color migration normalization processing on the reference pathological image set in sequence to obtain a standard pathological image set” specifically includes: performing size normalization processing and color migration normalization processing on all annotated lesion specimen images in sequence; The size standardization processing and the color migration standardization processing are performed, and the set of annotated pathological images is obtained by calculation based on the annotated lesion specimen images after the processing; wherein the annotated lesion specimen images correspond to the precancerous lesion specimen images with the corresponding lesion annotation masks; for all unannotated lesion specimen images and all non-precancerous lesion specimen images, the size standardization processing and the color migration standardization processing are performed in sequence, and the set of unannotated pathological images is obtained by calculation based on the unannotated lesion specimen images and the non-precancerous lesion specimen images after the processing; wherein the unannotated lesion specimen images correspond to the precancerous lesion specimen images without the corresponding lesion annotation masks.
作为本发明一实施方式的进一步改进,所述标注病变标本图像的数量占所有癌前病变标本图像的数量的30%;所有非癌前病变标本图像的数量占所有癌前病变标本图像的数量的20%。As a further improvement of an embodiment of the present invention, the number of the labeled lesion specimen images accounts for 30% of the number of all precancerous lesion specimen images; the number of all non-precancerous lesion specimen images accounts for 20% of the number of all precancerous lesion specimen images.
作为本发明一实施方式的进一步改进,所述“运算得到标准病理图像集合”具体包括:对完成尺寸标准化处理和颜色迁移标准化处理的参考病理图像执行滑窗区域分割,得到并根据多组滑窗区域图像组,运算得到所述标准病理图像集合;其中,所述滑窗区域分割具体包括:构建预设尺寸的图像区域滑窗,并使所述图像区域滑窗按照预设步长对标注标准化图像和对应的所述病变标注掩膜执行遍历分割,得到多组标注滑窗图像组和标注滑窗掩膜组;其中,所述标注标准化图像为完成标准化处理后的标注病变标本图像;遍历、分析并根据标注滑窗掩膜组中所有标注滑窗掩膜的病灶区域占比,筛选更新所述标注滑窗图像和对应的标注滑窗掩膜;使所述图像区域滑窗按照所述预设步长对无标注标准化图像和非病变标准化图像执行遍历分割,得到多组无标注滑窗图像组和非病变滑窗图像组;其中,所述无标注标准化图像为完成标准化处理后的无标注病变标本图像,所述非病变标准化图像为完成标准化处理后的非癌前病变标本图像;遍历、分析并根据无标注滑窗图像和非病变滑窗图像的组织区域占比,筛选更新所述无标注滑窗图像和所述非病变滑窗图像。As a further improvement of an embodiment of the present invention, the "obtaining a set of standard pathological images by calculation" specifically includes: performing sliding window area segmentation on a reference pathological image that has completed size standardization and color migration standardization, and obtaining and calculating the set of standard pathological images based on multiple groups of sliding window area image groups; wherein the sliding window area segmentation specifically includes: constructing an image area sliding window of a preset size, and causing the image area sliding window to perform traversal segmentation on the annotated standardized image and the corresponding lesion annotation mask according to a preset step size, and obtaining multiple groups of annotated sliding window image groups and annotated sliding window mask groups; wherein the annotated standardized image is an annotated lesion specimen image that has completed standardization processing; traversal, segmentation The method comprises the following steps: analyzing and screening and updating the annotated sliding window image and the corresponding annotated sliding window mask according to the proportion of the lesion area of all the annotated sliding window masks in the annotated sliding window mask group; making the image area sliding window perform traversal segmentation on the unannotated standardized image and the non-lesion standardized image according to the preset step size to obtain multiple groups of unannotated sliding window image groups and non-lesion sliding window image groups; wherein the unannotated standardized image is an unannotated lesion specimen image after standardization processing, and the non-lesion standardized image is an image of a non-precancerous lesion specimen after standardization processing; traversing, analyzing and screening and updating the unannotated sliding window image and the non-lesion sliding window image according to the proportion of the tissue area of the unannotated sliding window image and the non-lesion sliding window image.
作为本发明一实施方式的进一步改进,在“遍历、分析并根据标注滑窗掩膜组中所有标注滑窗掩膜的病灶区域占比,筛选更新所述标注滑窗图像和对应的标注滑窗掩膜”之后,所述方法具体包括:对所述标注滑窗图像和对应的标注滑窗掩膜执行随机数据增广处理,得到所述有标注病理图像集合;在所述“遍历、分析并根据无标注滑窗图像和非病变滑窗图像的组织区域占比,筛选更新所述无标注滑窗图像和所述非病变滑窗图像”之后,所述方法具体包括:对所述无标注滑窗图像和所述非病变滑窗图像执行随机数据增广处理,得到所述无标注病理图像集合;其中,所述随机数据增广具体包括:按照预设概率对图像矩阵进行水平翻转、垂直翻转、预设角度旋转和转置至少其中一种。As a further improvement of an embodiment of the present invention, after "traversing, analyzing and screening and updating the annotated sliding window image and the corresponding annotated sliding window mask according to the proportion of the lesion area of all annotated sliding window masks in the annotated sliding window mask group", the method specifically includes: performing random data augmentation processing on the annotated sliding window image and the corresponding annotated sliding window mask to obtain the set of annotated pathological images; after "traversing, analyzing and screening and updating the unannotated sliding window image and the non-lesion sliding window image according to the proportion of the tissue area of the unannotated sliding window image and the non-lesion sliding window image", the method specifically includes: performing random data augmentation processing on the unannotated sliding window image and the non-lesion sliding window image to obtain the set of unannotated pathological images; wherein the random data augmentation specifically includes: performing at least one of horizontal flipping, vertical flipping, preset angle rotation and transposition on the image matrix according to a preset probability.
作为本发明一实施方式的进一步改进,所述病变标注掩膜包括对应于癌前病变标本图像中每个像素的独热编码标签,所述独热编码标签包含分别表征背景判断标注、上皮内瘤变判断标注和肠上皮化生判断标注的第一编码位、第二编码位和第三编码位。As a further improvement of one embodiment of the present invention, the lesion annotation mask includes a one-hot encoding label corresponding to each pixel in the precancerous lesion specimen image, and the one-hot encoding label includes a first encoding bit, a second encoding bit and a third encoding bit that respectively represent the background judgment label, the intraepithelial neoplasia judgment label and the intestinal metaplasia judgment label.
作为本发明一实施方式的进一步改进,所述尺寸标准化处理具体包括:对所述参考病理图像集合执行尺寸标准化处理,统一所有参考病理图像至预设放大倍数;所述颜色迁移标准化处理具体包括:接收基准染色图像,对其执行色彩空间转换,并计算得到基准染色向量矩阵;接收参考病理图像,对其执行色彩空间转换,并计算得到参考颜色密度矩阵;根据所述基准染色向量矩阵和所述参考颜色密度矩阵,生成对应于所述参考病理图像的颜色迁移图像。As a further improvement of an embodiment of the present invention, the size standardization processing specifically includes: performing size standardization processing on the reference pathology image set to unify all reference pathology images to a preset magnification; the color migration standardization processing specifically includes: receiving a baseline staining image, performing color space conversion on it, and calculating a baseline staining vector matrix; receiving a reference pathology image, performing color space conversion on it, and calculating a reference color density matrix; generating a color migration image corresponding to the reference pathology image based on the baseline staining vector matrix and the reference color density matrix.
作为本发明一实施方式的进一步改进,所述“接收基准染色图像,对其执行色彩空间转换,并计算得到基准染色向量矩阵”具体包括:接收基准染色图像,进行光密度矩阵转换处理,得到基准光密度矩阵;对所述基准光密度矩阵执行奇异值分解,选择第一奇异极值和第二奇异极值创建投影平面;确定至少一个参考奇异值及其在所述投影平面上的参考平面轴,将所述基准光密度矩阵投影至所述投影平面,拟合投影后的基准光密度矩阵上所有数值点与所述投影平面的原点的连接线,并计算所述连接线与所述参考平面轴的夹角,求取所有夹角中的极大值,得到极大夹角数据;计算对应于所述极大夹角数据的光密度矩阵,对该光密度矩阵执行归一化运算后,得到所述基准染色向量矩阵。As a further improvement of an embodiment of the present invention, the "receiving a reference staining image, performing color space conversion on it, and calculating a reference staining vector matrix" specifically includes: receiving a reference staining image, performing optical density matrix conversion processing, and obtaining a reference optical density matrix; performing singular value decomposition on the reference optical density matrix, selecting the first singular extreme value and the second singular extreme value to create a projection plane; determining at least one reference singular value and its reference plane axis on the projection plane, projecting the reference optical density matrix to the projection plane, fitting the connecting line between all numerical points on the projected reference optical density matrix and the origin of the projection plane, and calculating the angle between the connecting line and the reference plane axis, finding the maximum value among all angles, and obtaining maximum angle data; calculating the optical density matrix corresponding to the maximum angle data, and performing a normalization operation on the optical density matrix to obtain the reference staining vector matrix.
作为本发明一实施方式的进一步改进,所述“接收参考病理图像,对其执行色彩空间转换,并计算得到参考颜色密度矩阵”具体包括:接收参考病理图像,对其依次执行光密度矩阵转换、奇异值分解、平面投影和极大夹角数据求取,计算得到对应于所述参考病理图像的参考光密度矩阵和参考染色向量矩阵;根据所述参考染色向量矩阵和所述参考光密度矩阵,计算得到对应于所述参考病理图像的所述参考颜色密度矩阵。As a further improvement of an embodiment of the present invention, the "receiving a reference pathological image, performing color space conversion on it, and calculating a reference color density matrix" specifically includes: receiving a reference pathological image, performing optical density matrix conversion, singular value decomposition, plane projection and maximum angle data acquisition on it in sequence, and calculating a reference optical density matrix and a reference staining vector matrix corresponding to the reference pathological image; based on the reference staining vector matrix and the reference optical density matrix, calculating the reference color density matrix corresponding to the reference pathological image.
作为本发明一实施方式的进一步改进,所述方法具体包括:对所述参考病理图像执行下采样插值,设定所述 参考病理图像的放大倍数为10倍;其中,所述下采样插值为最邻近插值。As a further improvement of an embodiment of the present invention, the method specifically comprises: performing downsampling interpolation on the reference pathological image, setting the The magnification of the reference pathological image is 10 times; wherein the downsampling interpolation is the nearest neighbor interpolation.
作为本发明一实施方式的进一步改进,在所述“根据所述有标注样本图像集合,调用第一神经网络模型执行有监督训练后,根据所述无标注样本图像集合,调用第一神经网络模型执行遍历推理,得到对应于所述无标注样本图像集合的第一识别伪标签集合”之前,所述方法还包括:选取以全卷积网络为结构基础的语义分割骨干模型作为基础骨干模型;分别根据第一权重配置参数和第二权重配置参数,基于所述基础骨干模型执行模型初始化,得到所述第一神经网络模型和所述第二神经网络模型;其中,所述第一神经网络模型和所述第二神经网络模型,均搭载有softmax激活函数,且配置为具有相同的优化器和学习率调整策略。As a further improvement of an embodiment of the present invention, before the step of "after calling the first neural network model to perform supervised training according to the set of labeled sample images, calling the first neural network model to perform traversal reasoning according to the set of unlabeled sample images to obtain a first set of identification pseudo-labels corresponding to the set of unlabeled sample images", the method also includes: selecting a semantic segmentation backbone model based on a fully convolutional network as a basic backbone model; performing model initialization based on the basic backbone model according to first weight configuration parameters and second weight configuration parameters, respectively, to obtain the first neural network model and the second neural network model; wherein the first neural network model and the second neural network model are both equipped with a softmax activation function and are configured to have the same optimizer and learning rate adjustment strategy.
作为本发明一实施方式的进一步改进,所述基础骨干模型配置为基于U-Net网络架构,所述第一权重配置参数设置为基于Xavier参数初始化策略生成,所述第二权重配置参数设置为基于Kaiming参数初始化策略生成;所述第一神经网络模型和所述第二神经网络模型配置为包括随机梯度下降优化器,所述学习率调整策略配置为模型学习率值随迭代次数的增加而减小。As a further improvement of one embodiment of the present invention, the basic backbone model is configured based on a U-Net network architecture, the first weight configuration parameter is set to be generated based on a Xavier parameter initialization strategy, and the second weight configuration parameter is set to be generated based on a Kaiming parameter initialization strategy; the first neural network model and the second neural network model are configured to include a stochastic gradient descent optimizer, and the learning rate adjustment strategy is configured so that the model learning rate value decreases with an increase in the number of iterations.
作为本发明一实施方式的进一步改进,所述模型学习率值等于剩余迭代次数与总迭代次数之比的预设指数次幂,与基础学习率值之积。As a further improvement of an embodiment of the present invention, the model learning rate value is equal to the product of a preset exponential power of the ratio of the remaining number of iterations to the total number of iterations and a basic learning rate value.
作为本发明一实施方式的进一步改进,所述第一损失函数配置为第一有监督损失函数与第一伪标签损失函数的加权之和,其中,所述第一有监督损失函数指向所述第一神经网络模型基于样本图像集合进行的有监督训练过程,所述第一伪标签损失函数指向所述第二神经网络模型基于推理结果进行的有监督训练过程;所述第二损失函数配置为第二有监督损失函数与第二伪标签损失函数的加权之和,其中,所述第二有监督损失函数指向所述第二神经网络模型基于所述样本图像集合进行的有监督训练过程,所述第二伪标签损失函数指向所述第一神经网络模型基于推理结果进行的有监督训练过程。As a further improvement of one embodiment of the present invention, the first loss function is configured as a weighted sum of a first supervised loss function and a first pseudo-label loss function, wherein the first supervised loss function refers to a supervised training process of the first neural network model based on a sample image set, and the first pseudo-label loss function refers to a supervised training process of the second neural network model based on an inference result; the second loss function is configured as a weighted sum of a second supervised loss function and a second pseudo-label loss function, wherein the second supervised loss function refers to a supervised training process of the second neural network model based on the sample image set, and the second pseudo-label loss function refers to a supervised training process of the first neural network model based on the inference result.
作为本发明一实施方式的进一步改进,所述第一有监督损失函数配置为第一有监督交叉熵损失函数与第一有监督交并比损失函数之和;其中,所述第一有监督交叉熵损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类概率之间的差距,所述第一有监督交并比损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类类别之间的差距;所述第一伪标签损失函数包括第一伪标签交叉熵损失函数;其中,所述第一伪标签交叉熵损失函数表征所述第一神经网络模型对所述样本图像集合的推理分类概率,与所述第二神经网络模型对所述样本图像集合的推理分类类别之间的差距;所述第二有监督损失函数配置为第二有监督交叉熵损失函数与第二有监督交并比损失函数之和;其中,所述第二有监督交叉熵损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类概率之间的差距,所述第二有监督交并比损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类类别之间的差距;所述第二伪标签损失函数包括第二伪标签交叉熵损失函数;其中,所述第二伪标签交叉熵损失函数表征所述第二神经网络模型对所述样本图像集合的推理分类概率,与所述第一神经网络模型对所述样本图像集合的推理分类类别之间的差距。As a further improvement of an embodiment of the present invention, the first supervised loss function is configured as the sum of a first supervised cross entropy loss function and a first supervised intersection-over-union loss function; wherein, the first supervised cross entropy loss function represents the gap between the known label data in the sample image set and the corresponding inference classification probability, and the first supervised intersection-over-union loss function represents the gap between the known label data in the sample image set and the corresponding inference classification category; the first pseudo-label loss function includes a first pseudo-label cross entropy loss function; wherein, the first pseudo-label cross entropy loss function represents the difference between the inference classification probability of the sample image set by the first neural network model and the inference classification category of the sample image set by the second neural network model. The gap between class categories; the second supervised loss function is configured as the sum of a second supervised cross entropy loss function and a second supervised intersection-over-union loss function; wherein the second supervised cross entropy loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification probability, and the second supervised intersection-over-union loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification category; the second pseudo-label loss function includes a second pseudo-label cross entropy loss function; wherein the second pseudo-label cross entropy loss function characterizes the gap between the inference classification probability of the sample image set by the second neural network model and the inference classification category of the sample image set by the first neural network model.
作为本发明一实施方式的进一步改进,样本图像表征上皮内瘤变情况和肠上皮化生情况;所述第一有监督交叉熵损失函数、所述第一伪标签交叉熵损失函数、所述第二有监督交叉熵损失函数和所述第二伪标签交叉熵损失函数,指向样本图像中背景区域、上皮内瘤变区域和肠上皮化生区域;所述第一有监督交并比损失函数和所述第二有监督交并比损失函数,指向样本图像中上皮内瘤变区域和肠上皮化生区域。As a further improvement of one embodiment of the present invention, the sample image characterizes the intraepithelial neoplasia and intestinal metaplasia; the first supervised cross entropy loss function, the first pseudo-label cross entropy loss function, the second supervised cross entropy loss function and the second pseudo-label cross entropy loss function point to the background area, intraepithelial neoplasia area and intestinal metaplasia area in the sample image; the first supervised intersection-over-union loss function and the second supervised intersection-over-union loss function point to the intraepithelial neoplasia area and intestinal metaplasia area in the sample image.
作为本发明一实施方式的进一步改进,所述第一伪标签损失函数和所述第二伪标签损失函数具有相等的预设权重值,所述预设权重值配置为随迭代次数的增加而增大。As a further improvement of an embodiment of the present invention, the first pseudo-label loss function and the second pseudo-label loss function have equal preset weight values, and the preset weight values are configured to increase with an increase in the number of iterations.
作为本发明一实施方式的进一步改进,所述预设权重值等于权重最大值与预设递增函数的乘积,所述预设递增函数配置为函数值无限趋近于1。As a further improvement of an embodiment of the present invention, the preset weight value is equal to the product of the maximum weight value and a preset increasing function, and the preset increasing function is configured so that the function value approaches 1 infinitely.
作为本发明一实施方式的进一步改进,样本图像表征上皮内瘤变情况和肠上皮化生情况。As a further improvement of an embodiment of the present invention, the sample image represents the intraepithelial neoplasia and intestinal metaplasia.
为实现上述发明目的之一,本发明一实施方式提供一种病理图像识别模型训练系统,包括:一个或多个处理器;存储器,用于存储一个或多个计算机程序,当所述一个或多个计算机程序被所述一个或多个处理器执行时,配置为执行上述任一种技术方案所述的病理图像识别模型训练方法。To achieve one of the above-mentioned purposes of the invention, one embodiment of the present invention provides a pathological image recognition model training system, comprising: one or more processors; a memory for storing one or more computer programs, which, when the one or more computer programs are executed by the one or more processors, are configured to execute the pathological image recognition model training method described in any of the above-mentioned technical solutions.
为实现上述发明目的之一,本发明一实施方式提供一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述任一种技术方案所述的病理图像识别模型训练方法。To achieve one of the above-mentioned purposes of the invention, one embodiment of the present invention provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the pathological image recognition model training method described in any of the above-mentioned technical solutions is implemented.
为实现上述发明目的之一,本发明一实施方式提供一种病理图像识别方法,所述方法包括:执行上述任一种技术方案所述的病理图像识别模型训练方法,得到第一模型训练参数和第二模型训练参数至少其中之一;将模型训练参数搭载至对应的神经网络模型中,构建病理图像识别模型;接收待测病理图像数据并进行预处理,将预处理后的待测病理图像数据输入所述病理图像识别模型中进行遍历预测,得到病理识别数据。 To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention provides a pathological image recognition method, which includes: executing the pathological image recognition model training method described in any of the above-mentioned technical solutions to obtain at least one of the first model training parameters and the second model training parameters; carrying the model training parameters into the corresponding neural network model to construct a pathological image recognition model; receiving the pathological image data to be tested and preprocessing it, and inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction to obtain pathological recognition data.
作为本发明一实施方式的进一步改进,所述“接收待测病理图像数据并进行预处理,将预处理后的待测病理图像数据输入所述病理图像识别模型中进行遍历预测,得到病理识别数据”具体包括:对所述待测病理图像数据依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到待测病理图像集合;将所述待测病理图像集合输入所述病理图像识别模型中进行遍历预测,得到病理识别像素区;将所述病理识别像素区叠加显示于待测病理图像上,形成病理判断图像。As a further improvement of an embodiment of the present invention, the "receiving pathological image data to be tested and preprocessing it, inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction, and obtaining pathological recognition data" specifically includes: performing size standardization processing and color migration standardization processing on the pathological image data to be tested in sequence, and calculating to obtain a set of pathological images to be tested; inputting the set of pathological images to be tested into the pathological image recognition model for traversal prediction, and obtaining a pathological recognition pixel area; and superimposing and displaying the pathological recognition pixel area on the pathological image to be tested to form a pathological judgment image.
作为本发明一实施方式的进一步改进,所述“运算得到待测病理图像集合”具体包括:对完成尺寸标准化处理和颜色迁移标准化处理的待测病理图像数据执行滑窗区域分割,根据待测滑窗图像中低灰度值区域占比情况,筛选得到所述待测病理图像集合。As a further improvement of one embodiment of the present invention, the "calculation to obtain a set of pathological images to be tested" specifically includes: performing sliding window area segmentation on the pathological image data to be tested that has completed size standardization and color migration standardization, and screening to obtain the set of pathological images to be tested based on the proportion of low grayscale value areas in the sliding window image to be tested.
作为本发明一实施方式的进一步改进,所述病理识别数据包括癌前病变判定信息,所述“接收待测病理图像数据并进行预处理,将预处理后的待测病理图像数据输入所述病理图像识别模型中进行遍历预测,得到病理识别数据”具体包括:对所述病理识别像素区中分别指向上皮内瘤变和肠上皮化生的像素值进行降序排列,计算预设数量范围内的像素平均值,得到第一平均值和第二平均值,并判断所述第一平均值和所述第二平均值与预设癌前病变判定阈值之间的数值大小关系;若所述第一平均值和所述第二平均值其中之一大于所述癌前病变判定阈值,则判定该病理识别像素区对应的待测病理图像所表征的位置发生癌前病变,输出癌前病变判定信息。As a further improvement of an embodiment of the present invention, the pathology identification data includes precancerous lesion determination information, and the "receiving the pathology image data to be tested and preprocessing it, inputting the preprocessed pathology image data to be tested into the pathology image recognition model for traversal prediction, and obtaining the pathology identification data" specifically includes: arranging the pixel values in the pathology identification pixel area respectively pointing to intraepithelial neoplasia and intestinal metaplasia in descending order, calculating the pixel average value within a preset number range, obtaining a first average value and a second average value, and judging the numerical relationship between the first average value and the second average value and a preset precancerous lesion determination threshold; if one of the first average value and the second average value is greater than the precancerous lesion determination threshold, it is judged that a precancerous lesion occurs at the position represented by the pathology image to be tested corresponding to the pathology identification pixel area, and outputting the precancerous lesion determination information.
与现有技术相比,本发明提供的病理图像识别模型训练方法,通过构建第一神经网络模型和第二神经网络模型两个并行的学习模型,利用产生的两组损失函数,相对照地进行模型的训练和优化,从而充分利用有限的图像数据进行训练,并使神经网络模型的性能更为稳定;利用样本图像集合依次进行前一模型到后一模型的训练,以及利用样本图像集合依次进行后一模型到前一模型的训练,复合一般有监督训练和基于伪标签的有监督训练,能够减少对有标记数据等稀缺数据类型的依赖性,将无标记数据也等效于有标记数据而参与模型的训练过程,从而大幅提升了训练得到的模型的性能、降低成本并提高了训练速度。Compared with the prior art, the pathological image recognition model training method provided by the present invention constructs two parallel learning models, a first neural network model and a second neural network model, and uses the two sets of loss functions generated to train and optimize the models in comparison, thereby making full use of limited image data for training and making the performance of the neural network model more stable; using a sample image set to sequentially train the previous model to the next model, and using a sample image set to sequentially train the next model to the previous model, combining general supervised training and pseudo-label-based supervised training, can reduce dependence on scarce data types such as labeled data, and make unlabeled data equivalent to labeled data and participate in the model training process, thereby greatly improving the performance of the trained model, reducing costs and increasing training speed.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明一实施方式中病理图像识别模型训练系统的结构示意图。FIG1 is a schematic diagram of the structure of a pathological image recognition model training system according to an embodiment of the present invention.
图2是本发明一实施方式中病理图像识别模型训练方法的步骤示意图。FIG. 2 is a schematic diagram of the steps of a pathological image recognition model training method according to an embodiment of the present invention.
图3是本发明一实施方式中病理图像识别模型训练方法的第一实施例的步骤示意图。FIG. 3 is a schematic diagram of the steps of a first embodiment of a pathological image recognition model training method according to an embodiment of the present invention.
图4是本发明另一实施方式中病理图像识别模型训练方法的部分步骤示意图。FIG. 4 is a schematic diagram of some steps of a pathological image recognition model training method in another embodiment of the present invention.
图5是本发明另一实施方式中病理图像识别模型训练方法的第一实施例的部分步骤示意图。FIG. 5 is a schematic diagram of some steps of a first embodiment of a pathological image recognition model training method in another embodiment of the present invention.
图6是本发明另一实施方式中病理图像识别模型训练方法的第一实施例的一具体示例的部分步骤示意图。FIG. 6 is a schematic diagram of some steps of a specific example of the first embodiment of the pathological image recognition model training method in another embodiment of the present invention.
图7是本发明再一实施方式中病理图像识别模型训练方法的部分步骤示意图。FIG. 7 is a schematic diagram of some steps of a pathological image recognition model training method in yet another embodiment of the present invention.
图8是本发明再一实施方式中病理图像识别模型训练方法的第一实施例的部分步骤示意图。FIG8 is a schematic diagram of some steps of a first embodiment of a pathological image recognition model training method in yet another embodiment of the present invention.
图9是本发明又一实施方式中执行病理图像识别模型训练方法时图像数据的转化流程示意图。FIG9 is a schematic diagram of the image data conversion process when executing the pathological image recognition model training method in another embodiment of the present invention.
图10是本发明一实施方式中病理图像识别方法及其第一实施例的步骤示意图。FIG. 10 is a schematic diagram of the steps of a pathological image recognition method and a first embodiment thereof in one embodiment of the present invention.
具体实施方式Detailed ways
以下将结合附图所示的具体实施方式对本发明进行详细描述。但这些实施方式并不限制本发明,本领域的普通技术人员根据这些实施方式所做出的结构、方法、或功能上的变换均包含在本发明的保护范围内。The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.
需要说明的是,术语“包括”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。此外,术语“第一”、“第二”、“第三”等仅用于描述目的,而不能理解为指示或暗示相对重要性。It should be noted that the term "comprises" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In addition, the terms "first", "second", "third", etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
本发明的核心技术路线在于,通过构建两套并行的神经网络模型,相互交替地执行有监督训练和基于有监督训练后的推测结果来进行有监督训练,从而达到充分利用样本图像集合内容、输出训练参数素质表现稳定,以及提升模型预测准确度的技术效果。同时,本发明后文提出的、诸如对图像的标准化、分组、滑窗分割等附加技术特征,还能够从样本图像集合自身素质、用于训练的图像集构建和资源占用等方面,形成对模型训练方法的进一步优化。值得强调地,下文多种实施方式、实施例或具体示例之间可以相互组合,由此形成的新的技术方案能够被包含于本发明的保护范围内。The core technical route of the present invention is to construct two sets of parallel neural network models, alternately perform supervised training and supervised training based on the inference results after supervised training, so as to achieve the technical effects of making full use of the content of the sample image set, stabilizing the quality of the output training parameters, and improving the prediction accuracy of the model. At the same time, the additional technical features proposed in the following text of the present invention, such as image standardization, grouping, sliding window segmentation, etc., can also further optimize the model training method from the aspects of the quality of the sample image set itself, the construction of the image set used for training, and resource occupation. It is worth emphasizing that the various implementation methods, embodiments or specific examples below can be combined with each other, and the new technical scheme formed thereby can be included in the protection scope of the present invention.
本发明一实施方式为了解决技术问题和实现技术效果,提供了一种存储介质,可以具体是一种计算机可读存储介质或者计算机可读信号介质或者是上述两者的任意组合,从而,所述存储介质可以设置于计算机中并存储有计算机程序。所述计算机存储介质可以是计算机能够存取的任何可用介质,或可以是包含一个或多个可用介质集成的服务器、数据中心等存储设备。所述可用介质可以是例如软盘、硬盘、磁带等的磁性介质,或例如DVD(Digital  Video Disc,高密度数字视频光盘)等的光介质,或例如SSD(Solid State Disk,固态硬盘)等的半导体介质,或上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。所述计算机程序被计算机中任一处理器执行时,实施一种病理图像识别模型训练方法,以至少执行:样本图像集合的接收,第一神经网络模型、第二神经网络模型的调用和训练,第一损失函数、第二损失函数的计算,以及第一模型训练参数和第二模型训练参数至少其中之一的生成。In order to solve the technical problem and achieve the technical effect, an embodiment of the present invention provides a storage medium, which can be specifically a computer-readable storage medium or a computer-readable signal medium or any combination of the above two, so that the storage medium can be set in a computer and store a computer program. The computer storage medium can be any available medium that can be accessed by a computer, or can be a storage device such as a server or a data center that includes one or more available media. The available medium can be a magnetic medium such as a floppy disk, a hard disk, a magnetic tape, or a DVD (Digital Video Recorder). Video Disc, high-density digital video disc) and other optical media, or semiconductor media such as SSD (Solid State Disk, solid state hard disk), or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in combination with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above. When the computer program is executed by any processor in a computer, a pathological image recognition model training method is implemented to at least perform: receiving a set of sample images, calling and training a first neural network model and a second neural network model, calculating a first loss function and a second loss function, and generating at least one of a first model training parameter and a second model training parameter.
本发明一实施方式进一步提供一种如图1所示的病理图像识别模型训练系统100,该病理图像识别模型训练系统100包括处理器11、通信接口12、存储器13以及通信总线14。处理器11、通信接口12、存储器13通过通信总线14完成相互间的通信。以下部件连接至通信接口12:包括键盘、鼠标等的输入部件;包括诸如阴极射线管(CRT,Cathode Ray Tube)、液晶显示器(LCD,Liquid Crystal Display)等及扬声器等的输出部件;包括硬盘等的存储器13;以及包括诸如局域网卡、调制解调器等的网络接口卡的通信部件。通信部件经由诸如因特网的网络执行通信处理。根据需要可将驱动器连接至通信接口12。可拆卸介质,诸如磁盘、光盘、磁光盘、半导体介质等等,根据需要安装在驱动器上,以便于从其上读出的计算机程序根据需要被安装入存储器13。One embodiment of the present invention further provides a pathological image recognition model training system 100 as shown in FIG1 , and the pathological image recognition model training system 100 includes a processor 11, a communication interface 12, a memory 13, and a communication bus 14. The processor 11, the communication interface 12, and the memory 13 communicate with each other through the communication bus 14. The following components are connected to the communication interface 12: input components including a keyboard, a mouse, etc.; output components including a cathode ray tube (CRT, Cathode Ray Tube), a liquid crystal display (LCD, Liquid Crystal Display), etc., and a speaker, etc.; a memory 13 including a hard disk, etc.; and a communication component including a network interface card such as a local area network card, a modem, etc. The communication component performs communication processing via a network such as the Internet. A drive can be connected to the communication interface 12 as needed. Removable media, such as magnetic disks, optical disks, magneto-optical disks, semiconductor media, etc., are installed on the drive as needed so that the computer program read therefrom can be installed into the memory 13 as needed.
特别地,根据本申请的实施例,各个方法流程图中所描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部件从网络上被下载和安装,和/或从可拆卸介质被安装。在该计算机程序被处理器11执行时,执行本申请的系统中限定的各种功能。In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication component, and/or installed from a removable medium. When the computer program is executed by the processor 11, various functions defined in the system of the present application are executed.
病理图像识别模型训练系统100基于下文提供的病理图像识别模型训练方法训练得到。The pathological image recognition model training system 100 is trained based on the pathological image recognition model training method provided below.
其中,存储器13用于存放应用程序;处理器11用于执行存储器13上存放的应用程序,该应用程序可以是前文所述的、存储于存储介质上的应用程序,也即上述存储介质可以是包含于存储器13的。在执行该应用程序时,同样可以实现诸如前文所述的功能和步骤,并达到对应的技术效果。The memory 13 is used to store an application program; the processor 11 is used to execute the application program stored in the memory 13, and the application program may be the application program stored in the storage medium as described above, that is, the storage medium may be included in the memory 13. When executing the application program, the functions and steps as described above may also be implemented, and the corresponding technical effects may be achieved.
其他结构特征,例如可能存在的功能分区和模块的调整,可以根据其所搭载的应用程序确定。具体地,在病理图像识别模型训练系统100中,或在一种病理图像识别模型训练装置中,可以包括用于获取样本图像集合的数据获取模块,可以包括用于构建第一神经网络模型和第二神经网络模型的模型构建模块,可以包括用于运算第一损失函数和第二损失函数的数据运算模块,也可以包括用于对第一神经网络模型和第二神经网络模型进行迭代训练的迭代训练模块。Other structural features, such as possible functional partitions and module adjustments, can be determined according to the application program it carries. Specifically, in the pathological image recognition model training system 100, or in a pathological image recognition model training device, it can include a data acquisition module for acquiring a sample image set, a model construction module for constructing a first neural network model and a second neural network model, a data operation module for calculating a first loss function and a second loss function, and an iterative training module for iteratively training the first neural network model and the second neural network model.
本发明一实施方式提供一种如图2所示的病理图像识别模型训练方法,该方法应用的程序或指令,可以搭载于上述存储介质和/或上述病理图像识别模型训练系统和/或上述病理图像识别模型训练装置中,以实现对病理图像识别模型进行训练的技术效果。病理图像识别模型训练方法具体包括下述步骤。One embodiment of the present invention provides a pathological image recognition model training method as shown in FIG2. The program or instruction used in the method can be carried in the above-mentioned storage medium and/or the above-mentioned pathological image recognition model training system and/or the above-mentioned pathological image recognition model training device to achieve the technical effect of training the pathological image recognition model. The pathological image recognition model training method specifically includes the following steps.
步骤21,接收样本图像集合。Step 21: Receive a sample image set.
步骤22,根据样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数。Step 22, according to the sample image set, call the first neural network model to perform supervised training and traversal reasoning in sequence, and call the second neural network model to perform supervised training based on the reasoning result to calculate the first loss function.
步骤23,根据样本图像集合,调用第二神经网络模型依次执行有监督训练和遍历推理,并调用第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数。Step 23, according to the sample image set, call the second neural network model to perform supervised training and traversal reasoning in sequence, and call the first neural network model to perform supervised training based on the reasoning result to calculate the second loss function.
步骤24,根据第一损失函数和第二损失函数对第一神经网络模型和第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。Step 24, iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
所述样本图像集合,可以具体解释为用于进行病理图像识别模型训练的图像集合或图像数据集合,其内容可以指向任何需要进行病理图像识别和分析的部位。例如,样本图像集合可以指向消化系统中胃部、肠道等部位。基于其自身用途的限制,样本图像集合中至少可以包含指向病变部位或病变前部位的部分图像。The sample image set can be specifically interpreted as an image set or image data set for training a pathological image recognition model, and its content can point to any part that needs to be recognized and analyzed for pathological images. For example, the sample image set can point to the stomach, intestines, and other parts of the digestive system. Based on the limitations of its own use, the sample image set can at least include some images pointing to the lesion site or the pre-lesion site.
在将训练后的病理图像识别模型用于对消化系统癌变进行前期预警的场景下,样本图像集合中至少部分样本图像可以配置为,表征上皮内瘤变情况和肠上皮化生情况等。其中,所述肠上皮化生一般被认为是发生癌变的前期表现,可以分为小肠型上皮化生、结肠上皮化生两大类型。进一步地,考虑到结肠上皮化生发生恶性癌变风险较高,因此,可以将样本图像集合中表征结肠上皮化生的样本图像数量配置得更多,或在训练中赋予其更高的权重。 In the scenario where the trained pathological image recognition model is used for early warning of digestive system cancer, at least some of the sample images in the sample image set can be configured to characterize intraepithelial neoplasia and intestinal metaplasia. Among them, intestinal metaplasia is generally considered to be an early manifestation of cancer, which can be divided into two types: small intestinal metaplasia and colonic metaplasia. Furthermore, considering that colonic metaplasia has a higher risk of malignant cancer, the number of sample images representing colonic metaplasia in the sample image set can be configured to be larger, or it can be given a higher weight in training.
优选地,所述样本图像集合包括有标注样本图像集合和无标注样本图像集合。对于有标注样本图像集合而言,本发明并不限制样本图像标注的方式,可以是对部分区域提供统一的标签。同理,本发明也并不限制样本图像标注的形式。作为较优的实施方式,样本图像的标注可以是对每个像素进行类别划分,并最终形成一张与样本图像尺寸相适应的掩膜,从而该样本图像与对应的掩膜共同组成所述有标注样本图像集合。所述有标注样本图像集合应当至少包含部分指向病变部位和病变前部位的样本图像,而对于无标注样本图像集合,则可以包括指向病变部位或病变前部位的样本图像,也可以包括不包含病变或病变前特征的样本图像。Preferably, the sample image set includes a set of labeled sample images and a set of unlabeled sample images. For the set of labeled sample images, the present invention does not limit the way of labeling sample images, which may be to provide a unified label for partial areas. Similarly, the present invention does not limit the form of sample image labeling. As a preferred implementation, the labeling of sample images may be to classify each pixel, and finally form a mask that is adapted to the size of the sample image, so that the sample image and the corresponding mask together constitute the set of labeled sample images. The set of labeled sample images should at least include some sample images pointing to the lesion site and the pre-lesion site, while for the set of unlabeled sample images, it may include sample images pointing to the lesion site or the pre-lesion site, and may also include sample images that do not include lesion or pre-lesion features.
所述第一神经网络模型和所述第二神经网络模型可以是任何一种可以支持有监督训练和推理预测的神经网络模型。所述第一损失函数表征,在依次调用第一神经网络模型和第二神经网络模型进行训练的过程中,模型推理情况和实际分类情况的偏差。所述第二损失函数表征,在依次调用第二神经网络模型和第一神经网络模型进行训练的过程中,模型推理情况和实际分类情况的偏差。The first neural network model and the second neural network model can be any neural network model that can support supervised training and inference prediction. The first loss function represents the deviation between the model inference and the actual classification in the process of calling the first neural network model and the second neural network model for training in sequence. The second loss function represents the deviation between the model inference and the actual classification in the process of calling the second neural network model and the first neural network model for training in sequence.
基于此,本发明提供一较优的实施例,旨在搭建一个较优的神经网络模型以适应病理图像识别的应用场景,并提升模型训练的效率。该实施例具体包括步骤:选取以全卷积网络为结构基础的语义分割骨干模型作为基础骨干模型;分别根据第一权重配置参数和第二权重配置参数,基于所述基础骨干模型执行模型初始化,得到所述第一神经网络模型和所述第二神经网络模型。Based on this, the present invention provides a preferred embodiment, which aims to build a better neural network model to adapt to the application scenario of pathological image recognition and improve the efficiency of model training. This embodiment specifically includes the steps of: selecting a semantic segmentation backbone model based on a fully convolutional network as a basic backbone model; performing model initialization based on the basic backbone model according to the first weight configuration parameter and the second weight configuration parameter, respectively, to obtain the first neural network model and the second neural network model.
如此,以全卷积网络(FCN,Fully Convolutional Network)为结构基础,能够用反卷积操作替代传统卷积神经网络(CNN,Convolutional Neural Networks)最后的全连接层,从而在训练、推理和预测过程中,保持图像输出尺寸与输入尺寸的一致性,以适应精细化预测(例如,对每个像素点进行预测)的需要。In this way, with the fully convolutional network (FCN) as the structural basis, the deconvolution operation can replace the last fully connected layer of the traditional convolutional neural network (CNN), so as to maintain the consistency of the image output size with the input size during training, inference and prediction to meet the needs of refined prediction (for example, prediction for each pixel).
此外,选用支持语义分割的骨干模型作为基础骨干模型,能够实现像素级别的分类,从而在应对多样化的分类需求时,能够准确地将病变或病变前区域与背景区域分割出来,提供医疗工作者更为准确可靠的参考。In addition, the selection of a backbone model that supports semantic segmentation as the basic backbone model can achieve pixel-level classification, so that when dealing with diverse classification needs, it can accurately segment the lesion or pre-lesion area from the background area, providing medical workers with a more accurate and reliable reference.
所述第一权重参数和所述第二权重参数优选配置为基于不同的参数初始化策略生成,使得对应的第一神经网络模型和第二神经网络模型在保持训练并行的基础上,具有相互独立的内部特性。如此,提升最终生成的第一模型训练参数或第二模型训练参数的泛化能力。又因为第一神经网络模型和第二神经网络模型配置为基于同一基础骨干模型构建而成,因此无需对输入的样本图像集合进行针对模型的适应性调整,输出数据信息的形式也相仿,从而更方便相互形成对照,并计算总体损失函数来进行性能评价。The first weight parameter and the second weight parameter are preferably configured to be generated based on different parameter initialization strategies, so that the corresponding first neural network model and the second neural network model have independent internal characteristics on the basis of maintaining parallel training. In this way, the generalization ability of the first model training parameters or the second model training parameters finally generated is improved. Because the first neural network model and the second neural network model are configured to be built based on the same basic backbone model, there is no need to make adaptive adjustments to the input sample image set for the model, and the form of the output data information is also similar, which makes it easier to compare with each other and calculate the overall loss function for performance evaluation.
作为优选地,所述第一神经网络模型和所述第二神经网络模型,均搭载有softmax激活函数,且配置为具有相同的优化器和学习率调整策略。从而,能够进一步保证两个神经网络模型的基本配置保持一致,能够相互对照地并行训练。其中,利用softmax激活函数适应数量更多的分类需求,例如,可以对单个像素或像素区域进行背景、上皮内瘤变和肠上皮化生共计三种类别的识别判定。判定信息的形式可以是分类概率值。Preferably, the first neural network model and the second neural network model are both equipped with a softmax activation function and are configured to have the same optimizer and learning rate adjustment strategy. Thus, it is possible to further ensure that the basic configurations of the two neural network models remain consistent and can be trained in parallel in comparison with each other. Among them, the softmax activation function is used to adapt to a larger number of classification requirements. For example, a single pixel or pixel area can be identified and determined in three categories: background, intraepithelial neoplasia, and intestinal metaplasia. The determination information can be in the form of a classification probability value.
在一种优选的具体示例中,所述基础骨干模型配置为基于U-Net网络架构。相比于传统的全卷积网络的跨层连接(skip connect),U-Net网络架构在进行尺寸调整时选择对特征进行叠加,从而使得通道(channel)数量翻倍,并且具有兼顾全局特征和局部特征,从而适应多尺度预测和深度监督(Deep Supervision)。In a preferred specific example, the basic backbone model is configured based on the U-Net network architecture. Compared with the traditional full convolutional network's skip connection, the U-Net network architecture chooses to superimpose features when resizing, thereby doubling the number of channels and taking into account both global and local features, thereby adapting to multi-scale prediction and deep supervision.
所述第一权重配置参数优选设置为基于Xavier参数初始化策略生成,所述第二权重配置参数优选设置为基于Kaiming参数初始化策略生成。前者应用于tanh激活函数运算场景下的表现更好,能够在一定程度上解决高斯分布随神经网络深度增加所造成的梯度消失的问题,后者则更侧重于对relu激活函数等非线性激活函数层面的能力,也能够一定程度上改善数据方差逐层递减的问题。在一种应用场景下,上述参数初始化策略可以是基于PyTorch学习库实现,上述第一权重配置参数和所述第二权重配置参数,可以解释为具有不同的张量参数(tensor)。可见,两权重参数并不必然限定于采用上述两种参数初始化策略来生成。The first weight configuration parameter is preferably set to be generated based on the Xavier parameter initialization strategy, and the second weight configuration parameter is preferably set to be generated based on the Kaiming parameter initialization strategy. The former performs better when applied to the tanh activation function operation scenario, and can solve the problem of gradient disappearance caused by the Gaussian distribution as the depth of the neural network increases to a certain extent. The latter focuses more on the ability of nonlinear activation functions such as the relu activation function, and can also improve the problem of data variance decreasing layer by layer to a certain extent. In an application scenario, the above parameter initialization strategy can be implemented based on the PyTorch learning library, and the above first weight configuration parameter and the second weight configuration parameter can be interpreted as having different tensor parameters (tensor). It can be seen that the two weight parameters are not necessarily limited to being generated using the above two parameter initialization strategies.
此外,所述第一神经网络模型和所述第二神经网络模型可以配置为具有相同的随机梯度下降(SGD,Stochastic Gradient Descent)优化器,以使神经网络模型的性能能够被实时评估,并且赋予其更快的学习速度。当然,本发明并不排斥采用批量梯度下降、小批量梯度下降等方式构建优化器。所述学习率调整策略配置为模型学习率值随迭代次数的增加而减小,从而使得神经网络模型的性能逐渐趋向于稳定。对于所述模型学习率值,可以在初始化之时为其设定一个最大的模型学习率值作为基础学习率值。该基础学习率值优选为0.01。In addition, the first neural network model and the second neural network model can be configured to have the same stochastic gradient descent (SGD) optimizer, so that the performance of the neural network model can be evaluated in real time and give it a faster learning speed. Of course, the present invention does not exclude the use of batch gradient descent, mini-batch gradient descent and other methods to construct the optimizer. The learning rate adjustment strategy is configured so that the model learning rate value decreases with the increase in the number of iterations, so that the performance of the neural network model gradually tends to be stable. For the model learning rate value, a maximum model learning rate value can be set as the basic learning rate value at the time of initialization. The basic learning rate value is preferably 0.01.
优选地,为了增强学习率在迭代过程中变化的平稳性,可以具体将所述模型学习率值配置为,等于剩余迭代次数与总迭代次数之比的预设指数次幂,与所述基础学习率值之积。定义当前迭代次数为n,总迭代次数为max_iter,预设指数值为i,基础学习率值为Li,则所述模型学习率值至少配置为满足: Preferably, in order to enhance the stability of the learning rate change during the iteration process, the model learning rate value can be specifically configured to be equal to the product of the preset exponential power of the ratio of the remaining number of iterations to the total number of iterations and the basic learning rate value. Define the current number of iterations as n, the total number of iterations as max_iter, the preset exponent value as i, and the basic learning rate value as Li, then the model learning rate value is at least configured to satisfy:
具体地,所述基础学习率值可以配置为0.01,所述预设指数值可以配置为0.9,则所述模型学习率值可以至 少配置为满足: Specifically, the basic learning rate value can be configured as 0.01, the preset exponent value can be configured as 0.9, and the model learning rate value can be configured as Minimum configuration is required to meet:
在基于上述实施方式提供的第一实施例中,本发明根据样本图像集合中的有标注样本图像集合和无标注样本图像集合,对应第一神经网络模型和第二神经网络模型配置了不同的训练策略,以有监督训练和推理为主,将伪标签推理结果作为第二层有监督训练的基础,并进一步充分利用样本图像集合,特别是其中较为稀缺的有标注样本图像集合,提高了模型的泛化识别能力和预测准确性。如图3所示,该第一实施例具体包括下述步骤。In the first embodiment provided based on the above implementation, the present invention configures different training strategies for the first neural network model and the second neural network model according to the labeled sample image set and the unlabeled sample image set in the sample image set, mainly using supervised training and reasoning, taking the pseudo-label reasoning result as the basis for the second-level supervised training, and further making full use of the sample image set, especially the relatively scarce labeled sample image set, to improve the generalization recognition ability and prediction accuracy of the model. As shown in Figure 3, the first embodiment specifically includes the following steps.
步骤21,接收样本图像集合。Step 21: Receive a sample image set.
步骤221,根据有标注样本图像集合,调用第一神经网络模型执行有监督训练后,根据无标注样本图像集合,调用第一神经网络模型执行遍历推理,得到对应于无标注样本图像集合的第一识别伪标签集合。Step 221, after calling the first neural network model to perform supervised training according to the labeled sample image set, calling the first neural network model to perform traversal reasoning according to the unlabeled sample image set to obtain a first recognition pseudo-label set corresponding to the unlabeled sample image set.
步骤222,根据无标注样本图像集合和第一识别伪标签集合,调用第二神经网络模型执行有监督训练,并计算得到第一损失函数。Step 222: Based on the unlabeled sample image set and the first recognition pseudo-label set, call the second neural network model to perform supervised training and calculate the first loss function.
步骤231,根据有标注样本图像集合,调用第二神经网络模型执行有监督训练后,根据无标注样本图像集合,调用第二神经网络模型执行遍历推理,得到对应于无标注样本图像集合的第二识别伪标签集合。Step 231, after calling the second neural network model to perform supervised training according to the labeled sample image set, calling the second neural network model to perform traversal reasoning according to the unlabeled sample image set to obtain a second recognition pseudo-label set corresponding to the unlabeled sample image set.
步骤232,根据无标注样本图像集合和第二识别伪标签集合,调用第一神经网络模型执行有监督训练,并计算得到第二损失函数。Step 232: Based on the unlabeled sample image set and the second recognition pseudo-label set, call the first neural network model to perform supervised training, and calculate the second loss function.
步骤24,根据第一损失函数和第二损失函数对第一神经网络模型和第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。Step 24, iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
如此,一方面,能够以“从第一神经网络模型到第二神经网络模型”和“从第二神经网络模型到第一神经网络模型”两个方向进行模型训练;另一方面,能够经由有监督训练后的模型对无标注样本图像集合进行推理,得到并以识别伪标签和无标注样本图像集合作为“有标注样本图像集合”再进行有监督训练,提升模型的效能,经过迭代得到精确度和稳定性更好的模型训练参数,并减小对大量有标注样本图像集合需求的依赖性。In this way, on the one hand, model training can be performed in two directions: "from the first neural network model to the second neural network model" and "from the second neural network model to the first neural network model"; on the other hand, the unlabeled sample image set can be inferred through the supervised training model, and the identified pseudo-labels and the unlabeled sample image set can be used as the "labeled sample image set" for further supervised training, thereby improving the performance of the model, and obtaining model training parameters with better accuracy and stability through iteration, and reducing the dependence on the demand for a large number of labeled sample image sets.
优选地,对于该实施方式或该实施方式之下的任一种实施例,或对于下文提及的任何一种实施方式,所述第一损失函数和所述第二损失函数还可以具有下述配置。首先,所述第一损失函数配置为第一有监督损失函数与第一伪标签损失函数的加权之和,所述第二损失函数配置为第二有监督损失函数与第二伪标签损失函数的加权之和,如此,能够利用第一损失函数和第二损失函数分别作为针对于步骤22和步骤23的模型总体评价参量,囊括上述两个方向下训练的全过程,增强迭代训练的效果。Preferably, for this embodiment or any embodiment under this embodiment, or for any embodiment mentioned below, the first loss function and the second loss function may also have the following configuration. First, the first loss function is configured as the weighted sum of the first supervised loss function and the first pseudo-label loss function, and the second loss function is configured as the weighted sum of the second supervised loss function and the second pseudo-label loss function. In this way, the first loss function and the second loss function can be used as overall model evaluation parameters for step 22 and step 23, respectively, covering the entire process of training in the above two directions and enhancing the effect of iterative training.
具体地,所述第一有监督损失函数指向所述第一神经网络模型基于样本图像集合进行的有监督训练过程,所述第一伪标签损失函数指向所述第二神经网络模型基于推理结果进行的有监督训练过程。优选地,所述“基于推理结果进行”在上述实施方式的第一实施例中,可以被具体解释为“基于第一识别伪标签集合进行”。所述第二有监督损失函数指向所述第二神经网络模型基于所述样本图像集合进行的有监督训练过程,所述第二伪标签损失函数指向所述第一神经网络模型基于推理结果进行的有监督训练过程。所述“基于推理结果进行”在上述实施方式的第一实施例中,可以被具体解释为“基于第二识别伪标签集合进行”。Specifically, the first supervised loss function refers to the supervised training process of the first neural network model based on the sample image set, and the first pseudo-label loss function refers to the supervised training process of the second neural network model based on the reasoning result. Preferably, the "based on the reasoning result" in the first embodiment of the above-mentioned implementation mode can be specifically interpreted as "based on the first identification pseudo-label set". The second supervised loss function refers to the supervised training process of the second neural network model based on the sample image set, and the second pseudo-label loss function refers to the supervised training process of the first neural network model based on the reasoning result. The "based on the reasoning result" in the first embodiment of the above-mentioned implementation mode can be specifically interpreted as "based on the second identification pseudo-label set".
如此,可以在构建步骤整体对应的损失函数作为评价参量的基础上,囊括基于有标签数据和伪标签数据的有监督训练过程,提升模型的泛化识别能力,减小对有标签数据的需求量。In this way, based on the loss function corresponding to the overall construction step as an evaluation parameter, the supervised training process based on labeled data and pseudo-labeled data can be included to improve the generalization recognition ability of the model and reduce the demand for labeled data.
上述提供的技术方案旨在对损失函数所对应的训练过程进行对应,而对于损失函数的具体类型,在一种具体示例中,可以将上述任一种损失函数配置为交叉熵损失函数,或交叉熵损失函数与交并比损失函数的组合。优选地,在以反映模型整体效能为先的情况下,可以采用后一种组合方案来配置损失函数,在以保持训练过程的稳定性和确定性为先的情况下,可以采用前一种单一方案来配置损失函数。The technical solution provided above is intended to correspond to the training process corresponding to the loss function, and for the specific type of loss function, in a specific example, any of the above loss functions can be configured as a cross entropy loss function, or a combination of a cross entropy loss function and an intersection-over-union loss function. Preferably, in the case where the overall effectiveness of the model is given priority, the latter combination scheme can be used to configure the loss function, and in the case where the stability and certainty of the training process are given priority, the former single scheme can be used to configure the loss function.
基于此,本发明提供一种优选的方案,针对上述不同损失函数的作用来进行损失函数类型的配置。在该优选方案中,所述第一有监督损失函数配置为第一有监督交叉熵损失函数与第一有监督交并比损失函数之和。其中,所述第一有监督交叉熵损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类概率之间的差距,所述第一有监督交并比损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类类别之间的差距。Based on this, the present invention provides a preferred solution to configure the loss function type according to the effects of the above-mentioned different loss functions. In this preferred solution, the first supervised loss function is configured as the sum of the first supervised cross entropy loss function and the first supervised intersection-over-union loss function. Among them, the first supervised cross entropy loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification probability, and the first supervised intersection-over-union loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification category.
在所述样本图像集合包括有标注样本图像集合的实施方式中,所述已知标签数据可以是所述有标注样本图像集合中诸如掩膜的标签数据。所述已知标签数据对应的推理分类概率,可以是第一神经网络模型对有标注样本图像中所有像素的推理分类概率。所述已知标签数据对应的推理分类类别,可以是第一神经网络模型对有标注样本图像中所有像素的推理分类类别。In an embodiment where the sample image set includes a labeled sample image set, the known label data may be label data such as a mask in the labeled sample image set. The inference classification probability corresponding to the known label data may be the inference classification probability of all pixels in the labeled sample image by the first neural network model. The inference classification category corresponding to the known label data may be the inference classification category of all pixels in the labeled sample image by the first neural network model.
所述第一伪标签损失函数配置为包括第一伪标签交叉熵损失函数。其中,所述第一伪标签交叉熵损失函数表 征所述第一神经网络模型对所述样本图像集合的推理分类概率,与所述第二神经网络模型对所述样本图像集合的推理分类类别之间的差距。The first pseudo label loss function is configured to include a first pseudo label cross entropy loss function. The invention relates to a method for characterizing the gap between the inference classification probability of the first neural network model for the sample image set and the inference classification category of the second neural network model for the sample image set.
在所述样本图像集合包括无标注样本图像集合的实施方式中,所述第一伪标签交叉熵损失函数可以表征,第一神经网络模型对无标注样本图像中所有像素的推理分类概率,与第二神经网络模型对无标注样本图像中所有像素的推理分类类别之间的差距。In an embodiment where the sample image set includes an unlabeled sample image set, the first pseudo-label cross entropy loss function can characterize the gap between the inferred classification probability of all pixels in the unlabeled sample images by the first neural network model and the inferred classification category of all pixels in the unlabeled sample images by the second neural network model.
所述第二有监督损失函数配置为第二有监督交叉熵损失函数与第二有监督交并比损失函数之和。其中,所述第二有监督交叉熵损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类概率之间的差距。所述第二有监督交并比损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类类别之间的差距。具体地,所述已知标签数据对应的推理分类概率,可以是第二神经网络模型对有标注样本图像中所有像素的推理分类概率。所述已知标签数据对应的推理分类类别,可以是第二神经网络模型对有标注样本图像中所有像素的推理分类类别。The second supervised loss function is configured as the sum of a second supervised cross entropy loss function and a second supervised intersection-over-union loss function. Among them, the second supervised cross entropy loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification probability. The second supervised intersection-over-union loss function characterizes the gap between the known label data in the sample image set and the corresponding inference classification category. Specifically, the inference classification probability corresponding to the known label data may be the inference classification probability of the second neural network model for all pixels in the labeled sample image. The inference classification category corresponding to the known label data may be the inference classification category of the second neural network model for all pixels in the labeled sample image.
所述第二伪标签损失函数包括第二伪标签交叉熵损失函数。其中,所述第二伪标签交叉熵损失函数表征所述第二神经网络模型对所述样本图像集合的推理分类概率,与所述第一神经网络模型对所述样本图像集合的推理分类类别之间的差距。具体地,所述第二伪标签交叉熵损失函数可以表征,第二神经网络模型对无标注样本图像中所有像素的推理分类概率,与第一神经网络模型对无标注样本图像中所有像素的推理分类类别之间的差距。The second pseudo-label loss function includes a second pseudo-label cross entropy loss function. The second pseudo-label cross entropy loss function represents the difference between the inference classification probability of the second neural network model for the sample image set and the inference classification category of the first neural network model for the sample image set. Specifically, the second pseudo-label cross entropy loss function can represent the difference between the inference classification probability of all pixels in the unlabeled sample image by the second neural network model and the inference classification category of all pixels in the unlabeled sample image by the first neural network model.
定义有标注样本图像对应的已知标签数据(可以是图像对应的病变标注掩膜,或该掩膜上对应于每个像素的分类编码标签)为labelL;定义第一神经网络模型对有标注样本图像中全部像素的推理分类概率为out_prob_1L,第一神经网络模型对有标注样本图像中全部像素的推理分类类别为out_class_1L,第一神经网络模型对无标注样本图像中全部像素的推理分类概率为out_prob_1U,第一神经网络模型对无标注样本图像中全部像素的推理分类类别为pseudo_label_1U(也即,所述第一识别伪标签集合);定义第二神经网络模型对有标注样本图像中全部像素的推理分类概率为out_prob_2L,第一神经网络模型对有标注样本图像中全部像素的推理分类类别为out_class_2L,第一神经网络模型对无标注样本图像中全部像素的推理分类概率为out_prob_2U,第一神经网络模型对无标注样本图像中全部像素的推理分类类别为pseudo_label_2U(也即,所述第二识别伪标签集合)。则,所述第一有监督损失函数至少满足:Define the known label data corresponding to the labeled sample image (which may be the lesion annotation mask corresponding to the image, or the classification coding label corresponding to each pixel on the mask) as label L ; define the inference classification probability of all pixels in the labeled sample image by the first neural network model as out_prob_1 L , the inference classification category of all pixels in the labeled sample image by the first neural network model as out_class_1 L , the inference classification probability of all pixels in the unlabeled sample image by the first neural network model as out_prob_1 U , and the inference classification category of all pixels in the unlabeled sample image by the first neural network model as pseudo_label_1 U (that is, the first recognition pseudo label set); define the inference classification probability of all pixels in the labeled sample image by the second neural network model as out_prob_2 L , the inference classification category of all pixels in the labeled sample image by the first neural network model as out_class_2 L , the inference classification probability of all pixels in the unlabeled sample image by the first neural network model as out_prob_2 U , and the inference classification category of all pixels in the unlabeled sample image by the first neural network model as pseudo_label_2 U (That is, the second identification pseudo-label set). Then, the first supervised loss function at least satisfies:
supervised_loss_1=ce_loss(out_prob_1L,labelL)+dice_loss(out_class_1L,labelL);supervised_loss_1=ce_loss(out_prob_1 L ,label L )+dice_loss(out_class_1 L ,label L );
其中,所述ce_loss(out_prob_1L,labelL)为所述第一有监督交叉熵损失函数,所述dice_loss(out_class_1L,labelL)为所述第一有监督交并比损失函数。Wherein, the ce_loss(out_prob_1 L ,label L ) is the first supervised cross entropy loss function, and the dice_loss(out_class_1 L ,label L ) is the first supervised intersection-over-union loss function.
所述第一伪标签损失函数至少满足:pseudo_loss_1=ce_loss(out_prob_1U,pseudo_label_2U);The first pseudo label loss function at least satisfies: pseudo_loss_1=ce_loss(out_prob_1 U ,pseu_label_2 U );
其中,所述ce_loss(out_prob_1U,pseudo_label_2U)为所述第一伪标签交叉熵损失函数。Among them, the ce_loss(out_prob_1 U ,pseudo_label_2 U ) is the first pseudo-label cross entropy loss function.
所述第二有监督损失函数至少满足:The second supervised loss function at least satisfies:
supervised_loss_2=ce_loss(out_prob_2L,labelL)+dice_loss(out_class_2L,labelL);supervised_loss_2=ce_loss(out_prob_2 L ,label L )+dice_loss(out_class_2 L ,label L );
其中,所述ce_loss(out_prob_2L,labelL)为所述第二有监督交叉熵损失函数,所述dice_loss(out_class_2L,labelL)为所述第二有监督交并比损失函数。 Wherein, the ce_loss(out_prob_2 L ,label L ) is the second supervised cross entropy loss function, and the dice_loss(out_class_2 L ,label L ) is the second supervised intersection-over-union loss function.
所述第二伪标签损失函数至少满足:pseudo_loss_2=ce_loss(out_prob_2U,pseudo_label_1U);The second pseudo label loss function at least satisfies: pseudo_loss_2=ce_loss(out_prob_2 U ,pseu_label_1 U );
其中,所述ce_loss(out_prob_1U,pseudo_label_2U)为所述第二伪标签交叉熵损失函数。Wherein, the ce_loss(out_prob_1 U ,pseudo_label_2 U ) is the second pseudo-label cross entropy loss function.
在上文提及的一种实施方式中,所述样本图像集合中的样本图像表征上皮内瘤变情况和肠上皮化生情况。从而,所述第一有监督交叉熵损失函数、所述第一伪标签交叉熵损失函数、所述第二有监督交叉熵损失函数和所述第二伪标签交叉熵损失函数,指向样本图像中背景区域、上皮内瘤变区域和肠上皮化生区域,也即将其配置为三分类平均交叉熵损失(cross-entropy loss)函数。所述第一有监督交并比损失函数和所述第二有监督交并比损失函数,指向样本图像中上皮内瘤变区域和肠上皮化生区域,也即将其配置为二分类平均交并比损失(dice loss)函数。In one embodiment mentioned above, the sample images in the sample image set characterize the intraepithelial neoplasia and intestinal metaplasia. Thus, the first supervised cross entropy loss function, the first pseudo-label cross entropy loss function, the second supervised cross entropy loss function and the second pseudo-label cross entropy loss function point to the background area, the intraepithelial neoplasia area and the intestinal metaplasia area in the sample image, that is, they are configured as a three-class average cross entropy loss (cross-entropy loss) function. The first supervised intersection-of-union loss function and the second supervised intersection-of-union loss function point to the intraepithelial neoplasia area and the intestinal metaplasia area in the sample image, that is, they are configured as a two-class average intersection-of-union loss (dice loss) function.
对于第一损失函数中第一伪标签损失函数的权重,以及第二损失函数中第二伪标签损失函数的权重,可以优选将其配置为具有相等的预设权重值,从而增强两种训练方向下模型评价的一致性。进一步地,可以将该预设权重值配置为随着训练迭代次数的增加而增大,也即两者配置为正相关。如此,逐渐提高对伪标签损失函数的置信度,使模型训练过程逐渐趋于稳定。当然,本发明并不排斥将所述预设权重值配置为定值的技术方案,如此,能够将伪标签损失函数参与模型评价过程的程度保持在一个稳定的范围内。For the weight of the first pseudo-label loss function in the first loss function, and the weight of the second pseudo-label loss function in the second loss function, it is preferred to configure them to have equal preset weight values, so as to enhance the consistency of model evaluation under the two training directions. Furthermore, the preset weight value can be configured to increase with the increase in the number of training iterations, that is, the two are configured to be positively correlated. In this way, the confidence in the pseudo-label loss function is gradually improved, so that the model training process gradually tends to be stable. Of course, the present invention does not exclude the technical solution of configuring the preset weight value as a fixed value, so that the degree of participation of the pseudo-label loss function in the model evaluation process can be kept within a stable range.
具体地,对于将预设权重值配置为动态变化值的技术方案而言,本发明提供一优选的配置方式,将所述预设权重值配置为等于权重最大值与预设递增函数的乘积,所述预设递增函数配置为函数值无限趋近于1。优选地,所述预设递增函数配置为由0开始平缓增大,且以较小的斜率无限趋近于1。Specifically, for the technical solution of configuring the preset weight value as a dynamically changing value, the present invention provides a preferred configuration mode, wherein the preset weight value is configured to be equal to the product of the maximum weight value and a preset increasing function, and the preset increasing function is configured so that the function value infinitely approaches 1. Preferably, the preset increasing function is configured to increase smoothly from 0 and infinitely approaches 1 with a smaller slope.
基于此,在一种实施方式中,可以利用欧拉数作为底数构建随迭代次数变化的指数函数,从而实现上述配置方式。定义权重最大值为λmax,当前迭代次数为n,则所述预设权重值至少满足:
Based on this, in one implementation, the Euler number can be used as the base to construct an exponential function that changes with the number of iterations, thereby realizing the above configuration. Define the maximum weight value as λ max , the current number of iterations is n, and the preset weight value at least satisfies:
其中,符号“//”代表向下取整整除,用于返回整除结果的整数部分。基于上述配置,可以使预设权重值具有更为平缓的变化趋势。所述权重最大值λmax优选为0.1。The symbol "//" represents the integer division downwards, and is used to return the integer part of the integer division result. Based on the above configuration, the preset weight value can have a more gentle change trend. The maximum weight value λ max is preferably 0.1.
当然,本发明还可以利用线性函数来作为上述预设递增函数,定义当前迭代次数为n,总迭代次数为max_iter,则所述预设权重值至少满足:
Of course, the present invention can also use a linear function as the above-mentioned preset increasing function, define the current number of iterations as n, and the total number of iterations as max_iter, then the preset weight value at least satisfies:
如此,可以实现前80%的训练步骤对预设权重值进行递增配置,后20%保持预设权重值不变。In this way, the first 80% of the training steps can be configured incrementally for the preset weight values, and the last 20% can keep the preset weight values unchanged.
可以理解地,本发明上述实施方式虽然将“得到第一模型训练参数和第二模型训练参数至少其中之一”作为最后步骤,但并不意味着执行本发明提供的技术方案只能得到模型训练参数,本领域技术人员当然可以根据该模型训练参数生成对应的神经网络模型,以用于进行病理图像识别。基于此,本发明还可以包括在步骤24之后的补充步骤:加载所述第一模型训练参数对所述第一神经网络模型进行初始化,和/或加载所述第二模型训练参数对所述第二神经网络模型进行初始化,得到病理图像识别模型。It is understandable that although the above-mentioned embodiment of the present invention takes "obtaining at least one of the first model training parameter and the second model training parameter" as the last step, it does not mean that only the model training parameters can be obtained by executing the technical solution provided by the present invention. Those skilled in the art can certainly generate a corresponding neural network model based on the model training parameters for pathological image recognition. Based on this, the present invention may also include a supplementary step after step 24: loading the first model training parameters to initialize the first neural network model, and/or loading the second model training parameters to initialize the second neural network model to obtain a pathological image recognition model.
可以理解地,上述迭代训练过程的终止条件可以被具体配置为,当损失函数降低并稳定在预设区间范围内即停止。It can be understood that the termination condition of the above iterative training process can be specifically configured to stop when the loss function is reduced and stabilized within a preset range.
需要说明地,本发明提供的病理图像识别模型训练方法的推理测试过程,可以是在单独的验证集上进行,且配置为在完成每轮训练后即对训练得到的神经网络模型进行验证,从而得到与上文相对应的损失函数指标,从而进行最优节点(也即上文所述模型训练参数)的选取。由此可见,本发明提供的病理图像识别模型训练方法并不仅仅包含在训练集上的迭代过程,更包括在验证集上进行模型评估选择的过程。此外,定义迭代总轮数为epoch,则总迭代次数max_iter,可以对应等于迭代总轮数epoch与遍历样本图像集合中所有数据所需迭代次数的乘积。 It should be noted that the reasoning test process of the pathological image recognition model training method provided by the present invention can be performed on a separate verification set, and is configured to verify the trained neural network model after completing each round of training, so as to obtain the loss function index corresponding to the above, so as to select the optimal node (that is, the model training parameters described above). It can be seen that the pathological image recognition model training method provided by the present invention is not only included in the iterative process on the training set, but also includes the process of model evaluation and selection on the verification set. In addition, the total number of iterations is defined as epoch, and the total number of iterations max_iter can correspond to the product of the total number of iterations epoch and the number of iterations required to traverse all the data in the sample image set.
同理,本发明也并不限制所述步骤21之前不能包含其他前置步骤。例如,在本发明另一种实施方式中,提供了所述样本图像集合的生成过程,将形态特征各异的参考病理图像集合进行标准化处理后,分组形成训练集和验证集,从而便于后续训练过程的进行。结合图2和图4所示,该另一实施方式具体包括下述步骤。Similarly, the present invention does not limit the step 21 to include other pre-steps. For example, in another embodiment of the present invention, a generation process of the sample image set is provided, and a reference pathological image set with different morphological characteristics is standardized and grouped into a training set and a validation set, so as to facilitate the subsequent training process. In combination with FIG. 2 and FIG. 4, the other embodiment specifically includes the following steps.
步骤31,接收参考病理图像集合。Step 31: Receive a reference pathology image set.
步骤32,对参考病理图像集合依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到标准病理图像集合。其中,所述标准病理图像集合包括有标注病理图像集合和无标注病理图像集合。Step 32, performing size standardization processing and color migration standardization processing on the reference pathology image set in sequence, and calculating to obtain a standard pathology image set. The standard pathology image set includes a labeled pathology image set and an unlabeled pathology image set.
步骤33,对有标注病理图像集合进行分组,将第一有标注图像集合与无标注病理图像集合组合构成样本图像训练集,并根据第二有标注图像集合形成样本图像验证集。Step 33, grouping the annotated pathological image sets, combining the first annotated image set with the unannotated pathological image set to form a sample image training set, and forming a sample image verification set based on the second annotated image set.
步骤34,根据样本图像训练集和样本图像验证集,生成样本图像集合。Step 34: Generate a sample image set based on the sample image training set and the sample image verification set.
步骤21,接收样本图像集合。Step 21: Receive a sample image set.
步骤22,根据样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数。Step 22, according to the sample image set, call the first neural network model to perform supervised training and traversal reasoning in sequence, and call the second neural network model to perform supervised training based on the reasoning result to calculate the first loss function.
步骤23,根据样本图像集合,调用第二神经网络模型依次执行有监督训练和遍历推理,并调用第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数。Step 23, according to the sample image set, call the second neural network model to perform supervised training and traversal reasoning in sequence, and call the first neural network model to perform supervised training based on the reasoning result to calculate the second loss function.
步骤24,根据第一损失函数和第二损失函数对第一神经网络模型和第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。Step 24, iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
如此,能够将参考病理图像集合中每组图像或图像数据,处理成具有统一的尺寸和染色情况的图像或图像数据,避免由于染色等外部因素,影响后续的模型训练过程和模型训练参数的准确性。同时,将样本图像训练集配置为同时包含有标注病理图像和无标注病理图像,能够适应后续对训练过程的特殊配置,降低对有标注病理图像的需求。In this way, each group of images or image data in the reference pathological image set can be processed into images or image data with uniform size and staining conditions, avoiding the influence of external factors such as staining on the accuracy of subsequent model training process and model training parameters. At the same time, the sample image training set is configured to include both annotated pathological images and unannotated pathological images, which can adapt to the special configuration of the subsequent training process and reduce the demand for annotated pathological images.
所述参考病理图像集合中的参考病理图像,可以解释为至少包含部分经过标注的标本图像的参考图像集合。所述参考图像集合用于生成所述样本图像集合,并投入模型训练中。基于所述样本图像集合包括样本图像训练集和样本图像验证集,上文提及的任何关于在训练集上进行迭代训练的步骤,即可对应配置为在所述样本图像训练集上进行,任何关于在验证集上进行评估选择的步骤,即可对应配置为在所述样本图像验证集上进行,本发明并不对此进行展开描述。The reference pathological images in the reference pathological image set can be interpreted as a reference image set that at least contains some labeled specimen images. The reference image set is used to generate the sample image set and is put into model training. Based on the fact that the sample image set includes a sample image training set and a sample image verification set, any of the steps mentioned above regarding iterative training on the training set can be configured to be performed on the sample image training set, and any of the steps regarding evaluation and selection on the verification set can be configured to be performed on the sample image verification set, which is not described in detail in the present invention.
本发明基于上述另一实施方式提供其第一实施例,将参考病理图像集合配置为根据不同种类的病变标本图像选择性进行像素标注而生成,并针对由此形成的多种图像分别进行标准化处理,从而得到标准病理图像集合中的不同组成部分。结合图2和图5,该第一实施例具体包括下述步骤。The present invention provides a first embodiment based on the above another embodiment, wherein the reference pathology image set is configured to be generated by selectively annotating pixels according to different types of lesion specimen images, and the multiple images thus formed are respectively standardized to obtain different components of the standard pathology image set. In conjunction with FIG. 2 and FIG. 5 , the first embodiment specifically includes the following steps.
步骤301,接收癌前病变标本图像和非癌前病变标本图像。Step 301: receiving a precancerous lesion specimen image and a non-precancerous lesion specimen image.
步骤302,对部分癌前病变标本图像进行像素标注,得到病变标注掩膜。Step 302 : pixel-annotate some precancerous lesion specimen images to obtain lesion annotation masks.
步骤303,根据癌前病变标本图像、对应的病变标注掩膜,以及非癌前病变标本图像,生成参考病理图像集合。Step 303 : generating a reference pathology image set according to the precancerous lesion specimen image, the corresponding lesion annotation mask, and the non-precancerous lesion specimen image.
步骤31,接收参考病理图像集合。Step 31: Receive a reference pathology image set.
步骤32,对参考病理图像集合依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到标准病理图像集合。所述步骤32具体包括:Step 32, performing size standardization and color migration standardization on the reference pathology image set in sequence, and calculating to obtain a standard pathology image set. The step 32 specifically includes:
步骤321,对所有标注病变标本图像依次执行尺寸标准化处理和颜色迁移标准化处理,并根据处理后的标注病变标本图像,运算得到有标注病理图像集合;其中,所述标注病变标本图像对应于具有对应病变标注掩膜的癌前病变标本图像;Step 321, performing size standardization processing and color migration standardization processing on all labeled lesion specimen images in sequence, and obtaining a set of labeled pathology images based on the processed labeled lesion specimen images; wherein the labeled lesion specimen images correspond to precancerous lesion specimen images with corresponding lesion annotation masks;
步骤322,对所有无标注病变标本图像和所有非癌前病变标本图像,依次执行尺寸标准化处理和颜色迁移标准化处理,并根据处理后的无标注病变标本图像和非癌前病变标本图像,运算得到无标注病理图像集合;其中,所述无标注病变标本图像对应于不具有对应病变标注掩膜的癌前病变标本图像。Step 322, size normalization processing and color migration normalization processing are performed on all unlabeled lesion specimen images and all non-precancerous lesion specimen images in sequence, and a set of unlabeled pathological images is obtained by calculation based on the processed unlabeled lesion specimen images and non-precancerous lesion specimen images; wherein the unlabeled lesion specimen images correspond to precancerous lesion specimen images without corresponding lesion annotation masks.
步骤33,对有标注病理图像集合进行分组,将第一有标注图像集合与无标注病理图像集合组合构成样本图像训练集,并根据第二有标注图像集合形成样本图像验证集。Step 33, grouping the annotated pathological image sets, combining the first annotated image set with the unannotated pathological image set to form a sample image training set, and forming a sample image verification set based on the second annotated image set.
步骤34,根据样本图像训练集和样本图像验证集,生成样本图像集合。Step 34: Generate a sample image set based on the sample image training set and the sample image verification set.
步骤21,接收样本图像集合。Step 21: Receive a sample image set.
步骤22,根据样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数。Step 22, according to the sample image set, call the first neural network model to perform supervised training and traversal reasoning in sequence, and call the second neural network model to perform supervised training based on the reasoning result to calculate the first loss function.
步骤23,根据样本图像集合,调用第二神经网络模型依次执行有监督训练和遍历推理,并调用第一神经网 络模型基于推理结果进行有监督训练,计算得到第二损失函数。Step 23, based on the sample image set, call the second neural network model to perform supervised training and traversal reasoning in sequence, and call the first neural network The network model is supervisedly trained based on the inference results, and the second loss function is calculated.
步骤24,根据第一损失函数和第二损失函数对第一神经网络模型和第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。Step 24, iteratively training the first neural network model and the second neural network model according to the first loss function and the second loss function to obtain at least one of the first model training parameters and the second model training parameters.
在上述病理图像识别模型训练方法应用于消化系统前期预警的场景下时,所述癌前病变标本图像可以被解释为:存在上皮内瘤变或肠上皮化生现象的标本图像。所述非癌前病变标本图像则可以对应解释为:不包含上述现象的标本图像。实施上述技术方案,可以只对部分癌前病变标本图像进行像素标注,从而减少成本消耗。When the above-mentioned pathological image recognition model training method is applied to the scenario of early warning of the digestive system, the precancerous lesion specimen image can be interpreted as: a specimen image with intraepithelial neoplasia or intestinal metaplasia. The non-precancerous lesion specimen image can be correspondingly interpreted as: a specimen image that does not contain the above-mentioned phenomenon. By implementing the above-mentioned technical solution, only some precancerous lesion specimen images can be pixel-annotated, thereby reducing cost consumption.
对于上述图像或图像数据的数量或数据量的配置,可以具体是:所述标注病变标本图像的数量占所有癌前病变标本图像的数量的30%。相较于完全有监督训练所要求的100%而言,能够大幅降低成本,提高效率和标注数据的利用率。此外,所有非癌前病变标本图像的数量占所有癌前病变标本图像的数量的20%,能够增强模型的泛化识别能力。The configuration of the number or amount of data of the above-mentioned images or image data can be specifically: the number of the labeled lesion specimen images accounts for 30% of the number of all precancerous lesion specimen images. Compared with the 100% required for fully supervised training, it can greatly reduce costs, improve efficiency and utilization of labeled data. In addition, the number of all non-precancerous lesion specimen images accounts for 20% of the number of all precancerous lesion specimen images, which can enhance the generalization recognition ability of the model.
为了保证后续模型训练的顺利进行,本发明基于上述第一实施例,还提供了一种针对步骤321和步骤322的具体示例。在该具体示例中,所述步骤32具体包括步骤:对完成尺寸标准化处理和颜色迁移标准化处理的参考病理图像执行滑窗区域分割,得到并根据多组滑窗区域图像组,运算得到标准病理图像集合。如此,能够将参考病理图像切分为适合作为模型输入的尺寸,从而方便模型进行遍历和迭代训练。In order to ensure the smooth progress of subsequent model training, the present invention further provides a specific example for step 321 and step 322 based on the above first embodiment. In this specific example, step 32 specifically includes the steps of: performing sliding window region segmentation on the reference pathological image that has completed the size standardization processing and color migration standardization processing, and obtaining and calculating a standard pathological image set based on multiple groups of sliding window region image groups. In this way, the reference pathological image can be cut into a size suitable for model input, thereby facilitating the traversal and iterative training of the model.
所述滑窗区域图像组中的滑窗区域图像,具有256*256的尺寸大小。执行滑窗区域分割的步长可以是滑窗区域图像任一边的0.25至0.5倍中的任一像素尺寸,例如可以是128像素。从而,在遍历过程中形成50%的重叠,使其有效涵盖各种边缘特征。The sliding window region images in the sliding window region image group have a size of 256*256. The step size for performing sliding window region segmentation can be any pixel size between 0.25 and 0.5 times of any side of the sliding window region image, for example, 128 pixels. Thus, a 50% overlap is formed during the traversal process, so that various edge features are effectively covered.
具体地,如图6所示,所述“滑窗区域分割”可以包括:Specifically, as shown in FIG6 , the “sliding window region segmentation” may include:
步骤3211,构建预设尺寸的图像区域滑窗,并使图像区域滑窗按照预设步长对标注标准化图像和对应的病变标注掩膜执行遍历分割,得到多组标注滑窗图像组和标注滑窗掩膜组;Step 3211, constructing an image area sliding window of a preset size, and making the image area sliding window perform traversal segmentation on the annotated standardized image and the corresponding lesion annotated mask according to a preset step length, to obtain multiple groups of annotated sliding window image groups and annotated sliding window mask groups;
步骤3212,遍历、分析并根据标注滑窗掩膜组中所有标注滑窗掩膜的病灶区域占比,筛选更新标注滑窗图像和对应的标注滑窗掩膜;Step 3212, traverse, analyze and filter and update the labeled sliding window image and the corresponding labeled sliding window mask according to the proportion of the lesion area of all labeled sliding window masks in the labeled sliding window mask group;
步骤3221,使图像区域滑窗按照预设步长对无标注标准化图像和非病变标准化图像执行遍历分割,得到多组无标注滑窗图像组和非病变滑窗图像组;Step 3221, causing the image region sliding window to perform traversal segmentation on the unlabeled standardized image and the non-lesion standardized image according to a preset step length, to obtain multiple groups of unlabeled sliding window image groups and non-lesion sliding window image groups;
步骤3222,遍历、分析并根据无标注滑窗图像和非病变滑窗图像的组织区域占比,筛选更新无标注滑窗图像和非病变滑窗图像。Step 3222, traverse, analyze and filter and update the unlabeled sliding window images and the non-lesion sliding window images according to the tissue area ratio of the unlabeled sliding window images and the non-lesion sliding window images.
其中,所述标注标准化图像为完成标准化处理后的标注病变标本图像。所述无标注标准化图像为完成标准化处理后的无标注病变标本图像。所述非病变标准化图像为完成标准化处理后的非癌前病变标本图像。如此,能够得到对应标注病变标本图像的滑窗区域图像组、对应于病变标注掩膜的滑窗区域掩膜组、对应于无标注病变标本图像的滑窗区域图像组,以及对应于非癌前病变标本图像的滑窗区域图像组,以分别作为模型的数据输入。The annotated standardized image is an annotated lesion specimen image after standardization. The unannotated standardized image is an unannotated lesion specimen image after standardization. The non-lesion standardized image is a non-precancerous lesion specimen image after standardization. In this way, a sliding window region image group corresponding to annotated lesion specimen images, a sliding window region mask group corresponding to lesion annotation masks, a sliding window region image group corresponding to unannotated lesion specimen images, and a sliding window region image group corresponding to non-precancerous lesion specimen images can be obtained to serve as data inputs for the model respectively.
一方面,上述滑窗区域图像组中滑窗区域图像,可以是RGB图像。因此,输入到神经网络模型中进行迭代的数据类型,可以是RGB图像对应的RGB矩阵,并具体可以是(256,256,T)的多通道RGB矩阵。通道数T可以根据待识别类别的数量来确定,对于上述消化系统癌变前期预警的应用场景而言,通道数T=3,分别指代背景、上皮内瘤变和肠上皮化生三种。On the one hand, the sliding window area image in the above sliding window area image group can be an RGB image. Therefore, the data type input into the neural network model for iteration can be an RGB matrix corresponding to the RGB image, and specifically can be a multi-channel RGB matrix of (256, 256, T). The number of channels T can be determined according to the number of categories to be identified. For the above application scenario of early warning of digestive system cancer, the number of channels T = 3, which respectively refer to the background, intraepithelial neoplasia and intestinal metaplasia.
进一步地,在标注滑窗掩膜中,可以利用RGB值(0,0,255)指向的蓝色表示背景,利用RGB值(255,0,0)指向的红色表示上皮内瘤变,利用RGB值(0,255,0)指向的绿色表示肠上皮化生。此外,上述标本图像可以具体是由统一的染色方法制成(例如,苏木素-伊红染色法,Hematoxylin-Hosin Staining),并保存为统一的格式(例如,svs格式或kfb格式等)。对应生成的标注滑窗掩膜,可以配置为PNG(Portable Network Graphics,便携式网络图形)文件。进行标注的方式,可以具体是通过ASAP(Automated Slide Analysis Platform,自动载玻片分析平台)或labelme等工具标注。Furthermore, in the annotation sliding window mask, the blue color pointed to by the RGB value (0, 0, 255) can be used to represent the background, the red color pointed to by the RGB value (255, 0, 0) can be used to represent the intraepithelial neoplasia, and the green color pointed to by the RGB value (0, 255, 0) can be used to represent the intestinal metaplasia. In addition, the above specimen image can be specifically made by a unified staining method (for example, Hematoxylin-Hosin Staining) and saved in a unified format (for example, svs format or kfb format, etc.). The corresponding generated annotation sliding window mask can be configured as a PNG (Portable Network Graphics) file. The way of annotation can be specifically annotated by tools such as ASAP (Automated Slide Analysis Platform) or labelme.
另一方面,对标注滑窗图像和对应的标注滑窗掩膜进行更新筛选的过程,可以具体配置为根据中心区域病灶部位覆盖程度进行筛选,筛选保留覆盖程度高于预设百分比的标注滑窗图像和标注滑窗掩膜。在上述消化系统的场景下,在滑窗图像尺寸为256*256时,可以截取标注滑窗掩膜上中心位置64*64像素大小的区域,在其中任一病灶覆盖面积大于等于该区域的三分之一时,则保留该区域对应的标注滑窗图像和标注滑窗掩膜。所述任一病灶可以解释为上皮内瘤变或肠上皮化生其中之一。如此,可以减少筛选更新过程中的数据处理量,选择更能够概括标注滑窗图像内容的中心区域进行分析,加快整体工作效率。On the other hand, the process of updating and screening the annotated sliding window image and the corresponding annotated sliding window mask can be specifically configured to screen according to the coverage of the lesion site in the central area, and screen and retain the annotated sliding window image and the annotated sliding window mask with a coverage higher than a preset percentage. In the above-mentioned digestive system scenario, when the sliding window image size is 256*256, an area of 64*64 pixels in size at the center position of the annotated sliding window mask can be intercepted. When the coverage area of any lesion is greater than or equal to one-third of the area, the annotated sliding window image and the annotated sliding window mask corresponding to the area are retained. Any of the lesions can be interpreted as one of intraepithelial neoplasia or intestinal metaplasia. In this way, the amount of data processing in the screening and updating process can be reduced, and the central area that can better summarize the content of the annotated sliding window image can be selected for analysis, thereby speeding up the overall work efficiency.
对无标注滑窗图像和非病变滑窗图像进行更新筛选的过程,可以具体配置为根据整体的组织区域占比来进行,筛选保留阻值区域占比高于预设百分比的无标注滑窗图像和非病变滑窗图像。在上述消化系统的场景下,可 以计算其中灰度值较低(诸如,灰度值低于210)的区域来作为组织区域,计算该区域在整体图像中的占比并与预设的30%或其他数值进行比较。若大于30%,则予以保留。可以理解地,由于此部分并不包含病灶或其他需要进行分类的特征,因此可以将无标注滑窗图像和非病变滑窗图像整体设置为背景色(例如,蓝色)。The process of updating and screening the unlabeled sliding window images and the non-lesion sliding window images can be specifically configured to be performed according to the overall tissue area ratio, and the unlabeled sliding window images and the non-lesion sliding window images whose resistance area ratio is higher than a preset percentage are screened and retained. In the above-mentioned digestive system scenario, The area with a lower grayscale value (such as a grayscale value lower than 210) is calculated as the tissue area, and the proportion of the area in the overall image is calculated and compared with a preset 30% or other value. If it is greater than 30%, it is retained. It can be understood that since this part does not contain lesions or other features that need to be classified, the unlabeled sliding window image and the non-lesion sliding window image can be set as a background color (for example, blue) as a whole.
再一方面,除了直接利用上述滑窗区域图像组和标注滑窗掩膜组进行训练以外(也即,将更新后的标注滑窗图像和对应的标注滑窗掩膜直接作为标注病理图像集合,将更新后的无标注滑窗图像和非病变滑窗图像直接作为无标注病理图像集合),在该具体示例中,还可以对上述数据进行增广处理,从而进一步增强模型的泛化识别能力。具体地,继续如图6所示,所述步骤3212之后可以包括步骤3213:对标注滑窗图像和对应的标注滑窗掩膜执行随机数据增广处理,得到有标注病理图像集合。所述步骤3222之后可以包括步骤3223:对无标注滑窗图像和非病变滑窗图像执行随机数据增广处理,得到无标注病理图像集合。On the other hand, in addition to directly using the above-mentioned sliding window area image group and the annotated sliding window mask group for training (that is, using the updated annotated sliding window image and the corresponding annotated sliding window mask directly as the annotated pathology image set, and using the updated unannotated sliding window image and the non-lesion sliding window image directly as the unannotated pathology image set), in this specific example, the above-mentioned data can also be augmented to further enhance the generalization recognition ability of the model. Specifically, as shown in Figure 6, the step 3212 may include step 3213: performing random data augmentation processing on the annotated sliding window image and the corresponding annotated sliding window mask to obtain a set of annotated pathology images. The step 3222 may include step 3223: performing random data augmentation processing on the unannotated sliding window image and the non-lesion sliding window image to obtain a set of unannotated pathology images.
具体地,所述“随机数据增广”可以包括步骤:按照预设概率对图像矩阵进行水平翻转、垂直翻转、预设角度旋转和转置至少其中一种。从而,通过调整图像的形态来生成基于此的不同数据。所述预设概率优选为50%。所述预设角度优选为90°。Specifically, the "random data augmentation" may include the steps of: performing at least one of horizontal flipping, vertical flipping, rotation at a preset angle, and transposition on the image matrix according to a preset probability. Thus, by adjusting the image morphology, different data based on the image is generated. The preset probability is preferably 50%. The preset angle is preferably 90°.
对于上述病变标注掩膜的形式,除了可以配置为PNG文件格式以外,其上用于对像素进行标注的内容,可以具体配置为独热编码标签的形式。换言之,所述病变标注掩膜包括对应于癌前病变标本图像中每个像素的独热编码标签。具体地,所述独热编码标签包含分别表征背景判断标注、上皮内瘤变判断标注和肠上皮化生判断标注的第一编码位、第二编码位和第三编码位。例如,在某一像素对应的独热编码标签为(0,0,1)时,表征该像素归属于背景部分,若为(1,0,0)则表征该像素归属于上皮内瘤变部分,若为(0,1,0)则表征该像素归属于肠上皮化生部分。For the form of the above-mentioned lesion annotation mask, in addition to being configured as a PNG file format, the content used to annotate pixels thereon can be specifically configured in the form of a unique hot coding label. In other words, the lesion annotation mask includes a unique hot coding label corresponding to each pixel in the precancerous lesion specimen image. Specifically, the unique hot coding label includes a first coding bit, a second coding bit, and a third coding bit that respectively characterize the background judgment label, the intraepithelial neoplasia judgment label, and the intestinal metaplasia judgment label. For example, when the unique hot coding label corresponding to a certain pixel is (0, 0, 1), it represents that the pixel belongs to the background part, if it is (1, 0, 0), it represents that the pixel belongs to the intraepithelial neoplasia part, and if it is (0, 1, 0), it represents that the pixel belongs to the intestinal metaplasia part.
该实施方式与前文中通过RGB值形成的不同颜色进行类别划分的技术方案并不矛盾,上述独热编码标签可以被解释为经由RGB图像或RGB矩阵归一化后得到的。基于此,本发明对应位置还可以包括对于病变标注掩膜或标注滑窗掩膜进行归一化处理的步骤。This implementation does not conflict with the technical solution of classifying by different colors formed by RGB values in the previous text. The above-mentioned one-hot encoding label can be interpreted as obtained after normalization of the RGB image or RGB matrix. Based on this, the corresponding position of the present invention can also include a step of normalizing the lesion annotation mask or the annotation sliding window mask.
对于步骤32及其衍生步骤中提出的尺寸标准化和颜色迁移标准化处理过程,本发明再一实施方式中提供了下述优选方案。For the size standardization and color migration standardization processes proposed in step 32 and its derivative steps, the present invention provides the following preferred scheme in another embodiment.
首先,所述尺寸标准化处理可以具体配置为对参考病理图像的放大倍数进行调整,也即所述步骤32及其衍生步骤可以具体包括步骤:对所述参考病理图像集合执行尺寸标准化处理,统一所有参考病理图像至预设放大倍数。优选地,所述预设放大倍数为10倍,参考病理图像的初始放大倍数可能是5倍、10倍、20倍或40倍。First, the size normalization process can be specifically configured to adjust the magnification of the reference pathology image, that is, the step 32 and its derivative steps can specifically include the steps of: performing size normalization on the reference pathology image set, unifying all reference pathology images to a preset magnification. Preferably, the preset magnification is 10 times, and the initial magnification of the reference pathology image may be 5 times, 10 times, 20 times or 40 times.
进一步地,在所述参考病理图像配置为RGB图像时,为了保证处理后的、与参考病理图像中癌前病变标本图像对应的病变标注掩膜只包含有既定类别的像素值(RGB层面为蓝、红、绿),其下采样插值方法可以选用最近邻(nearest neighbor)插值法。Furthermore, when the reference pathology image is configured as an RGB image, in order to ensure that the processed lesion annotation mask corresponding to the precancerous lesion specimen image in the reference pathology image only contains pixel values of predetermined categories (blue, red, and green at the RGB level), the downsampling interpolation method may use the nearest neighbor interpolation method.
其次,所述颜色迁移标准化处理可以包括如图7所示的细化步骤,也即图4中的步骤32及其衍生步骤,可以具体包括下述步骤。Secondly, the color migration standardization process may include the refinement steps shown in FIG. 7 , that is, step 32 in FIG. 4 and its derivative steps, which may specifically include the following steps.
步骤41,接收基准染色图像,对其执行色彩空间转换,并计算得到基准染色向量矩阵。Step 41, receiving a reference dyeing image, performing color space conversion on it, and calculating a reference dyeing vector matrix.
步骤42,接收参考病理图像,对其执行色彩空间转换,并计算得到参考颜色密度矩阵。Step 42: Receive a reference pathological image, perform color space conversion on it, and calculate a reference color density matrix.
步骤43,根据基准染色向量矩阵和参考颜色密度矩阵,生成对应于所述参考病理图像的颜色迁移图像。Step 43: Generate a color migration image corresponding to the reference pathological image according to the reference staining vector matrix and the reference color density matrix.
如此,无需进行复杂的迁移系数计算,直接根据基准染色向量矩阵即可完成颜色迁移过程,具有更佳的颜色迁移效果,且不会过分增加运算量,简化了运算逻辑。In this way, there is no need to perform complex migration coefficient calculations, and the color migration process can be completed directly according to the reference coloring vector matrix, which has a better color migration effect, does not excessively increase the amount of calculation, and simplifies the calculation logic.
在基于上述再一实施方式的第一实施例中,所述上述步骤41可以具体包括图8所示的下述步骤。In a first embodiment based on the above further implementation manner, the above step 41 may specifically include the following steps shown in FIG. 8 .
步骤411,接收基准染色图像,进行光密度矩阵转换处理,得到基准光密度矩阵。Step 411, receiving a reference staining image, performing optical density matrix conversion processing, and obtaining a reference optical density matrix.
步骤412,对基准光密度矩阵执行奇异值分解,选择第一奇异极值和第二奇异极值创建投影平面。Step 412, performing singular value decomposition on the reference optical density matrix, selecting the first singular extremum and the second singular extremum to create a projection plane.
步骤413,确定至少一个参考奇异值及其在投影平面上的参考平面轴,将基准光密度矩阵投影至投影平面,拟合投影后的基准光密度矩阵上所有数值点与投影平面的原点的连接线,并计算连接线与参考平面轴的夹角,求取所有夹角中的极大值,得到极大夹角数据。Step 413, determine at least one reference singular value and its reference plane axis on the projection plane, project the reference optical density matrix onto the projection plane, fit the connecting lines of all numerical points on the projected reference optical density matrix and the origin of the projection plane, calculate the angle between the connecting line and the reference plane axis, find the maximum value among all the angles, and obtain the maximum angle data.
步骤414,计算对应于极大夹角数据的光密度矩阵,对该光密度矩阵执行归一化运算后,得到基准染色向量矩阵。Step 414, calculate the optical density matrix corresponding to the maximum angle data, and perform a normalization operation on the optical density matrix to obtain a reference staining vector matrix.
如此,能够以较高的效率,将苏木素-伊红染色法染色形成的基准染色图像进行染色层面上的分离,将其中表征染色程度的基准染色向量矩阵提取出来,从而在后续步骤中进行直接替换,达到颜色迁移的效果。In this way, the reference staining image formed by the hematoxylin-eosin staining method can be separated on the staining level with high efficiency, and the reference staining vector matrix representing the staining degree can be extracted, so as to be directly replaced in the subsequent steps to achieve the effect of color migration.
所述基准染色图像可以解释为:具有较优染色质量的参考病理图像。从而,可以以此作为基准,对其他参考病理图像做颜色迁移标准化处理。所述光密度矩阵转换处理可以解释为:将RGB颜色域下的基准染色图像,转 换为OD(Optical Density)光密度域下的基准光密度矩阵。在此过程中,还可以包括对光密度值小于预设光密度阈值像素点的移除过程。The reference staining image can be interpreted as a reference pathological image with better staining quality. Therefore, it can be used as a benchmark to perform color migration standardization processing on other reference pathological images. The optical density matrix conversion processing can be interpreted as: converting the reference staining image in the RGB color domain into The optical density matrix is converted to a reference optical density matrix in the OD (Optical Density) optical density domain. In this process, the process of removing pixels whose optical density values are less than a preset optical density threshold value may also be included.
所述奇异值分解可以被解释为:将基准光密度矩阵分解成一个酉矩阵U、一个特征值平方根Σ和另一个酉矩阵V的转置的乘积的形式。基于此,本发明即利用特征值平方根Σ来建立投影平面,并具体地,利用其中较为典型的特征值以表征两种染色剂的染色倾向,从而提取基准染色向量矩阵。此时,奇异值向量中两个最大的向量,也即所述第一奇异极值和所述第二奇异极值则可以作为用于计算该较为典型的特征值的参考量。The singular value decomposition can be interpreted as: decomposing the reference optical density matrix into a unitary matrix U, an eigenvalue square root Σ and the transposed product of another unitary matrix V. Based on this, the present invention uses the eigenvalue square root Σ to establish a projection plane, and specifically, uses the more typical eigenvalues therein to characterize the staining tendency of the two dyes, thereby extracting the reference staining vector matrix. At this time, the two largest vectors in the singular value vector, that is, the first singular extreme value and the second singular extreme value, can be used as a reference for calculating the more typical eigenvalue.
所述“将基准光密度矩阵投影至投影平面”还可以包括:对投影后的数值进行归一化处理。在此之后进行夹角极值的计算,能够简化运算步骤并在一定程度上减小误差。所述“至少一个参考奇异值”可以是投影平面上任何一个奇异值,优选可以是所述第一奇异极值和所述第二奇异极值其中之一,所述“其在投影平面上的参考平面轴”,则对应可以是所述第一奇异极值在投影平面上形成的数轴或所述第二奇异极值在投影平面上形成的数轴。The “projecting the reference optical density matrix onto the projection plane” may also include: normalizing the projected values. Calculating the angle extreme value thereafter can simplify the operation steps and reduce errors to a certain extent. The “at least one reference singular value” may be any singular value on the projection plane, preferably one of the first singular extreme value and the second singular extreme value, and the “reference plane axis on the projection plane” may correspond to the number axis formed by the first singular extreme value on the projection plane or the number axis formed by the second singular extreme value on the projection plane.
最终生成的基准染色向量矩阵,记载了该基准染色图像的染色倾向,并将其他组织区域内容清洗掉。此时,所述基准染色向量矩阵中的向量元素,则体现了苏木精和伊红染剂两种染色剂的染色程度。The final generated reference staining vector matrix records the staining tendency of the reference staining image and removes other tissue region contents. At this time, the vector elements in the reference staining vector matrix reflect the staining degree of the two staining agents, hematoxylin and eosin.
换言之,所述基准光密度矩阵满足ODtarget=Ctarget×Starget,其中,Ctarget为基准染色图像的基准颜色密度矩阵,Starget为基准染色图像的基准染色向量矩阵,经过上述步骤,则可以将所述基准染色向量矩阵提取出来。In other words, the reference optical density matrix satisfies OD target =C target ×S target , where C target is the reference color density matrix of the reference staining image, and S target is the reference staining vector matrix of the reference staining image. After the above steps, the reference staining vector matrix can be extracted.
在基于上述再一实施方式的第一实施例中,所述上述步骤42可以具体包括图8所示的下述步骤。In a first embodiment based on the above further implementation manner, the above step 42 may specifically include the following steps shown in FIG. 8 .
步骤421,接收参考病理图像,对其依次执行光密度矩阵转换、奇异值分解、平面投影和极大夹角数据求取,计算得到对应于参考病理图像的参考光密度矩阵和参考染色向量矩阵。Step 421, receiving a reference pathological image, and sequentially performing optical density matrix conversion, singular value decomposition, plane projection, and maximum angle data acquisition on it, to calculate a reference optical density matrix and a reference staining vector matrix corresponding to the reference pathological image.
步骤422,根据参考染色向量矩阵和参考光密度矩阵,计算得到对应于参考病理图像的参考颜色密度矩阵。Step 422: Calculate a reference color density matrix corresponding to the reference pathological image based on the reference staining vector matrix and the reference optical density matrix.
步骤421中“光密度矩阵转换”、“奇异值分解”、“平面投影”和“极大夹角数据求取”等部分,可以替换地实施上述步骤411至步骤414的技术方案及相关解释,此处不再赘述。The parts of "optical density matrix conversion", "singular value decomposition", "plane projection" and "maximum angle data acquisition" in step 421 can be replaced by implementing the technical solutions and related explanations of the above steps 411 to 414, which will not be repeated here.
对于参考病理图像而言,其参考光密度矩阵同样满足ODsource=Csource×Ssource。其中,Csource为参考染色图像的参考颜色密度矩阵,Ssource为参考染色图像的参考染色向量矩阵。经过步骤421,则可以将所述参考染色向量矩阵提取出来,经过步骤422,则可以根据上述运算关系计算得到参考颜色密度矩阵。从而,可以将参考颜色密度矩阵和基准染色向量矩阵进行“叉乘”重组,生成颜色迁移后的光密度矩阵(也即,ODsource_norm=Csource×Starget)。从而,执行相对于步骤41的色彩空间转换的反变换,将颜色迁移后的光密度矩阵还原至RGB颜色域,最终得到所述颜色迁移图像。For the reference pathological image, its reference optical density matrix also satisfies OD source = C source × S source . Among them, C source is the reference color density matrix of the reference staining image, and S source is the reference staining vector matrix of the reference staining image. After step 421, the reference staining vector matrix can be extracted, and after step 422, the reference color density matrix can be calculated according to the above-mentioned operation relationship. Thus, the reference color density matrix and the benchmark staining vector matrix can be reorganized by "cross multiplication" to generate an optical density matrix after color migration (that is, OD source_norm = C source × S target ). Thus, an inverse transformation relative to the color space conversion of step 41 is performed to restore the optical density matrix after color migration to the RGB color domain, and finally the color migration image is obtained.
本发明提供的上述多种实施方式、实施例或具体示例之间可以相互进行组合,从而最终形成多个更优的实施方式。图9则对应示出了在执行所述更优的实施方式中的一种时,相关图像或图像数据的转化过程。The above-mentioned various implementations, embodiments or specific examples provided by the present invention can be combined with each other to finally form multiple better implementations. FIG9 shows the conversion process of related images or image data when executing one of the better implementations.
在接收到所述癌前病变标本图像后,通过病变区域标记会对应形成所述标注病变标本图像和所述无标注病变标本图像。所述标注病变标本图像,还包括对应的病变标注掩膜,标注病变标本图像经过尺寸标准化、颜色迁移标准化等处理后生成所述标注标准化图像,并进一步经过滑窗区域分割,产生所述标注滑窗图像组。在此过程中,病变标注掩膜同样经过上述对应步骤,最终产生与所述标注滑窗图像组相对应的标注滑窗掩膜组,两者共同组成所述有标注病理图像集合。继续地,经过预设的训练集、验证集占比关系,可以将有标注病理图像集合分为第一有标注图像集合(或称,有标注样本图像集合)和第二有标注图像集合,前者参与所述样本图像训练集的构成,后者作为所述样本图像验证集参与模型的评估选择环节。After receiving the precancerous lesion specimen image, the labeled lesion specimen image and the unlabeled lesion specimen image are correspondingly formed through the lesion area marking. The labeled lesion specimen image also includes a corresponding lesion annotation mask. The labeled lesion specimen image is processed by size standardization, color migration standardization, etc. to generate the labeled standardized image, and further subjected to sliding window area segmentation to generate the labeled sliding window image group. In this process, the lesion annotation mask also undergoes the above corresponding steps to finally generate a labeled sliding window mask group corresponding to the labeled sliding window image group, and the two together constitute the labeled pathological image set. Continuing, through the preset training set and verification set ratio relationship, the labeled pathological image set can be divided into a first labeled image set (or, labeled sample image set) and a second labeled image set, the former participating in the composition of the sample image training set, and the latter participating in the evaluation and selection link of the model as the sample image verification set.
基于癌前病变标本图像生成的所述无标注病变标本图像,经过尺寸标准化、颜色迁移标准化等处理后生成所述无标注标准化图像,并进一步经过滑窗区域分割,产生所述无标注滑窗图像组。此外,在接收到所述非癌前病变标本图像后,会经过尺寸标准化、颜色迁移标准化等处理后生成所述非病变标准化图像,并进一步经过滑窗区域分割,产生所述非病变滑窗图像组。所述无标注滑窗图像组和所述非病变滑窗图像组,共同组成所述无标注病理图像集合(或称,无标注样本图像集合),从而,与所述第一有标注图像集合共同构成所述样本图像训练集。The unlabeled lesion specimen image generated based on the precancerous lesion specimen image is processed by size standardization, color migration standardization, etc. to generate the unlabeled standardized image, and further processed by sliding window area segmentation to generate the unlabeled sliding window image group. In addition, after receiving the non-precancerous lesion specimen image, the non-lesion standardized image is generated after size standardization, color migration standardization, etc., and further processed by sliding window area segmentation to generate the non-lesion sliding window image group. The unlabeled sliding window image group and the non-lesion sliding window image group together constitute the unlabeled pathology image set (or, unlabeled sample image set), thereby, together with the first labeled image set, constituting the sample image training set.
本发明一实施方式为了准确识别和对病理图像中不同区域进行分类,提供了一种病理图像识别系统和如图10所示的病理图像识别方法。In order to accurately identify and classify different regions in a pathological image, an embodiment of the present invention provides a pathological image recognition system and a pathological image recognition method as shown in FIG10 .
对应于上述病理图像识别方法,本发明首先提供一种存储介质,可以具有与对应于病理图像识别模型训练方 法的存储介质相同或相类似的配置方案,甚至可以将病理图像识别方法和病理图像识别模型训练方法的应用程序设置于同一个存储介质中。同理,所述病理图像识别系统的配置方案也可以具有与病理图像识别模型训练系统相同或类似的配置方案,此处不再赘述。Corresponding to the above-mentioned pathological image recognition method, the present invention first provides a storage medium, which can have a corresponding pathological image recognition model training method. The configuration scheme of the pathological image recognition system can be the same or similar to that of the pathological image recognition model training system, and even the application programs of the pathological image recognition method and the pathological image recognition model training method can be set in the same storage medium. Similarly, the configuration scheme of the pathological image recognition system can also have the same or similar configuration scheme as that of the pathological image recognition model training system, which will not be repeated here.
对应地,本发明一实施方式提供的病理图像识别方法,同样可以搭载于上述存储介质和/或上述病理图像识别系统中。病理图像识别方法具体包括下述步骤。Correspondingly, the pathological image recognition method provided in one embodiment of the present invention can also be installed in the above storage medium and/or the above pathological image recognition system. The pathological image recognition method specifically includes the following steps.
步骤51,执行一种病理图像识别模型训练方法,得到第一模型训练参数和第二模型训练参数至少其中之一。Step 51, executing a pathological image recognition model training method to obtain at least one of a first model training parameter and a second model training parameter.
步骤52,将模型训练参数搭载至对应的神经网络模型中,构建病理图像识别模型。Step 52, load the model training parameters into the corresponding neural network model to build a pathological image recognition model.
步骤53,接收待测病理图像数据并进行预处理,将预处理后的待测病理图像数据输入病理图像识别模型中进行遍历预测,得到病理识别数据。Step 53, receiving the pathological image data to be tested and preprocessing it, inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction, and obtaining pathological recognition data.
所述病理图像识别模型训练方法可以是前文任一种实施方式、实施例或具体示例所提供的模型训练方法,本领域技术人员可以参照前文所述,以步骤51至步骤53作为基础产生多种衍生的实施方式,此处不再赘述。The pathological image recognition model training method can be the model training method provided by any of the above-mentioned implementation modes, embodiments or specific examples. Those skilled in the art can refer to the above-mentioned description and generate a variety of derived implementation modes based on steps 51 to 53, which will not be repeated here.
所述对应的神经网络模型可以解释为:与第一模型训练参数和第二模型训练参数至少其中之一相对应的神经网络模型。举例而言,该神经网络模型可以是所述第一神经网络模型,则对应搭载训练得到的第一模型训练参数到所述第一神经网络模型中,构建得到病理图像识别模型。该神经网络模型是所述第二神经网络模型时同理。但可以理解地,所述病理图像识别模型也可以配置为同时包含并行的第一神经网络模型和第二神经网络模型。The corresponding neural network model can be interpreted as: a neural network model corresponding to at least one of the first model training parameters and the second model training parameters. For example, the neural network model can be the first neural network model, then the first model training parameters obtained by training are loaded into the first neural network model to construct a pathological image recognition model. The same is true when the neural network model is the second neural network model. However, it can be understood that the pathological image recognition model can also be configured to include a parallel first neural network model and a second neural network model at the same time.
值得说明地,所述待测病理图像数据可以具有与所述样本图像集合中的样本图像具有相类似的格式、内容形式配置。尤其可以与无标注样本图像集合中的无标注样本图像具有相类似的形式,此处不再赘述。It is worth noting that the pathological image data to be tested may have a format and content configuration similar to that of the sample images in the sample image set, and may especially have a form similar to that of the unlabeled sample images in the unlabeled sample image set, which will not be described in detail here.
本发明基于上述实施方式,提供其第一实施例,该第一实施例提供了对于步骤53的优选技术方案。所述第一实施例中的步骤53可以具体包括下述步骤。Based on the above implementation, the present invention provides a first embodiment thereof, and the first embodiment provides a preferred technical solution for step 53. Step 53 in the first embodiment may specifically include the following steps.
步骤531,对待测病理图像数据依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到待测病理图像集合。Step 531 , performing size standardization processing and color migration standardization processing on the pathological image data to be tested in sequence, and obtaining a set of pathological images to be tested by calculation.
步骤532,将待测病理图像集合输入病理图像识别模型中进行遍历预测,得到病理识别像素区。Step 532: input the pathological image set to be tested into the pathological image recognition model for traversal prediction to obtain the pathological recognition pixel area.
步骤533,将病理识别像素区叠加显示于待测病理图像上,形成病理判断图像。Step 533 , superimposing the pathology recognition pixel area on the pathology image to be detected to form a pathology judgment image.
所述尺寸标准化处理和所述颜色迁移标准化处理,可以参照前文提供的技术方案,并优选对待测病理图像或其数据,进行尺寸放大比例的调整,以及染色风格倾向的统一化,实现提高预测准确度的效果。The size standardization processing and the color migration standardization processing can refer to the technical solution provided above, and preferably adjust the size magnification ratio of the pathological image to be tested or its data, and unify the staining style tendency, so as to achieve the effect of improving the prediction accuracy.
所述病理识别像素区可以解释为:对应于待测病理图像上每个像素的判断结果分布情况。病理识别像素区可以具体包括背景识别像素区、上皮内瘤变识别像素区和肠上皮化生像素区,针对每个像素依次具有背景判断标注、上皮内瘤变判断标注和肠上皮化生判断标注。所述病理识别像素区的表现形式可以是与所述病变标注掩膜等相类似的掩膜,可以是与待测病理图像相对应的图像,也可以是单纯指向待测病理图像上某些确定区域的数据组。The pathology identification pixel area can be interpreted as: the distribution of judgment results corresponding to each pixel on the pathology image to be tested. The pathology identification pixel area can specifically include a background identification pixel area, an intraepithelial neoplasia identification pixel area and an intestinal metaplasia pixel area, and each pixel has a background judgment annotation, an intraepithelial neoplasia judgment annotation and an intestinal metaplasia judgment annotation in sequence. The pathology identification pixel area can be expressed in the form of a mask similar to the lesion annotation mask, an image corresponding to the pathology image to be tested, or a data group that simply points to certain specific areas on the pathology image to be tested.
在本实施方式中,虽然生成了病理判断图像,但并不限定将病理判断图像作为所述病理识别数据,其可以作为中间数据呈现。当然,也可以取消对步骤533的设置,替换实施其他技术方案。In this embodiment, although a pathology judgment image is generated, it is not limited to the pathology judgment image as the pathology identification data, and it can be presented as intermediate data. Of course, the setting of step 533 can also be cancelled and replaced by other technical solutions.
优选地,同样可以对完成标准化处理的待测病理图像数据执行分割和筛选处理,从而得到所述待测病理图像集合作为神经网络模型的输入。换言之,所述“运算得到待测病理图像集合”可以具体包括步骤:对完成尺寸标准化处理和颜色迁移标准化处理的待测病理图像数据执行滑窗区域分割,根据待测滑窗图像中低灰度值区域占比情况,筛选得到所述待测病理图像集合。所述筛选规则,可以参照前文对无标注滑窗图像和非病变滑窗图像筛选更新的技术方案。Preferably, segmentation and screening can also be performed on the pathological image data to be tested that has completed the standardization process, so as to obtain the pathological image set to be tested as the input of the neural network model. In other words, the "obtaining the pathological image set to be tested by calculation" can specifically include the steps of: performing sliding window area segmentation on the pathological image data to be tested that has completed the size standardization process and the color migration standardization process, and screening the pathological image set to be tested according to the proportion of low gray value areas in the sliding window image to be tested. The screening rules can refer to the technical solution for screening and updating unlabeled sliding window images and non-lesion sliding window images in the previous text.
当然,本发明并不排斥在上述特征处与前文提供的技术方案形成区别。由此产生的技术方案同样应该被认为落入本发明所保护的范围内。例如,进行滑窗区域分割的步长可以被配置为与图像区域滑窗的边长相等,并优选为256像素。Of course, the present invention does not exclude the difference from the technical solution provided above in the above-mentioned features. The resulting technical solution should also be considered to fall within the scope protected by the present invention. For example, the step length for performing sliding window region segmentation can be configured to be equal to the side length of the image region sliding window, and preferably 256 pixels.
为规避分割结果里假阳性对标本定性诊断的影响,上述第一实施例中的病理识别数据可以具体配置为包括癌前病变判定信息。基于此,所述步骤53还可以进一步包括下述步骤。In order to avoid the influence of false positives in the segmentation results on the qualitative diagnosis of the specimen, the pathological identification data in the first embodiment can be specifically configured to include precancerous lesion determination information. Based on this, the step 53 can further include the following steps.
步骤534,对病理识别像素区中分别指向上皮内瘤变和肠上皮化生的像素值进行降序排列,计算预设数量范围内的像素平均值,得到第一平均值和第二平均值,并判断第一平均值和第二平均值与预设癌前病变判定阈值之间的数值大小关系。Step 534, arrange the pixel values pointing to intraepithelial neoplasia and intestinal metaplasia in the pathological identification pixel area in descending order, calculate the average value of pixels within a preset number range, obtain a first average value and a second average value, and determine the numerical relationship between the first average value and the second average value and the preset precancerous lesion determination threshold.
步骤535,若第一平均值和第二平均值其中之一大于癌前病变判定阈值,则判定该病理识别像素区对应的待测病理图像所表征的位置发生癌前病变,输出癌前病变判定信息。Step 535: if one of the first average value and the second average value is greater than the precancerous lesion determination threshold, it is determined that a precancerous lesion occurs at the position represented by the pathological image to be detected corresponding to the pathological identification pixel area, and precancerous lesion determination information is output.
优选地,所述癌前病变判定阈值为0.5,所述预设数量范围为10000个像素范围内或15000个像素范围内。当然,本发明还隐含地包括步骤:若第一平均值和第二平均值均不大于癌前病变判定阈值,则判定该病理识别像 素区对应的待测病理图像所表征的位置未发生癌前病变,输出癌前病变判定信息。Preferably, the precancerous lesion determination threshold is 0.5, and the preset number range is within 10,000 pixels or within 15,000 pixels. Of course, the present invention also implicitly includes the step of: if both the first average value and the second average value are not greater than the precancerous lesion determination threshold, then the pathological recognition image is determined to be No precancerous lesions occur at the position represented by the pathological image to be tested corresponding to the element area, and precancerous lesion determination information is output.
综上,本发明提供的病理图像识别模型训练方法,通过构建第一神经网络模型和第二神经网络模型两个并行的学习模型,并用产生的两组损失函数,相对照地进行模型的训练和优化,从而充分利用有限的图像数据进行训练,并使神经网络模型的性能更为稳定;利用样本图像集合依次进行前一模型到后一模型的训练,以及利用样本图像集合依次进行后一模型到前一模型的训练,结合一般有监督训练和基于伪标签的有监督训练,能够减少对有标记数据等稀缺数据类型的依赖性,隐性地将无标记数据也当作有标记数据参与模型的训练过程,从而大幅提升了训练得到的模型的性能、降低成本并提高了训练速度。In summary, the pathological image recognition model training method provided by the present invention constructs two parallel learning models, the first neural network model and the second neural network model, and uses the two sets of loss functions generated to train and optimize the models in comparison, thereby making full use of limited image data for training and making the performance of the neural network model more stable; using a sample image set to sequentially train the previous model to the next model, and using a sample image set to sequentially train the next model to the previous model, combined with general supervised training and pseudo-label-based supervised training, it can reduce the dependence on scarce data types such as labeled data, and implicitly treat unlabeled data as labeled data to participate in the model training process, thereby greatly improving the performance of the trained model, reducing costs and increasing training speed.
同理,应用基于上述训练过程生成的病理图像识别模型(或模型训练数据)所构成的病理图像识别方法,自然可以兼顾高泛化识别率、低稀缺数据依赖性,以及高成本和低性能等优势。Similarly, the pathological image recognition method constructed by the pathological image recognition model (or model training data) generated based on the above training process can naturally take into account the advantages of high generalization recognition rate, low dependence on scarce data, as well as high cost and low performance.
应当理解,虽然本说明书按照实施方式加以描述,但并非每个实施方式仅包含一个独立的技术方案,说明书的这种叙述方式仅仅是为清楚起见,本领域技术人员应当将说明书作为一个整体,各实施方式中的技术方案也可以经适当组合,形成本领域技术人员可以理解的其他实施方式。It should be understood that although this specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
上文所列出的一系列的详细说明仅仅是针对本发明的可行性实施方式的具体说明,它们并非用以限制本发明的保护范围,凡未脱离本发明技艺精神所作的等效实施方式或变更均应包含在本发明的保护范围之内。 The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.

Claims (28)

  1. 一种病理图像识别模型训练方法,其特征在于,所述方法包括:A pathological image recognition model training method, characterized in that the method comprises:
    接收样本图像集合;receiving a sample image set;
    根据所述样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数;According to the sample image set, calling the first neural network model to perform supervised training and traversal reasoning in sequence, and calling the second neural network model to perform supervised training based on the reasoning result, and calculating a first loss function;
    根据所述样本图像集合,调用所述第二神经网络模型依次执行有监督训练和遍历推理,并调用所述第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数;According to the sample image set, calling the second neural network model to perform supervised training and traversal reasoning in sequence, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating a second loss function;
    根据所述第一损失函数和所述第二损失函数对所述第一神经网络模型和所述第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。The first neural network model and the second neural network model are iteratively trained according to the first loss function and the second loss function to obtain at least one of a first model training parameter and a second model training parameter.
  2. 根据权利要求1所述的病理图像识别模型训练方法,其特征在于,所述样本图像集合包括有标注样本图像集合和无标注样本图像集合。The pathological image recognition model training method according to claim 1 is characterized in that the sample image set includes a labeled sample image set and an unlabeled sample image set.
  3. 根据权利要求2所述的病理图像识别模型训练方法,其特征在于,所述“根据所述样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数”具体包括:The pathological image recognition model training method according to claim 2 is characterized in that the step of "calling the first neural network model to sequentially perform supervised training and traversal reasoning according to the sample image set, and calling the second neural network model to perform supervised training based on the reasoning result, and calculating the first loss function" specifically includes:
    根据所述有标注样本图像集合,调用所述第一神经网络模型执行有监督训练后,根据所述无标注样本图像集合,调用所述第一神经网络模型执行遍历推理,得到对应于所述无标注样本图像集合的第一识别伪标签集合;After calling the first neural network model to perform supervised training according to the set of labeled sample images, calling the first neural network model to perform traversal reasoning according to the set of unlabeled sample images to obtain a first recognition pseudo-label set corresponding to the set of unlabeled sample images;
    根据所述无标注样本图像集合和所述第一识别伪标签集合,调用所述第二神经网络模型执行有监督训练,并计算得到所述第一损失函数;According to the unlabeled sample image set and the first recognition pseudo-label set, calling the second neural network model to perform supervised training, and calculating the first loss function;
    所述“根据所述样本图像集合,调用所述第二神经网络模型依次执行有监督训练和遍历推理,并调用所述第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数”具体包括:The “according to the sample image set, calling the second neural network model to sequentially perform supervised training and traversal reasoning, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating the second loss function” specifically includes:
    根据所述有标注样本图像集合,调用所述第二神经网络模型执行有监督训练后,根据所述无标注样本图像集合,调用所述第二神经网络模型执行遍历推理,得到对应于所述无标注样本图像集合的第二识别伪标签集合;After calling the second neural network model to perform supervised training according to the set of labeled sample images, calling the second neural network model to perform traversal reasoning according to the set of unlabeled sample images to obtain a second set of identification pseudo labels corresponding to the set of unlabeled sample images;
    根据所述无标注样本图像集合和所述第二识别伪标签集合,调用所述第一神经网络模型执行有监督训练,并计算得到所述第二损失函数。According to the unlabeled sample image set and the second identification pseudo-label set, the first neural network model is called to perform supervised training, and the second loss function is calculated.
  4. 根据权利要求1所述的病理图像识别模型训练方法,其特征在于,在所述“接收样本图像集合”之前,所述方法还包括:The pathological image recognition model training method according to claim 1 is characterized in that, before the "receiving the sample image set", the method further comprises:
    接收参考病理图像集合;receiving a reference pathology image set;
    对所述参考病理图像集合依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到标准病理图像集合;其中,所述标准病理图像集合包括有标注病理图像集合和无标注病理图像集合;Performing size standardization processing and color migration standardization processing on the reference pathology image set in sequence, and obtaining a standard pathology image set by calculation; wherein the standard pathology image set includes a labeled pathology image set and an unlabeled pathology image set;
    对所述有标注病理图像集合进行分组,将第一有标注图像集合与所述无标注病理图像集合组合构成样本图像训练集,并根据第二有标注图像集合形成样本图像验证集;Grouping the annotated pathological image sets, combining the first annotated image set with the unannotated pathological image set to form a sample image training set, and forming a sample image verification set based on the second annotated image set;
    根据所述样本图像训练集和所述样本图像验证集,生成所述样本图像集合。The sample image set is generated according to the sample image training set and the sample image verification set.
  5. 根据权利要求4所述的病理图像识别模型训练方法,其特征在于,在所述“接收参考病理图像集合”之前,所述方法具体包括:The pathological image recognition model training method according to claim 4 is characterized in that, before the “receiving a reference pathological image set”, the method specifically comprises:
    接收癌前病变标本图像和非癌前病变标本图像;Receiving images of precancerous lesion specimens and images of non-precancerous lesion specimens;
    对部分癌前病变标本图像进行像素标注,得到病变标注掩膜;Perform pixel annotation on some precancerous lesion specimen images to obtain lesion annotation masks;
    根据所述癌前病变标本图像、对应的病变标注掩膜,以及所述非癌前病变标本图像,生成所述参考病理图像集合;generating the reference pathological image set according to the precancerous lesion specimen image, the corresponding lesion annotation mask, and the non-precancerous lesion specimen image;
    所述“对所述参考病理图像集合依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到标准病理图像集合”具体包括:The “performing size standardization processing and color migration standardization processing on the reference pathological image set in sequence to obtain a standard pathological image set” specifically includes:
    对所有标注病变标本图像依次执行尺寸标准化处理和颜色迁移标准化处理,并根据处理后的标注病变标本图像,运算得到所述有标注病理图像集合;其中,所述标注病变标本图像对应于具有对应病变标注掩膜的癌前病变标本图像;Performing size standardization processing and color migration standardization processing on all labeled lesion specimen images in sequence, and calculating and obtaining the labeled pathology image set according to the processed labeled lesion specimen images; wherein the labeled lesion specimen images correspond to the precancerous lesion specimen images with corresponding lesion annotation masks;
    对所有无标注病变标本图像和所有非癌前病变标本图像,依次执行尺寸标准化处理和颜色迁移标准化处理,并根据处理后的无标注病变标本图像和非癌前病变标本图像,运算得到所述无标注病理图像集合;其中,所述无标注病变标本图像对应于不具有对应病变标注掩膜的癌前病变标本图像。Size standardization and color migration standardization are performed in sequence on all unlabeled lesion specimen images and all non-precancerous lesion specimen images, and the unlabeled pathological image set is obtained by calculation based on the processed unlabeled lesion specimen images and non-precancerous lesion specimen images; wherein the unlabeled lesion specimen images correspond to precancerous lesion specimen images without corresponding lesion annotation masks.
  6. 根据权利要求5所述的病理图像识别模型训练方法,其特征在于,所述标注病变标本图像的数量占所有 癌前病变标本图像的数量的30%;所有非癌前病变标本图像的数量占所有癌前病变标本图像的数量的20%。The pathological image recognition model training method according to claim 5 is characterized in that the number of the labeled lesion specimen images accounts for all 30% of the number of precancerous lesion specimen images; the number of all non-precancerous lesion specimen images accounts for 20% of the number of all precancerous lesion specimen images.
  7. 根据权利要求5所述的病理图像识别模型训练方法,其特征在于,所述“运算得到标准病理图像集合”具体包括:The pathological image recognition model training method according to claim 5 is characterized in that the "operating to obtain a standard pathological image set" specifically includes:
    对完成尺寸标准化处理和颜色迁移标准化处理的参考病理图像执行滑窗区域分割,得到并根据多组滑窗区域图像组,运算得到所述标准病理图像集合;其中,所述滑窗区域分割具体包括:Performing sliding window region segmentation on the reference pathological image that has completed the size standardization processing and the color migration standardization processing to obtain and obtain the standard pathological image set based on multiple groups of sliding window region image groups; wherein the sliding window region segmentation specifically includes:
    构建预设尺寸的图像区域滑窗,并使所述图像区域滑窗按照预设步长对标注标准化图像和对应的所述病变标注掩膜执行遍历分割,得到多组标注滑窗图像组和标注滑窗掩膜组;其中,所述标注标准化图像为完成标准化处理后的标注病变标本图像;Constructing an image area sliding window of a preset size, and making the image area sliding window perform traversal segmentation on the annotated standardized image and the corresponding lesion annotated mask according to a preset step length, to obtain multiple groups of annotated sliding window image groups and annotated sliding window mask groups; wherein the annotated standardized image is an annotated lesion specimen image after the standardization process is completed;
    遍历、分析并根据标注滑窗掩膜组中所有标注滑窗掩膜的病灶区域占比,筛选更新所述标注滑窗图像和对应的标注滑窗掩膜;Traversing, analyzing, and screening and updating the annotated sliding window image and the corresponding annotated sliding window mask according to the proportion of the lesion area of all annotated sliding window masks in the annotated sliding window mask group;
    使所述图像区域滑窗按照所述预设步长对无标注标准化图像和非病变标准化图像执行遍历分割,得到多组无标注滑窗图像组和非病变滑窗图像组;其中,所述无标注标准化图像为完成标准化处理后的无标注病变标本图像,所述非病变标准化图像为完成标准化处理后的非癌前病变标本图像;The image area sliding window is used to perform traversal segmentation on the unlabeled standardized image and the non-lesion standardized image according to the preset step length to obtain multiple groups of unlabeled sliding window image groups and non-lesion sliding window image groups; wherein the unlabeled standardized image is an unlabeled lesion specimen image after standardization processing, and the non-lesion standardized image is a non-precancerous lesion specimen image after standardization processing;
    遍历、分析并根据无标注滑窗图像和非病变滑窗图像的组织区域占比,筛选更新所述无标注滑窗图像和所述非病变滑窗图像。Traverse, analyze, and filter and update the unlabeled sliding window image and the non-lesion sliding window image according to the tissue area ratio of the unlabeled sliding window image and the non-lesion sliding window image.
  8. 根据权利要求7所述的病理图像识别模型训练方法,其特征在于,在“遍历、分析并根据标注滑窗掩膜组中所有标注滑窗掩膜的病灶区域占比,筛选更新所述标注滑窗图像和对应的标注滑窗掩膜”之后,所述方法具体包括:The pathological image recognition model training method according to claim 7 is characterized in that after "traversing, analyzing and screening and updating the annotated sliding window image and the corresponding annotated sliding window mask according to the lesion area proportion of all annotated sliding window masks in the annotated sliding window mask group", the method specifically includes:
    对所述标注滑窗图像和对应的标注滑窗掩膜执行随机数据增广处理,得到所述有标注病理图像集合;Performing random data augmentation processing on the annotated sliding window image and the corresponding annotated sliding window mask to obtain the annotated pathological image set;
    在所述“遍历、分析并根据无标注滑窗图像和非病变滑窗图像的组织区域占比,筛选更新所述无标注滑窗图像和所述非病变滑窗图像”之后,所述方法具体包括:After “traversing, analyzing, and screening and updating the unlabeled sliding window image and the non-lesion sliding window image according to the tissue area ratio of the unlabeled sliding window image and the non-lesion sliding window image”, the method specifically includes:
    对所述无标注滑窗图像和所述非病变滑窗图像执行随机数据增广处理,得到所述无标注病理图像集合;Performing random data augmentation processing on the unlabeled sliding window image and the non-lesion sliding window image to obtain the unlabeled pathological image set;
    其中,所述随机数据增广具体包括:The random data augmentation specifically includes:
    按照预设概率对图像矩阵进行水平翻转、垂直翻转、预设角度旋转和转置至少其中一种。The image matrix is at least one of horizontally flipped, vertically flipped, rotated at a preset angle, and transposed according to a preset probability.
  9. 根据权利要求5所述的病理图像识别模型训练方法,其特征在于,所述病变标注掩膜包括对应于癌前病变标本图像中每个像素的独热编码标签,所述独热编码标签包含分别表征背景判断标注、上皮内瘤变判断标注和肠上皮化生判断标注的第一编码位、第二编码位和第三编码位。The pathological image recognition model training method according to claim 5 is characterized in that the lesion annotation mask includes a one-hot encoding label corresponding to each pixel in the precancerous lesion specimen image, and the one-hot encoding label includes a first encoding bit, a second encoding bit, and a third encoding bit that respectively characterize the background judgment label, the intraepithelial neoplasia judgment label, and the intestinal metaplasia judgment label.
  10. 根据权利要求4所述的病理图像识别模型训练方法,其特征在于,所述尺寸标准化处理具体包括:The pathological image recognition model training method according to claim 4 is characterized in that the size standardization process specifically includes:
    对所述参考病理图像集合执行尺寸标准化处理,统一所有参考病理图像至预设放大倍数;Performing size standardization processing on the reference pathology image set to unify all reference pathology images to a preset magnification;
    所述颜色迁移标准化处理具体包括:The color migration standardization process specifically includes:
    接收基准染色图像,对其执行色彩空间转换,并计算得到基准染色向量矩阵;receiving a reference dyed image, performing a color space conversion on the image, and calculating a reference dyed vector matrix;
    接收参考病理图像,对其执行色彩空间转换,并计算得到参考颜色密度矩阵;receiving a reference pathological image, performing color space conversion on the image, and calculating a reference color density matrix;
    根据所述基准染色向量矩阵和所述参考颜色密度矩阵,生成对应于所述参考病理图像的颜色迁移图像。A color migration image corresponding to the reference pathological image is generated according to the reference staining vector matrix and the reference color density matrix.
  11. 根据权利要求10所述的病理图像识别模型训练方法,其特征在于,所述“接收基准染色图像,对其执行色彩空间转换,并计算得到基准染色向量矩阵”具体包括:The pathological image recognition model training method according to claim 10 is characterized in that the step of "receiving a reference stained image, performing a color space conversion on the image, and calculating a reference stained vector matrix" specifically includes:
    接收基准染色图像,进行光密度矩阵转换处理,得到基准光密度矩阵;receiving a reference staining image, performing optical density matrix conversion processing, and obtaining a reference optical density matrix;
    对所述基准光密度矩阵执行奇异值分解,选择第一奇异极值和第二奇异极值创建投影平面;Performing singular value decomposition on the reference optical density matrix, selecting a first singular extreme value and a second singular extreme value to create a projection plane;
    确定至少一个参考奇异值及其在所述投影平面上的参考平面轴,将所述基准光密度矩阵投影至所述投影平面,拟合投影后的基准光密度矩阵上所有数值点与所述投影平面的原点的连接线,并计算所述连接线与所述参考平面轴的夹角,求取所有夹角中的极大值,得到极大夹角数据;Determine at least one reference singular value and its reference plane axis on the projection plane, project the reference optical density matrix onto the projection plane, fit the connecting line between all numerical points on the projected reference optical density matrix and the origin of the projection plane, calculate the angle between the connecting line and the reference plane axis, find the maximum value among all the angles, and obtain maximum angle data;
    计算对应于所述极大夹角数据的光密度矩阵,对该光密度矩阵执行归一化运算后,得到所述基准染色向量矩阵。The optical density matrix corresponding to the maximum angle data is calculated, and after performing a normalization operation on the optical density matrix, the reference staining vector matrix is obtained.
  12. 根据权利要求11所述的病理图像识别模型训练方法,其特征在于,所述“接收参考病理图像,对其执行色彩空间转换,并计算得到参考颜色密度矩阵”具体包括:The pathological image recognition model training method according to claim 11 is characterized in that the step of "receiving a reference pathological image, performing color space conversion on the reference pathological image, and calculating a reference color density matrix" specifically includes:
    接收参考病理图像,对其依次执行光密度矩阵转换、奇异值分解、平面投影和极大夹角数据求取,计算得到对应于所述参考病理图像的参考光密度矩阵和参考染色向量矩阵;Receive a reference pathological image, and sequentially perform optical density matrix conversion, singular value decomposition, plane projection, and maximum angle data acquisition on the reference pathological image to calculate a reference optical density matrix and a reference staining vector matrix corresponding to the reference pathological image;
    根据所述参考染色向量矩阵和所述参考光密度矩阵,计算得到对应于所述参考病理图像的所述参考颜色密度矩阵。 The reference color density matrix corresponding to the reference pathological image is calculated based on the reference staining vector matrix and the reference optical density matrix.
  13. 根据权利要求10所述的病理图像识别模型训练方法,其特征在于,所述方法具体包括:The pathological image recognition model training method according to claim 10 is characterized in that the method specifically comprises:
    对所述参考病理图像执行下采样插值,设定所述参考病理图像的放大倍数为10倍;其中,所述下采样插值为最邻近插值。Downsampling interpolation is performed on the reference pathological image, and the magnification of the reference pathological image is set to 10 times; wherein the downsampling interpolation is nearest neighbor interpolation.
  14. 根据权利要求1所述的病理图像识别模型训练方法,其特征在于,在所述“根据所述有标注样本图像集合,调用第一神经网络模型执行有监督训练后,根据所述无标注样本图像集合,调用第一神经网络模型执行遍历推理,得到对应于所述无标注样本图像集合的第一识别伪标签集合”之前,所述方法还包括:The pathological image recognition model training method according to claim 1 is characterized in that before the step of “after calling the first neural network model to perform supervised training according to the labeled sample image set, calling the first neural network model to perform traversal reasoning according to the unlabeled sample image set to obtain a first recognition pseudo-label set corresponding to the unlabeled sample image set”, the method further comprises:
    选取以全卷积网络为结构基础的语义分割骨干模型作为基础骨干模型;The semantic segmentation backbone model based on the fully convolutional network structure is selected as the basic backbone model;
    分别根据第一权重配置参数和第二权重配置参数,基于所述基础骨干模型执行模型初始化,得到所述第一神经网络模型和所述第二神经网络模型;其中,所述第一神经网络模型和所述第二神经网络模型,均搭载有softmax激活函数,且配置为具有相同的优化器和学习率调整策略。According to the first weight configuration parameter and the second weight configuration parameter, model initialization is performed based on the basic backbone model to obtain the first neural network model and the second neural network model; wherein the first neural network model and the second neural network model are both equipped with a softmax activation function and are configured to have the same optimizer and learning rate adjustment strategy.
  15. 根据权利要求14所述的病理图像识别模型训练方法,其特征在于,所述基础骨干模型配置为基于U-Net网络架构,所述第一权重配置参数设置为基于Xavier参数初始化策略生成,所述第二权重配置参数设置为基于Kaiming参数初始化策略生成;The pathological image recognition model training method according to claim 14 is characterized in that the basic backbone model is configured based on a U-Net network architecture, the first weight configuration parameter is set to be generated based on a Xavier parameter initialization strategy, and the second weight configuration parameter is set to be generated based on a Kaiming parameter initialization strategy;
    所述第一神经网络模型和所述第二神经网络模型配置为包括随机梯度下降优化器,所述学习率调整策略配置为模型学习率值随迭代次数的增加而减小。The first neural network model and the second neural network model are configured to include a stochastic gradient descent optimizer, and the learning rate adjustment strategy is configured so that the model learning rate value decreases as the number of iterations increases.
  16. 根据权利要求15所述的病理图像识别模型训练方法,其特征在于,所述模型学习率值等于剩余迭代次数与总迭代次数之比的预设指数次幂,与基础学习率值之积。The pathological image recognition model training method according to claim 15 is characterized in that the model learning rate value is equal to the product of a preset exponential power of the ratio of the remaining number of iterations to the total number of iterations and a basic learning rate value.
  17. 根据权利要求1所述的病理图像识别模型训练方法,其特征在于,所述第一损失函数配置为第一有监督损失函数与第一伪标签损失函数的加权之和,其中,所述第一有监督损失函数指向所述第一神经网络模型基于样本图像集合进行的有监督训练过程,所述第一伪标签损失函数指向所述第二神经网络模型基于推理结果进行的有监督训练过程;The pathological image recognition model training method according to claim 1 is characterized in that the first loss function is configured as a weighted sum of a first supervised loss function and a first pseudo-label loss function, wherein the first supervised loss function refers to a supervised training process of the first neural network model based on a sample image set, and the first pseudo-label loss function refers to a supervised training process of the second neural network model based on an inference result;
    所述第二损失函数配置为第二有监督损失函数与第二伪标签损失函数的加权之和,其中,所述第二有监督损失函数指向所述第二神经网络模型基于所述样本图像集合进行的有监督训练过程,所述第二伪标签损失函数指向所述第一神经网络模型基于推理结果进行的有监督训练过程。The second loss function is configured as a weighted sum of a second supervised loss function and a second pseudo-label loss function, wherein the second supervised loss function refers to a supervised training process performed by the second neural network model based on the sample image set, and the second pseudo-label loss function refers to a supervised training process performed by the first neural network model based on the inference result.
  18. 根据权利要求17所述的病理图像识别模型训练方法,其特征在于,所述第一有监督损失函数配置为第一有监督交叉熵损失函数与第一有监督交并比损失函数之和;其中,所述第一有监督交叉熵损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类概率之间的差距,所述第一有监督交并比损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类类别之间的差距;The pathological image recognition model training method according to claim 17 is characterized in that the first supervised loss function is configured as the sum of a first supervised cross entropy loss function and a first supervised intersection-over-union loss function; wherein the first supervised cross entropy loss function represents the gap between the known label data in the sample image set and the corresponding inference classification probability, and the first supervised intersection-over-union loss function represents the gap between the known label data in the sample image set and the corresponding inference classification category;
    所述第一伪标签损失函数包括第一伪标签交叉熵损失函数;其中,所述第一伪标签交叉熵损失函数表征所述第一神经网络模型对所述样本图像集合的推理分类概率,与所述第二神经网络模型对所述样本图像集合的推理分类类别之间的差距;The first pseudo-label loss function includes a first pseudo-label cross entropy loss function; wherein the first pseudo-label cross entropy loss function represents the gap between the inference classification probability of the first neural network model for the sample image set and the inference classification category of the second neural network model for the sample image set;
    所述第二有监督损失函数配置为第二有监督交叉熵损失函数与第二有监督交并比损失函数之和;其中,所述第二有监督交叉熵损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类概率之间的差距,所述第二有监督交并比损失函数表征所述样本图像集合中的已知标签数据和对应的推理分类类别之间的差距;The second supervised loss function is configured as the sum of a second supervised cross entropy loss function and a second supervised intersection-over-union loss function; wherein the second supervised cross entropy loss function represents the gap between the known label data in the sample image set and the corresponding inference classification probability, and the second supervised intersection-over-union loss function represents the gap between the known label data in the sample image set and the corresponding inference classification category;
    所述第二伪标签损失函数包括第二伪标签交叉熵损失函数;其中,所述第二伪标签交叉熵损失函数表征所述第二神经网络模型对所述样本图像集合的推理分类概率,与所述第一神经网络模型对所述样本图像集合的推理分类类别之间的差距。The second pseudo-label loss function includes a second pseudo-label cross-entropy loss function; wherein the second pseudo-label cross-entropy loss function represents the gap between the inference classification probability of the second neural network model for the sample image set and the inference classification category of the first neural network model for the sample image set.
  19. 根据权利要求18所述的病理图像识别模型训练方法,其特征在于,样本图像表征上皮内瘤变情况和肠上皮化生情况;The pathological image recognition model training method according to claim 18 is characterized in that the sample image represents intraepithelial neoplasia and intestinal metaplasia;
    所述第一有监督交叉熵损失函数、所述第一伪标签交叉熵损失函数、所述第二有监督交叉熵损失函数和所述第二伪标签交叉熵损失函数,指向样本图像中背景区域、上皮内瘤变区域和肠上皮化生区域;所述第一有监督交并比损失函数和所述第二有监督交并比损失函数,指向样本图像中上皮内瘤变区域和肠上皮化生区域。The first supervised cross entropy loss function, the first pseudo-label cross entropy loss function, the second supervised cross entropy loss function and the second pseudo-label cross entropy loss function point to the background area, intraepithelial neoplasia area and intestinal metaplasia area in the sample image; the first supervised intersection-over-union loss function and the second supervised intersection-over-union loss function point to the intraepithelial neoplasia area and intestinal metaplasia area in the sample image.
  20. 根据权利要求17所述的病理图像识别模型训练方法,其特征在于,所述第一伪标签损失函数和所述第二伪标签损失函数具有相等的预设权重值,所述预设权重值配置为随迭代次数的增加而增大。The pathological image recognition model training method according to claim 17 is characterized in that the first pseudo-label loss function and the second pseudo-label loss function have equal preset weight values, and the preset weight values are configured to increase with the increase in the number of iterations.
  21. 根据权利要求20所述的病理图像识别模型训练方法,其特征在于,所述预设权重值等于权重最大值与预设递增函数的乘积,所述预设递增函数配置为函数值无限趋近于1。The pathological image recognition model training method according to claim 20 is characterized in that the preset weight value is equal to the product of the maximum weight value and a preset increasing function, and the preset increasing function is configured so that the function value infinitely approaches 1.
  22. 根据权利要求1所述的病理图像识别模型训练方法,其特征在于,样本图像表征上皮内瘤变情况和肠上皮化生情况。 The pathological image recognition model training method according to claim 1 is characterized in that the sample images represent intraepithelial neoplasia and intestinal metaplasia.
  23. 一种病理图像识别模型训练系统,其特征在于,包括:一个或多个处理器;存储器,用于存储一个或多个计算机程序,当所述一个或多个计算机程序被所述一个或多个处理器执行时,配置为执行一种病理图像识别模型训练方法;所述病理图像识别模型训练方法包括:A pathological image recognition model training system, characterized by comprising: one or more processors; a memory for storing one or more computer programs, wherein when the one or more computer programs are executed by the one or more processors, the system is configured to execute a pathological image recognition model training method; the pathological image recognition model training method comprises:
    接收样本图像集合;receiving a sample image set;
    根据所述样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数;According to the sample image set, calling the first neural network model to perform supervised training and traversal reasoning in sequence, and calling the second neural network model to perform supervised training based on the reasoning result, and calculating a first loss function;
    根据所述样本图像集合,调用所述第二神经网络模型依次执行有监督训练和遍历推理,并调用所述第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数;According to the sample image set, calling the second neural network model to perform supervised training and traversal reasoning in sequence, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating a second loss function;
    根据所述第一损失函数和所述第二损失函数对所述第一神经网络模型和所述第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。The first neural network model and the second neural network model are iteratively trained according to the first loss function and the second loss function to obtain at least one of a first model training parameter and a second model training parameter.
  24. 一种存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现一种病理图像识别模型训练方法;所述病理图像识别模型训练方法包括:A storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, a pathological image recognition model training method is implemented; the pathological image recognition model training method comprises:
    接收样本图像集合;receiving a sample image set;
    根据所述样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数;According to the sample image set, calling the first neural network model to perform supervised training and traversal reasoning in sequence, and calling the second neural network model to perform supervised training based on the reasoning result, and calculating a first loss function;
    根据所述样本图像集合,调用所述第二神经网络模型依次执行有监督训练和遍历推理,并调用所述第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数;According to the sample image set, calling the second neural network model to perform supervised training and traversal reasoning in sequence, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating a second loss function;
    根据所述第一损失函数和所述第二损失函数对所述第一神经网络模型和所述第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。The first neural network model and the second neural network model are iteratively trained according to the first loss function and the second loss function to obtain at least one of a first model training parameter and a second model training parameter.
  25. 一种病理图像识别方法,其特征在于,所述方法包括:A pathological image recognition method, characterized in that the method comprises:
    执行一种病理图像识别模型训练方法,得到第一模型训练参数和第二模型训练参数至少其中之一;Executing a pathological image recognition model training method to obtain at least one of a first model training parameter and a second model training parameter;
    将模型训练参数搭载至对应的神经网络模型中,构建病理图像识别模型;Load the model training parameters into the corresponding neural network model to build a pathological image recognition model;
    接收待测病理图像数据并进行预处理,将预处理后的待测病理图像数据输入所述病理图像识别模型中进行遍历预测,得到病理识别数据;Receiving and preprocessing the pathological image data to be tested, and inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction to obtain pathological recognition data;
    其中,所述病理图像识别模型训练方法包括:Wherein, the pathological image recognition model training method includes:
    接收样本图像集合;receiving a sample image set;
    根据所述样本图像集合,调用第一神经网络模型依次执行有监督训练和遍历推理,并调用第二神经网络模型基于推理结果进行有监督训练,计算得到第一损失函数;According to the sample image set, calling the first neural network model to perform supervised training and traversal reasoning in sequence, and calling the second neural network model to perform supervised training based on the reasoning result, and calculating a first loss function;
    根据所述样本图像集合,调用所述第二神经网络模型依次执行有监督训练和遍历推理,并调用所述第一神经网络模型基于推理结果进行有监督训练,计算得到第二损失函数;According to the sample image set, calling the second neural network model to perform supervised training and traversal reasoning in sequence, and calling the first neural network model to perform supervised training based on the reasoning result, and calculating a second loss function;
    根据所述第一损失函数和所述第二损失函数对所述第一神经网络模型和所述第二神经网络模型进行迭代训练,得到第一模型训练参数和第二模型训练参数至少其中之一。The first neural network model and the second neural network model are iteratively trained according to the first loss function and the second loss function to obtain at least one of a first model training parameter and a second model training parameter.
  26. 根据权利要求25所述的病理图像识别方法,其特征在于,所述“接收待测病理图像数据并进行预处理,将预处理后的待测病理图像数据输入所述病理图像识别模型中进行遍历预测,得到病理识别数据”具体包括:The pathological image recognition method according to claim 25 is characterized in that the "receiving the pathological image data to be tested and preprocessing it, inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction, and obtaining the pathological recognition data" specifically includes:
    对所述待测病理图像数据依次执行尺寸标准化处理和颜色迁移标准化处理,运算得到待测病理图像集合;Performing size standardization processing and color migration standardization processing on the pathological image data to be tested in sequence, and obtaining a set of pathological images to be tested by calculation;
    将所述待测病理图像集合输入所述病理图像识别模型中进行遍历预测,得到病理识别像素区;Inputting the pathological image set to be tested into the pathological image recognition model for traversal prediction to obtain a pathological recognition pixel area;
    将所述病理识别像素区叠加显示于待测病理图像上,形成病理判断图像。The pathology recognition pixel area is superimposed and displayed on the pathology image to be detected to form a pathology judgment image.
  27. 根据权利要求26所述的病理图像识别方法,其特征在于,所述“运算得到待测病理图像集合”具体包括:对完成尺寸标准化处理和颜色迁移标准化处理的待测病理图像数据执行滑窗区域分割,根据待测滑窗图像中低灰度值区域占比情况,筛选得到所述待测病理图像集合。The pathological image recognition method according to claim 26 is characterized in that the "operation to obtain a set of pathological images to be tested" specifically includes: performing sliding window area segmentation on the pathological image data to be tested that has completed size standardization and color migration standardization, and screening to obtain the set of pathological images to be tested based on the proportion of low grayscale value areas in the sliding window image to be tested.
  28. 根据权利要求26所述的病理图像识别方法,其特征在于,所述病理识别数据包括癌前病变判定信息,所述“接收待测病理图像数据并进行预处理,将预处理后的待测病理图像数据输入所述病理图像识别模型中进行遍历预测,得到病理识别数据”具体包括:The pathological image recognition method according to claim 26 is characterized in that the pathological recognition data includes precancerous lesion determination information, and the "receiving the pathological image data to be tested and preprocessing it, inputting the preprocessed pathological image data to be tested into the pathological image recognition model for traversal prediction, and obtaining the pathological recognition data" specifically includes:
    对所述病理识别像素区中分别指向上皮内瘤变和肠上皮化生的像素值进行降序排列,计算预设数量范围内的像素平均值,得到第一平均值和第二平均值,并判断所述第一平均值和所述第二平均值与预设癌前病变判定阈值之间的数值大小关系;Arrange the pixel values pointing to intraepithelial neoplasia and intestinal metaplasia in the pathological identification pixel area in descending order, calculate the average value of pixels within a preset number range, obtain a first average value and a second average value, and determine the numerical relationship between the first average value and the second average value and a preset precancerous lesion determination threshold;
    若所述第一平均值和所述第二平均值其中之一大于所述癌前病变判定阈值,则判定该病理识别像素区对应的待测病理图像所表征的位置发生癌前病变,输出癌前病变判定信息。 If one of the first average value and the second average value is greater than the precancerous lesion determination threshold, it is determined that a precancerous lesion occurs at the position represented by the pathological image to be detected corresponding to the pathological identification pixel area, and precancerous lesion determination information is output.
PCT/CN2023/125221 2022-10-18 2023-10-18 Pathological image recognition method, pathological image recognition model training method and system therefor, and storage medium WO2024083152A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211272240.8A CN115346076B (en) 2022-10-18 2022-10-18 Pathological image recognition method, model training method and system thereof, and storage medium
CN202211272240.8 2022-10-18

Publications (1)

Publication Number Publication Date
WO2024083152A1 true WO2024083152A1 (en) 2024-04-25

Family

ID=83956978

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/125221 WO2024083152A1 (en) 2022-10-18 2023-10-18 Pathological image recognition method, pathological image recognition model training method and system therefor, and storage medium

Country Status (2)

Country Link
CN (1) CN115346076B (en)
WO (1) WO2024083152A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115346076B (en) * 2022-10-18 2023-01-17 安翰科技(武汉)股份有限公司 Pathological image recognition method, model training method and system thereof, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111598182A (en) * 2020-05-22 2020-08-28 北京市商汤科技开发有限公司 Method, apparatus, device and medium for training neural network and image recognition
WO2021259392A2 (en) * 2021-01-21 2021-12-30 北京安德医智科技有限公司 Network training method and apparatus, and image recognition method and electronic device
CN114022718A (en) * 2022-01-07 2022-02-08 安翰科技(武汉)股份有限公司 Digestive system pathological image recognition method, system and computer storage medium
CN114581434A (en) * 2022-03-24 2022-06-03 生仝智能科技(北京)有限公司 Pathological image processing method based on deep learning segmentation model and electronic equipment
CN115346076A (en) * 2022-10-18 2022-11-15 安翰科技(武汉)股份有限公司 Pathological image recognition method, model training method and system thereof, and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10817779B2 (en) * 2017-08-30 2020-10-27 International Business Machines Corporation Bayesian network based hybrid machine learning
CN108197666A (en) * 2018-01-30 2018-06-22 咪咕文化科技有限公司 A kind of processing method, device and the storage medium of image classification model
CN111178432B (en) * 2019-12-30 2023-06-06 武汉科技大学 Weak supervision fine granularity image classification method of multi-branch neural network model
CN112183577A (en) * 2020-08-31 2021-01-05 华为技术有限公司 Training method of semi-supervised learning model, image processing method and equipment
CN112598658A (en) * 2020-12-29 2021-04-02 哈尔滨工业大学芜湖机器人产业技术研究院 Disease identification method based on lightweight twin convolutional neural network
CN113128613B (en) * 2021-04-29 2023-10-17 南京大学 Semi-supervised anomaly detection method based on transfer learning
CN114419363A (en) * 2021-12-23 2022-04-29 北京三快在线科技有限公司 Target classification model training method and device based on label-free sample data
CN115130650A (en) * 2022-04-27 2022-09-30 腾讯科技(深圳)有限公司 Model training method and related device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111598182A (en) * 2020-05-22 2020-08-28 北京市商汤科技开发有限公司 Method, apparatus, device and medium for training neural network and image recognition
WO2021259392A2 (en) * 2021-01-21 2021-12-30 北京安德医智科技有限公司 Network training method and apparatus, and image recognition method and electronic device
CN114022718A (en) * 2022-01-07 2022-02-08 安翰科技(武汉)股份有限公司 Digestive system pathological image recognition method, system and computer storage medium
CN114581434A (en) * 2022-03-24 2022-06-03 生仝智能科技(北京)有限公司 Pathological image processing method based on deep learning segmentation model and electronic equipment
CN115346076A (en) * 2022-10-18 2022-11-15 安翰科技(武汉)股份有限公司 Pathological image recognition method, model training method and system thereof, and storage medium

Also Published As

Publication number Publication date
CN115346076B (en) 2023-01-17
CN115346076A (en) 2022-11-15

Similar Documents

Publication Publication Date Title
Zheng et al. Adaptive color deconvolution for histological WSI normalization
WO2024083152A1 (en) Pathological image recognition method, pathological image recognition model training method and system therefor, and storage medium
Lafarge et al. Learning domain-invariant representations of histological images
CN108647641A (en) Video behavior dividing method and device based on two-way Model Fusion
İnik et al. A new method for automatic counting of ovarian follicles on whole slide histological images based on convolutional neural network
WO2023131301A1 (en) Digestive system pathology image recognition method and system, and computer storage medium
CN112990222B (en) Image boundary knowledge migration-based guided semantic segmentation method
US11688061B2 (en) Interpretation of whole-slide images in digital pathology
CN107945181A (en) Treating method and apparatus for breast cancer Lymph Node Metastasis pathological image
CN111723815B (en) Model training method, image processing device, computer system and medium
JP2023543044A (en) Method of processing images of tissue and system for processing images of tissue
CN108305253A (en) A kind of pathology full slice diagnostic method based on more multiplying power deep learnings
WO2021035412A1 (en) Automatic machine learning (automl) system, method and device
CN112116957A (en) Disease subtype prediction method, system, device and medium based on small sample
CN114639102B (en) Cell segmentation method and device based on key point and size regression
CN113763371A (en) Pathological image cell nucleus segmentation method and device
Khan et al. Computer-assisted diagnosis of lymph node metastases in colorectal cancers using transfer learning with an ensemble model
Mei et al. Dense contour-imbalance aware framework for colon gland instance segmentation
CN112528058A (en) Fine-grained image classification method based on image attribute active learning
Sandarenu et al. Survival prediction in triple negative breast cancer using multiple instance learning of histopathological images
EP4275052A1 (en) Quantification of conditions on biomedical images across staining modalities using a multi-task deep learning framework
WO2022221991A1 (en) Image data processing method and apparatus, computer, and storage medium
CN115641317B (en) Pathological image-oriented dynamic knowledge backtracking multi-example learning and image classification method
CN116884597A (en) Pathological image breast cancer molecular typing method and system based on self-supervision pre-training and multi-example learning
US20220399114A1 (en) Processing multimodal images of tissue for medical evaluation

Legal Events

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

Ref document number: 23879140

Country of ref document: EP

Kind code of ref document: A1