[go: up one dir, main page]

CN118247224A - A breast cancer pathology image analysis method based on deep learning - Google Patents

A breast cancer pathology image analysis method based on deep learning Download PDF

Info

Publication number
CN118247224A
CN118247224A CN202410228084.8A CN202410228084A CN118247224A CN 118247224 A CN118247224 A CN 118247224A CN 202410228084 A CN202410228084 A CN 202410228084A CN 118247224 A CN118247224 A CN 118247224A
Authority
CN
China
Prior art keywords
image
layer
breast cancer
module
images
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410228084.8A
Other languages
Chinese (zh)
Inventor
黄堂森
颜成钢
韩卫东
何敏
殷海兵
黄星儒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN202410228084.8A priority Critical patent/CN118247224A/en
Publication of CN118247224A publication Critical patent/CN118247224A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30096Tumor; Lesion

Landscapes

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

Abstract

The invention discloses a breast cancer pathological image analysis method based on deep learning. Firstly, constructing an improved EFFICIENTNET-B0 network model, and carrying out model optimization through a disclosed breast cancer clinical sample data set until a loss function converges to obtain a trained image analysis model; and analyzing the breast cancer pathological image to be identified by using the trained image analysis model to generate a clear epithelial tissue image and a clear mesenchymal tissue image. The method can more accurately identify and classify the epithelial tissues and the mesenchymal tissues in the pathological images of the breast cancer, and better help doctors to understand and read the medical images, so that the accuracy of breast cancer diagnosis is improved, the working efficiency is improved, and meanwhile, important assistance can be provided for predicting the development and the recovery of the breast cancer, and important references are provided for the doctors to formulate personalized and efficient treatment schemes.

Description

一种基于深度学习的乳腺癌病理图像分析方法A breast cancer pathology image analysis method based on deep learning

技术领域Technical Field

本发明涉及深度学习技术领域,更具体的说是涉及一种基于深度学习的乳腺癌病理图像分析方法。The present invention relates to the field of deep learning technology, and more specifically to a breast cancer pathology image analysis method based on deep learning.

背景技术Background Art

当前人工智能技术在迅速发展,展现出了独特的优势,在各个领域得到广泛应用,其中以深度学习为代表的各类算法是当前的研究热点。深度学习是人工智能的一个重要子领域,旨在模拟人脑神经元的连接,使计算机能够更好地识别信息和上下文中的关系。近年来,基于神经网络的深度学习方法在许多任务,如图像识别、语音识别、自然语言处理等方面都取得了突破性成果。深度学习模型以其高度的灵活性和有效性,已被广泛应用于各种问题的解决。深度学习是未来计算机科学领域最具前景的方法之一,不断向全新的应用领域拓展。Artificial intelligence technology is developing rapidly, showing unique advantages and being widely used in various fields. Among them, various algorithms represented by deep learning are the current research hotspots. Deep learning is an important subfield of artificial intelligence, which aims to simulate the connection of neurons in the human brain so that computers can better recognize the relationship between information and context. In recent years, deep learning methods based on neural networks have achieved breakthrough results in many tasks such as image recognition, speech recognition, and natural language processing. Deep learning models have been widely used to solve various problems with their high flexibility and effectiveness. Deep learning is one of the most promising methods in the field of computer science in the future, and it continues to expand into new application areas.

随着计算机科学和医学领域的进一步发展,深度学习已经在乳腺癌病理图像识别中起到了重要作用。此技术在图像识别、分类和图像分割等领域的不断突破,为乳腺癌早期发现和治疗提供了更好的途径。乳腺癌病理图像识别的核心挑战包括细胞组织和分支的定位、细胞变化的识别以及良性和恶性肿瘤的鉴别。以前这些工作依赖病理学家的经验和知识,但深度学习的出现则打破了这种局限。由于深度学习能够自动分析图像,它能显著地减少工作量、提高效率和准确性,从而减少了人为因素的影响。随着深度学习在医学影像分析中的应用日渐广泛,这种技术在乳腺癌病理图像识别中也发挥了重要的作用。深度学习为乳腺癌的早期发现与治疗提供了新的方向。With the further development of computer science and medicine, deep learning has played an important role in breast cancer pathology image recognition. The continuous breakthroughs of this technology in image recognition, classification and image segmentation provide a better way for early detection and treatment of breast cancer. The core challenges of breast cancer pathology image recognition include the localization of cell tissues and branches, the identification of cell changes, and the differentiation of benign and malignant tumors. In the past, these tasks relied on the experience and knowledge of pathologists, but the emergence of deep learning has broken this limitation. Because deep learning can automatically analyze images, it can significantly reduce workload, improve efficiency and accuracy, thereby reducing the impact of human factors. With the increasing application of deep learning in medical image analysis, this technology has also played an important role in breast cancer pathology image recognition. Deep learning provides a new direction for the early detection and treatment of breast cancer.

研究人员利用深度学习对乳腺癌组织的细胞核进行分割,并取得了很高的准确度,表明深度学习在乳腺癌病理图像识别方面所拥有的巨大潜力。然后有学者使用无监督深度学习方法对乳腺癌组织切片进行了识别,进一步提升了该领域的研究。深度学习在乳腺癌筛查和诊断过程中的作用被日益重视。在乳腺癌的患者筛查和诊断过程中,尽早发现重要的标志性特征至关重要。这些特征可能很微小,很难被裸眼识别,但却能被深度学习模型中的卷积神经网络(CNN)识别,通过卷积神经网络(CNN)检测乳腺癌的关键标志性特性的微妙变化,可以增加早期诊断的可能性。现有技术提出了一种名为“深度残差学习”的模型,成功的将这些微小特征并入预测乳腺癌复发风险的数学模型中,极大的提升了预测的精准性。另一方面,深度学习也在乳腺癌治疗决策中发挥了重要的作用,包括对外科干预的决定以及对治疗方案的选择均起着重要作用,因为进行手术时需对肿瘤进行准确评估。同时,使用深度学习进行乳腺癌患者输送到淋巴结的细胞识别,在临床实践中取得了重要突破。深度学习也被应用于患者的个性化治疗中,通过分析乳腺癌分子亚型,为患者设计最适合的治疗方案提供重要帮助。Researchers used deep learning to segment the cell nuclei of breast cancer tissue and achieved high accuracy, indicating the great potential of deep learning in breast cancer pathology image recognition. Then some scholars used unsupervised deep learning methods to identify breast cancer tissue sections, further improving research in this field. The role of deep learning in breast cancer screening and diagnosis is increasingly valued. In the screening and diagnosis of breast cancer patients, it is crucial to detect important landmark features as early as possible. These features may be very small and difficult to be recognized by the naked eye, but they can be recognized by the convolutional neural network (CNN) in the deep learning model. The detection of subtle changes in the key landmark characteristics of breast cancer through the convolutional neural network (CNN) can increase the possibility of early diagnosis. The existing technology proposes a model called "deep residual learning", which successfully incorporates these tiny features into the mathematical model for predicting the risk of breast cancer recurrence, greatly improving the accuracy of the prediction. On the other hand, deep learning also plays an important role in breast cancer treatment decisions, including the decision on surgical intervention and the choice of treatment options, because the tumor needs to be accurately assessed during surgery. At the same time, the use of deep learning to identify cells transported to lymph nodes in breast cancer patients has made important breakthroughs in clinical practice. Deep learning has also been applied to personalized treatment of patients, providing important help in designing the most suitable treatment plan for patients by analyzing the molecular subtypes of breast cancer.

有研究表明,乳腺癌与上皮-间充质转化(EMT,Epithelial-MesenchymalTransition)有关,EMT是一个生物过程,细胞在上皮状态和间充质状态间转化,该过程在生物发育、组织修复以及恶性肿瘤发生中扮演着重要角色。早在80年代,EMT过程就已经被生物学家研究,发现EMT是成为恶性肿瘤发生和发展的机理之一。在乳腺癌中,EMT过程与癌症侵袭、迁移以及耐药性等多种重要生物学特性紧密相关。由上皮细胞转变为更具侵袭性的间充质细胞,可以促进癌症细胞穿过基底膜迁移到远处器官,形成转移病灶。由于EMT过程与乳腺癌的侵袭性和转移性相关,因此研究EMT对于乳腺癌的治疗有重要意义。Studies have shown that breast cancer is related to epithelial-mesenchymal transition (EMT). EMT is a biological process in which cells transform between epithelial and mesenchymal states. This process plays an important role in biological development, tissue repair, and the occurrence of malignant tumors. As early as the 1980s, the EMT process had been studied by biologists, and it was found that EMT is one of the mechanisms for the occurrence and development of malignant tumors. In breast cancer, the EMT process is closely related to many important biological characteristics such as cancer invasion, migration, and drug resistance. The transformation from epithelial cells to more invasive mesenchymal cells can promote cancer cells to migrate through the basement membrane to distant organs and form metastatic lesions. Since the EMT process is related to the invasiveness and metastasis of breast cancer, studying EMT is of great significance for the treatment of breast cancer.

深度学习在识别和预测乳腺癌的EMT过程中展现出了巨大的潜力,利用深度神经网络(DNN)可以从复杂的基因组数据中提取出关键特征,这使得科研人员能够识别和理解影响EMT相关基因的潜在机制及其变换规律。为了提升这一研究方法的准确性,有学者提出了一种新的深度学习模型,该模型通过强化学习算法优化了DNN的结构,增强了模型在预测EMT状态时的准确性。更进一步地,有学者开发了一种基于深度学习的自动化方法,通过对乳腺癌组织切片进行复杂的图像分析,可以确定EMT的状态,这种方法不仅大大提高了EMT状态判断的效率,而且减少了由于人工病理学阅片带来的误判风险。Deep learning has shown great potential in identifying and predicting the EMT process of breast cancer. Deep neural networks (DNNs) can be used to extract key features from complex genomic data, which enables researchers to identify and understand the potential mechanisms and transformation patterns that affect EMT-related genes. In order to improve the accuracy of this research method, some scholars have proposed a new deep learning model that optimizes the structure of DNNs through reinforcement learning algorithms, enhancing the accuracy of the model in predicting EMT status. Furthermore, some scholars have developed an automated method based on deep learning that can determine the state of EMT by performing complex image analysis on breast cancer tissue sections. This method not only greatly improves the efficiency of EMT status judgment, but also reduces the risk of misjudgment due to manual pathology reading.

综上所述,深度学习在乳腺癌EMT的研究中显示出了巨大的潜力,预期在未来,随着技术的不断发展和优化,这项技术将在乳腺癌的预测、诊断和治疗中发挥更大的作用。然而,乳腺癌EMT的研究依然面临着诸多挑战,EMT并非一个非此即彼的过程,在很多情况下,细胞可能只是处于了部分EMT状态,即介于上皮和间充质之间的状态。这就使得研究这一过程变得复杂且困难,这种困难极有可能耽误乳腺癌的早期发现和治疗。In summary, deep learning has shown great potential in the study of breast cancer EMT. It is expected that in the future, with the continuous development and optimization of technology, this technology will play a greater role in the prediction, diagnosis and treatment of breast cancer. However, the study of breast cancer EMT still faces many challenges. EMT is not an either-or process. In many cases, cells may only be in a partial EMT state, that is, a state between epithelium and mesenchyme. This makes the study of this process complicated and difficult, and this difficulty is very likely to delay the early detection and treatment of breast cancer.

因此,如何更准确的对乳腺癌病理图像中的上皮组织和间充质组织进行识别和分类,为医生提高乳腺癌诊断的准确性提供支持是本领域技术人员亟需解决的技术问题。Therefore, how to more accurately identify and classify epithelial tissue and mesenchymal tissue in breast cancer pathological images and provide support for doctors to improve the accuracy of breast cancer diagnosis is a technical problem that technicians in this field urgently need to solve.

发明内容Summary of the invention

有鉴于此,本发明提供了一种基于深度学习的乳腺癌病理图像分析方法,解决了背景技术存在的问题。In view of this, the present invention provides a breast cancer pathology image analysis method based on deep learning, which solves the problems existing in the background technology.

为了实现上述目的,本发明提供如下技术方案:In order to achieve the above object, the present invention provides the following technical solutions:

一种基于深度学习的乳腺癌病理图像分析方法,包括以下步骤:A breast cancer pathology image analysis method based on deep learning, comprising the following steps:

构建改进型的EfficientNet-B0网络模型并通过公开的乳腺癌临床样本数据集进行模型优化,直至损失函数收敛,得到训练好的图像分析模型;Build an improved EfficientNet-B0 network model and optimize the model using a public breast cancer clinical sample dataset until the loss function converges to obtain a trained image analysis model;

利用训练好的图像分析模型对待识别的乳腺癌病理图像进行分析,生成清晰的上皮组织图像和间充质组织图像。The trained image analysis model is used to analyze the breast cancer pathology images to be identified and generate clear epithelial tissue images and mesenchymal tissue images.

可选的,所述的公开的乳腺癌临床样本数据集采用TCGA(The Cancer GenomeAtlas)数据集;Optionally, the public breast cancer clinical sample dataset adopts the TCGA (The Cancer Genome Atlas) dataset;

可选的,所述的改进型的EfficientNet-B0网络模型以EfficientNet模型为基础,通过增加网络层数、增大通道数量和参数数量进行网络结构优化,包括依次相连的主干网络、第一模块、Block1、Block2、Block3、Block4、Block5、第二模块和输出层;Optionally, the improved EfficientNet-B0 network model is based on the EfficientNet model, and the network structure is optimized by increasing the number of network layers, the number of channels and the number of parameters, including a backbone network, a first module, Block1, Block2, Block3, Block4, Block5, a second module and an output layer connected in sequence;

主干网络包括依次连接的输入层、第一缩放层、归一化层、第一零填充层、第一二维卷积层、第一批归一化层和第一激活函数层;The backbone network includes an input layer, a first scaling layer, a normalization layer, a first zero-filling layer, a first two-dimensional convolutional layer, a first batch of normalization layers, and a first activation function layer connected in sequence;

Block1包括依次连接的第二模块、第三模块和第一叠加层,其中第二模块还与第一叠加层连接;Block1 includes a second module, a third module and a first stacking layer connected in sequence, wherein the second module is also connected to the first stacking layer;

Block2包括依次连接的第二模块、第三模块和第二叠加层,Block1中的第一叠加层分别与Block2中的第二模块、第二叠加层连接;Block2 includes a second module, a third module and a second stacking layer connected in sequence, and the first stacking layer in Block1 is connected to the second module and the second stacking layer in Block2 respectively;

Block3包括依次连接的第二模块、第三模块、第三叠加层、第三模块和第四叠加层,Block2中的第二叠加层分别与Block3中的第二模块、第三叠加层连接,第三叠加层与第四叠加层连接;Block3 includes a second module, a third module, a third stacking layer, a third module and a fourth stacking layer connected in sequence, the second stacking layer in Block2 is connected to the second module and the third stacking layer in Block3 respectively, and the third stacking layer is connected to the fourth stacking layer;

Block4包括依次连接的第二模块、第三模块、第五叠加层、第三模块和第六叠加层,Block3中的第四叠加层分别与Block4中的第二模块、第五叠加层、第六叠加层连接;Block4 includes a second module, a third module, a fifth superimposed layer, a third module and a sixth superimposed layer connected in sequence, and the fourth superimposed layer in Block3 is connected to the second module, the fifth superimposed layer and the sixth superimposed layer in Block4 respectively;

Block5包括依次连接的第二模块、第三模块、第七叠加层、第三模块、第八叠加层、第九叠加层、第三模块和第十叠加层,Block4中的第六叠加层分别与Block5中的第二模块、第七叠加层、第八叠加层、第九叠加层、第十叠加层连接。Block5 includes a second module, a third module, a seventh superimposed layer, a third module, an eighth superimposed layer, a ninth superimposed layer, a third module and a tenth superimposed layer connected in sequence, and the sixth superimposed layer in Block4 is respectively connected to the second module, the seventh superimposed layer, the eighth superimposed layer, the ninth superimposed layer and the tenth superimposed layer in Block5.

可选的,第一模块包括依次连接的第一深度可分离卷积层、第二批归一化层和第二激活函数层。Optionally, the first module includes a first depth-wise separable convolutional layer, a second batch normalization layer, and a second activation function layer connected in sequence.

可选的,第二模块包括依次连接的第二深度可分离卷积层、第三批归一化层、第三激活函数层、第二零填充层、第三深度可分离卷积层、第四批归一化层和第四激活函数层。Optionally, the second module includes a second depthwise separable convolutional layer, a third batch normalization layer, a third activation function layer, a second zero-filling layer, a third depthwise separable convolutional layer, a fourth batch normalization layer and a fourth activation function layer, which are connected in sequence.

可选的,第三模块包括全局平均池化层、第二缩放层、第二二维卷积层和第三二维卷积层。Optionally, the third module includes a global average pooling layer, a second scaling layer, a second two-dimensional convolution layer and a third two-dimensional convolution layer.

可选的,模型优化采用Adam算法,损失函数为二值交叉熵损失函数。Optionally, the model is optimized using the Adam algorithm, and the loss function is a binary cross entropy loss function.

可选的,利用训练好的图像分析模型对待识别的乳腺癌病理图像进行分析,具体如下:Optionally, the trained image analysis model is used to analyze the breast cancer pathology image to be identified, as follows:

首先将待识别的乳腺癌病理图像从KFB文件格式转换为SVS文件格式,将裁剪得到的图像转换为RGB格式并缩放到原来尺寸的一半,获取缩放后的宽度和高度并存储缩放后的图像转换数据类型;对缩放图像进行滑动窗口处理,用两个循环分别遍历缩放图像的宽度和高度;计算每个图像块内非白色像素点的数量,判断是否满足非白像素阈值,当非白色像素数大于阈值λ时,将该图像块依次进行翻转、旋转、归一化变换后输入到训练好的图像分析模型进行预测,得到一个数组g1,表示每个变换后的图像块的预测结果;然后再将g1中的预测结果进行加权平均并累加到数组相应的位置上,同时通过累加掩码矩阵记录每个像素被处理的次数,将每个像素的预测结果除以该像素被处理的次数,得到最终的归一化预测结果g2;接下来把g2中归一化的值缩放到0到255的范围,在该范围内的图像视为有效图像,若g2>255则会被视为噪声而舍弃;再将有效图像数组转换为图像I1,并将图像I1转换为灰度图像I2,即完成将SVS图像文件转换成PNG文件;所述的PNG文件包括清晰的上皮组织图像和间充质组织图像。First, the breast cancer pathology image to be identified is converted from the KFB file format to the SVS file format, the cropped image is converted to the RGB format and scaled to half of the original size, the scaled width and height are obtained and the scaled image conversion data type is stored; the scaled image is processed by sliding windows, and the width and height of the scaled image are traversed by two loops respectively; the number of non-white pixels in each image block is calculated to determine whether the non-white pixel threshold is met. When the number of non-white pixels is greater than the threshold λ, the image block is flipped, rotated, and normalized in turn and input into the trained image analysis model for prediction to obtain an array g1 , which represents the prediction result of each transformed image block; then the prediction results in g1 are weighted averaged and accumulated to the corresponding position of the array, and the number of times each pixel is processed is recorded by accumulating the mask matrix, and the prediction result of each pixel is divided by the number of times the pixel is processed to obtain the final normalized prediction result g2 ; next, the normalized value in g2 is scaled to the range of 0 to 255, and the image within this range is regarded as a valid image. If g2 >255 will be regarded as noise and discarded; then the effective image array is converted into image I 1 , and image I 1 is converted into grayscale image I 2 , thus completing the conversion of the SVS image file into a PNG file; the PNG file includes clear epithelial tissue images and mesenchymal tissue images.

可选的,所述方法还包括:采用组织增强视融算法生成可视化热力覆盖图像,具体包括以下步骤:Optionally, the method further includes: using a tissue enhancement visual fusion algorithm to generate a visualized thermal overlay image, specifically including the following steps:

读取SVS图像文件,获取SVS图像数据;Read SVS image file and obtain SVS image data;

读取PNG文件,并将PNG图像大小调整为与SVS图像相同;Read the PNG file and resize the PNG image to be the same as the SVS image;

采用高斯滤波器,平滑PNG图像;Use Gaussian filter to smooth PNG images;

将平滑后的PNG图像值映射到彩色空间,得到彩色的热力图;Map the smoothed PNG image values to the color space to obtain a color heat map;

应用颜色阈值并创建掩码,将热力图中的黑色背景去除;Apply color thresholding and create a mask to remove the black background from the heat map;

将处理后的热力图和SVS图像按预设比例融合,生成最终的可视化热力覆盖图像。The processed thermal map and SVS image are fused at a preset ratio to generate the final visualized thermal coverage image.

可选的,所述方法还包括采用综合灰度阈值智能判定算法对图像分析结果进行评估,具体包括以下步骤:Optionally, the method further comprises evaluating the image analysis result by using a comprehensive grayscale threshold intelligent determination algorithm, specifically comprising the following steps:

计算PNG图像所有像素的总和;Calculate the sum of all pixels of a PNG image;

计算PNG图像的面积,即图像的宽度乘以高度;Calculate the area of the PNG image, which is the width multiplied by the height of the image;

计算PNG图像中像素值大于等于1的像素总数和占据的面积;Calculate the total number of pixels with pixel values greater than or equal to 1 and the area they occupy in the PNG image;

计算每幅PNG图像中的上皮组织面积或间质组织面积所占总组织区域面积的比例 Calculate the ratio of epithelial tissue area or interstitial tissue area to the total tissue area in each PNG image and

式中,表示第i副图像中上皮组织面积和总区域面积的比例,Total_sum(i)表示第i副图像中的上皮组织像素点数量,Total_area(i)表示第i副图像中总的像素点数量;设有N副图像,则i的取值范围:1≤i≤N;In the formula, It represents the ratio of epithelial tissue area to total area in the i-th image, Total_sum(i) represents the number of epithelial tissue pixels in the i-th image, and Total_area(i) represents the total number of pixels in the i-th image. If there are N images, the value range of i is: 1≤i≤N;

表示第k副图像中间充质组织面积和总区域面积的比例,Total_area_1(k)表示第k副图像中的总的像素点数量,Total_sum_1(k)表示第k副图像中的间充质组织像素点数量;设有M副图像,则k的取值范围:1≤k≤M。 It represents the ratio of the mesenchymal tissue area to the total area in the kth image, Total_area_1(k) represents the total number of pixels in the kth image, and Total_sum_1(k) represents the number of mesenchymal tissue pixels in the kth image. If there are M images, the value range of k is: 1≤k≤M.

设置一个比例阈值r,将与比例阈值r进行比较,若则Xi=1,否则Xi=0;同样,若则Yk=1,否则Yk=0;Set a ratio threshold r, Compared with the ratio threshold r, if Then Xi = 1, otherwise Xi = 0; similarly, if Then Y k =1, otherwise Y k =0;

分别计算取1数量的比例,并保存为Le和LmCalculate separately and Take the ratio of the quantities 1 and save them as L e and L m :

本发明有益效果如下:The beneficial effects of the present invention are as follows:

经由上述的技术方案可知,与现有技术相比,本发明提供了一种基于深度学习的乳腺癌病理图像分析方法,能够更准确地识别和分类乳腺癌病理图像中的上皮组织和间充质组织,更好地帮助医生理解和解读医学影像,从而提高乳腺癌诊断的准确性,提高工作效率,同时可为预测乳腺癌的发展和愈后提供重要帮助,也为医生制定个性化和高效的治疗方案提供了重要参考。It can be seen from the above technical solution that compared with the prior art, the present invention provides a breast cancer pathology image analysis method based on deep learning, which can more accurately identify and classify epithelial tissue and mesenchymal tissue in breast cancer pathology images, better help doctors understand and interpret medical images, thereby improving the accuracy of breast cancer diagnosis and improving work efficiency. At the same time, it can provide important help for predicting the development and recovery of breast cancer, and also provide an important reference for doctors to formulate personalized and efficient treatment plans.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

图1为本发明提供的基于深度学习的乳腺癌病理图像分析方法的流程图;FIG1 is a flow chart of a breast cancer pathology image analysis method based on deep learning provided by the present invention;

图2为本发明提供的复合型网络结构示意图;FIG2 is a schematic diagram of a composite network structure provided by the present invention;

图3为本发明提供的改进型的EfficientNet-B0网络模型的结构图;FIG3 is a structural diagram of an improved EfficientNet-B0 network model provided by the present invention;

图4(a)-图4(b)为本发明提供的实验用的原始图像的切片信息示意图;FIG. 4( a )-FIG 4( b ) are schematic diagrams of slice information of original images used in experiments provided by the present invention;

图5为本发明提供的与图4中原始图像对应的上皮组织图像;FIG5 is an epithelial tissue image corresponding to the original image in FIG4 provided by the present invention;

图6为本发明提供的与图4中原始图像对应的间充质图像;FIG6 is a mesenchymal image corresponding to the original image in FIG4 provided by the present invention;

图7为本发明提供的经过颜色转换处理后的间充质图像;FIG7 is a mesenchyme image after color conversion provided by the present invention;

图8为本发明提供的可视化的热力图。FIG8 is a visualized heat map provided by the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

本发明实施例公开了一种基于深度学习的乳腺癌病理图像分析方法,如图1所示,包括以下步骤:The embodiment of the present invention discloses a method for analyzing breast cancer pathology images based on deep learning, as shown in FIG1 , comprising the following steps:

基于乳腺癌组织切片获取显微镜图像并进行预处理,构建训练集;Acquire microscope images based on breast cancer tissue sections and perform preprocessing to construct a training set;

构建改进型的EfficientNet-B0网络模型并基于训练集进行模型优化,直至损失函数收敛,得到训练好的图像分析模型;Build an improved EfficientNet-B0 network model and optimize the model based on the training set until the loss function converges to obtain a trained image analysis model;

利用训练好的图像分析模型对待识别的乳腺癌病理图像进行分析,生成清晰的上皮组织图像和间充质组织图像。The trained image analysis model is used to analyze the breast cancer pathology images to be identified and generate clear epithelial tissue images and mesenchymal tissue images.

接下来,对图1所示的过程进行详细阐述,以对本技术方案进行更深一步地了解。Next, the process shown in FIG. 1 is described in detail to provide a deeper understanding of the present technical solution.

1、实验用病理图像1. Experimental pathological images

实验用病理图像来源于某大学附属医院的乳腺癌病例。乳腺癌病理图像资料主要由医院病理科提供,这些资料涵盖了患者接受手术或活检后的乳腺组织切片显微镜图像,包括常规的HE染色和相关免疫组化染色,用以观察肿瘤细胞的形态学特征和生物学标志物表达情况。此外,病理图像包含丰富的细胞微观信息,如细胞大小、形状、排列方式和病变情况等,这对病理学家进行疾病诊断和分析非常重要。这些乳腺癌病理图像资料为乳腺癌研究提供了宝贵资源。通过应用深度学习等先进技术,为乳腺癌的诊断和治疗提供更多帮助。The pathological images used in the experiment were derived from breast cancer cases in a university hospital. Breast cancer pathological image data are mainly provided by the hospital's pathology department. These data cover microscope images of breast tissue sections after surgery or biopsy, including conventional HE staining and related immunohistochemical staining, which are used to observe the morphological characteristics of tumor cells and the expression of biological markers. In addition, pathological images contain rich cellular microscopic information, such as cell size, shape, arrangement, and lesion conditions, which is very important for pathologists to diagnose and analyze diseases. These breast cancer pathological image data provide valuable resources for breast cancer research. By applying advanced technologies such as deep learning, more help can be provided for the diagnosis and treatment of breast cancer.

2、图像采集2. Image acquisition

本实施例获得的病例图像来源于某大学附属医院2015-2022年收治的乳腺癌手术病例。共计获取切片图像525张,所有图像均经过数字扫描得到KFB格式的高清数字影像,每张图像的大小都是100MB以上,图像像素都是10000pixel×10000pixel以上。The case images obtained in this embodiment are from breast cancer surgery cases admitted to a university affiliated hospital from 2015 to 2022. A total of 525 slice images were obtained, all of which were digitally scanned to obtain high-definition digital images in KFB format. The size of each image is more than 100MB, and the image pixels are all more than 10000 pixels × 10000 pixels.

图像采集是指从乳腺癌组织切片中获取显微镜图像。首先,从患者体内获取受影响的乳腺组织。然后,将这些组织制备成薄片并进行染色,如常规的苏木素-伊红(HE)染色和免疫组化染色,以便观察肿瘤细胞的形态和生物学标志物表达情况。接着,使用显微镜扫描这些染色切片并捕捉高分辨率的图像,这些图像将用于后续的进一步分析。Image acquisition refers to obtaining microscopic images from breast cancer tissue sections. First, affected breast tissue is obtained from the patient. Then, these tissues are prepared into thin slices and stained, such as conventional hematoxylin-eosin (HE) staining and immunohistochemical staining, to observe the morphology of tumor cells and the expression of biological markers. Next, these stained sections are scanned using a microscope and high-resolution images are captured, which will be used for further analysis.

3、模型构建3. Model construction

本实施例针对乳腺癌病理图片的特点,选择EfficientNet作为基础网络模型。EfficientNet网络模型无论是效果、参数量还是速度均大幅度超越之前的网络。此网络模型的主要设计采用了复合模型,复合型网络如图2所示。In view of the characteristics of breast cancer pathology images, this embodiment selects EfficientNet as the basic network model. The EfficientNet network model significantly surpasses the previous network in terms of effect, parameter quantity and speed. The main design of this network model adopts a composite model, and the composite network is shown in Figure 2.

图2中的复合型网络结构同时考虑了网络的三个维度(深度,宽度,分辨率)。深度指的是模型的深度,即网络的层数,网络越深,感受野越大,提取的特征语义越强;宽度指的是网络特征维度大小(即通道数),特征维度越大,模型的表征能力越强;分辨率指的是网络的输入图像大小,即高乘宽(H*W),输入图像分辨率越大,越有利于提取更细粒度特征。深度和宽度影响网络模型的参数大小和速度,但是分辨率只影响模型速度,因为分辨率越大,计算量越大。本实施例中的EfficientNet复合网络模型是在传统模型的基础上同时增加网络的宽度、深度以及网络的输入分辨率,并通过网络宽度、深度和分辨率的均衡缩放,实现与其他网络相比更高的精度和效率。The composite network structure in Figure 2 takes into account the three dimensions of the network (depth, width, and resolution) at the same time. Depth refers to the depth of the model, that is, the number of layers of the network. The deeper the network, the larger the receptive field, and the stronger the extracted feature semantics; width refers to the size of the network feature dimension (that is, the number of channels). The larger the feature dimension, the stronger the representation ability of the model; resolution refers to the input image size of the network, that is, height times width (H*W). The larger the input image resolution, the more conducive it is to extract finer-grained features. Depth and width affect the parameter size and speed of the network model, but resolution only affects the model speed, because the larger the resolution, the greater the amount of calculation. The EfficientNet composite network model in this embodiment increases the width, depth, and input resolution of the network on the basis of the traditional model, and achieves higher accuracy and efficiency than other networks through balanced scaling of network width, depth, and resolution.

虽然增加网络的深度能够提取更加丰富、复杂的高级语义特征,但是网络的深度过深会面临梯度消失及训练困难等问题。增加网络的宽度能够获得更高细粒度的特征,且也更容易训练,但是对于宽度很大、深度较浅的网络很难学习到更深层次的特征。增加输入网络的图像分辨率能够获得更高细粒度的特征模版,图像分辨率越高能看到的细节就越多,能提升分辨能力,但是对于非常高的输入分辨率,准确率的增益也会减少,且大分辨率图像会增加网络的计算量。所以不能只强调三个维度中的某一个维度,需要在三个维度之间取得平衡。Although increasing the depth of the network can extract richer and more complex high-level semantic features, too deep a network will face problems such as gradient vanishing and difficulty in training. Increasing the width of the network can obtain more fine-grained features and is easier to train, but it is difficult for a network with a large width and shallow depth to learn deeper features. Increasing the image resolution of the input network can obtain more fine-grained feature templates. The higher the image resolution, the more details can be seen, which can improve the resolution ability. However, for very high input resolutions, the accuracy gain will also decrease, and large-resolution images will increase the amount of computation for the network. Therefore, we cannot emphasize only one of the three dimensions, but need to strike a balance between the three dimensions.

因此,针对输入图像较大的特点,本实施例以EfficientNet模型为基础,增加网络层数、增大通道数量和参数数量对网络结构进行优化,经过权衡之后得到改进型的EfficientNet-B0网络模型,其结构如图3所示,包括:包括依次相连的主干网络、第一模块、Block1、Block2、Block3、Block4、Block5、第二模块和输出层;具体地:Therefore, in view of the large input image, this embodiment is based on the EfficientNet model, increases the number of network layers, increases the number of channels and the number of parameters to optimize the network structure, and obtains an improved EfficientNet-B0 network model after weighing the pros and cons. Its structure is shown in FIG3 , including: a backbone network, a first module, Block1, Block2, Block3, Block4, Block5, a second module and an output layer connected in sequence; specifically:

EfficientNet-B0网络模型的第一层即主干网络,通道数为32,包括依次连接的输入层、第一缩放层、归一化层、第一零填充层、第一二维卷积层、第一批归一化层和第一激活函数层;其中,卷积层的卷积核大小为3×3,分辨率为224×224(高×宽);The first layer of the EfficientNet-B0 network model is the backbone network, which has 32 channels and includes the input layer, the first scaling layer, the normalization layer, the first zero-filling layer, the first two-dimensional convolution layer, the first batch of normalization layers, and the first activation function layer. The convolution kernel size of the convolution layer is 3×3, and the resolution is 224×224 (height×width).

EfficientNet-B0网络模型的第二层即第一模块,通道数为16,包括依次连接的第一深度可分离卷积层、第二批归一化层和第二激活函数层;其中,卷积层的卷积核大小为k3×3,分辨率为112×112(高×宽);The second layer of the EfficientNet-B0 network model, i.e. the first module, has 16 channels and includes the first depthwise separable convolutional layer, the second batch normalization layer, and the second activation function layer connected in sequence; the convolution kernel size of the convolutional layer is k3×3, and the resolution is 112×112 (height×width);

EfficientNet-B0网络模型的第三层即Block1,通道数为24,包括依次连接的第二模块、第三模块和第一叠加层,其中第二模块还与第一叠加层连接;第二模块包括依次连接的第二深度可分离卷积层、第三批归一化层、第三激活函数层、第二零填充层、第三深度可分离卷积层、第四批归一化层和第四激活函数层;第三模块包括全局平均池化层、第二缩放层、第二二维卷积层和第三二维卷积层,其中,卷积层的卷积核大小为k3×3,分辨率为112×112(高×宽);The third layer of the EfficientNet-B0 network model is Block1, which has 24 channels and includes a second module, a third module and a first stacking layer connected in sequence, wherein the second module is also connected to the first stacking layer; the second module includes a second depth-separable convolution layer, a third batch normalization layer, a third activation function layer, a second zero-filling layer, a third depth-separable convolution layer, a fourth batch normalization layer and a fourth activation function layer connected in sequence; the third module includes a global average pooling layer, a second scaling layer, a second two-dimensional convolution layer and a third two-dimensional convolution layer, wherein the convolution kernel size of the convolution layer is k3×3 and the resolution is 112×112 (height×width);

EfficientNet-B0网络模型的第四层即Block2,通道数为40,包括依次连接的第二模块、第三模块和第二叠加层,Block1中的第一叠加层分别与Block2中的第二模块、第二叠加层连接;其中,卷积层的卷积核大小为k5×5,分辨率为56×56(高×宽);The fourth layer of the EfficientNet-B0 network model is Block2, which has 40 channels and includes the second module, the third module, and the second stacking layer connected in sequence. The first stacking layer in Block1 is connected to the second module and the second stacking layer in Block2 respectively. The convolution kernel size of the convolution layer is k5×5, and the resolution is 56×56 (height×width).

EfficientNet-B0网络模型的第五层即Block3,通道数为80,包括依次连接的第二模块、第三模块、第三叠加层、第三模块和第四叠加层,Block2中的第二叠加层分别与Block3中的第二模块、第三叠加层连接,第三叠加层与第四叠加层连接;其中,卷积层的卷积核大小为k3×3,分辨率为28×28(高×宽);The fifth layer of the EfficientNet-B0 network model is Block3, which has 80 channels and includes the second module, the third module, the third stacked layer, the third module and the fourth stacked layer connected in sequence. The second stacked layer in Block2 is connected to the second module and the third stacked layer in Block3 respectively, and the third stacked layer is connected to the fourth stacked layer. The convolution kernel size of the convolution layer is k3×3, and the resolution is 28×28 (height×width).

EfficientNet-B0网络模型的第六层即Block4,通道数为112,包括依次连接的第二模块、第三模块、第五叠加层、第三模块和第六叠加层,Block3中的第四叠加层分别与Block4中的第二模块、第五叠加层、第六叠加层连接;其中,卷积层的卷积核大小为k5×5,分辨率为14×14(高×宽);The sixth layer of the EfficientNet-B0 network model is Block4, which has 112 channels and includes the second module, the third module, the fifth stacking layer, the third module and the sixth stacking layer connected in sequence. The fourth stacking layer in Block3 is connected to the second module, the fifth stacking layer and the sixth stacking layer in Block4 respectively; the convolution kernel size of the convolution layer is k5×5, and the resolution is 14×14 (height×width);

EfficientNet-B0网络模型的的第七层即Block5,通道数为192,包括依次连接的第二模块、第三模块、第七叠加层、第三模块、第八叠加层、第九叠加层、第三模块和第十叠加层,Block4中的第六叠加层分别与Block5中的第二模块、第七叠加层、第八叠加层、第九叠加层、第十叠加层连接。其中,卷积层的卷积核大小为k5×5,分辨率为14×14(高×宽);The seventh layer of the EfficientNet-B0 network model is Block5, which has 192 channels and includes the second module, the third module, the seventh superposition layer, the third module, the eighth superposition layer, the ninth superposition layer, the third module and the tenth superposition layer connected in sequence. The sixth superposition layer in Block4 is connected to the second module, the seventh superposition layer, the eighth superposition layer, the ninth superposition layer and the tenth superposition layer in Block5 respectively. Among them, the convolution kernel size of the convolution layer is k5×5, and the resolution is 14×14 (height×width);

EfficientNet-B0网络模型的第八层即第二模块,通道数为320,包括依次连接的第二深度可分离卷积层、第三批归一化层、第三激活函数层、第二零填充层、第三深度可分离卷积层、第四批归一化层和第四激活函数层;其中,卷积层的卷积核大小为k3×3,分辨率为7×7(高×宽);The eighth layer of the EfficientNet-B0 network model, i.e. the second module, has 320 channels and includes the second depthwise separable convolutional layer, the third batch normalization layer, the third activation function layer, the second zero-filling layer, the third depthwise separable convolutional layer, the fourth batch normalization layer, and the fourth activation function layer, which are connected in sequence; the convolution kernel size of the convolutional layer is k3×3, and the resolution is 7×7 (height×width);

EfficientNet-B0网络模型的第九层即输出层,通道数为1280,包含1×1的卷积操作内核,分辨率为7×7(高×宽)。The ninth layer of the EfficientNet-B0 network model is the output layer, which has 1280 channels, contains a 1×1 convolution operation kernel, and has a resolution of 7×7 (height×width).

根据以上结构可以看出EfficientNet-B0在网络单元、结构设计、正则化方法等多个方面进行了优化,性能和效率相比传统网络有较大提升,是目前效率和精度均较高的模型结构,为后续训练做好了准备。According to the above structure, it can be seen that EfficientNet-B0 has been optimized in many aspects such as network units, structural design, and regularization methods. Its performance and efficiency have been greatly improved compared to traditional networks. It is currently a model structure with high efficiency and accuracy, and is ready for subsequent training.

4、模型训练4. Model training

(1)训练数据集(1) Training Dataset

数据集来源是从公开数据集TCGA库中下载病理图片作为训练数据集。The source of the dataset is pathological images downloaded from the public dataset TCGA library as a training dataset.

(2)损失函数(2) Loss Function

本实施例的主要研究目的是区分乳腺癌病理图像中的上皮细胞和间质细胞,因此,使用二值交叉熵损失函数(Binary Crossentropy)作为损失函数。The main research purpose of this embodiment is to distinguish epithelial cells and stromal cells in breast cancer pathology images. Therefore, a binary cross entropy loss function is used as a loss function.

二值交叉熵损失函数适用于二分类问题,其中每个样本只有两个可能的类别。在本实施例中,上皮细胞和间质细胞可以视为两个类别,将数据标签进行二值化,将上皮细胞标记为1,间质细胞标记为0。The binary cross entropy loss function is suitable for binary classification problems, where each sample has only two possible categories. In this embodiment, epithelial cells and mesenchymal cells can be regarded as two categories, and the data labels are binarized, with epithelial cells marked as 1 and mesenchymal cells marked as 0.

二值交叉熵损失函数的计算公式如下:The calculation formula of the binary cross entropy loss function is as follows:

Loss(p,y)=-[y*log(p)+(1-y)*log(1-p)];Loss(p,y)=-[y*log(p)+(1-y)*log(1-p)];

其中,y是真实标签(二值化后的标签,取值0或1),p是模型的预测概率,取值范围是[0,1],log是取自然对数。Among them, y is the true label (the label after binarization, the value is 0 or 1), p is the predicted probability of the model, the value range is [0,1], and log is the natural logarithm.

针对一个批次的训练样本,损失函数的计算为:For a batch of training samples, the loss function is calculated as:

Loss(p,y)=-1/Q*∑(yj*log(pj)+(1-yj)*log(1-pj));Loss(p,y)=-1/Q*∑(yj*log(pj)+(1-yj)*log(1-pj));

其中,Q是该批次中的样本数,j表示第j个样本。当样本为正样本(y=1)时,损失函数会关注p的大小,使p尽可能接近1。当样本为负样本(y=0)时,损失函数会关注1-p的大小,使1-p尽可能接近1。这样通过最小化损失函数,可以使模型的预测概率p尽可能匹配真实标签y。损失函数的计算结果越小,表示模型的预测结果与真实标签越接近,模型的性能越好,能够更好地区分乳腺癌病理图像中的上皮细胞和间质细胞。Where Q is the number of samples in the batch, and j represents the jth sample. When the sample is a positive sample (y=1), the loss function focuses on the size of p, making p as close to 1 as possible. When the sample is a negative sample (y=0), the loss function focuses on the size of 1-p, making 1-p as close to 1 as possible. In this way, by minimizing the loss function, the model's predicted probability p can match the true label y as much as possible. The smaller the calculated result of the loss function, the closer the model's predicted result is to the true label, the better the performance of the model, and the better it can distinguish epithelial cells and stromal cells in breast cancer pathology images.

(3)优化算法与参数设置(3) Optimization algorithm and parameter setting

由于本实施例使用的模型具有大量参数,并且需要在训练过程中快速收敛和优化性能,根据Adam算法的特点,选择Adam算法是一个合理的选择。Since the model used in this embodiment has a large number of parameters and needs to converge quickly and optimize performance during the training process, according to the characteristics of the Adam algorithm, choosing the Adam algorithm is a reasonable choice.

Adam算法适用于具有大量参数的深度学习模型。它能够自适应地调整学习率,同时结合了动量的概念,可以提高模型的收敛速度和稳定性。其自适应的特点使其不容易陷入局部最优,而动量机制也加速了训练过程。The Adam algorithm is suitable for deep learning models with a large number of parameters. It can adaptively adjust the learning rate and combine the concept of momentum to improve the convergence speed and stability of the model. Its adaptive characteristics make it less likely to fall into local optimality, and the momentum mechanism also accelerates the training process.

Adam优化算法的主要思想是通过计算梯度的一阶矩估计(均值)和二阶矩估计(方差),来自适应地调整每个参数的学习率。通过自适应学习率的调整,Adam能够在不同参数上应用不同的学习率,以提高收敛速度和稳定性。The main idea of the Adam optimization algorithm is to adaptively adjust the learning rate of each parameter by calculating the first-order moment estimate (mean) and second-order moment estimate (variance) of the gradient. By adjusting the adaptive learning rate, Adam can apply different learning rates to different parameters to improve convergence speed and stability.

Adam算法的更新公式如下:The update formula of the Adam algorithm is as follows:

其中,m为梯度的一阶矩估计(均值),v为梯度的二阶矩估计(方差),g为当前的梯度,θ为模型的参数。α为学习率,本实施例中取值0.001。β1和β2为控制一阶矩和二阶矩衰减率的超参数,本实施例中分别取值为0.9和0.999。ε是一个很小的常数用于数值稳定性,取值为10-8。Adam算法通过计算梯度的一阶和二阶矩估计来更新参数,一阶矩估计相当于动量法中的动量项,二阶矩估计相当于自适应学习率的调整,这使得Adam算法能够在不同的参数上应用不同的学习率,从而更好地适应不同参数的梯度特性。此外,在训练模型时还设定了批量大小为256,L1正则化,迭代次数取1000。具体的设置会根据实际情况进行调整和优化,通过实验和验证来选择最佳的参数组合。Wherein, m is the first-order moment estimate (mean) of the gradient, v is the second-order moment estimate (variance) of the gradient, g is the current gradient, and θ is the parameter of the model. α is the learning rate, which is 0.001 in this embodiment. β 1 and β 2 are hyperparameters for controlling the decay rate of the first-order moment and the second-order moment, which are 0.9 and 0.999 respectively in this embodiment. ε is a very small constant for numerical stability, which is 10 -8 . The Adam algorithm updates the parameters by calculating the first-order and second-order moment estimates of the gradient. The first-order moment estimate is equivalent to the momentum term in the momentum method, and the second-order moment estimate is equivalent to the adjustment of the adaptive learning rate, which enables the Adam algorithm to apply different learning rates to different parameters, so as to better adapt to the gradient characteristics of different parameters. In addition, the batch size is set to 256, L1 regularization, and the number of iterations is 1000 when training the model. The specific settings will be adjusted and optimized according to the actual situation, and the best parameter combination will be selected through experiments and verification.

5、图像预测5. Image Prediction

预测数据集来源是从某大学附属医院收集的525张病理图像。The prediction dataset comes from 525 pathological images collected from a university affiliated hospital.

预处理:预处理是在对图像进行深入分析之前对其进行一定程度的处理,以减小噪声、消除非相关信息并增强图像特征。Preprocessing: Preprocessing is a certain degree of processing of the image before in-depth analysis to reduce noise, eliminate irrelevant information and enhance image features.

①格式转换:将采集到的图像文件转换为适合计算机处理的格式,由于本实施例获取的KFB文件不适合计算机处理,所以需要进行文件格式转换。先将KFB文件格式转换为SVS文件格式,转换后的SVS文件格式适合计算机处理。① Format conversion: The collected image file is converted into a format suitable for computer processing. Since the KFB file obtained in this embodiment is not suitable for computer processing, file format conversion is required. First, the KFB file format is converted into the SVS file format. The converted SVS file format is suitable for computer processing.

②图像增强:本实施例中实现图像数据增强的主要步骤包括:图像读取和数据增强,如:调整到统一尺寸;根据参数随机产生旋转角度、平移距离等变换参数;根据填充模式对图像边缘进行处理;根据变换参数对图像像素值矩阵进行仿射变换;对图像执行随机翻转或缩放操作;标准化处理图像像素值;返回变换后的图像批次和标签给模型训练。通过在每次迭代中对部分样本进行随机变换,可以有效增加训练数据量,提升模型泛化能力,避免过拟合,实现了高效的图像数据增强。② Image enhancement: The main steps to achieve image data enhancement in this embodiment include: image reading and data enhancement, such as: adjusting to a uniform size; randomly generating transformation parameters such as rotation angle and translation distance according to parameters; processing image edges according to the filling mode; performing affine transformation on the image pixel value matrix according to the transformation parameters; performing random flipping or scaling operations on the image; standardizing the image pixel values; returning the transformed image batches and labels to the model training. By randomly transforming some samples in each iteration, the amount of training data can be effectively increased, the generalization ability of the model can be improved, overfitting can be avoided, and efficient image data enhancement can be achieved.

③预测EM组织分型:由于本实施例中的原始图像都很大,因此需要将图像中的感兴趣区域与背景进行分割,移除无关的信息,保留仅包含肿瘤细胞和周围正常组织的区域。本实施例中实现EM组织分型的主要步骤是:将原始图像按照指定的切片大小和重叠大小划分为多个重叠的切片;计算每个切片内非白色像素点的数量,判断是否满足非白像素阈值。如果满足,则认为该切片包含有效信息,需要进行后续处理。利用改进型的EfficientNet-B0网络模型对满足条件的每个切片进行预测。将预测结果平均后累加到分割结果矩阵中。同时累加掩码矩阵,再记录每个像素被处理的次数。最后将分割结果矩阵除以掩码矩阵,实现了结果的平均,并将分割结果保存为图片输出。通过将图像划分为重叠的小切片,然后对每个切片独立预测后再叠加结果,实现了基于切片的EM组织分型,这种方法可以很好地处理大型医学图像。③ Predict EM tissue typing: Since the original images in this embodiment are very large, it is necessary to segment the region of interest in the image from the background, remove irrelevant information, and retain the area containing only tumor cells and surrounding normal tissues. The main steps for implementing EM tissue typing in this embodiment are: dividing the original image into multiple overlapping slices according to the specified slice size and overlap size; calculating the number of non-white pixels in each slice to determine whether the non-white pixel threshold is met. If it is met, it is considered that the slice contains valid information and needs to be processed later. The improved EfficientNet-B0 network model is used to predict each slice that meets the conditions. The prediction results are averaged and added to the segmentation result matrix. At the same time, the mask matrix is accumulated, and the number of times each pixel is processed is recorded. Finally, the segmentation result matrix is divided by the mask matrix to achieve the average of the results, and the segmentation results are saved as picture output. By dividing the image into overlapping small slices, and then independently predicting each slice and superimposing the results, slice-based EM tissue typing is achieved. This method can handle large medical images well.

经过EM组织分型后的图像将继续进行后续处理来进一步优化预测结果,如本实施例中使用的组织增强视融算法将预测的分割结果可视化,使分割结果更加直观,以便于人工检查和分析。The images after EM tissue typing will continue to be processed to further optimize the prediction results. For example, the tissue enhancement visual fusion algorithm used in this embodiment visualizes the predicted segmentation results, making the segmentation results more intuitive and convenient for manual inspection and analysis.

6、实验6. Experiment

(1)实验数据及实验设置(1) Experimental data and experimental settings

图4是实验所用的原始图像之一,从图4(a)中可以获取整体的图像信息以及完整的图像形状,图4(b)是局部放大后的细节图像,从中可以清楚观察到切片信息的病理区域。FIG4 is one of the original images used in the experiment. The overall image information and the complete image shape can be obtained from FIG4(a). FIG4(b) is a detail image after local magnification, from which the pathological area of the slice information can be clearly observed.

使用PyTorch V3.9进行实验,模型在Nvidia Tesla V100 GPU上进行训练。本实例使用EfficientNet-B0网络模型,优化器为Adam,学习率设为0.001,批次大小为256,训练过程中总共进行了10个epoch。损失函数为交叉熵损失函数。实验用的计算机性能:处理器为Intel(R)Core(TM)i5-8500 CPU@3.00GHz,RAM为8.00GB,64位操作系统,基于x64的处理器,Linux系统。The experiment was conducted using PyTorch V3.9, and the model was trained on an Nvidia Tesla V100 GPU. This example uses the EfficientNet-B0 network model, the optimizer is Adam, the learning rate is set to 0.001, the batch size is 256, and a total of 10 epochs are performed during the training process. The loss function is the cross entropy loss function. The computer performance used in the experiment: the processor is Intel(R) Core(TM) i5-8500 CPU@3.00GHz, the RAM is 8.00GB, the operating system is 64-bit, the processor is based on x64, and the Linux system.

(2)实验过程(2) Experimental process

实验用的原始病理图像是KFB文件,一种专门用于存储数字病理图像的文件格式,由于病理图像都是大尺寸,KFB格式支持存储这样的大尺寸图像,同时也支持RGB三通道颜色模式存储颜色病理图像。此外,KFB文件可以将图像分为多个等级或层次,每个等级的图像分辨率不同,这使得用户可以根据需要查看不同分辨率的图像。尽管KFB文件具有上述很多优点,但它的读取和处理需要依赖特定公司提供的特定软件,这限制了它的兼容性和便捷性,不便于后续用深度学习算法来识别KFB文件。因此,在本实验中优先将KFB文件转换为SVS文件。SVS文件不仅具备KFB文件的优点,而且更加开放和兼容,可以在各种不同的软件和环境中被方便地读取和处理。因此,相比KFB文件,SVS文件的开放性和兼容性是其主要优势,它可以被广泛地应用在各种病理图像分析的工作中,这也是本实验优先把KFB文件转换为SVS文件的原因。The original pathological images used in the experiment are KFB files, a file format specifically used to store digital pathological images. Since pathological images are large in size, the KFB format supports the storage of such large-size images, and also supports the storage of color pathological images in RGB three-channel color mode. In addition, KFB files can divide images into multiple levels or layers, and the image resolution of each level is different, which allows users to view images of different resolutions as needed. Although KFB files have many of the above advantages, their reading and processing require specific software provided by specific companies, which limits their compatibility and convenience, and is not convenient for subsequent deep learning algorithms to identify KFB files. Therefore, in this experiment, KFB files are preferentially converted to SVS files. SVS files not only have the advantages of KFB files, but are also more open and compatible, and can be easily read and processed in a variety of different software and environments. Therefore, compared with KFB files, the openness and compatibility of SVS files are their main advantages. It can be widely used in various pathological image analysis work, which is also the reason why KFB files are preferentially converted to SVS files in this experiment.

对变换后的每一个SVS图像文件进行一系列的图像处理操作。首先打开一个SVS图像文件,然后获取该图像文件的总尺寸,从图像中裁剪出一个感兴趣的区域,然后将裁剪出的图像转换为RGB格式并对其进行缩放,缩放到原来尺寸的一半;再获取缩放后的宽度和高度,将缩放后的图像转换数据类型存储起来,便于后续的处理。A series of image processing operations are performed on each transformed SVS image file. First, an SVS image file is opened, and then the total size of the image file is obtained, an area of interest is cropped from the image, and then the cropped image is converted to RGB format and scaled to half of the original size; then the scaled width and height are obtained, and the scaled image conversion data type is stored for subsequent processing.

接下来对图像进行滑动窗口处理,采用两个循环分别遍历图像的宽度和高度。对每个图像块,首先计算非白色像素数量。当非白色像素数大于阈值λ时,将该图像块依次进行翻转、旋转、归一化等变换后输入到训练好的图像分析模型进行预测,得到一个数组g1,表示每个变换后的图像的预测结果。然后再将g1中的预测结果进行加权平均得到最终的归一化预测结果g2,这样可以消除图像块重叠部分被多次处理的影响,使得模型的预测结果更加准确。接下来把g2中归一化的值缩放到0(黑色)到255(白色)的范围,在该范围内的图像则视为有效图像(若g2>255则会被视为噪声而舍弃),再将有效图像数组经过转换和大小调整得到新的图像如图5所示,即完成将SVS图像文件转换成PNG文件。Next, the image is processed by sliding window, and two loops are used to traverse the width and height of the image respectively. For each image block, the number of non-white pixels is first calculated. When the number of non-white pixels is greater than the threshold λ, the image block is successively flipped, rotated, normalized, and other transformations are input into the trained image analysis model for prediction, and an array g 1 is obtained, which represents the prediction results of each transformed image. Then the prediction results in g 1 are weighted averaged to obtain the final normalized prediction result g 2 , which can eliminate the influence of multiple processing of the overlapping parts of the image blocks, making the prediction results of the model more accurate. Next, the normalized value in g 2 is scaled to the range of 0 (black) to 255 (white), and the image within this range is regarded as a valid image (if g 2 >255, it will be regarded as noise and discarded), and then the valid image array is converted and resized to obtain a new image as shown in Figure 5, that is, the conversion of the SVS image file into a PNG file is completed.

图5中的灰度图像是由图4中的原始图像变化而来。在获得该图像的过程中使用了下采样滤镜,当需要缩小图像时,使用这种滤镜可以得到更好的结果,因为它会对图像进行抗锯齿处理,即消除或减少图像缩小后可能出现的锯齿状的边缘。图5中的图像就是需要的上皮组织的图像,通过对比这两幅图像可以发现不但形状相似,且有效的提取了上皮组织细胞。从这两幅图像的对比中可以说明,本实施例的神经网络模型和一系列图像处理方法能精确的从原始图像中得到上皮组织图像,这为早期发现和诊断乳腺疾病提供了可靠的数据支持。Grayscale image in Fig. 5 is changed from the original image in Fig. 4. Downsampling filter was used in the process of obtaining the image. When the image needs to be reduced, better results can be obtained by using this filter, because it can carry out anti-aliasing to the image, i.e., eliminate or reduce the jagged edges that may appear after the image is reduced. Image in Fig. 5 is exactly the image of the epithelial tissue needed. By comparing these two images, it can be found that not only the shapes are similar, but also the epithelial tissue cells are effectively extracted. From the comparison of these two images, it can be explained that the neural network model of the present embodiment and a series of image processing methods can accurately obtain the epithelial tissue image from the original image, which provides reliable data support for early detection and diagnosis of breast diseases.

接下来对图5进行反转操作,对图像中的每个像素进行反转,即将每个像素的颜色值从亮变暗,从暗变亮,这样操作可以达到视觉效果增强、特征提取和数据增强等作用。在灰度模式下,黑色将变为白色,白色将变为黑色,这样就可以得到与图5相反的新图像图6。Next, we perform an inversion operation on Figure 5, inverting each pixel in the image, that is, changing the color value of each pixel from bright to dark and from dark to bright, so that we can achieve visual enhancement, feature extraction, and data enhancement. In grayscale mode, black will become white and white will become black, so that we can get a new image Figure 6 that is the opposite of Figure 5.

图6就是我们得到的与原始图像相对应的间充质图像,再比较图6和图4可以发现,它们的图像不但形状几乎一致,更说明了图6是从图4中提取的间充质组织。从这两幅图像的对比中进一步证实了本实施例的网络模型、算法及数据处理方法能精确的从原始图像中提取间充质图像,这为早期发现和准确诊断乳腺疾病提供了可靠的数据支持。FIG6 is the mesenchymal image corresponding to the original image. By comparing FIG6 with FIG4, it can be found that not only are their images almost identical in shape, but also FIG6 is the mesenchymal tissue extracted from FIG4. The comparison of the two images further confirms that the network model, algorithm and data processing method of the present embodiment can accurately extract the mesenchymal image from the original image, which provides reliable data support for early detection and accurate diagnosis of breast diseases.

为了获得更高质量的间充质图像,本实验中对图6做颜色转换的进一步处理,具体的处理逻辑是将白色像素(R、G、B通道的值都为255)且透明度大于等于128的像素转换为黑色,其他颜色的像素保持不变,这样可以将原始图像中的暗色区域转换为亮色区域,从而更好地提取目标物体或特定区域,进一步处理后获得新图像如图7所示。通过对比图7和图6可发现,图7中可以更清楚地观察到图像中的特征和细节,能突出显示原始图像中的边缘、轮廓或其他特征。在后续的图像处理任务中,有助于将图像中的前景目标与背景进行分离,更易根据图像的亮度差异来提取目标物体。这对于图像分割、目标检测等任务中的特征提取、形状分析和后续处理非常有用。In order to obtain a higher quality mesenchymal image, Figure 6 is further processed by color conversion in this experiment. The specific processing logic is to convert white pixels (the values of the R, G, and B channels are all 255) and the pixels with transparency greater than or equal to 128 into black, and the pixels of other colors remain unchanged. In this way, the dark area in the original image can be converted into a bright area, so as to better extract the target object or specific area. After further processing, the new image is obtained as shown in Figure 7. By comparing Figure 7 with Figure 6, it can be found that the features and details in the image can be more clearly observed in Figure 7, and the edges, contours or other features in the original image can be highlighted. In subsequent image processing tasks, it helps to separate the foreground target from the background in the image, and it is easier to extract the target object based on the brightness difference of the image. This is very useful for feature extraction, shape analysis and subsequent processing in tasks such as image segmentation and target detection.

(3)实验评估(3) Experimental evaluation

为了评估实验效果,本实施例中用两种方法进行实验评估。第一种方法是用组织增强视融算法来评估效果,第二种方法是通过综合灰度阈值智能判定算法来评估效果。下面分别介绍这两种评估方法。In order to evaluate the experimental effect, two methods are used in this embodiment for experimental evaluation. The first method is to evaluate the effect by using a tissue enhancement visual fusion algorithm, and the second method is to evaluate the effect by using a comprehensive gray threshold intelligent judgment algorithm. The following introduces these two evaluation methods respectively.

方法1:组织增强视融算法Method 1: Tissue Enhanced Visual Fusion Algorithm

在实际的医疗诊断中,灰度图像不利于观察,因此为了便于观察者更好地理解和解析原始图像的特定特征,使得这种特征能够在原始图像中被直观地看到,将灰度的PNG热力图图像转化为透明的彩色覆盖层图像,再将这个彩色覆盖层图像与原SVS全图像融合,生成一个可视化的热力图新图像。热力图可以用来高亮显示SVS图像的特定区域,这样可以更直观地观察和分析数据的特征、趋势和异常。In actual medical diagnosis, grayscale images are not conducive to observation. Therefore, in order to facilitate the observer to better understand and analyze the specific features of the original image, so that such features can be intuitively seen in the original image, the grayscale PNG thermal map image is converted into a transparent color overlay image, and then the color overlay image is fused with the original SVS full image to generate a new visual thermal map image. The thermal map can be used to highlight specific areas of the SVS image, so that the characteristics, trends and anomalies of the data can be more intuitively observed and analyzed.

第一步:读取SVS图像,获取SVS图像数据,本实施例中使用的SVS文件是由KFB文件转换而来,包含大量的生物组织信息;Step 1: Read the SVS image and obtain SVS image data. The SVS file used in this embodiment is converted from the KFB file and contains a large amount of biological tissue information;

第二步:读取PNG图像,调整大小匹配SVS图像,将其大小调整为与SVS图像相同是为了在后续能够将两者进行有效的融合;Step 2: Read the PNG image and resize it to match the SVS image. The purpose of resizing it to the same size as the SVS image is to be able to effectively fuse the two later.

第三步:应用高斯滤波器平滑PNG图像,可以使热力图更加平滑,高斯滤波可以用来减少图像的噪声和细节,使图像更加平滑,避免在最后的融合图像中出现锐利的边缘;Step 3: Applying a Gaussian filter to smooth the PNG image can make the heat map smoother. Gaussian filtering can be used to reduce the noise and details of the image, making the image smoother and avoiding sharp edges in the final fused image.

第四步:将平滑后的PNG图像值映射到彩色空间,得到彩色的热力图,可以使得热力图的信息更加直观和易于理解;Step 4: Map the smoothed PNG image values to the color space to obtain a color heat map, which can make the information of the heat map more intuitive and easy to understand;

第五步:应用颜色阈值并创建掩码,这个步骤是为了将热力图中的黑色背景去除,只保留有用的信息。在融合时,背景部分就不会对SVS图像产生影响,只有有用的热力图信息才会显示在SVS图像上;Step 5: Apply color threshold and create mask. This step is to remove the black background in the heat map and keep only useful information. When fusion is performed, the background will not affect the SVS image, and only useful heat map information will be displayed on the SVS image.

第六步:融合图像并保存结果,这一步是将处理后的热力图和SVS图像按预设比例融合,生成最终的可视化热力覆盖图像,新的可视化热力图如图8所示。Step 6: Fuse images and save results. This step is to fuse the processed heat map and SVS image according to the preset ratio to generate the final visualized thermal overlay image. The new visualized heat map is shown in Figure 8.

热力图是一种通过颜色变化来表示数据的大小或者密度的可视化方法。比较原始图像图4和热力图像图8,可以发现图4中难以直观观察的特征在图8中以直观的方式展现出来,使得观察者可以更好地理解和诊断疾病。图8的图像中同时包含了SVS图像的原始信息和热力图的特征信息,通过色彩的深浅可以快速地看出数据的分布、集中和变化情况。同时,热力图还可以将数据中的高值或低值区域突显出来,快速找到数据的关键区域或者异常点。A heat map is a visualization method that uses color changes to represent the size or density of data. Comparing the original image Figure 4 and the heat map Figure 8, it can be found that the features that are difficult to observe intuitively in Figure 4 are presented in an intuitive way in Figure 8, allowing the observer to better understand and diagnose the disease. The image in Figure 8 contains both the original information of the SVS image and the characteristic information of the heat map. The distribution, concentration, and changes of the data can be quickly seen through the depth of color. At the same time, the heat map can also highlight the high-value or low-value areas in the data, and quickly find the key areas or abnormal points of the data.

因此,本实施例中利用组织增强视融算法生成的热力图代表了原始图像中特定特征的分布(例如细胞的密度、疾病的严重程度等),使得原本难以直观观察的特征以直观的方式展现出来,使得观察者可以更好地理解和分析原始图像,为疾病的诊断提供数据支持,是本技术方案中的巨大贡献。Therefore, the heat map generated by the tissue-enhanced visual fusion algorithm in this embodiment represents the distribution of specific features in the original image (such as cell density, severity of the disease, etc.), so that features that were originally difficult to observe intuitively are displayed in an intuitive manner, allowing observers to better understand and analyze the original image, providing data support for the diagnosis of the disease, which is a great contribution of this technical solution.

方法2:综合灰度阈值智能判定算法Method 2: Comprehensive grayscale threshold intelligent judgment algorithm

本实施例提取了乳腺癌病理图片中的量化特征,主要用以下两个比例特征分别表示每副PNG图像中的上皮组织面积或间质组织面积所占总组织区域面积的比例,这两个比率的计算公式分别为:This embodiment extracts quantitative features from breast cancer pathology images, mainly using the following two ratio features to represent the ratio of the epithelial tissue area or the interstitial tissue area in each PNG image to the total tissue area. The calculation formulas for these two ratios are:

式中,表示第i副图像中上皮组织面积和总区域面积的比例,Total_sum(i)表示第i副图像中的上皮组织像素点数量,Total_area(i)表示第i副图像中总的像素点数量;设有N副图像,则i的取值范围:1≤i≤N;In the formula, It represents the ratio of epithelial tissue area to total area in the i-th image, Total_sum(i) represents the number of epithelial tissue pixels in the i-th image, and Total_area(i) represents the total number of pixels in the i-th image. If there are N images, the value range of i is: 1≤i≤N;

Rmk表示第k副图像中间充质组织面积和总区域面积的比例,Total_area_1(k)表示第k副图像中的总的像素点数量,Total_sum_1(k)表示第k副图像中的间充质组织像素点数量;设有M副图像,则k的取值范围:1≤k≤M。R mk represents the ratio of the mesenchymal tissue area to the total area in the kth image, Total_area_1(k) represents the total number of pixels in the kth image, and Total_sum_1(k) represents the number of mesenchymal tissue pixels in the kth image. If there are M images, the value range of k is: 1≤k≤M.

第一步:读取PNG图像;Step 1: Read the PNG image;

第二步:计算PNG图像所有像素的总和(`Total_sum`或Total_sum_1);Step 2: Calculate the sum of all pixels of the PNG image (`Total_sum` or Total_sum_1);

第三步:计算PNG图像的面积(`Total_area`),即图像的宽度乘以高度;Step 3: Calculate the area of the PNG image (`Total_area`), which is the width of the image multiplied by the height;

第四步:计算PNG图像中像素值大于等于1的像素总数和占据的面积;Step 4: Calculate the total number of pixels with pixel values greater than or equal to 1 and the area they occupy in the PNG image;

第五步:将这些计算结果保存到excel表中(如表1和表2所示),并根据以上公式分别计算比例本实施例中一共计算了56张图片数据,获得了28个有效的数据和28个有效的数据;Step 5: Save these calculation results in Excel tables (as shown in Table 1 and Table 2), and calculate the proportions according to the above formulas and In this embodiment, a total of 56 image data were calculated, and 28 valid Data and 28 valid data;

第六步:设置一个比例阈值r,将与该阈值进行比较,若则Xi=1,否则Xi=0;同样,若则Yk=1,否则Yk=0;Step 6: Set a ratio threshold r. Compared with the threshold, if Then Xi = 1, otherwise Xi = 0; similarly, if Then Y k =1, otherwise Y k =0;

第七步:按下式分别计算取1数量的比例,并保存Le和LmStep 7: Calculate according to the following formula and Take the ratio of the quantity 1 and save Le and Lm :

表1实验获得的28个上皮组织面积和总区域面积的比例数据Table 1 The ratio data of 28 epithelial tissue areas and total area obtained in the experiment

表2实验获得的28个间充质组织面积和总区域面积的比例数据Table 2 The ratio of the area of 28 mesenchymal tissues to the total area obtained in the experiment

在综合灰度阈值智能判定算法中,Le取值越高说明对上皮组织的识别越准确,Lm取值越高说明对间质组织的识别越准确,希望Le和Lm均取值愈高愈好,但通常Le和Lm之间无法同时取得最高值,它们之间实际上是相互矛盾的,即一项提高取值,另一项取值就会降低,而我们又希望获得最佳识别性能,就需要取得Le和Lm之间的最佳均衡。因此,本实施例中为取得Le和Lm之间的最佳均衡,采用遗传算法选取最佳阈值r。In the comprehensive gray threshold intelligent judgment algorithm, the higher the Le value, the more accurate the recognition of epithelial tissue, and the higher the Lm value, the more accurate the recognition of interstitial tissue. It is hoped that the higher the Le and Lm values are, the better. However, usually, Le and Lm cannot simultaneously obtain the highest value. In fact, they are contradictory to each other, that is, if one value is increased, the other value will be reduced. However, if we want to obtain the best recognition performance, we need to obtain the best balance between Le and Lm . Therefore, in this embodiment, in order to obtain the best balance between Le and Lm , a genetic algorithm is used to select the optimal threshold r.

利用遗传算法的主要原因是它适用于优化问题,特别是在参数优化和组合优化方面,遗传算法能提供有效的解决方案,而本实施例中复杂的、多参数的问题尤其适用遗传算法来求解。The main reason for using genetic algorithms is that they are suitable for optimization problems, especially in parameter optimization and combinatorial optimization. Genetic algorithms can provide effective solutions. In this embodiment, complex, multi-parameter problems are particularly suitable for genetic algorithms to solve.

经过遗传算法的计算之后,得到最佳阈值r=0.0336,计算获得此阈值下的Le=0.8548,Lm=0.8125。取得的实验结果说明本技术方案中的方法能平衡Le和Lm,且上皮组织和间质组织的识别率均超过了80%,这证明了本发明中的模型和方法具有卓越的性能,远超出其它已有方法。After calculation by genetic algorithm, the optimal threshold value r = 0.0336 was obtained, and Le = 0.8548 and Lm = 0.8125 were calculated under this threshold value. The experimental results obtained show that the method in the technical solution can balance Le and Lm , and the recognition rates of epithelial tissue and interstitial tissue are both over 80%, which proves that the model and method in the present invention have excellent performance, far exceeding other existing methods.

为了更早地发现乳腺癌以及其发病风险,本发明提出了一种创新的深度神经网络算法,专门用于分析乳腺癌医学图像,这一算法的核心功能是能够精确地从病理图像中区分出上皮组织和间质组织,从而为早期诊断提供了关键的数据支持。In order to detect breast cancer and its risk of disease earlier, the present invention proposes an innovative deep neural network algorithm specifically for analyzing breast cancer medical images. The core function of this algorithm is to accurately distinguish epithelial tissue and stromal tissue from pathological images, thereby providing key data support for early diagnosis.

在经过一系列实验测试后,本发明中的模型和方法成功生成了清晰的上皮组织和间充质组织图像,并在热力图中呈现出良好的可视化效果。定量评估的结果显示,本实施例中的模型在上皮组织和间质组织的识别准确率方面分别达到了0.8548和0.8125。这一成果不仅展示了网络模型的高效性和处理方法的有效性,而且为乳腺癌的早期检测和准确诊断提供了重要的技术支持。After a series of experimental tests, the model and method of the present invention successfully generated clear images of epithelial tissue and mesenchymal tissue, and presented good visualization effects in the thermal map. The results of quantitative evaluation showed that the model in this embodiment achieved 0.8548 and 0.8125 in the recognition accuracy of epithelial tissue and mesenchymal tissue, respectively. This achievement not only demonstrates the efficiency of the network model and the effectiveness of the processing method, but also provides important technical support for the early detection and accurate diagnosis of breast cancer.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1.一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,包括以下步骤:1. A breast cancer pathology image analysis method based on deep learning, characterized in that it comprises the following steps: 构建改进型的EfficientNet-B0网络模型并通过公开的乳腺癌临床样本数据集进行模型优化,直至损失函数收敛,得到训练好的图像分析模型;Build an improved EfficientNet-B0 network model and optimize the model using a public breast cancer clinical sample dataset until the loss function converges to obtain a trained image analysis model; 利用训练好的图像分析模型对待识别的乳腺癌病理图像进行分析,生成清晰的上皮组织图像和间充质组织图像。The trained image analysis model is used to analyze the breast cancer pathology images to be identified and generate clear epithelial tissue images and mesenchymal tissue images. 2.根据权利要求1所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,所述的公开的乳腺癌临床样本数据集采用TCGA数据集。2. According to the deep learning-based breast cancer pathology image analysis method of claim 1, it is characterized in that the public breast cancer clinical sample dataset adopts the TCGA dataset. 3.根据权利要求1所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,所述的改进型的EfficientNet-B0网络模型以EfficientNet模型为基础,通过增加网络层数、增大通道数量和参数数量进行网络结构优化,包括依次相连的主干网络、第一模块、Block1、Block2、Block3、Block4、Block5、第二模块和输出层;3. According to claim 1, a method for analyzing breast cancer pathology images based on deep learning is characterized in that the improved EfficientNet-B0 network model is based on the EfficientNet model, and the network structure is optimized by increasing the number of network layers, the number of channels and the number of parameters, including a backbone network, a first module, Block1, Block2, Block3, Block4, Block5, a second module and an output layer connected in sequence; 主干网络包括依次连接的输入层、第一缩放层、归一化层、第一零填充层、第一二维卷积层、第一批归一化层和第一激活函数层;The backbone network includes an input layer, a first scaling layer, a normalization layer, a first zero-filling layer, a first two-dimensional convolutional layer, a first batch of normalization layers, and a first activation function layer connected in sequence; Block1包括依次连接的第二模块、第三模块和第一叠加层,其中第二模块还与第一叠加层连接;Block1 includes a second module, a third module and a first stacking layer connected in sequence, wherein the second module is also connected to the first stacking layer; Block2包括依次连接的第二模块、第三模块和第二叠加层,Block1中的第一叠加层分别与Block2中的第二模块、第二叠加层连接;Block2 includes a second module, a third module and a second stacking layer connected in sequence, and the first stacking layer in Block1 is connected to the second module and the second stacking layer in Block2 respectively; Block3包括依次连接的第二模块、第三模块、第三叠加层、第三模块和第四叠加层,Block2中的第二叠加层分别与Block3中的第二模块、第三叠加层连接,第三叠加层与第四叠加层连接;Block3 includes a second module, a third module, a third stacking layer, a third module and a fourth stacking layer connected in sequence, the second stacking layer in Block2 is connected to the second module and the third stacking layer in Block3 respectively, and the third stacking layer is connected to the fourth stacking layer; Block4包括依次连接的第二模块、第三模块、第五叠加层、第三模块和第六叠加层,Block3中的第四叠加层分别与Block4中的第二模块、第五叠加层、第六叠加层连接;Block4 includes a second module, a third module, a fifth superimposed layer, a third module and a sixth superimposed layer connected in sequence, and the fourth superimposed layer in Block3 is connected to the second module, the fifth superimposed layer and the sixth superimposed layer in Block4 respectively; Block5包括依次连接的第二模块、第三模块、第七叠加层、第三模块、第八叠加层、第九叠加层、第三模块和第十叠加层,Block4中的第六叠加层分别与Block5中的第二模块、第七叠加层、第八叠加层、第九叠加层、第十叠加层连接。Block5 includes a second module, a third module, a seventh superimposed layer, a third module, an eighth superimposed layer, a ninth superimposed layer, a third module and a tenth superimposed layer connected in sequence, and the sixth superimposed layer in Block4 is respectively connected to the second module, the seventh superimposed layer, the eighth superimposed layer, the ninth superimposed layer and the tenth superimposed layer in Block5. 4.根据权利要求3所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,第一模块包括依次连接的第一深度可分离卷积层、第二批归一化层和第二激活函数层。4. A breast cancer pathology image analysis method based on deep learning according to claim 3, characterized in that the first module includes a first depth-separable convolutional layer, a second batch normalization layer and a second activation function layer connected in sequence. 5.根据权利要求4所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,第二模块包括依次连接的第二深度可分离卷积层、第三批归一化层、第三激活函数层、第二零填充层、第三深度可分离卷积层、第四批归一化层和第四激活函数层。5. According to a deep learning-based breast cancer pathology image analysis method according to claim 4, it is characterized in that the second module includes a second depth-separable convolutional layer, a third batch normalization layer, a third activation function layer, a second zero-filling layer, a third depth-separable convolutional layer, a fourth batch normalization layer and a fourth activation function layer connected in sequence. 6.根据权利要求5所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,第三模块包括全局平均池化层、第二缩放层、第二二维卷积层和第三二维卷积层。6. A breast cancer pathology image analysis method based on deep learning according to claim 5, characterized in that the third module includes a global average pooling layer, a second scaling layer, a second two-dimensional convolutional layer and a third two-dimensional convolutional layer. 7.根据权利要求1-6任意一项所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,模型优化采用Adam算法,损失函数为二值交叉熵损失函数。7. A breast cancer pathology image analysis method based on deep learning according to any one of claims 1-6, characterized in that the model optimization adopts the Adam algorithm and the loss function is a binary cross entropy loss function. 8.根据权利要求1所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,利用训练好的图像分析模型对待识别的乳腺癌病理图像进行分析,具体如下:8. The method for analyzing breast cancer pathology images based on deep learning according to claim 1 is characterized in that the breast cancer pathology images to be identified are analyzed using a trained image analysis model, specifically as follows: 首先将待识别的乳腺癌病理图像从KFB文件格式转换为SVS文件格式,将裁剪得到的图像转换为RGB格式并缩放到原来尺寸的一半,获取缩放后的宽度和高度并存储缩放后的图像转换数据类型;对缩放图像进行滑动窗口处理,用两个循环分别遍历缩放图像的宽度和高度;计算每个图像块内非白色像素点的数量,判断是否满足非白像素阈值,当非白色像素数大于阈值λ时,将该图像块依次进行翻转、旋转、归一化变换后输入到训练好的图像分析模型进行预测,得到一个数组g1,表示每个变换后的图像块的预测结果;然后再将g1中的预测结果进行加权平均并累加到数组相应的位置上,同时通过累加掩码矩阵记录每个像素被处理的次数,将每个像素的预测结果除以该像素被处理的次数,得到最终的归一化预测结果g2;接下来把g2中归一化的值缩放到0到255的范围,在该范围内的图像视为有效图像,若g2>255则会被视为噪声而舍弃;再将有效图像数组转换为图像I1,并将图像I1转换为灰度图像I2,即完成将SVS图像文件转换成PNG文件;所述的PNG文件包括清晰的上皮组织图像和间充质组织图像。First, the breast cancer pathology image to be identified is converted from the KFB file format to the SVS file format, the cropped image is converted to the RGB format and scaled to half of the original size, the scaled width and height are obtained and the scaled image conversion data type is stored; the scaled image is processed by sliding windows, and the width and height of the scaled image are traversed by two loops respectively; the number of non-white pixels in each image block is calculated to determine whether the non-white pixel threshold is met. When the number of non-white pixels is greater than the threshold λ, the image block is flipped, rotated, and normalized in turn and input into the trained image analysis model for prediction to obtain an array g1 , which represents the prediction result of each transformed image block; then the prediction results in g1 are weighted averaged and accumulated to the corresponding position of the array, and the number of times each pixel is processed is recorded by accumulating the mask matrix, and the prediction result of each pixel is divided by the number of times the pixel is processed to obtain the final normalized prediction result g2 ; next, the normalized value in g2 is scaled to the range of 0 to 255, and the image within this range is regarded as a valid image. If g2 >255 will be regarded as noise and discarded; then the effective image array is converted into image I 1 , and image I 1 is converted into grayscale image I 2 , thus completing the conversion of the SVS image file into a PNG file; the PNG file includes clear epithelial tissue images and mesenchymal tissue images. 9.根据权利要求8所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,所述方法还包括:采用组织增强视融算法生成可视化热力覆盖图像,具体包括以下步骤:9. A method for analyzing breast cancer pathology images based on deep learning according to claim 8, characterized in that the method further comprises: using a tissue enhancement visual fusion algorithm to generate a visualized thermal overlay image, specifically comprising the following steps: 读取SVS图像文件,获取SVS图像数据;Read SVS image file and obtain SVS image data; 读取PNG文件,并将PNG图像大小调整为与SVS图像相同;Read the PNG file and resize the PNG image to be the same as the SVS image; 采用高斯滤波器,平滑PNG图像;Use Gaussian filter to smooth PNG images; 将平滑后的PNG图像值映射到彩色空间,得到彩色的热力图;Map the smoothed PNG image values to the color space to obtain a color heat map; 应用颜色阈值并创建掩码,将热力图中的黑色背景去除;Apply color thresholding and create a mask to remove the black background from the heat map; 将处理后的热力图和SVS图像按预设比例融合,生成最终的可视化热力覆盖图像。The processed thermal map and SVS image are fused at a preset ratio to generate the final visualized thermal coverage image. 10.根据权利要求8所述的一种基于深度学习的乳腺癌病理图像分析方法,其特征在于,所述方法还包括采用综合灰度阈值智能判定算法对图像分析结果进行评估,具体包括以下步骤:10. A breast cancer pathology image analysis method based on deep learning according to claim 8, characterized in that the method further comprises evaluating the image analysis results using a comprehensive grayscale threshold intelligent judgment algorithm, specifically comprising the following steps: 计算PNG图像所有像素的总和;Calculate the sum of all pixels of a PNG image; 计算PNG图像的面积,即图像的宽度乘以高度;Calculate the area of the PNG image, which is the width multiplied by the height of the image; 计算PNG图像中像素值大于等于1的像素总数和占据的面积;Calculate the total number of pixels with pixel values greater than or equal to 1 and the area they occupy in the PNG image; 计算每幅PNG图像中的上皮组织面积或间质组织面积所占总组织区域面积的比例 Calculate the ratio of epithelial tissue area or interstitial tissue area to the total tissue area in each PNG image and 式中,表示第i副图像中上皮组织面积和总区域面积的比例,Total_sum(i)表示第i副图像中的上皮组织像素点数量,Total_area(i)表示第i副图像中总的像素点数量;设有N副图像,则i的取值范围:1≤i≤N;In the formula, It represents the ratio of epithelial tissue area to total area in the i-th image, Total_sum(i) represents the number of epithelial tissue pixels in the i-th image, and Total_area(i) represents the total number of pixels in the i-th image. If there are N images, the value range of i is: 1≤i≤N; 表示第k副图像中间充质组织面积和总区域面积的比例,Total_area_1(k)表示第k副图像中的总的像素点数量,Total_sum_1(k)表示第k副图像中的间充质组织像素点数量;设有M副图像,则k的取值范围:1≤k≤M; represents the ratio of the mesenchymal tissue area to the total area in the kth image, Total_area_1(k) represents the total number of pixels in the kth image, and Total_sum_1(k) represents the number of mesenchymal tissue pixels in the kth image. If there are M images, the value range of k is: 1≤k≤M; 设置一个比例阈值r,将与比例阈值r进行比较,若则Xi=1,否则Xi=0;同样,若则Yk=1,否则Yk=0;Set a ratio threshold r, Compared with the ratio threshold r, if Then Xi = 1, otherwise Xi = 0; similarly, if Then Y k =1, otherwise Y k =0; 分别计算取1数量的比例,并保存为Le和LmCalculate separately and Take the ratio of the quantities 1 and save them as L e and L m :
CN202410228084.8A 2024-02-29 2024-02-29 A breast cancer pathology image analysis method based on deep learning Pending CN118247224A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410228084.8A CN118247224A (en) 2024-02-29 2024-02-29 A breast cancer pathology image analysis method based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410228084.8A CN118247224A (en) 2024-02-29 2024-02-29 A breast cancer pathology image analysis method based on deep learning

Publications (1)

Publication Number Publication Date
CN118247224A true CN118247224A (en) 2024-06-25

Family

ID=91554745

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410228084.8A Pending CN118247224A (en) 2024-02-29 2024-02-29 A breast cancer pathology image analysis method based on deep learning

Country Status (1)

Country Link
CN (1) CN118247224A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118711838A (en) * 2024-08-30 2024-09-27 南昌大学第一附属医院 An online classification method and system for breast cancer based on artificial intelligence

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118711838A (en) * 2024-08-30 2024-09-27 南昌大学第一附属医院 An online classification method and system for breast cancer based on artificial intelligence

Similar Documents

Publication Publication Date Title
Wan et al. Robust nuclei segmentation in histopathology using ASPPU-Net and boundary refinement
CN112101451A (en) Breast cancer histopathology type classification method based on generation of confrontation network screening image blocks
CN116524226A (en) A device and method for breast cancer pathological image classification based on deep learning
Pan et al. Cell detection in pathology and microscopy images with multi-scale fully convolutional neural networks
Meng et al. A computationally virtual histological staining method to ovarian cancer tissue by deep generative adversarial networks
CN106056595A (en) Method for automatically identifying whether thyroid nodule is benign or malignant based on deep convolutional neural network
Dogar et al. Attention augmented distance regression and classification network for nuclei instance segmentation and type classification in histology images
Huang et al. Interpretable laryngeal tumor grading of histopathological images via depth domain adaptive network with integration gradient CAM and priori experience-guided attention
CN118762362B (en) Stem cell classification method and system based on image segmentation
CN115546605A (en) Training method and device based on image labeling and segmentation model
CN116884597A (en) Pathological image breast cancer molecular typing method and system based on self-supervision pre-training and multi-example learning
Yonekura et al. Improving the generalization of disease stage classification with deep CNN for glioma histopathological images
CN117670794A (en) TLS pathology detection method, device and medium based on deep learning
CN114445356A (en) Multi-resolution-based full-field pathological section image tumor rapid positioning method
CN118247224A (en) A breast cancer pathology image analysis method based on deep learning
Zhao et al. CoADS: Cross attention based dual-space graph network for survival prediction of lung cancer using whole slide images
CN119693666A (en) Cancer grading prediction method, device, equipment and storage medium
Hasan et al. Real-time segmentation and classification of whole-slide images for tumor biomarker scoring
CN119495422A (en) A machine vision detection method based on deep learning
CN119180838A (en) Breast cancer histological image segmentation and classification method based on multi-scale deep learning
Hemalatha et al. Self-supervised learning using diverse cell images for cervical cancer classification
Wang et al. A novel dataset and a two-stage deep learning method for breast cancer mitosis nuclei identification
Menaka et al. A Robust DL Approach for Detection of Invasive Ductal Carcinoma in Whole Slide Images using DenseNet169
Ahmed Real-time and accurate deep learning-based multi-organ nucleus segmentation in histology images
CN118072981A (en) A method for pathological staging and grading of chronic hepatitis B based on deep learning

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