CN114581709B - Model training, method, device and medium for identifying objects in medical images - Google Patents
Model training, method, device and medium for identifying objects in medical images Download PDFInfo
- Publication number
- CN114581709B CN114581709B CN202210205467.4A CN202210205467A CN114581709B CN 114581709 B CN114581709 B CN 114581709B CN 202210205467 A CN202210205467 A CN 202210205467A CN 114581709 B CN114581709 B CN 114581709B
- Authority
- CN
- China
- Prior art keywords
- area
- model
- target
- region
- training
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing 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/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H30/00—ICT specially adapted for the handling or processing of medical images
- G16H30/40—ICT specially adapted for the handling or processing of medical images for processing medical images, e.g. editing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Multimedia (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
- Radiology & Medical Imaging (AREA)
- Epidemiology (AREA)
- Primary Health Care (AREA)
- Public Health (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本公开涉及基于人工智能的图像处理领域,具体涉及一种识别医学图像中的目标的模型训练、方法、设备及介质。The present disclosure relates to the field of image processing based on artificial intelligence, and in particular to a model training, method, device and medium for identifying targets in medical images.
背景技术Background Art
近些年来,人工智能技术在计算机视觉领域中取得了巨大的成就。例如,深度学习技术在语义分割、图像分类和目标识别等方面的应用越来越广泛。特别在医学领域,常常通过对医学图像中的目标进行分割、识别或分类以辅助对目标进行分析。In recent years, artificial intelligence technology has made great achievements in the field of computer vision. For example, deep learning technology is increasingly used in semantic segmentation, image classification, and object recognition. Especially in the medical field, it is often necessary to segment, identify, or classify objects in medical images to assist in the analysis of the objects.
目前,深度学习目标识别技术对大尺寸的目标可以获得较高的识别准确度,但是对小目标(例如细物体或小物体)的识别性能却不尽人意,容易造成漏报和虚警的情况,并且区别小目标的类别也很困难。例如,在眼底图像中,点状出血和微血管瘤等小目标体征由于目标小、颜色浅、颜色接近,因此在深度学习进行目标识别时不易发现,也不易区分。因此,如何有效地对小目标进行识别还有待于研究。At present, deep learning target recognition technology can achieve high recognition accuracy for large-sized targets, but the recognition performance for small targets (such as thin objects or small objects) is unsatisfactory, which easily leads to missed reports and false alarms, and it is also difficult to distinguish the categories of small targets. For example, in fundus images, small target signs such as punctate hemorrhages and microvascular tumors are not easy to find or distinguish when deep learning is used for target recognition because the targets are small, light in color, and close in color. Therefore, how to effectively recognize small targets remains to be studied.
发明内容Summary of the invention
本公开是有鉴于上述现有技术的状况而提出的,其目的在于提供一种能够有效地对小目标进行识别的识别医学图像中的目标的模型训练、方法、设备及介质。The present disclosure is proposed in view of the above-mentioned state of the prior art, and its purpose is to provide a model training, method, device and medium for identifying targets in medical images that can effectively identify small targets.
为此,本公开第一方面提供一种识别医学图像中的目标的模型训练方法,包括:获取作为训练样本的所述医学图像和所述训练样本中的所述目标对应的标注区域;确定所述标注区域对应的区域分割结果,并利用所述训练样本和所述区域分割结果构建训练集,其中,通过对所述标注区域内的图像数据进行欠分割以获取所述区域分割结果;并且基于所述训练集训练待训练模型,并利用训练损失函数优化所述待训练模型,其中,在所述训练损失函数中,利用空间权重减小所述训练样本中的第一区域的像素对所述待训练模型的负面影响,所述第一区域为所述训练样本中的所述标注区域内的所述目标的目标区域以外的区域,所述目标区域由所述区域分割结果确定。在这种情况下,通过对训练样本中标注区域内的图像数据进行欠分割以识别标注区域内未确定类别的像素,并结合空间权重对待训练模型进行训练以减小标注区域内的未确定类别的像素对待训练模型的负面影响,进而能够使训练后的待训练模型对输入图像的预测结果的准确性提高。由此,能够有效地对小目标进行识别。To this end, the first aspect of the present disclosure provides a model training method for identifying targets in medical images, comprising: obtaining the medical image as a training sample and the annotated area corresponding to the target in the training sample; determining the region segmentation result corresponding to the annotated area, and constructing a training set using the training sample and the region segmentation result, wherein the region segmentation result is obtained by under-segmenting the image data in the annotated area; and training a model to be trained based on the training set, and optimizing the model to be trained using a training loss function, wherein in the training loss function, spatial weights are used to reduce the negative impact of pixels in a first area in the training sample on the model to be trained, the first area being an area other than a target area of the target in the annotated area in the training sample, and the target area being determined by the region segmentation result. In this case, by under-segmenting the image data in the annotated area in the training sample to identify pixels of undetermined categories in the annotated area, and combining the spatial weights to train the model to be trained to reduce the negative impact of pixels of undetermined categories in the annotated area on the model to be trained, the accuracy of the prediction results of the input image by the trained model to be trained can be improved. Thus, small targets can be effectively identified.
另外,在本公开的第一方面所涉及的模型训练方法中,可选地,获取所述区域分割结果进一步包括:基于所述训练样本中所述标注区域对应的图像数据获取待分割图像数据、或基于所述训练样本中所述标注区域对应的图像数据以及感兴趣分割结果中所述标注区域对应的图像数据获取所述待分割图像数据,其中,所述感兴趣分割结果为用于识别所述训练样本的感兴趣区域的二值图像;并且利用目标分割阈值对所述待分割图像数据进行阈值分割,进而获取所述区域分割结果,其中,所述区域分割结果为二值图像。在这种情况下,能够通过阈值分割识别待分割图像数据中的目标区域,并且在标注区域包括感兴趣区域以外的区域时,能够消除感兴趣区域以外的噪声。In addition, in the model training method involved in the first aspect of the present disclosure, optionally, obtaining the region segmentation result further includes: obtaining the image data to be segmented based on the image data corresponding to the annotated region in the training sample, or obtaining the image data to be segmented based on the image data corresponding to the annotated region in the training sample and the image data corresponding to the annotated region in the segmentation result of interest, wherein the segmentation result of interest is a binary image for identifying the region of interest of the training sample; and performing threshold segmentation on the image data to be segmented using a target segmentation threshold, thereby obtaining the region segmentation result, wherein the region segmentation result is a binary image. In this case, the target region in the image data to be segmented can be identified by threshold segmentation, and when the annotated region includes a region outside the region of interest, the noise outside the region of interest can be eliminated.
另外,在本公开的第一方面所涉及的模型训练方法中,可选地,根据所述目标所属的标注类别的获取阈值方法获取所述目标分割阈值,其中,各个标注类别的获取阈值方法由各个标注类别的平均面积和平均颜色确定,所述获取阈值方法包括第一种方法和第二种方法,所述第一种方法对应的标注类别的平均面积大于所述第二种方法对应的标注类别的平均面积且所述第一种方法对应的标注类别的平均颜色比所述第二种方法对应的标注类别的平均颜色浅;对于所述第一种方法,查找阈值,使所述待分割图像数据内灰度值大于所述阈值的像素的面积小于所述待分割图像数据的面积的预设倍数,将所述阈值作为所述目标分割阈值,其中,所述预设倍数大于0且小于1;对于所述第二种方法,若所述待分割图像数据的最小的边的长度小于预设长度,则取所述待分割图像数据中像素的灰度值的均值作为所述目标分割阈值,否则基于所述待分割图像数据的四个角的区域和中心区域的灰度值确定所述目标分割阈值。在这种情况下,能够根据目标对应的标注类别自身的特点获取目标分割阈值。由此,能够提高阈值分割的准确性。In addition, in the model training method involved in the first aspect of the present disclosure, optionally, the target segmentation threshold is obtained according to the threshold acquisition method of the annotation category to which the target belongs, wherein the threshold acquisition method of each annotation category is determined by the average area and average color of each annotation category, and the threshold acquisition method includes a first method and a second method, wherein the average area of the annotation category corresponding to the first method is greater than the average area of the annotation category corresponding to the second method and the average color of the annotation category corresponding to the first method is lighter than the average color of the annotation category corresponding to the second method; for the first method, a threshold is searched so that the area of pixels with gray values greater than the threshold in the image data to be segmented is less than a preset multiple of the area of the image data to be segmented, and the threshold is used as the target segmentation threshold, wherein the preset multiple is greater than 0 and less than 1; for the second method, if the length of the smallest side of the image data to be segmented is less than the preset length, the average gray value of the pixels in the image data to be segmented is taken as the target segmentation threshold, otherwise the target segmentation threshold is determined based on the gray values of the four corners and the center area of the image data to be segmented. In this case, the target segmentation threshold can be obtained according to the characteristics of the annotation category corresponding to the target. Thereby, the accuracy of threshold segmentation can be improved.
另外,在本公开的第一方面所涉及的模型训练方法中,可选地,在获取所述区域分割结果之前:还对所述待分割图像数据的阈值分割结果进行腐蚀操作以获取至少一个连通区域,从所述至少一个连通区域中选择中心离所述待分割图像数据的中心最近的所述连通区域作为所述区域分割结果。由此,能够获得准确的目标区域。In addition, in the model training method involved in the first aspect of the present disclosure, optionally, before obtaining the region segmentation result: an erosion operation is further performed on the threshold segmentation result of the image data to be segmented to obtain at least one connected region, and the connected region whose center is closest to the center of the image data to be segmented is selected from the at least one connected region as the region segmentation result. In this way, an accurate target region can be obtained.
另外,在本公开的第一方面所涉及的模型训练方法中,可选地,在所述空间权重中,所述训练样本中的所述第一区域的像素被分配第一权重,其中,所述第一权重为0。在这种情况下,能够忽略未确定类别的样本,以减小未确定类别的样本对待训练模型的负面影响。In addition, in the model training method involved in the first aspect of the present disclosure, optionally, in the spatial weight, the pixels of the first area in the training sample are assigned a first weight, wherein the first weight is 0. In this case, samples of undetermined categories can be ignored to reduce the negative impact of samples of undetermined categories on the model to be trained.
另外,在本公开的第一方面所涉及的模型训练方法中,可选地,所述训练样本中的所述第一区域、第二区域、第三区域和第四区域的像素分别被分配第一权重、第二权重、第三权重和第四权重,其中,所述第二区域为所述目标区域,所述第三区域为感兴趣区域内的不属于所述标注区域的区域,所述第四区域为所述感兴趣区域之外的区域,所述第一权重小于所述第二权重且小于所述第三权重,所述第四权重小于所述第二权重且小于所述第三权重。在这种情况下,能够抑制未确定类别的像素以及感兴趣区域以外的像素对待训练模型的负面影响,提高目标区域以内和感兴趣区域内的无目标区域对待训练模型的正面影响。由此,能够提高模型的准确性。In addition, in the model training method involved in the first aspect of the present disclosure, optionally, the pixels of the first area, the second area, the third area and the fourth area in the training sample are respectively assigned a first weight, a second weight, a third weight and a fourth weight, wherein the second area is the target area, the third area is an area within the region of interest that does not belong to the annotated area, the fourth area is an area outside the region of interest, the first weight is less than the second weight and less than the third weight, and the fourth weight is less than the second weight and less than the third weight. In this case, the negative impact of pixels of undetermined categories and pixels outside the region of interest on the model to be trained can be suppressed, and the positive impact of non-target areas within the target area and the region of interest on the model to be trained can be increased. In this way, the accuracy of the model can be improved.
另外,在本公开的第一方面所涉及的模型训练方法中,可选地,所述待训练模型是语义分割模型,所述待训练模型的预测结果是所述训练样本的语义分割结果。由此,能够对小目标进行识别。In addition, in the model training method involved in the first aspect of the present disclosure, optionally, the model to be trained is a semantic segmentation model, and the prediction result of the model to be trained is the semantic segmentation result of the training sample. Thus, small targets can be identified.
另外,在本公开的第一方面所涉及的模型训练方法中,可选地,所述标注区域的形状为矩形。由此,能够降低标注的难度。In addition, in the model training method involved in the first aspect of the present disclosure, optionally, the shape of the labeled area is a rectangle, thereby reducing the difficulty of labeling.
本公开第二方面提供了一种电子设备,该电子设备包括:至少一个处理电路,所述至少一个处理电路被配置为执行本公开第一方面所述的模型训练方法的步骤。A second aspect of the present disclosure provides an electronic device, which includes: at least one processing circuit, and the at least one processing circuit is configured to execute the steps of the model training method described in the first aspect of the present disclosure.
本公开第三方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有至少一个指令,所述至少一个指令被处理器执行时实现上述的模型训练方法的步骤。A third aspect of the present disclosure provides a computer-readable storage medium, which stores at least one instruction, and when the at least one instruction is executed by a processor, the steps of the above-mentioned model training method are implemented.
本公开第四方面提供了一种识别医学图像中目标的方法,该方法包括:获取作为输入图像的所述医学图像;并且利用根据本公开第一方面所述的模型训练方法训练的至少一个经训练模型,确定针对所述输入图像的各个经训练模型的预测结果,基于所述至少一个经训练模型的预测结果获取目标预测结果。The fourth aspect of the present disclosure provides a method for identifying targets in a medical image, the method comprising: acquiring the medical image as an input image; and using at least one trained model trained by the model training method described in the first aspect of the present disclosure to determine the prediction results of each trained model for the input image, and obtaining a target prediction result based on the prediction result of the at least one trained model.
另外,在本公开的第四方面所涉及的方法中,可选地,各个经训练模型的预测结果包括所述输入图像中的各个像素属于相应标注类别的概率,按标注类别和像素对所述至少一个经训练模型的预测结果进行集成以获取所述输入图像的各个像素属于相应标注类别的集成概率,基于所述集成概率确定连通区域,基于该连通区域获取各个标注类别对应的所述目标预测结果,其中,若仅存在一个经训练模型,则将所述概率作为所述集成概率,否则对多个经训练模型的预测结果求均值以获取所述输入图像中的各个像素属于相应标注类别的概率均值并作为所述集成概率。在这种情况下,基于集成概率获取目标预测结果,能够进一步提高目标预测结果的准确性。In addition, in the method involved in the fourth aspect of the present disclosure, optionally, the prediction results of each trained model include the probability that each pixel in the input image belongs to the corresponding labeled category, the prediction results of the at least one trained model are integrated according to the labeled category and pixel to obtain the integrated probability that each pixel of the input image belongs to the corresponding labeled category, the connected area is determined based on the integrated probability, and the target prediction results corresponding to each labeled category are obtained based on the connected area, wherein if there is only one trained model, the probability is used as the integrated probability, otherwise the prediction results of multiple trained models are averaged to obtain the average probability that each pixel in the input image belongs to the corresponding labeled category and use it as the integrated probability. In this case, obtaining the target prediction result based on the integrated probability can further improve the accuracy of the target prediction result.
另外,在本公开的第四方面所涉及的方法中,可选地,所述医学图像为眼底图像。在这种情况下,训练后获得的模型能够对眼底图像中的小目标进行识别。In addition, in the method involved in the fourth aspect of the present disclosure, optionally, the medical image is a fundus image. In this case, the model obtained after training can recognize small targets in the fundus image.
另外,在本公开的第四方面所涉及的方法中,可选地,所述目标包括微血管瘤、点状出血、片状出血和线状出血。在这种情况下,训练后获得的模型能够对眼底图像中的小目标进行识别。In addition, in the method involved in the fourth aspect of the present disclosure, optionally, the target includes microvascular tumors, punctate hemorrhages, sheet hemorrhages and linear hemorrhages. In this case, the model obtained after training can identify small targets in fundus images.
本公开第五方面提供了一种电子设备,该电子设备包括:至少一个处理电路,所述至少一个处理电路被配置为:获取作为输入图像的所述医学图像;并且利用根据本公开第一方面所述的模型训练方法训练的至少一个经训练模型,确定针对所述输入图像的各个经训练模型的预测结果,基于所述至少一个经训练模型的预测结果获取目标预测结果。A fifth aspect of the present disclosure provides an electronic device, comprising: at least one processing circuit, wherein the at least one processing circuit is configured to: obtain the medical image as an input image; and determine the prediction results of each trained model for the input image using at least one trained model trained by the model training method described in the first aspect of the present disclosure, and obtain a target prediction result based on the prediction results of the at least one trained model.
根据本公开,提供一种能够有效地对小目标进行识别的识别医学图像中的目标的模型训练、方法、设备及介质。According to the present disclosure, a model training, method, device and medium for identifying targets in medical images that can effectively identify small targets are provided.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
现在将仅通过参考附图的例子进一步详细地解释本公开,其中:The present disclosure will now be explained in further detail by way of example only with reference to the accompanying drawings, in which:
图1是示出了本公开示例所涉及的识别目标环境的示例的示意图。FIG. 1 is a schematic diagram showing an example of identifying a target environment involved in the examples of the present disclosure.
图2是示出了本公开示例所涉及的模型训练方法的示例的流程图。FIG2 is a flowchart showing an example of a model training method involved in the examples of the present disclosure.
图3是示出了本公开示例所涉及的一些示例的标注区域的示意图。FIG. 3 is a schematic diagram showing some example annotation areas involved in the examples of the present disclosure.
图4是示出了本公开示例所涉及的一些示例的区域分割结果的示意图。FIG. 4 is a schematic diagram showing some example region segmentation results involved in the examples of the present disclosure.
图5是示出了本公开示例所涉及的获取区域分割结果的示例的流程图。FIG. 5 is a flowchart showing an example of obtaining a region segmentation result according to an example of the present disclosure.
图6是示出了本公开示例所涉及的采用U-Net架构的待训练模型的示例的架构图。FIG6 is an architecture diagram showing an example of a model to be trained using a U-Net architecture involved in the examples of the present disclosure.
图7是示出了本公开示例所涉及的一些示例的若干个区域的示意图。FIG. 7 is a schematic diagram showing several areas of some examples involved in the examples of the present disclosure.
图8是示出了本公开示例所涉及的识别图像中的目标的方法的示例的流程图。FIG. 8 is a flowchart showing an example of a method for identifying a target in an image according to an example of the present disclosure.
具体实施方式DETAILED DESCRIPTION
以下,参考附图,详细地说明本公开的优选实施方式。在下面的说明中,对于相同的部件赋予相同的符号,省略重复的说明。另外,附图只是示意性的图,部件相互之间的尺寸的比例或者部件的形状等可以与实际的不同。需要说明的是,本公开中的术语“包括”和“具有”以及它们的任何变形,例如所包括或所具有的一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可以包括或具有没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。本公开所描述的所有方法可以以任何合适的顺序执行,除非在此另有指示或者与上下文明显矛盾。Hereinafter, with reference to the accompanying drawings, the preferred embodiments of the present disclosure are described in detail. In the following description, the same symbols are given to the same parts, and repeated descriptions are omitted. In addition, the accompanying drawings are only schematic diagrams, and the ratio of the sizes of the parts to each other or the shapes of the parts, etc. may be different from the actual ones. It should be noted that the terms "including" and "having" in the present disclosure and any variations thereof, such as the process, method, system, product or device of a series of steps or units included or possessed are not necessarily limited to those steps or units clearly listed, but may include or have other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. All methods described in the present disclosure can be performed in any suitable order, unless otherwise indicated herein or clearly contradictory to the context.
本文中的术语“电路”可以指硬件电路和/或硬件电路和软件的组合。在本公开中术语“模型”能够处理输入并且提供相应输出。在本文中,术语“神经网络”、“深度神经网络”、“模型”、“网络”和“神经网络模型”可互换使用。另外,本文提到相关对象(例如,标注区域、待分割图像数据和目标)的矩形特性(例如,边、宽、高、宽度和高度),若对象本身不为矩形,除非特别说明,可以默认为对象的外接矩形的矩形特性。The term "circuit" in this document may refer to a hardware circuit and/or a combination of a hardware circuit and software. In the present disclosure, the term "model" is capable of processing inputs and providing corresponding outputs. In this document, the terms "neural network", "deep neural network", "model", "network" and "neural network model" are used interchangeably. In addition, when referring to the rectangular properties (e.g., sides, width, height, width and height) of related objects (e.g., annotated areas, image data to be segmented, and targets), if the object itself is not a rectangle, unless otherwise specified, it can be defaulted to the rectangular properties of the circumscribed rectangle of the object.
现有深度学习目标识别的方案,采用各种形状的框标的标注方式(也即,不要求准确边界的标注方式)对小目标进行识别。但是如上文所简要提及的,该方案对图像中小目标的识别效果不尽人意,存在较大的漏报和虚警的风险。这是由于小目标的面积较小,可提取的特征少,容易受噪声和其他组织的干扰。因此一种更好的方案是通过深度学习目标分割的方式对小目标进行分割从而实现对小目标的识别。但是该方案需要对小目标的边界进行精确标注,造成图像标注的困难。为了克服上面两个方案的不足,本公开通过对标注区域进行欠分割以获取区域分割结果,并使用该结果作为金标准对图像进行分割,从而实现了小目标的准确识别。特别地,本公开采用空间权重的方法处理标注区域内欠分割所导致的未确定类别的像素对图像分割的负面影响。在这种情况下,能够有效地对小目标进行识别。The existing deep learning target recognition scheme uses a labeling method of various shapes of frame marks (that is, a labeling method that does not require accurate boundaries) to identify small targets. However, as briefly mentioned above, the recognition effect of this scheme on small targets in images is not satisfactory, and there is a large risk of missed reports and false alarms. This is because the area of small targets is small, there are few extractable features, and they are easily interfered by noise and other tissues. Therefore, a better solution is to segment small targets by deep learning target segmentation to achieve recognition of small targets. However, this solution requires accurate labeling of the boundaries of small targets, which makes image labeling difficult. In order to overcome the shortcomings of the above two schemes, the present disclosure obtains regional segmentation results by under-segmenting the labeled area, and uses the results as the gold standard to segment the image, thereby achieving accurate recognition of small targets. In particular, the present disclosure uses a spatial weight method to deal with the negative impact of pixels of undetermined categories on image segmentation caused by under-segmentation in the labeled area. In this case, small targets can be effectively identified.
因此,本公开的示例提出了一种训练模型和识别图像中的目标的方案,以解决上述问题和/或其他潜在问题中的一个或多个。该方案采用图像分割的方法进行目标识别(也即,先对训练样本中标注区域内的图像数据进行图像分割以获取区域分割结果,然后将区域分割结果进行后处理得到目标识别结果)。具体地,该方案通过对训练样本中标注区域内的图像数据进行欠分割以识别标注区域内未确定类别的像素,并结合空间权重(也即,权重的设置可以与像素的位置相关)对神经网络模型进行训练以减小标注区域内的未确定类别的像素对神经网络模型的负面影响,能够提高经训练模型对输入图像(例如,医学图像)的预测结果的准确性。另外,经训练模型可以为经训练的神经网络模型(也即,训练后的神经网络模型。例如,经训练的语义分割模型。由此,能够优化训练所得的模型的性能,提高模型对小目标的识别的准确性。在一些示例中,经训练模型可以是训练后获得的最优的神经网络模型。Therefore, the examples of the present disclosure propose a training model and a solution for identifying targets in an image to solve one or more of the above problems and/or other potential problems. The solution uses an image segmentation method to perform target recognition (that is, first perform image segmentation on the image data in the labeled area in the training sample to obtain a region segmentation result, and then post-process the region segmentation result to obtain a target recognition result). Specifically, the solution performs under-segmentation on the image data in the labeled area in the training sample to identify pixels of undetermined categories in the labeled area, and trains the neural network model in combination with spatial weights (that is, the setting of weights can be related to the position of pixels) to reduce the negative impact of pixels of undetermined categories in the labeled area on the neural network model, thereby improving the accuracy of the prediction results of the trained model for the input image (for example, a medical image). In addition, the trained model can be a trained neural network model (that is, a trained neural network model. For example, a trained semantic segmentation model. Thus, the performance of the trained model can be optimized and the accuracy of the model in recognizing small targets can be improved. In some examples, the trained model can be the optimal neural network model obtained after training.
本公开的示例涉及的训练模型和识别图像中的目标的方案,其有效地对小目标进行识别。本公开的示例涉及的识别图像中的目标的模型训练方法可以简称为模型训练方法或训练方法。需要说明的是,本公开的示例涉及的方案同样适用于大目标的识别。The examples disclosed herein involve training models and schemes for identifying targets in images, which effectively identify small targets. The model training method for identifying targets in images involved in the examples disclosed herein can be referred to as a model training method or a training method. It should be noted that the schemes involved in the examples disclosed herein are also applicable to the identification of large targets.
本公开的示例涉及的图像可以来自相机、CT扫描、PET-CT扫描、SPECT扫描、MRI、超声、X射线、血管造影照片、荧光图、胶囊内窥镜拍摄的图像或其组合。在一些示例中,图像可以为医学图像。例如,医学图像可以包括但不限于眼底图像、肺部图像、胃部图像、胸部图像和脑部图像等。由此,能够对医学图像中的小目标进行识别。在一些示例中,图像可以为自然图像。自然图像可以为自然场景下观察或者拍摄到的图像。由此,能够对自然图像中的小目标进行识别。以下以图像为医学图像中的眼底图像为例描述了本公开的示例,并且这样的描述并不限制本公开的范围,对于本领域技术人员而言,可以使用其它类型的图像而没有限制。The images involved in the examples of the present disclosure may come from a camera, a CT scan, a PET-CT scan, a SPECT scan, an MRI, an ultrasound, an X-ray, an angiogram, a fluorescence image, an image taken by a capsule endoscope, or a combination thereof. In some examples, the image may be a medical image. For example, the medical image may include, but is not limited to, a fundus image, a lung image, a stomach image, a chest image, and a brain image. Thus, small targets in the medical image can be identified. In some examples, the image may be a natural image. A natural image may be an image observed or photographed in a natural scene. Thus, small targets in a natural image can be identified. The following describes an example of the present disclosure using the image as a fundus image in a medical image as an example, and such a description does not limit the scope of the present disclosure. For those skilled in the art, other types of images may be used without limitation.
以下将结合附图来详细描述本公开的示例。为了便于理解,在下文描述中提及的具体数据均是示例性的,并不用于限定本公开的保护范围。应当理解,根据本公开示例还可以包括未示出的附加模块、可以省略所示出的模块、未示出的附加动作和/或可以省略所示出的动作,本公开的范围在此方面不受限制。The examples of the present disclosure will be described in detail below in conjunction with the accompanying drawings. For ease of understanding, the specific data mentioned in the following description are exemplary and are not intended to limit the scope of protection of the present disclosure. It should be understood that according to the examples of the present disclosure, additional modules not shown may be included, the modules shown may be omitted, additional actions not shown, and/or the actions shown may be omitted, and the scope of the present disclosure is not limited in this respect.
图1是示出了本公开示例所涉及的识别目标环境100的示例的示意图。如图1所示,识别目标环境100可以包括计算设备110。计算设备110可以是具有计算能力的任何设备。例如,计算设备110可以为云服务器、个人计算机、大型机和分布式计算系统等。FIG. 1 is a schematic diagram showing an example of an identification target environment 100 involved in the examples of the present disclosure. As shown in FIG. 1 , the identification target environment 100 may include a computing device 110. The computing device 110 may be any device with computing capabilities. For example, the computing device 110 may be a cloud server, a personal computer, a mainframe, a distributed computing system, etc.
计算设备110可以获取输入120并利用神经网络模型130(有时也可以被简称为待训练模型130或模型130)生成与输入120对应的输出140。在一些示例中,输入120可以为上述的图像,输出140可以为预测结果、训练参数(例如,权重)、或性能指标(例如,准确率和错误率)等。在一些示例中,神经网络模型130可以包括但不限于语义分割模型(例如,U-Net)、或者其他与图像处理相关的模型。另外,可以利用任何合适的网络结构来实现神经网络模型130。例如,卷积神经网络(CNN)、循环神经网络(RNN)和深度神经网络(DNN)等。The computing device 110 can obtain input 120 and generate output 140 corresponding to the input 120 using a neural network model 130 (sometimes also referred to as a model to be trained 130 or model 130). In some examples, the input 120 can be the above-mentioned image, and the output 140 can be a prediction result, a training parameter (e.g., weight), or a performance indicator (e.g., accuracy and error rate). In some examples, the neural network model 130 can include but is not limited to a semantic segmentation model (e.g., U-Net), or other models related to image processing. In addition, the neural network model 130 can be implemented using any suitable network structure. For example, a convolutional neural network (CNN), a recurrent neural network (RNN), and a deep neural network (DNN).
在一些示例中,识别目标环境100还可以包括模型训练装置和模型应用装置(未图示)。模型训练装置可以用于实施训练神经网络模型130的训练方法以获取经训练模型。模型应用装置可以用于实施利用经训练模型获取预测结果的相关方法以对图像中的目标进行识别。另外,在模型训练阶段,神经网络模型130可以是待训练模型130。在模型应用阶段,神经网络模型130可以是经训练模型。In some examples, the target recognition environment 100 may also include a model training device and a model application device (not shown). The model training device may be used to implement a training method for training the neural network model 130 to obtain a trained model. The model application device may be used to implement a related method for obtaining a prediction result using the trained model to recognize the target in the image. In addition, in the model training stage, the neural network model 130 may be a model to be trained 130. In the model application stage, the neural network model 130 may be a trained model.
图2是示出了本公开示例所涉及的模型训练方法的示例的流程图。例如,模型训练方法可以由图1所示的计算设备110来执行。另外,模型训练方法可以训练识别医学图像中的目标的模型。Fig. 2 is a flowchart showing an example of a model training method involved in the examples of the present disclosure. For example, the model training method can be executed by the computing device 110 shown in Fig. 1. In addition, the model training method can train a model for identifying targets in medical images.
如图2所示,模型训练方法可以包括步骤S102。在步骤S102中,可以获取作为训练样本的医学图像和训练样本中的目标对应的标注区域。也即,在训练阶段,可以获取医学图像作为训练样本。由此,能够对医学图像中的目标进行识别。在一些示例中,医学图像可以为彩色图像。由此,能够提高对小目标识别的准确性。As shown in FIG. 2 , the model training method may include step S102. In step S102, a medical image as a training sample and a marked area corresponding to a target in the training sample may be obtained. That is, in the training stage, a medical image may be obtained as a training sample. Thus, the target in the medical image may be identified. In some examples, the medical image may be a color image. Thus, the accuracy of identifying small targets may be improved.
另外,医学图像中可以包含相应的目标,目标可以属于至少一个感兴趣的类别(也即,需要识别的类别)。在一些示例中,对于医学图像为眼底图像,目标可以包括微血管瘤、点状出血、片状出血和线状出血等小目标。在这种情况下,训练后获得的模型能够对眼底图像中的小目标进行识别。In addition, the medical image may contain corresponding targets, and the targets may belong to at least one category of interest (i.e., the category to be identified). In some examples, for the medical image being a fundus image, the targets may include small targets such as microaneurysms, punctate hemorrhages, sheet hemorrhages, and linear hemorrhages. In this case, the model obtained after training can identify small targets in fundus images.
图3是示出了本公开示例所涉及的一些示例的标注区域的示意图。FIG. 3 is a schematic diagram showing some example annotation areas involved in the examples of the present disclosure.
在一些示例中,可以对训练样本中目标进行标注以获取标注区域。另外,标注区域的形状可以为矩形、圆形或与训练样本中目标的形状相匹配的形状(例如,标注区域的形状可以为目标的轮廓)。优先地,标注区域的形状可以为矩形。由此,能够降低标注的难度。作为示例,图3示出了眼底图像中的标注区域D1,其中,标注区域D1的形状为矩形,标注区域D1内的目标为片状出血。In some examples, the target in the training sample can be annotated to obtain an annotated area. In addition, the shape of the annotated area can be a rectangle, a circle, or a shape that matches the shape of the target in the training sample (for example, the shape of the annotated area can be the outline of the target). Preferably, the shape of the annotated area can be a rectangle. Thus, the difficulty of annotation can be reduced. As an example, FIG3 shows an annotated area D1 in a fundus image, wherein the shape of the annotated area D1 is a rectangle, and the target in the annotated area D1 is a sheet hemorrhage.
另外,标注区域可以具有相应的标注标签(也即,目标的标注类别),该标注标签可以用于区分目标的类别。标注类别可以与目标的类别一一对应。例如,对于眼底图像,目标的类别和标注类别可以分别包括但不限于微血管瘤、点状出血、片状出血和线状出血等。在一些示例中,可以用数字表示相应的标注类别。由此,能够方便计算设备110进行计算。另外,标注区域和对应的标注标签可以称为标注结果。In addition, the annotated area may have a corresponding annotation label (that is, the annotation category of the target), which can be used to distinguish the category of the target. The annotation category may correspond to the category of the target one by one. For example, for fundus images, the category of the target and the annotation category may include but are not limited to microaneurysm, punctate hemorrhage, sheet hemorrhage, and linear hemorrhage, etc. In some examples, the corresponding annotation category may be represented by a number. Thus, it is convenient for the computing device 110 to perform calculations. In addition, the annotated area and the corresponding annotation label may be referred to as an annotation result.
如图2所示,模型训练方法还可以包括步骤S104。在步骤S104中,可以确定训练样本中的标注区域对应的区域分割结果(也可以称为伪分割结果),并利用训练样本和区域分割结果构建训练集。需要说明的是,在另一些示例中,确定标注区域对应的区域分割结果也可以不是必须,只要能够识别中标注区域中的目标区域(稍后描述),且目标区域内的像素确定属于目标即可。As shown in FIG2 , the model training method may further include step S104. In step S104, the region segmentation result (also referred to as pseudo segmentation result) corresponding to the annotated region in the training sample may be determined, and a training set may be constructed using the training sample and the region segmentation result. It should be noted that in other examples, it is not necessary to determine the region segmentation result corresponding to the annotated region, as long as the target region (described later) in the annotated region can be identified and the pixels in the target region are determined to belong to the target.
在一些示例中,根据实际情况(例如,训练样本的质量不满足训练要求或训练样本的尺寸大小不统一),在构建训练集之前,可以对训练样本进行相应的预处理后再用于构建训练集。In some examples, according to actual conditions (for example, the quality of training samples does not meet the training requirements or the sizes of training samples are not uniform), before constructing the training set, the training samples may be preprocessed accordingly and then used to construct the training set.
在一些示例中,对训练样本进行预处理可以包括对训练样本的尺寸大小进行统一。例如,可以将训练样本的尺寸大小统一为1024×1024或2048×2048。本公开并不限制训练样本的尺寸大小。在一些示例中,对训练样本进行预处理可以包括对训练样本进行裁剪。在一些示例中,在对训练样本进行裁剪中,可以获取训练样本中的感兴趣区域并利用感兴趣区域对训练样本进行裁剪。由此,能够使训练样本的尺寸一致且包含感兴趣区域。在一些示例中,感兴趣区域可以为可存在目标的区域(也可以称为前景区域)。例如,对于眼底图像,感兴趣区域可以为眼底区域。In some examples, preprocessing the training samples may include unifying the size of the training samples. For example, the size of the training samples may be unified to 1024×1024 or 2048×2048. The present disclosure does not limit the size of the training samples. In some examples, preprocessing the training samples may include cropping the training samples. In some examples, in cropping the training samples, a region of interest in the training samples may be obtained and the training samples may be cropped using the region of interest. Thus, the size of the training samples can be made consistent and include the region of interest. In some examples, the region of interest may be an area where a target may exist (also referred to as a foreground area). For example, for a fundus image, the region of interest may be a fundus area.
在一些示例中,可以对训练样本进行分割以获取感兴趣区域。在一些示例中,可以对训练样本进行阈值分割以获取感兴趣分割结果,其中,感兴趣分割结果可以用于识别训练样本的感兴趣区域。由此,能够识别感兴趣区域。另外,通过阈值分割获得的感兴趣分割结果可以为二值图像(也可以称为二值化图像)。可以理解的是,虽然上文通过阈值分割的方式获取感兴趣分割结果,但其他适合于获取感兴趣分割结果也同样适用。例如,可以通过神经网络的方式获取感兴趣分割结果。In some examples, the training samples may be segmented to obtain regions of interest. In some examples, the training samples may be threshold segmented to obtain segmentation results of interest, wherein the segmentation results of interest may be used to identify the regions of interest of the training samples. Thus, the regions of interest may be identified. In addition, the segmentation results of interest obtained by threshold segmentation may be binary images (also referred to as binarized images). It is to be understood that, although the segmentation results of interest are obtained by threshold segmentation above, other methods suitable for obtaining segmentation results of interest are also applicable. For example, the segmentation results of interest may be obtained by means of a neural network.
在一些示例中,对训练样本进行阈值分割可以为将训练样本平分为预设份数(例如9等份),基于训练样本的四个角的区域和中心区域的灰度值确定分割阈值,基于分割阈值对训练样本进行阈值分割,进而获取感兴趣分割结果。在一些示例中,基于训练样本的四个角的区域和中心区域的灰度值确定分割阈值可以为取四个角的区域中的各个区域的像素的灰度均值和中间区域的像素的灰度均值的平均值作为分割阈值进行阈值分割,进而获取感兴趣分割结果。In some examples, performing threshold segmentation on the training sample may be dividing the training sample into a preset number of parts (e.g., 9 equal parts), determining the segmentation threshold based on the grayscale values of the four corner regions and the central region of the training sample, performing threshold segmentation on the training sample based on the segmentation threshold, and thereby obtaining the segmentation result of interest. In some examples, determining the segmentation threshold based on the grayscale values of the four corner regions and the central region of the training sample may be taking the average of the grayscale mean of the pixels in each region of the four corner regions and the grayscale mean of the pixels in the middle region as the segmentation threshold for performing threshold segmentation, and thereby obtaining the segmentation result of interest.
另外,在阈值分割中,获取感兴趣分割结果之前,可以对训练样本对应的阈值分割结果(也即,初始分割结果)做腐蚀操作以获取感兴趣分割结果。例如,可以对训练样本的阈值分割结果做两次腐蚀操作以获取感兴趣分割结果,其中,腐蚀核的大小可以为5。由此,能够消除感兴趣区域(例如眼底区域)边缘的噪声。In addition, in the threshold segmentation, before obtaining the segmentation result of interest, the threshold segmentation result corresponding to the training sample (that is, the initial segmentation result) can be eroded to obtain the segmentation result of interest. For example, the threshold segmentation result of the training sample can be eroded twice to obtain the segmentation result of interest, wherein the size of the erosion kernel can be 5. In this way, the noise at the edge of the region of interest (such as the fundus region) can be eliminated.
返回参考图2,如上所述,在步骤S104中,可以确定标注区域对应的区域分割结果。另外,区域分割结果可以用于确定标注区域内的目标的目标区域。在这种情况下,能够识别出标注区域中的目标区域,进而能够基于目标区域确定未确定类别的像素。具体地,训练样本中的标注区域内的目标区域以外的像素可以为未确定类别的像素。Referring back to FIG. 2 , as described above, in step S104, the region segmentation result corresponding to the annotated region may be determined. In addition, the region segmentation result may be used to determine the target region of the target within the annotated region. In this case, the target region within the annotated region may be identified, and then the pixels of undetermined category may be determined based on the target region. Specifically, the pixels outside the target region within the annotated region in the training sample may be pixels of undetermined category.
另外,区域分割结果可以是能够识别出目标区域的任意形式的数据(例如,图像)。在一些示例中,区域分割结果可以为二值图像。在一些示例中,对于为二值图像的区域分割结果中,可以令值为1的像素对应的区域为目标区域(也即,若像素的值为1,则可以表示训练样本中对应位置的像素属于目标,若像素的值为0,则可以表示训练样本中对应位置的像素为未确定类别的像素)。在这种情况下,能够减小未确定类别的像素对待训练模型130的负面影响。In addition, the region segmentation result may be any form of data (e.g., an image) that can identify the target region. In some examples, the region segmentation result may be a binary image. In some examples, for the region segmentation result of a binary image, the region corresponding to the pixel with a value of 1 may be the target region (that is, if the pixel value is 1, it may indicate that the pixel at the corresponding position in the training sample belongs to the target, and if the pixel value is 0, it may indicate that the pixel at the corresponding position in the training sample is a pixel of an undetermined category). In this case, the negative impact of pixels of undetermined category on the training model 130 to be trained can be reduced.
图4是示出了本公开示例所涉及的一些示例的区域分割结果的示意图。FIG. 4 is a schematic diagram showing some example region segmentation results involved in the examples of the present disclosure.
作为示例,图4示出了图3中的标注区域D1对应的区域分割结果A1,其中,D2为目标区域。另外,为了使区域分割结果A1显示得更清楚,图4的区域分割结果A1是进行了等比例放大的结果,并不表示对本公开的限制,图4的区域分割结果A1实际可以与标注区域D1的大小一致。As an example, FIG4 shows a region segmentation result A1 corresponding to the marked region D1 in FIG3, where D2 is the target region. In addition, in order to make the region segmentation result A1 more clearly displayed, the region segmentation result A1 in FIG4 is a result of proportional enlargement, which does not represent a limitation of the present disclosure, and the region segmentation result A1 in FIG4 can actually be the same size as the marked region D1.
在一些示例中,可以对训练样本中标注区域内的图像数据进行欠分割以获取区域分割结果(也即,可以通过欠分割分割出标注区域内的目标对应的目标区域以获取区域分割结果)。由此,能够基于欠分割获得的区域分割结果识别标注区域内未确定类别的像素。一般而言,前景目标物误分割为背景但是背景未被误分割为前景目标可以称为欠分割。这里,欠分割可以为标注区域中的属于目标的像素误分割为非目标但标注区域中的不属于目标的像素未被误分割为目标。在这种情况下,能够使区域分割结果中目标区域内的像素确定属于目标。另外,在标注区域以内,目标区域以外的像素不一定属于目标(也即,可以为未确定类别的像素)。In some examples, the image data in the annotated area in the training sample can be under-segmented to obtain a regional segmentation result (that is, the target area corresponding to the target in the annotated area can be segmented out by under-segmentation to obtain a regional segmentation result). Thus, the pixels of undetermined category in the annotated area can be identified based on the regional segmentation result obtained by under-segmentation. Generally speaking, the foreground target object is mistakenly segmented as the background but the background is not mistakenly segmented as the foreground target, which can be called under-segmentation. Here, under-segmentation can be that the pixels belonging to the target in the annotated area are mistakenly segmented as non-targets but the pixels that do not belong to the target in the annotated area are not mistakenly segmented as targets. In this case, the pixels in the target area in the regional segmentation result can be determined to belong to the target. In addition, within the annotated area, the pixels outside the target area do not necessarily belong to the target (that is, they can be pixels of undetermined category).
在一些示例中,可以基于训练样本和上述的感兴趣分割结果中标注区域分别对应的图像数据确定标注区域对应的区域分割结果。具体地,可以将训练样本中标注区域对应的图像数据(以下将训练样本中标注区域对应的图像数据简称为第一图像数据)和上述的感兴趣分割结果(也即,感兴趣分割结果可以为用于识别训练样本的感兴趣区域的二值图像)中标注区域对应的图像数据(以下将感兴趣分割结果中标注区域对应的图像数据简称为第二图像数据)进行乘积运算以获取待分割图像数据(也即,标注区域内的图像数据),对待分割图像数据进行欠分割确定标注区域对应的区域分割结果。在这种情况下,在标注区域包括感兴趣区域以外的区域时,能够消除感兴趣区域以外的噪声。In some examples, the region segmentation result corresponding to the annotated region can be determined based on the training sample and the image data corresponding to the annotated region in the above-mentioned segmentation result of interest. Specifically, the image data corresponding to the annotated region in the training sample (hereinafter, the image data corresponding to the annotated region in the training sample is referred to as the first image data) and the image data corresponding to the annotated region in the above-mentioned segmentation result of interest (that is, the segmentation result of interest can be a binary image for identifying the region of interest of the training sample) (hereinafter, the image data corresponding to the annotated region in the segmentation result of interest is referred to as the second image data) can be multiplied to obtain the image data to be segmented (that is, the image data in the annotated region), and the image data to be segmented is under-segmented to determine the region segmentation result corresponding to the annotated region. In this case, when the annotated region includes an area outside the region of interest, the noise outside the region of interest can be eliminated.
图5是示出了本公开示例所涉及的获取区域分割结果的示例的流程图。也即,本公开的一些示例获取区域分割结果的流程。Fig. 5 is a flow chart showing an example of obtaining a region segmentation result involved in some examples of the present disclosure, that is, a process of obtaining a region segmentation result in some examples of the present disclosure.
如图5所示,获取区域分割结果可以包括步骤S202。在步骤S202中,可以基于标注区域获取待分割图像数据。如上所述,第一图像数据可以为训练样本中标注区域对应的图像数据,第二图像数据可以为感兴趣分割结果中标注区域对应的图像数据。也即,可以基于标注区域可以获取第一图像数据和/或第二图像数据,然后基于第一图像数据、或第一图像数据和第二图像数据获取待分割图像数据。As shown in FIG5 , obtaining the region segmentation result may include step S202. In step S202, the image data to be segmented may be obtained based on the annotated region. As described above, the first image data may be the image data corresponding to the annotated region in the training sample, and the second image data may be the image data corresponding to the annotated region in the segmentation result of interest. That is, the first image data and/or the second image data may be obtained based on the annotated region, and then the image data to be segmented may be obtained based on the first image data, or the first image data and the second image data.
在一些示例中,可以基于第一图像数据获取待分割图像数据。在一些示例,可以基于第一图像数据的颜色通道(例如,红色通道、绿色通道、蓝色通道)获取待分割图像数据。以眼底图像为例,可以基于第一图像数据的绿色通道获取待分割图像数据。具体地,可以从训练样本中获取(例如裁剪)标注区域对应的第一图像数据,然后取第一图像数据的绿色通道(也即G通道),基于第一图像数据的绿色通道获取待分割图像数据。在一些示例中,可以将第一图像数据的相应颜色通道(绿色通道)作为待分割图像数据以获取待分割图像数据。另外,可以根据医学图像自身的特点选择颜色空间和颜色通道,本公开不做特别限制。In some examples, the image data to be segmented can be obtained based on the first image data. In some examples, the image data to be segmented can be obtained based on the color channels (e.g., red channel, green channel, blue channel) of the first image data. Taking the fundus image as an example, the image data to be segmented can be obtained based on the green channel of the first image data. Specifically, the first image data corresponding to the annotated area can be obtained (e.g., cropped) from the training sample, and then the green channel (i.e., G channel) of the first image data is taken, and the image data to be segmented is obtained based on the green channel of the first image data. In some examples, the corresponding color channel (green channel) of the first image data can be used as the image data to be segmented to obtain the image data to be segmented. In addition, the color space and color channel can be selected according to the characteristics of the medical image itself, and the present disclosure does not impose any special restrictions.
在另一些示例中,可以基于第一图像数据以及第二图像数据获取待分割图像数据。在这种情况下,在标注区域包括感兴趣区域以外的区域时,能够消除感兴趣区域以外的噪声。在一些示例中,可以基于第一图像数据的颜色通道以及第二图像数据获取待分割图像数据。具体地,可以令第一图像数据的颜色通道表示为G1,第二图像数据表示为B1,则待分割图像数据可以表示为I1=G1□B1,其中,I1可以表示待分割图像数据,可以表示元素(也即,像素的灰度值)乘积运算。In some other examples, the image data to be segmented may be obtained based on the first image data and the second image data. In this case, when the annotated area includes an area outside the area of interest, the noise outside the area of interest can be eliminated. In some examples, the image data to be segmented may be obtained based on the color channel of the first image data and the second image data. Specifically, the color channel of the first image data may be represented as G 1 , and the second image data may be represented as B 1 , then the image data to be segmented may be represented as I 1 =G 1 □B 1 , where I 1 may represent the image data to be segmented, It can represent an element-wise (ie, grayscale value of a pixel) product operation.
需要说明的是,第一图像数据、第二图像数据以及待分割图像数据可以表示相应区域的图像数据(例如,像素数据、数据流或图像),在实践中,可以根据需要将相应区域的像素的值或像素的位置标记存储在相应的介质(例如内存或磁盘)以形成相应形式的图像数据,进而能够方便处理。另外,第一图像数据、第二图像数据和待分割图像数据的形状可以与标注区域的形状相匹配,也可以为标注区域的外接矩形,可以根据获取区域分割结果的方式进行选择。It should be noted that the first image data, the second image data, and the image data to be segmented can represent the image data of the corresponding area (for example, pixel data, data stream, or image). In practice, the pixel values or pixel position marks of the corresponding area can be stored in a corresponding medium (for example, memory or disk) as needed to form image data in a corresponding form, which can be easily processed. In addition, the shapes of the first image data, the second image data, and the image data to be segmented can match the shape of the annotated area, or can be the circumscribed rectangle of the annotated area, which can be selected according to the method of obtaining the area segmentation result.
另外,获取区域分割结果过程中,若必须利用待分割图像数据的矩形特性(例如,边、长、宽、高、四个角)且标注区域的形状不为矩形时,可以基于标注区域的外接矩形对应的区域获取待分割图像数据。也即,将标注区域的形状转换成矩形后,可以基于转换后的标注区域获取待分割图像数据。In addition, in the process of obtaining the region segmentation result, if the rectangular characteristics of the image data to be segmented (for example, sides, length, width, height, four corners) must be used and the shape of the marked region is not a rectangle, the image data to be segmented can be obtained based on the region corresponding to the circumscribed rectangle of the marked region. That is, after the shape of the marked region is converted into a rectangle, the image data to be segmented can be obtained based on the converted marked region.
如图5所示,获取区域分割结果还可以包括步骤S204。在步骤S204中,可以对待分割图像数据进行阈值分割以获取区域分割结果。但本公开的示例不限于此,在另一些示例中,也可以使用其他方式对待分割图像数据进行欠分割以获取区域分割结果。As shown in FIG5 , obtaining the region segmentation result may further include step S204. In step S204, threshold segmentation may be performed on the image data to be segmented to obtain the region segmentation result. However, the examples disclosed herein are not limited thereto. In other examples, other methods may be used to perform under-segmentation on the image data to be segmented to obtain the region segmentation result.
在一些示例中,在步骤S204中,可以利用目标分割阈值(稍后描述)对待分割图像数据进行阈值分割,进而获取区域分割结果。由此,能够通过阈值分割识别待分割图像数据中的目标区域。在一些示例中,在阈值分割中,可以令待分割图像数据中灰度值不小于目标分割阈值的像素的值为1,其他像素的值为0,进而获取区域分割结果。In some examples, in step S204, the target segmentation threshold (described later) can be used to perform threshold segmentation on the image data to be segmented, thereby obtaining a region segmentation result. Thus, the target region in the image data to be segmented can be identified by threshold segmentation. In some examples, in threshold segmentation, the value of the pixel whose gray value in the image data to be segmented is not less than the target segmentation threshold can be set to 1, and the value of other pixels can be set to 0, thereby obtaining a region segmentation result.
在一些示例中,在获取区域分割结果之前,还可以对待分割图像数据的阈值分割结果(也即,初始分割结果)进行腐蚀操作。在这种情况下,能够降低由于噪声的影响,导致阈值分割结果中存在像素上孤立的概率。In some examples, before obtaining the region segmentation result, the threshold segmentation result (ie, the initial segmentation result) of the image data to be segmented may be subjected to an erosion operation, in which case the probability of pixel isolation in the threshold segmentation result due to the influence of noise may be reduced.
在一些示例中,对待分割图像数据的阈值分割结果进行腐蚀操作中,腐蚀核k可以满足公式:In some examples, in the erosion operation on the threshold segmentation result of the image data to be segmented, the erosion kernel k can satisfy the formula:
其中,h可以表示标注区域(也即,待分割图像数据对应的标注区域)的高和w可以表示标注区域的宽,H可以表示训练样本的高度,W可以表示训练样本的宽度,p可以表示预设的超参数。在这种情况下,能够根据训练样本的大小、标注区域的大小和预设的超参数获取合适大小的腐蚀核。由此,能够抑制过度腐蚀。Wherein, h may represent the height of the annotated area (that is, the annotated area corresponding to the image data to be segmented), w may represent the width of the annotated area, H may represent the height of the training sample, W may represent the width of the training sample, and p may represent a preset hyperparameter. In this case, an erosion kernel of a suitable size can be obtained according to the size of the training sample, the size of the annotated area, and the preset hyperparameter. Thus, excessive erosion can be suppressed.
在一些示例中,预设的超参数可以是用于调整腐蚀核的大小。在这种情况下,能够使特别小的目标采用较小的腐蚀核。由此,能够避免过度腐蚀操作而导致特别小的目标的目标区域消失。In some examples, the preset hyperparameter may be used to adjust the size of the erosion kernel. In this case, a smaller erosion kernel can be used for a particularly small target. Thus, excessive erosion operations can be avoided, which may cause the target area of a particularly small target to disappear.
在一些示例中,预设的超参数可以为固定值。在一些示例中,预设的超参数可以根据医疗图像中同类别的目标的平均的尺寸大小确定。在一些示例中,预设的超参数可以根据医疗图像中同类别的目标的平均宽度和平均高度确定。在一些示例中,预设的超参数p可以满足公式:In some examples, the preset hyperparameter may be a fixed value. In some examples, the preset hyperparameter may be determined based on the average size of objects of the same category in the medical image. In some examples, the preset hyperparameter may be determined based on the average width and average height of objects of the same category in the medical image. In some examples, the preset hyperparameter p may satisfy the formula:
其中,和可以分别表示医疗图像中同类别的目标的平均宽度和平均高度,σw和σh可以分别表示宽度标准差和高度标准差,和可以分别表示医疗图像的平均宽度和平均高度。这里,医疗图像可以为用于获取预设的超参数的数据源中的图像。在一些示例中,可以对多个训练样本中同类别的目标的宽度和高度以及训练样本的宽度和高度进行统计,以获取预设的超参数的相关参数。也即,数据源可以为训练数据。在一些示例中,在具有标注区域的医疗图像(例如,训练样本)中,获取预设的超参数时,目标的宽度和高度也可以为对应的标注区域的宽度和高度。由此,能够方便地获取目标的宽度和高度。in, and can represent the average width and average height of the same category of targets in medical images, σw and σh can represent the standard deviation of width and height, respectively. and Can represent the average width and average height of the medical image respectively. Here, the medical image can be an image in the data source for obtaining the preset hyperparameters. In some examples, the width and height of targets of the same category in multiple training samples and the width and height of the training samples can be counted to obtain the relevant parameters of the preset hyperparameters. That is, the data source can be training data. In some examples, in a medical image with annotated areas (e.g., training samples), when obtaining the preset hyperparameters, the width and height of the target can also be the width and height of the corresponding annotated area. Thus, the width and height of the target can be easily obtained.
一般而言,待分割图像数据的阈值分割结果可能存在多个连通区域。在一些示例中,可以对待分割图像数据的阈值分割结果进行腐蚀操作以获取至少一个连通区域,从至少一个连通区域中选择中心离待分割图像数据的中心最近的连通区域作为区域分割结果。另外,离待分割图像数据的中心最近的连通区域可以表示识别出的目标区域。由此,能够获得准确的目标区域。在一些示例中,可以对腐蚀结果(也即,至少一个连通区域)查找轮廓,取面积最大的预设数量(例如3个)的轮廓作为候选,并保留候选轮廓中轮廓中心离待分割图像数据的中心最近的轮廓所对应的连通区域为区域分割结果。Generally speaking, there may be multiple connected regions in the threshold segmentation result of the image data to be segmented. In some examples, the threshold segmentation result of the image data to be segmented may be eroded to obtain at least one connected region, and a connected region whose center is closest to the center of the image data to be segmented is selected from the at least one connected region as the region segmentation result. In addition, the connected region closest to the center of the image data to be segmented may represent the identified target region. Thus, an accurate target region can be obtained. In some examples, contours may be searched for the erosion result (i.e., at least one connected region), and a preset number (e.g., 3) of contours with the largest area are taken as candidates, and the connected region corresponding to the contour whose center is closest to the center of the image data to be segmented in the candidate contours is retained as the region segmentation result.
另外,在待分割图像数据的阈值分割中,获取目标分割阈值的方式可以有多种。例如,可以根据常见的大律法(OTSU)的方式获取目标分割阈值。在一些示例中,获取目标分割阈值的方式可以从本公开的示例中描述的方式中选择至少一种。In addition, in the threshold segmentation of the image data to be segmented, there may be multiple ways to obtain the target segmentation threshold. For example, the target segmentation threshold may be obtained according to the common great law (OTSU) method. In some examples, the method for obtaining the target segmentation threshold may be selected from at least one of the methods described in the examples of the present disclosure.
在一些示例中,可以根据目标所属的标注类别获取目标分割阈值。在一些示例中,可以根据目标所属的标注类别的获取阈值方法获取目标分割阈值。在这种情况下,能够根据目标对应的标注类别自身的特点获取目标分割阈值。由此,能够提高阈值分割的准确性。另外,标注类别的获取阈值方法可以包括第一种方法和第二种方法。另外,训练样本中目标所属的标注类别可以是已知的。例如训练样本中目标所属的标注类别可以为标注结果中的标注标签。In some examples, the target segmentation threshold can be obtained according to the annotation category to which the target belongs. In some examples, the target segmentation threshold can be obtained according to the threshold acquisition method of the annotation category to which the target belongs. In this case, the target segmentation threshold can be obtained according to the characteristics of the annotation category itself corresponding to the target. Thereby, the accuracy of threshold segmentation can be improved. In addition, the threshold acquisition method of the annotation category can include the first method and the second method. In addition, the annotation category to which the target in the training sample belongs can be known. For example, the annotation category to which the target in the training sample belongs can be the annotation label in the annotation result.
在一些示例中,各个标注类别的获取阈值方法可以是通过各个标注类别的特征得到。在一些示例中,可以根据各个标注类别的平均面积和平均颜色来确定获取阈值方法。但本公开的示例不限于此,在另外一些示例中,也可以根据经验确定标注类别的获取阈值方法。例如,对于眼底图像,眼底图像中的片状出血可以使用第一种方法,眼底图像中的微血管瘤、点状出血和线状出血可以使用第二种方法。In some examples, the method for obtaining the threshold value of each annotation category can be obtained through the characteristics of each annotation category. In some examples, the method for obtaining the threshold value can be determined based on the average area and average color of each annotation category. However, the examples disclosed in the present invention are not limited to this. In other examples, the method for obtaining the threshold value of the annotation category can also be determined based on experience. For example, for fundus images, the first method can be used for sheet hemorrhages in fundus images, and the second method can be used for microaneurysms, punctate hemorrhages, and linear hemorrhages in fundus images.
在一些示例中,各个标注类别的平均面积和平均颜色可以是固定值,可以根据对样本数据进行统计获得。例如,可以对样本数据(例如训练样本)中同类别(例如,对于训练样本,同类别可以指同标注类别)的目标的面积和颜色分别进行求平均以获取平均面积和平均颜色。在另一些示例中,固定值也可以是经验值。In some examples, the average area and average color of each labeled category may be fixed values, which may be obtained by statistically analyzing sample data. For example, the areas and colors of objects of the same category (for example, for training samples, the same category may refer to the same labeled category) in sample data (such as training samples) may be averaged to obtain the average area and average color. In other examples, the fixed value may also be an empirical value.
在一些示例中,在根据各个标注类别的平均面积和平均颜色确定标注类别的获取阈值方法中,第一种方法对应的标注类别的平均面积可以大于第二种方法对应的标注类别的平均面积且第一种方法对应的标注类别的平均颜色可以比第二种方法对应的标注类别的平均颜色浅。例如,第一种方法可以针对面积大,颜色浅的这种标注类别的目标(例如,眼底图像中的片状出血)。第二种方法可以针对面积小,颜色深的这种标注类别的目标(例如,眼底图像中的微血管瘤、点状出血和线状出血)。In some examples, in the method of obtaining a threshold value for determining a labeling category based on the average area and average color of each labeling category, the average area of the labeling category corresponding to the first method may be greater than the average area of the labeling category corresponding to the second method, and the average color of the labeling category corresponding to the first method may be lighter than the average color of the labeling category corresponding to the second method. For example, the first method may be targeted at targets of such a labeling category that are large in area and light in color (e.g., flake hemorrhages in fundus images). The second method may be targeted at targets of such a labeling category that are small in area and dark in color (e.g., microvascular tumors, punctate hemorrhages, and linear hemorrhages in fundus images).
在一些示例中,在根据各个标注类别的平均面积和平均颜色确定标注类别的获取阈值方法中,可以通过第一预设面积和预设颜色值确定标注类别使用的获取阈值方法。由此,能够自动获取标注类别所使用的获取阈值方法。In some examples, in the method of determining the threshold value of the annotation category according to the average area and average color of each annotation category, the threshold value method used by the annotation category can be determined by the first preset area and preset color value. Thus, the threshold value method used by the annotation category can be automatically obtained.
在一些示例中,若标注类别的平均面积大于第一预设面积且平均颜色小于预设颜色值(也即,该标注类别的目标的面积相对大,颜色相对浅),则可以将该标注类别确定为使用第一种方法,否则若标注类别的平均面积不大于第一预设面积且平均颜色不小于预设颜色值(也即,该标注类别的目标的面积相对小,颜色相对深),则可以将该标注类别确定为使用第二种方法。In some examples, if the average area of a labeled category is larger than a first preset area and the average color is smaller than a preset color value (i.e., the area of the target of this labeled category is relatively large and the color is relatively light), then the labeled category can be determined to use the first method; otherwise, if the average area of the labeled category is not larger than the first preset area and the average color is not smaller than the preset color value (i.e., the area of the target of this labeled category is relatively small and the color is relatively dark), then the labeled category can be determined to use the second method.
在一些示例中,第一预设面积和预设颜色值可以根据区域分割结果进行调整。在一些示例中,第一预设面积和预设颜色值可以是固定值,固定值可以根据对样本数据进行统计获得。也即,可以利用统计学的方法统计少量的样本数据在不同第一预设面积和预设颜色值下的区域分割结果以确定最佳的用于分类的第一预设面积和预设颜色值。In some examples, the first preset area and the preset color value may be adjusted according to the region segmentation result. In some examples, the first preset area and the preset color value may be fixed values, and the fixed values may be obtained by statistically analyzing the sample data. That is, a statistical method may be used to analyze the region segmentation results of a small amount of sample data under different first preset areas and preset color values to determine the best first preset area and preset color value for classification.
如上所述,可以根据目标所属的标注类别的获取阈值方法获取目标分割阈值。在一些示例中,可以根据目标所属的标注类别的获取阈值方法和训练样本对应的待分割图像数据获取目标分割阈值。As described above, the target segmentation threshold can be obtained according to the threshold acquisition method of the annotation category to which the target belongs. In some examples, the target segmentation threshold can be obtained according to the threshold acquisition method of the annotation category to which the target belongs and the image data to be segmented corresponding to the training sample.
在一些示例中,对于第一种方法(也即,目标所属的标注类别的获取阈值方法为第一种方法),可以查找阈值,使待分割图像数据内灰度值大于该阈值的像素的面积小于待分割图像数据的面积的预设倍数,将该阈值作为目标分割阈值,其中,预设倍数可以大于0且小于1。以医学图像为8位量化的图像为例,可以遍历0至255的阈值,找到阈值使得待分割图像数据内灰度值大于该阈值的像素的面积小于待分割图像数据的面积的预设倍数,将该阈值作为目标分割阈值。另外,预设倍数可以为使目标区域不过分割的任意值。例如,预设倍数可以取偏小的值以使目标区域不过分割。在一些示例中,预设倍数可以由目标的形状通过经验来确定。In some examples, for the first method (that is, the method for obtaining the threshold value of the annotation category to which the target belongs is the first method), a threshold value can be found so that the area of pixels with grayscale values greater than the threshold value in the image data to be segmented is less than a preset multiple of the area of the image data to be segmented, and the threshold value is used as the target segmentation threshold value, wherein the preset multiple can be greater than 0 and less than 1. Taking the medical image as an 8-bit quantized image as an example, the threshold values from 0 to 255 can be traversed to find a threshold value so that the area of pixels with grayscale values greater than the threshold value in the image data to be segmented is less than a preset multiple of the area of the image data to be segmented, and the threshold value is used as the target segmentation threshold value. In addition, the preset multiple can be any value that prevents the target area from being over-segmented. For example, the preset multiple can be a relatively small value so that the target area is not over-segmented. In some examples, the preset multiple can be determined empirically by the shape of the target.
在一些示例中,对于第二种方法(也即,目标所属的标注类别的获取阈值方法为第二种方法),可以将待分割图像数据中像素的灰度值的均值作为目标分割阈值或基于待分割图像数据的四个角的区域和中心区域的灰度值确定目标分割阈值。In some examples, for the second method (that is, the method for obtaining the threshold of the labeled category to which the target belongs is the second method), the mean of the grayscale values of the pixels in the image data to be segmented can be used as the target segmentation threshold or the target segmentation threshold can be determined based on the grayscale values of the four corner areas and the central area of the image data to be segmented.
在一些示例中,对于第二种方法,若待分割图像数据的最小的边的长度小于预设长度,则可以取待分割图像数据中像素的灰度值的均值作为目标分割阈值。在一些示例中,预设长度可以为使目标区域不过分割的任意值。在一些示例中,预设长度可以为训练样本的最小边的第一预设比例。具体地,预设长度可以表示为min(rH,rW),其中,r可以表示第一预设比例,H可以表示训练样本的高度,W可以表示训练样本的宽度。In some examples, for the second method, if the length of the smallest side of the image data to be segmented is less than the preset length, the mean of the grayscale values of the pixels in the image data to be segmented can be taken as the target segmentation threshold. In some examples, the preset length can be any value that does not over-segment the target area. In some examples, the preset length can be a first preset ratio of the smallest side of the training sample. Specifically, the preset length can be expressed as min(rH, rW), where r can represent the first preset ratio, H can represent the height of the training sample, and W can represent the width of the training sample.
在一些示例中,第一预设比例可以为固定值。在一些示例中,第一预设比例可以根据医疗图像中同类别的目标的平均的尺寸大小确定。在一些示例中,第一预设比例可以根据医疗图像中同类别的目标的平均宽度和平均高度确定。在一些示例中,第一预设比例可以满足公式:In some examples, the first preset ratio may be a fixed value. In some examples, the first preset ratio may be determined based on the average size of objects of the same category in the medical image. In some examples, the first preset ratio may be determined based on the average width and average height of objects of the same category in the medical image. In some examples, the first preset ratio may satisfy the formula:
其中,和可以分别表示医疗图像中同类别的目标的平均宽度和平均高度,σw和σh可以分别表示宽度标准差和高度标准差,和可以分别表示医疗图像的平均宽度和平均高度。这里,医疗图像可以为用于获取第一预设比例的数据源中的图像。在一些示例中,数据源可以为训练数据。另外,可以与获取预设的超参数涉及的相关参数类似的方式获取第一预设比例涉及的相关参数,此处不再赘述。in, and can represent the average width and average height of the same category of targets in medical images, σw and σh can represent the standard deviation of width and height, respectively. and The average width and average height of the medical image may be represented respectively. Here, the medical image may be an image in a data source used to obtain the first preset ratio. In some examples, the data source may be training data. In addition, the relevant parameters involved in the first preset ratio may be obtained in a manner similar to the relevant parameters involved in obtaining the preset hyperparameters, which will not be described in detail here.
在一些示例中,对于第二种方法,若待分割图像数据的最小的边的长度不小于预设长度,则可以基于待分割图像数据的四个角的区域和中心区域的灰度值确定目标分割阈值。具体地,可以将待分割图像数据平分为预设份数(例如9等份),并基于待分割图像数据的四个角的区域和中心区域的灰度值确定目标分割阈值。具体内容参见上述基于训练样本的四个角的区域和中心区域的灰度值确定分割阈值的相关描述。In some examples, for the second method, if the length of the smallest side of the image data to be segmented is not less than a preset length, the target segmentation threshold can be determined based on the grayscale values of the four corner areas and the central area of the image data to be segmented. Specifically, the image data to be segmented can be divided into a preset number of parts (e.g., 9 equal parts), and the target segmentation threshold is determined based on the grayscale values of the four corner areas and the central area of the image data to be segmented. For details, see the above description of determining the segmentation threshold based on the grayscale values of the four corner areas and the central area of the training sample.
返回参考图2,如上所述,在步骤S104中,可以利用训练样本和区域分割结果构建训练集。也即,可以基于训练样本和训练样本对应的至少一个区域分割结果构建训练集。在一些示例中,训练集可以包括训练样本和训练样本的金标准。在一些示例中,可以基于区域分割结果获取训练样本的金标准。也即,可以基于区域分割结果识别目标区域,进而基于目标区域确定训练样本中的像素属于的真实类别。由此,能够获取训练样本的金标准。Referring back to FIG. 2 , as described above, in step S104, a training set may be constructed using training samples and region segmentation results. That is, a training set may be constructed based on training samples and at least one region segmentation result corresponding to the training samples. In some examples, the training set may include training samples and a gold standard of the training samples. In some examples, the gold standard of the training samples may be obtained based on the region segmentation results. That is, the target region may be identified based on the region segmentation results, and then the true category to which the pixels in the training sample belong may be determined based on the target region. Thus, the gold standard of the training sample may be obtained.
在一些示例中,真实类别可以包括目标的标注类别(例如,对于眼底图像,可以包括微血管瘤、点状出血、片状出血和线状出血)、无目标类别和未确定类别中的至少一项。具体跟优化待训练模型130的过程有关。In some examples, the true category may include a labeled category of the target (for example, for fundus images, it may include microaneurysm, punctate hemorrhage, sheet hemorrhage, and linear hemorrhage), a no-target category, and at least one of an undetermined category. This is specifically related to the process of optimizing the model to be trained 130.
另外,真实类别中的目标的标注类别可以为训练样本中的标注区域内的目标的目标区域(也即,稍后描述的第二区域)的像素属于的类别。另外,真实类别中的未确定类别可以为训练样本中的标注区域内的目标的目标区域以外的区域(也即,稍后描述的第一区域)的像素属于的类别。另外,真实类别中的无目标类别可以为训练样本中标注区域之外的像素属于的类别。在一些示例中,训练样本中标注区域之外的区域可以包括感兴趣区域之内且不属于标注区域的区域(也即,稍后描述的第三区域)。例如,对于医学图像,感兴趣区域之内且不属于标注区域的区域可以为医学图像中无目标的组织对应的区域。在一些示例中,训练样本中标注区域之外的区域可以包括感兴趣区域之内且不属于标注区域的区域、和感兴趣区域之外的区域(也即,稍后描述的第四区域)。In addition, the labeled category of the target in the true category may be the category to which the pixels of the target area (that is, the second area described later) of the target within the labeled area in the training sample belong. In addition, the undetermined category in the true category may be the category to which the pixels of the area outside the target area (that is, the first area described later) of the target within the labeled area in the training sample belong. In addition, the targetless category in the true category may be the category to which the pixels outside the labeled area in the training sample belong. In some examples, the area outside the labeled area in the training sample may include an area within the region of interest and not belonging to the labeled area (that is, the third area described later). For example, for a medical image, the area within the region of interest and not belonging to the labeled area may be an area corresponding to targetless tissue in the medical image. In some examples, the area outside the labeled area in the training sample may include an area within the region of interest and not belonging to the labeled area, and an area outside the region of interest (that is, the fourth area described later).
在一些示例中,还可以利用训练样本和区域分割结果构建验证集和测试集。In some examples, the training samples and region segmentation results can also be used to construct validation sets and test sets.
返回参考图2,模型训练方法还可以包括步骤S106。在步骤S106中,可以基于训练集训练待训练模型130,并利用训练损失函数优化待训练模型130。Referring back to Fig. 2, the model training method may further include step S106. In step S106, the model to be trained 130 may be trained based on the training set, and the model to be trained 130 may be optimized using a training loss function.
在一些示例中,待训练模型130可以包括但不限于是语义分割模型。另外,待训练模型130的预测结果可以包括但不限于是训练样本的语义分割结果。由此,能够对小目标进行识别。例如,在上述的输入120是待进行语义分割的图像数据,并且待训练模型130是语义分割模型的示例中,预测结果可以是图像数据的语义分割结果。另外,上述的输入120可以为彩色的图像数据。In some examples, the model to be trained 130 may include but is not limited to a semantic segmentation model. In addition, the prediction result of the model to be trained 130 may include but is not limited to the semantic segmentation result of the training sample. Thus, small targets can be identified. For example, in the example where the input 120 is image data to be semantically segmented, and the model to be trained 130 is a semantic segmentation model, the prediction result may be the semantic segmentation result of the image data. In addition, the input 120 may be color image data.
在一些示例中,在待训练模型130中,可以增加高维度的特征信息。由此,能够提高对小目标的识别的准确性。在一些示例中,在待训练模型130中,可以提取医学图像(例如训练样本)中的不同维度的特征信息,并将靠近最高维度的特征信息的预设维度的特征信息与最高维度的特征信息进行融合以增加高维度的特征信息。In some examples, in the model to be trained 130, high-dimensional feature information can be added. Thereby, the accuracy of recognizing small targets can be improved. In some examples, in the model to be trained 130, feature information of different dimensions in a medical image (e.g., a training sample) can be extracted, and feature information of a preset dimension close to the feature information of the highest dimension can be fused with the feature information of the highest dimension to increase the feature information of the high dimension.
图6是示出了本公开示例所涉及的采用U-Net架构的待训练模型130的示例的架构图。FIG6 is an architecture diagram showing an example of a model 130 to be trained using a U-Net architecture involved in the examples of the present disclosure.
作为示例,图6示出了采用U-Net架构的待训练模型130,其中,对于U-Net架构中的常见的网络层,此处不做过多解释。如图6所示,预设维度可以为2,2个维度的特征信息可以包括特征信息131a和特征信息132b,其中,特征信息131a可以通过上采样层132a与最高维度的特征信息进行融合,特征信息131b可以通过上采样层132b与最高维度的特征信息进行融合。另外,上采样层132a和上采样层132b的卷积大小可以是使特征信息(例如,特征信息131a和特征信息131b)经过上采样与最高维度的特征信息的大小一致的任意值。As an example, FIG6 shows a model 130 to be trained using a U-Net architecture, wherein the common network layers in the U-Net architecture are not explained in detail here. As shown in FIG6, the preset dimension can be 2, and the feature information of the two dimensions can include feature information 131a and feature information 132b, wherein the feature information 131a can be fused with the feature information of the highest dimension through the upsampling layer 132a, and the feature information 131b can be fused with the feature information of the highest dimension through the upsampling layer 132b. In addition, the convolution size of the upsampling layer 132a and the upsampling layer 132b can be any value that makes the feature information (e.g., feature information 131a and feature information 131b) consistent with the size of the feature information of the highest dimension after upsampling.
在一些示例中,在训练待训练模型130中,可以通过待训练模型130基于训练集的训练样本,获得训练样本对应的预测结果,然后基于训练样本对应的区域分割结果和预测结果构建训练损失函数(也即,可以利用基于区域分割结果获得的训练样本的金标准和预测结果构建训练损失函数)。另外,训练损失函数可以表示训练样本的金标准与对应的预测结果的差异程度。In some examples, when training the model to be trained 130, the prediction results corresponding to the training samples can be obtained by the model to be trained 130 based on the training samples of the training set, and then a training loss function can be constructed based on the region segmentation results and the prediction results corresponding to the training samples (that is, the training loss function can be constructed using the gold standard and the prediction results of the training samples obtained based on the region segmentation results). In addition, the training loss function can represent the degree of difference between the gold standard of the training sample and the corresponding prediction result.
在一些示例中,可以直接将区域分割结果作为训练样本的金标准。在一些示例中,可以将区域分割结果作为训练样本中的目标对应的标注区域内的像素的金标准以获取训练样本的金标准。另外,训练样本中的目标对应的标注区域以外的区域的像素的金标准可以根据需要进行设置。例如,可以固定设置为一种类别(例如,可以为本公开示例涉及的无目标类别)。又例如,可以通过对训练样本进行人工标注的方式进行设置或通过人工智能算法对训练样本进行自动标注的方式进行设置。本公开的示例对训练样本中的目标对应的标注区域以外的区域的像素的金标准的设置方式不做特别限制。In some examples, the region segmentation result can be directly used as the gold standard of the training sample. In some examples, the region segmentation result can be used as the gold standard of the pixels in the annotated area corresponding to the target in the training sample to obtain the gold standard of the training sample. In addition, the gold standard of the pixels in the area outside the annotated area corresponding to the target in the training sample can be set as needed. For example, it can be fixedly set to a category (for example, it can be the targetless category involved in the example of the present disclosure). For another example, it can be set by manually annotating the training samples or by automatically annotating the training samples through an artificial intelligence algorithm. The example of the present disclosure does not particularly limit the setting method of the gold standard of the pixels in the area outside the annotated area corresponding to the target in the training sample.
在一些示例中,在训练损失函数中,可以对训练样本中上述的未确定类别的像素分配权重以减小未确定类别的像素对待训练模型130的负面影响。由此,能够提高待训练模型130的准确性。在一些示例中,在训练损失函数中,可以利用空间权重减小训练样本中的未确定类别的像素对待训练模型130的负面影响。In some examples, in the training loss function, weights may be assigned to the pixels of the undetermined category in the training samples to reduce the negative impact of the pixels of the undetermined category on the model to be trained 130. Thus, the accuracy of the model to be trained 130 can be improved. In some examples, in the training loss function, spatial weights may be used to reduce the negative impact of the pixels of the undetermined category in the training samples on the model to be trained 130.
在一些示例中,在空间权重中,可以将训练样本分成若干个区域(也可以称为至少一个区域),并利用权重调整若干个区域中的各个区域对待训练模型130的影响。In some examples, in the spatial weight, the training samples may be divided into several regions (also referred to as at least one region), and the weights may be used to adjust the influence of each of the several regions on the model 130 to be trained.
在一些示例中,若干个区域可以包括第一区域。第一区域可以为训练样本中的未确定类别的像素的区域(也即,训练样本中标注区域内的目标区域以外的区域)。在一些示例中,在训练损失函数中,可以利用空间权重减小训练样本中的第一区域的像素对待训练模型130的负面影响。在一些示例中,在空间权重中,训练样本中的第一区域的像素可以被分配第一权重以减小对待训练模型130的负面影响。In some examples, the plurality of regions may include a first region. The first region may be a region of pixels of an undetermined category in the training sample (i.e., a region outside the target region within the labeled region in the training sample). In some examples, in the training loss function, spatial weights may be used to reduce the negative impact of pixels in the first region of the training sample on the model to be trained 130. In some examples, in the spatial weights, pixels in the first region of the training sample may be assigned a first weight to reduce the negative impact on the model to be trained 130.
另外,第一权重可以是使对待训练模型130的负面影响减小的任意值。在一些示例中,第一权重可以是固定值。在一些示例中,第一权重可以为0。在这种情况下,能够忽略未确定类别的样本,以减小未确定类别的样本对待训练模型130的负面影响。In addition, the first weight may be any value that reduces the negative impact on the model to be trained 130. In some examples, the first weight may be a fixed value. In some examples, the first weight may be 0. In this case, samples of undetermined categories can be ignored to reduce the negative impact of samples of undetermined categories on the model to be trained 130.
在一些示例中,若干个区域可以包括第二区域。第二区域可以为训练样本的目标区域。在一些示例中,在空间权重中,第二区域的像素可以被分配第二权重。在一些示例中,第一权重可以小于第二权重。另外,第二权重可以是使第二区域的像素对待训练模型130的正面影响增大的任意值。在一些示例中,第二权重可以是固定值。在一些示例中,第二权重可以为1。In some examples, the plurality of regions may include a second region. The second region may be a target region for a training sample. In some examples, in the spatial weight, pixels of the second region may be assigned a second weight. In some examples, the first weight may be less than the second weight. In addition, the second weight may be any value that increases the positive impact of the pixels of the second region on the model to be trained 130. In some examples, the second weight may be a fixed value. In some examples, the second weight may be 1.
在一些示例中,若干个区域可以包括第三区域。第三区域可以为训练样本中感兴趣区域内的不属于标注区域的区域。在一些示例中,在空间权重中,第三区域的像素可以被分配第三权重。在一些示例中,第一权重可以小于第三权重。另外,第三权重的设置原则可以与第二权重类似。In some examples, the plurality of regions may include a third region. The third region may be a region within the region of interest in the training sample that does not belong to the annotated region. In some examples, in the spatial weight, pixels in the third region may be assigned a third weight. In some examples, the first weight may be less than the third weight. In addition, the setting principle of the third weight may be similar to that of the second weight.
在一些示例中,若干个区域可以包括第四区域。第四区域可以为训练样本中感兴趣区域之外的区域。在一些示例中,在空间权重中,第四区域的像素可以被分配第四权重。在一些示例中,第四权重可以小于第二权重。另外,第四权重的设置原则可以与第一权重类似。In some examples, the plurality of regions may include a fourth region. The fourth region may be a region outside the region of interest in the training sample. In some examples, in the spatial weight, pixels in the fourth region may be assigned a fourth weight. In some examples, the fourth weight may be less than the second weight. In addition, the setting principle of the fourth weight may be similar to the first weight.
在一些示例中,若干个区域可以同时包括第一区域、第二区域、第三区域和第四区域,第一区域、第二区域、第三区域和第四区域的像素可以分别被分配第一权重、第二权重、第三权重和第四权重,其中,第一权重可以小于第二权重且小于第三权重,第四权重可以小于第二权重且小于第三权重。在这种情况下,能够抑制未确定类别的像素以及感兴趣区域以外的像素对待训练模型130的负面影响,提高目标区域以内和感兴趣区域内的无目标区域对待训练模型130的正面影响。由此,能够提高模型的准确性。优选地,第一权重可以为0,第二权重可以为1,第三权重可以为1,第四权重可以为0。在这种情况下,能够避免未确定类别的像素以及感兴趣区域以外的像素对待训练模型130的负面影响,提高目标区域以内和感兴趣区域内的无目标区域对待训练模型130的正面影响。由此,能够提高待训练模型130的准确性。In some examples, several regions may include a first region, a second region, a third region, and a fourth region at the same time, and the pixels of the first region, the second region, the third region, and the fourth region may be assigned a first weight, a second weight, a third weight, and a fourth weight, respectively, wherein the first weight may be less than the second weight and less than the third weight, and the fourth weight may be less than the second weight and less than the third weight. In this case, the negative impact of pixels of undetermined categories and pixels outside the region of interest on the model to be trained 130 can be suppressed, and the positive impact of non-target areas within the target region and the region of interest on the model to be trained 130 can be improved. Thus, the accuracy of the model can be improved. Preferably, the first weight may be 0, the second weight may be 1, the third weight may be 1, and the fourth weight may be 0. In this case, the negative impact of pixels of undetermined categories and pixels outside the region of interest on the model to be trained 130 can be avoided, and the positive impact of non-target areas within the target region and the region of interest on the model to be trained 130 can be improved. Thus, the accuracy of the model to be trained 130 can be improved.
但本公开的示例不限于此,在另一些示例中,若干个区域可以包括第一区域、第二区域、第三区域和第四区域的任意组合。However, the examples of the present disclosure are not limited thereto, and in other examples, the plurality of regions may include any combination of the first region, the second region, the third region, and the fourth region.
图7是示出了本公开示例所涉及的一些示例的若干个区域的示意图。FIG. 7 is a schematic diagram showing several areas of some examples involved in the examples of the present disclosure.
另外,为了清楚地描述若干个区域,图7是示出了二值化的各个区域的示意图,并不限制本公开一定要划分成图7所示的所有区域。其中,D3可以表示第一区域、D4可以表示第二区域,D5可以表示第三区域,D6可以表示第四区域。In addition, in order to clearly describe several regions, FIG7 is a schematic diagram showing various binarized regions, and does not limit the present disclosure to be divided into all the regions shown in FIG7. Among them, D3 can represent the first region, D4 can represent the second region, D5 can represent the third region, and D6 can represent the fourth region.
如上所述,在一些示例中,在空间权重中,可以将训练样本分成若干个区域,并利用权重调整若干个区域中的各个区域对待训练模型130的影响。As described above, in some examples, in spatial weighting, the training samples may be divided into several regions, and weights may be used to adjust the influence of each of the several regions on the model 130 to be trained.
在一些示例中,在训练损失函数中,可以按类别计算损失。如上所述,真实类别可以包括目标的标注类别、无目标类别和未确定类别中的至少一项。在一些示例中,在训练损失函数中,类别可以来源上述的真实类别。也即,训练损失函数中的类别可以包括目标的标注类别和无目标类别、或训练损失函数中的类别可以包括目标的标注类别、无目标类别、和未确定类别。具体训练损失函数中的类别与训练损失函数中选择的样本有关。In some examples, in the training loss function, the loss can be calculated by category. As described above, the true category can include at least one of the labeled category of the target, the no-target category, and the undetermined category. In some examples, in the training loss function, the category can be derived from the above-mentioned true category. That is, the categories in the training loss function can include the labeled category of the target and the no-target category, or the categories in the training loss function can include the labeled category of the target, the no-target category, and the undetermined category. The categories in the specific training loss function are related to the samples selected in the training loss function.
在一些示例中,在训练损失函数中,若训练样本中各个类别的样本(也即,像素)属于若干个区域中的相应区域,则可以将相应样本的损失乘以对应区域的权重。在这种情况下,能够基于空间权重确定训练损失函数,进而调整不同区域的像素对待训练模型130的影响。In some examples, in the training loss function, if samples (i.e., pixels) of each category in the training sample belong to a corresponding region among several regions, the loss of the corresponding sample can be multiplied by the weight of the corresponding region. In this case, the training loss function can be determined based on the spatial weight, thereby adjusting the influence of pixels in different regions on the training model 130.
在一些示例中,在训练损失函数中,可以基于各个类别的权重调整各个类别的样本对待训练模型130的影响。由此,能够调整不同类别的样本对待训练模型130的影响。In some examples, in the training loss function, the influence of samples of each category on the to-be-trained model 130 can be adjusted based on the weight of each category. Thus, the influence of samples of different categories on the to-be-trained model 130 can be adjusted.
在一些示例中,在训练损失函数中,可以同时基于空间权重和类别的权重调整样本对待训练模型130的影响。由此,能够按区域和类别调整样本对待训练模型130的影响。In some examples, in the training loss function, the influence of the sample on the to-be-trained model 130 can be adjusted based on both the spatial weight and the category weight. Thus, the influence of the sample on the to-be-trained model 130 can be adjusted by region and category.
在一些示例中,训练损失函数可以采用加权均衡交叉熵。在这种情况下,能够抑制正负样本失衡,进而进一步提高待训练模型130对小目标的识别的准确性。在一些示例中,在训练待训练模型130时,可以基于加权均衡交叉熵的训练损失函数,并利用空间权重来控制未确定类别的像素对待训练模型130的负面影响。In some examples, the training loss function may adopt weighted balanced cross entropy. In this case, the imbalance of positive and negative samples can be suppressed, thereby further improving the accuracy of the model to be trained 130 in recognizing small targets. In some examples, when training the model to be trained 130, the training loss function based on weighted balanced cross entropy can be used, and the spatial weights can be used to control the negative impact of pixels of undetermined categories on the model to be trained 130.
以下以空间权重中,第一区域的第一权重为0,第二区域的第二权重为1,第三区域的第三权重为1,第四区域的第四权重为0为例,描述基于加权均衡交叉熵的训练损失函数。需要说明的是,并不表示对本公开的限制,本领域人员可以根据情况,通过自由组合若干个区域中各个区域的权重和各个类别的权重设计基于加权均衡交叉熵的训练损失函数。基于加权均衡交叉熵的训练损失函数L可以满足公式(也即,相当于通过设置第一权重和第四权重为0,忽略第一区域和第四区域的损失):The following describes the training loss function based on weighted balanced cross entropy, taking the spatial weights in which the first weight of the first area is 0, the second weight of the second area is 1, the third weight of the third area is 1, and the fourth weight of the fourth area is 0 as an example. It should be noted that this does not limit the present disclosure, and those skilled in the art can design a training loss function based on weighted balanced cross entropy by freely combining the weights of each area in a number of areas and the weights of each category according to the circumstances. The training loss function L based on weighted balanced cross entropy can satisfy the formula (that is, equivalent to setting the first weight and the fourth weight to 0 and ignoring the losses of the first area and the fourth area):
其中,C可以表示类别的数量,Wi可以表示第i个类别的权重,Mi可以表示第i个类别的样本数量,yij可以表示上述训练样本的金标准中第i个类别的第j个样本的真实值,pij可以表示预测结果中第i个类别的第j个样本的预测值(也即,第j个样本属于第i个类别的概率)。另外,各个类别的样本可以为训练样本中相应类别的像素。另外,一个类别的样本,可以基于上述训练样本的金标准确定。如上所述,类别的权重可以调整各个类别的样本对待训练模型130的影响。Wherein, C may represent the number of categories, Wi may represent the weight of the ith category, Mi may represent the number of samples of the ith category, yij may represent the true value of the jth sample of the ith category in the gold standard of the training sample, and pij may represent the predicted value of the jth sample of the ith category in the prediction result (that is, the probability that the jth sample belongs to the ith category). In addition, the samples of each category may be pixels of the corresponding category in the training sample. In addition, the samples of a category may be determined based on the gold standard of the training sample. As described above, the weight of the category may adjust the influence of the samples of each category on the training model 130.
另外,公式(1)中,通过设置第一权重和第四权重为0,忽略第一区域和第四区域的样本,训练损失函数中的类别可以包括目标的标注类别和无目标类别,目标的标注类别可以为训练样本中第二区域的像素所属的类别,无目标类别可以为训练样本中第三区域的像素所属的类别。以眼底图像为例,公式(1)的训练损失函数中的类别可以包括微血管瘤、点状出血、片状出血和线状出血和无目标类别。In addition, in formula (1), by setting the first weight and the fourth weight to 0, the samples of the first area and the fourth area are ignored, and the categories in the training loss function can include the labeled category of the target and the non-target category. The labeled category of the target can be the category to which the pixels in the second area of the training sample belong, and the non-target category can be the category to which the pixels in the third area of the training sample belong. Taking the fundus image as an example, the categories in the training loss function of formula (1) can include microvascular tumor, punctate hemorrhage, sheet hemorrhage, linear hemorrhage and non-target category.
以下结合图8描述本公开涉及的识别图像中的目标的方法(以下简称识别方法)。另外,识别方法可以识别医学图像中的目标。图8是示出了本公开示例所涉及的识别图像中的目标的方法的示例的流程图。The following describes the method for identifying a target in an image (hereinafter referred to as the identification method) involved in the present disclosure in conjunction with FIG8. In addition, the identification method can identify targets in medical images. FIG8 is a flowchart showing an example of the method for identifying a target in an image involved in the example of the present disclosure.
如图8所示,识别方法可以包括步骤S302。在步骤S302中,可以获取作为输入图像的医学图像。在一些示例中,输入图像可以经过与上述的训练样本一样的预处理后再输入经训练模型。As shown in Fig. 8, the recognition method may include step S302. In step S302, a medical image may be obtained as an input image. In some examples, the input image may be pre-processed like the training sample described above before being input into the trained model.
如图8所示,识别方法还可以包括步骤S304。在步骤S304中,可以利用至少一个经训练模型,确定针对输入图像的各个经训练模型的预测结果,基于至少一个经训练模型的预测结果获取目标预测结果,其中,至少一个经训练模型可以根据上述模型训练方法训练获得。另外,至少一个经训练模型可以为基于同一种类型的网络架构(例如,U-Net),但网络结构不同和/或参数不同的模型。例如,可以增加或减少一些分支或网络层次以形成至少一个经训练模型。但本公开的示例不限于此,在另一些示例中,至少一个经训练模型也可以不基于同一种类型的网络架构。As shown in FIG8 , the recognition method may further include step S304. In step S304, at least one trained model may be used to determine the prediction results of each trained model for the input image, and a target prediction result may be obtained based on the prediction results of at least one trained model, wherein at least one trained model may be obtained by training according to the above-mentioned model training method. In addition, at least one trained model may be a model based on the same type of network architecture (e.g., U-Net), but with a different network structure and/or different parameters. For example, some branches or network levels may be added or reduced to form at least one trained model. However, the examples disclosed herein are not limited thereto. In other examples, at least one trained model may not be based on the same type of network architecture.
另外,各个经训练模型的预测结果可以包括输入图像中的各个像素属于相应标注类别的概率。标注类别可以为上述目标的标注类别。在一些示例中,可以按标注类别和像素对至少一个经训练模型的预测结果进行集成以获取输入图像的各个像素属于相应标注类别的集成概率,基于集成概率确定连通区域,基于该连通区域获取各个标注类别对应的目标预测结果。在这种情况下,基于集成概率获取目标预测结果,能够进一步提高目标预测结果的准确性。In addition, the prediction results of each trained model may include the probability that each pixel in the input image belongs to the corresponding labeled category. The labeled category may be the labeled category of the above-mentioned target. In some examples, the prediction results of at least one trained model may be integrated by the labeled category and pixel to obtain the integrated probability that each pixel of the input image belongs to the corresponding labeled category, and the connected area is determined based on the integrated probability, and the target prediction results corresponding to each labeled category are obtained based on the connected area. In this case, obtaining the target prediction results based on the integrated probability can further improve the accuracy of the target prediction results.
在一些示例中,在获取集成概率中,若仅存在一个经训练模型,则可以将该经训练模型的预测结果中输入图像中的各个像素属于相应标注类别的概率作为集成概率,否则可以对多个经训练模型的预测结果求均值以获取输入图像中的各个像素属于相应标注类别的概率均值(也即,可以按标注类别进行像素级别的求概率均值)。In some examples, in obtaining the integrated probability, if there is only one trained model, the probability that each pixel in the input image belongs to the corresponding labeled category in the prediction result of the trained model can be used as the integrated probability; otherwise, the prediction results of multiple trained models can be averaged to obtain the mean probability that each pixel in the input image belongs to the corresponding labeled category (that is, the probability average can be performed at the pixel level according to the labeled category).
在一些示例中,在基于集成概率确定连通区域中,可以基于集成概率和各个标注类别的分类阈值确定连通区域。具体地,可以将集成概率不小于分类阈值的像素的值设置为1,其他像素的值设置为0。在一些示例中,分类阈值可以基于验证集并采用性能指标来确定。另外,若存在连通区域,连通区域的数量可以为一个或多个。In some examples, in determining the connected area based on the integrated probability, the connected area can be determined based on the integrated probability and the classification threshold of each labeled category. Specifically, the value of the pixel whose integrated probability is not less than the classification threshold can be set to 1, and the value of other pixels can be set to 0. In some examples, the classification threshold can be determined based on the validation set and using a performance indicator. In addition, if there are connected areas, the number of connected areas can be one or more.
在一些示例中,在基于连通区域获取目标预测结果中,可以获取各个连通区域的外接矩形,若外接矩形的面积大于第二预设面积,则可以表示该外接矩形处存在目标,否则可以表示该外接矩形处不存在目标。In some examples, when obtaining target prediction results based on connected areas, the bounding rectangle of each connected area can be obtained. If the area of the bounding rectangle is larger than a second preset area, it can indicate that there is a target at the bounding rectangle; otherwise, it can indicate that there is no target at the bounding rectangle.
在一些示例中,第二预设面积可以为训练样本的面积的第二预设比例。具体地,第二预设面积可以表示为sHW,其中,s可以表示第二预设比例,H可以表示输入图像的高度,W可以表示输入图像的宽度。In some examples, the second preset area may be a second preset ratio of the area of the training sample. Specifically, the second preset area may be expressed as sHW, where s may represent the second preset ratio, H may represent the height of the input image, and W may represent the width of the input image.
在一些示例中,第二预设比例可以为固定值。在一些示例中,第二预设比例可以根据医疗图像中同类别的目标的面积的中值确定。在一些示例中,第二预设比例s可以满足公式:In some examples, the second preset ratio may be a fixed value. In some examples, the second preset ratio may be determined based on the median of the area of objects of the same category in the medical image. In some examples, the second preset ratio s may satisfy the formula:
其中,m可以分别表示医疗图像中同类别的目标的面积的中值,σ可以表示医疗图像中同类别的目标的面积的标准差,和可以分别表示医疗图像的平均宽度和平均高度。这里,医疗图像可以为用于获取第二预设比例的数据源中的图像。在一些示例中,数据源可以为训练数据。另外,可以与获取预设的超参数涉及的相关参数类似的方式获取第二预设比例涉及的相关参数,此处不再赘述。Among them, m can represent the median area of the same category of targets in the medical image, σ can represent the standard deviation of the area of the same category of targets in the medical image, and The average width and average height of the medical image may be represented respectively. Here, the medical image may be an image in a data source for obtaining the second preset ratio. In some examples, the data source may be training data. In addition, the relevant parameters involved in the second preset ratio may be obtained in a manner similar to the relevant parameters involved in obtaining the preset hyperparameters, which will not be described in detail here.
本公开还涉及计算机可读存储介质,该计算机可读存储介质可以存储有至少一个指令,至少一个指令被处理器执行时实现上述的模型训练方法或识别方法中的一个或多个步骤。The present disclosure also relates to a computer-readable storage medium, which may store at least one instruction, and when the at least one instruction is executed by a processor, one or more steps in the above-mentioned model training method or recognition method are implemented.
本公开还涉及电子设备,电子设备可以包括至少一个处理电路。至少一个处理电路被配置为上述的模型训练方法或识别方法中的一个或多个步骤。The present disclosure also relates to an electronic device, which may include at least one processing circuit. The at least one processing circuit is configured to perform one or more steps in the above-mentioned model training method or recognition method.
本公开的示例的识别医学图像中的目标的模型训练、方法、设备及介质,通过对训练样本中标注区域内的图像数据进行欠分割以识别标注区域内未确定类别的像素,并结合空间权重对待训练模型130进行训练以减小标注区域内的未确定类别的像素对待训练模型130的负面影响,进而能够使训练后的待训练模型130对输入图像的预测结果的准确性提高。由此,能够有效地对小目标进行识别。The model training, method, device and medium for identifying targets in medical images of the example disclosed in the present invention, by under-segmenting the image data in the labeled area in the training sample to identify the pixels of undetermined categories in the labeled area, and training the to-be-trained model 130 in combination with the spatial weight to reduce the negative impact of the pixels of undetermined categories in the labeled area on the to-be-trained model 130, can improve the accuracy of the prediction results of the input image by the trained model 130. Thus, small targets can be effectively identified.
虽然以上结合附图和示例对本公开进行了具体说明,但是可以理解,上述说明不以任何形式限制本公开。本领域技术人员在不偏离本公开的实质精神和范围的情况下可以根据需要对本公开进行变形和变化,这些变形和变化均落入本公开的范围内。Although the present disclosure is specifically described above in conjunction with the accompanying drawings and examples, it is to be understood that the above description does not limit the present disclosure in any form. Those skilled in the art may modify and change the present disclosure as needed without departing from the essential spirit and scope of the present disclosure, and these modifications and changes all fall within the scope of the present disclosure.
Claims (15)
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411213065.4A CN119206306A (en) | 2022-03-02 | 2022-03-02 | Method and electronic device for identifying targets in medical images |
CN202210205467.4A CN114581709B (en) | 2022-03-02 | 2022-03-02 | Model training, method, device and medium for identifying objects in medical images |
CN202411213063.5A CN119206305A (en) | 2022-03-02 | 2022-03-02 | Model training method and electronic device for identifying targets in medical images |
PCT/CN2022/095137 WO2023165033A1 (en) | 2022-03-02 | 2022-05-26 | Method for training model for recognizing target in medical image, method for recognizing target in medical image, and device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210205467.4A CN114581709B (en) | 2022-03-02 | 2022-03-02 | Model training, method, device and medium for identifying objects in medical images |
Related Child Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411213065.4A Division CN119206306A (en) | 2022-03-02 | 2022-03-02 | Method and electronic device for identifying targets in medical images |
CN202411213063.5A Division CN119206305A (en) | 2022-03-02 | 2022-03-02 | Model training method and electronic device for identifying targets in medical images |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114581709A CN114581709A (en) | 2022-06-03 |
CN114581709B true CN114581709B (en) | 2024-08-09 |
Family
ID=81777415
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411213065.4A Pending CN119206306A (en) | 2022-03-02 | 2022-03-02 | Method and electronic device for identifying targets in medical images |
CN202411213063.5A Pending CN119206305A (en) | 2022-03-02 | 2022-03-02 | Model training method and electronic device for identifying targets in medical images |
CN202210205467.4A Active CN114581709B (en) | 2022-03-02 | 2022-03-02 | Model training, method, device and medium for identifying objects in medical images |
Family Applications Before (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411213065.4A Pending CN119206306A (en) | 2022-03-02 | 2022-03-02 | Method and electronic device for identifying targets in medical images |
CN202411213063.5A Pending CN119206305A (en) | 2022-03-02 | 2022-03-02 | Model training method and electronic device for identifying targets in medical images |
Country Status (2)
Country | Link |
---|---|
CN (3) | CN119206306A (en) |
WO (1) | WO2023165033A1 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115082990A (en) * | 2022-06-27 | 2022-09-20 | 平安银行股份有限公司 | Living body detection method and device for human face |
CN117876384B (en) * | 2023-12-21 | 2024-08-20 | 珠海横琴圣澳云智科技有限公司 | Target object instance segmentation and model training method and related products |
CN117611926B (en) * | 2024-01-22 | 2024-04-23 | 重庆医科大学绍兴柯桥医学检验技术研究中心 | Medical image recognition method and system based on AI model |
CN117689660B (en) * | 2024-02-02 | 2024-05-14 | 杭州百子尖科技股份有限公司 | Vacuum cup temperature quality inspection method based on machine vision |
CN118115783B (en) * | 2024-02-02 | 2024-10-11 | 中山大学中山眼科中心 | Corneal staining analysis method based on deep learning and related training methods and systems |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111951274A (en) * | 2020-07-24 | 2020-11-17 | 上海联影智能医疗科技有限公司 | Image segmentation method, system, readable storage medium and device |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150051434A1 (en) * | 2012-02-21 | 2015-02-19 | Koninklijkie Philips N.V. | Method for regularizing aperture shape for milling |
CN105761250A (en) * | 2016-02-01 | 2016-07-13 | 福建师范大学 | Building extraction method based on fuzzy scene segmentation |
GB201709672D0 (en) * | 2017-06-16 | 2017-08-02 | Ucl Business Plc | A system and computer-implemented method for segmenting an image |
CN109741346B (en) * | 2018-12-30 | 2020-12-08 | 上海联影智能医疗科技有限公司 | Region-of-interest extraction method, device, equipment and storage medium |
IL287059B2 (en) * | 2019-04-11 | 2024-08-01 | Agilent Technologies Inc | A user interface that allows user markers for local segmentation in a biological sample |
CN110363138B (en) * | 2019-07-12 | 2024-07-26 | 腾讯科技(深圳)有限公司 | Model training method, image processing method, device, terminal and storage medium |
CN110503654B (en) * | 2019-08-01 | 2022-04-26 | 中国科学院深圳先进技术研究院 | A method, system and electronic device for medical image segmentation based on generative adversarial network |
CN110543911B (en) * | 2019-08-31 | 2022-12-16 | 华南理工大学 | A Weakly Supervised Object Segmentation Method Combining Classification Tasks |
CN110766694B (en) * | 2019-09-24 | 2021-03-26 | 清华大学 | Interactive segmentation method of three-dimensional medical image |
CN110689548B (en) * | 2019-09-29 | 2023-01-17 | 浪潮电子信息产业股份有限公司 | A medical image segmentation method, device, equipment and readable storage medium |
CN110910396A (en) * | 2019-10-18 | 2020-03-24 | 北京量健智能科技有限公司 | Method and device for optimizing image segmentation result |
CN110852332B (en) * | 2019-10-29 | 2020-12-01 | 腾讯科技(深圳)有限公司 | Training sample generation method and device, storage medium and electronic equipment |
EP4073752A4 (en) * | 2019-12-09 | 2024-01-03 | Janssen Biotech, Inc. | Method for determining severity of skin disease based on percentage of body surface area covered by lesions |
WO2021179205A1 (en) * | 2020-03-11 | 2021-09-16 | 深圳先进技术研究院 | Medical image segmentation method, medical image segmentation apparatus and terminal device |
CN113920420A (en) * | 2020-07-07 | 2022-01-11 | 香港理工大学深圳研究院 | A building extraction method, device, terminal device and readable storage medium |
CN112418205A (en) * | 2020-11-19 | 2021-02-26 | 上海交通大学 | Interactive image segmentation method and system based on focusing on wrongly segmented areas |
CN113920109B (en) * | 2021-10-29 | 2025-01-14 | 沈阳东软智能医疗科技研究院有限公司 | Medical image recognition model training method, recognition method, device and equipment |
-
2022
- 2022-03-02 CN CN202411213065.4A patent/CN119206306A/en active Pending
- 2022-03-02 CN CN202411213063.5A patent/CN119206305A/en active Pending
- 2022-03-02 CN CN202210205467.4A patent/CN114581709B/en active Active
- 2022-05-26 WO PCT/CN2022/095137 patent/WO2023165033A1/en unknown
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111951274A (en) * | 2020-07-24 | 2020-11-17 | 上海联影智能医疗科技有限公司 | Image segmentation method, system, readable storage medium and device |
Non-Patent Citations (2)
Title |
---|
动态图像特征空间的立体视觉匹配算法;吴文辉;《计算机工程与应用》;20110430;第178-181页 * |
基于像元集的置信传递立体匹配;周秀芝;王润生;;中国图象图形学报;20080315(第03期);第507-512页 * |
Also Published As
Publication number | Publication date |
---|---|
CN114581709A (en) | 2022-06-03 |
CN119206306A (en) | 2024-12-27 |
CN119206305A (en) | 2024-12-27 |
WO2023165033A1 (en) | 2023-09-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114581709B (en) | Model training, method, device and medium for identifying objects in medical images | |
CN111178197B (en) | Instance Segmentation Method of Cohesive Pigs in Group Breeding Based on Mask R-CNN and Soft-NMS Fusion | |
US20220108546A1 (en) | Object detection method and apparatus, and computer storage medium | |
JP7458328B2 (en) | Multi-sample whole-slide image processing via multi-resolution registration | |
CN111524137B (en) | Cell identification counting method and device based on image identification and computer equipment | |
Xu et al. | FFU‐net: feature fusion u‐net for lesion segmentation of diabetic retinopathy | |
US12039440B2 (en) | Image classification method and apparatus, and image classification model training method and apparatus | |
US9286537B2 (en) | System and method for classifying a skin infection | |
CN113011450B (en) | Training method, training device, recognition method and recognition system for glaucoma recognition | |
CN108647625A (en) | A kind of expression recognition method and device | |
Caseneuve et al. | Chest X-ray image preprocessing for disease classification | |
CN114600155A (en) | Weakly supervised multitask learning for cell detection and segmentation | |
CN111325725A (en) | Retina image recognition method and device, electronic equipment and storage medium | |
CN112464983A (en) | Small sample learning method for apple tree leaf disease image classification | |
CN112836653A (en) | Face privacy method, device and apparatus and computer storage medium | |
CN105512612A (en) | SVM-based image classification method for capsule endoscope | |
Salvi et al. | cyto‐Knet: An instance segmentation approach for multiple myeloma plasma cells using conditional kernels | |
Joshi et al. | Graph deep network for optic disc and optic cup segmentation for glaucoma disease using retinal imaging | |
Wu et al. | Super-resolution fusion optimization for poultry detection: A multi-object chicken detection method | |
CN118297837B (en) | Infrared simulator virtual image enhancement system based on image processing | |
Zheng et al. | Improvement of grayscale image 2D maximum entropy threshold segmentation method | |
CN118279667A (en) | Deep learning vitiligo identification method for dermoscope image | |
CN116309633A (en) | Retina blood vessel segmentation method based on nuclear intuitionistic fuzzy C-means clustering | |
CN117011346A (en) | Blower image registration algorithm | |
CN113971671B (en) | Instance segmentation method, device, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |