当前位置:网站首页>AI+Medical: Using Neural Networks for Medical Image Recognition and Analysis
AI+Medical: Using Neural Networks for Medical Image Recognition and Analysis
2022-08-09 23:14:00 【51CTO】

作者: 韩信子@ ShowMeAI
计算机视觉实战系列: https://www.showmeai.tech/tutorials/46
Industry famous enterprise application series: https://www.showmeai.tech/tutorials/63
本文地址: https://www.showmeai.tech/article-detail/298
声明:版权所有,转载请联系平台与作者并注明出处
收藏 ShowMeAI查看更多精彩内容
深度学习+医疗科技
In recent years, the rapid development of artificial intelligence technology has been applied to various vertical fields,For example, applying deep learning to various medical diagnoses,The effect is significant and even surpasses that of human experts in some aspects.典型的 CV The latest technology has been applied to the classification of Alzheimer's disease、肺癌检测、In medical imaging tasks such as retinal disease detection.

图像分割
Image segmentation is the process of dividing images into different groups according to their content,It locates objects and boundaries in an image.Semantic segmentation is pixel-level recognition,Our typical applications in many fields,The technical support behind it is image segmentation algorithm,比如:医学影像、Unmanned driving area detection、背景虚化等.


The basics of deep learning covered in this article,and detailed knowledge of computer vision,推荐大家阅读 ShowMeAI的教程专栏:
Semantic segmentation canonical network U-Net
U-Net is a convolutional network architecture,用于快速、Precisely segment biomedical images.
A comparison of the principles and advantages and disadvantages of various algorithms for semantic segmentation(包括U-Net), ShowMeAI in past articles 深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet) There are detailed explanations.
U-Net 的结构如下图所示:

在 U-Net 中,Like all other convolutional neural networks,It consists of layers like convolution and max pooling.
- U-Net 简单地将编码器的特征图拼接至每个阶段解码器的上采样特征图,从而形成一个梯形结构.该网络非常类似于 Ladder Network 类型的架构.
- 通过跳跃
拼接连接的架构,在每个阶段都允许解码器学习在编码器池化中丢失的相关特征. - 上采样采用转置卷积.
使用 U-Net Perform lung image segmentation

The dataset we use here is Montgomery County X Radiology datasets. The dataset consists of various types of lungs X Radiographic images and each X Image composition of the segmented images of the left and right lungs of the ray.You can also pass directlyShowMeAIThe Baidu network disk link to download this dataset.
实战数据集下载(百度网盘):公众号『ShowMeAI研究中心』回复『实战』,或者点击 这里 获取本文 [10] Lung medical image recognition and analysis using neural networks 『masked montgomery county x-ray set Pulmonary medical imaging dataset』
ShowMeAI官方GitHub: https://github.com/ShowMeAI-Hub

① Tool library import&环境设置
First import the tool library we used this time.
② 数据读取
Next we finish the data reading part,The content read here includes images and masks(mask,That is, a label of the same size as the image).We will adjust the dimension size,in order to be able to act U-Net 的输入.
③ 数据切分
We want to effectively evaluate the performance of the model,So next we do data partitioning,We divide all data into training set、验证集和测试集.具体代码如下:
④ TensorFlow IO准备
我们会使用到 TensorFlow Train and estimate,我们用 TensorFlow 读取 numpy array 格式的数据,转为 TensorFlow 的 tensor 形式,And build convenience to batch Morphology read and trained dataset 格式.
⑤ U-Net 网络构建
下面我们构建 U-Net 网络.
⑥ Evaluation criteria and loss functions
We target semantic segmentation scenarios,Write evaluation criteria IoU 的计算方式,并构建 Dice Loss Loss function for more targeted training and learning under semantic segmentation of medical scenes.
关于IoU、mIoUOther evaluation criteria can be viewed ShowMeAI的文章 深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet) 做更多了解.
关于Dice LossThe interpretation of the loss function is as follows:
Dice 系数
根据 Lee Raymond Dice 命名,是一种集合相似度度量函数,通常用于计算两个样本的相似度(值范围为 ):
表示 和 之间的交集; 和 分别表示 和 的元素个数.其中,分子中的系数 ,是因为分母存在重复计算 和 之间的共同元素的原因.
针对,For the semantic segmentation problem, Standard answer for segmented images GT, Predict labels for segmented images Pred.
Dice Coefficient difference function(Dice loss)
The code implementation of the evaluation criteria and loss function is as follows:
⑦ Hyperparameter setting and model compilation
Next before starting model training,Let's hammer out some hyperparameters first,如下:
- 批次大型
batch size = 2 - 学习率
learning rate= 1e-5 - 迭代轮次
epoch = 30
我们使用 Adam 优化器进行训练,The evaluation metrics used include Dice 系数、IoU、召回率和精度.
可以使用model.summaryView model structure information and parameter quantities:
结果如下图所示(部分内容截图,All model information is longer):

⑧ 回调函数&模型训练
We set the model storage related settings in the callback function,学习率调整策略等,Then train on the dataset.
The intermediate information of the training part is shown in the figure below.

while training the model over 30 个 epoch 后,保存的模型(The validation loss is 0.10216)The relevant evaluation index results are as follows:
dice coef:0.9148iou:0.8441recall:0.9865precision:0.9781val_loss:0.1022val_dice_coef: 0.9002val_iou:0.8198val_recall:0.9629val_precision:0.9577
⑨ Model loading and new data estimation
We can reload the model we just saved into memory,And make an estimate on the unseen test data set,代码如下:
Partial results visualization:
下面为2The original images of the test samples、original mask(标准答案)and the combined image of the prediction mask:
The input image for the test case(左侧)、Original mask label(中间)、预测掩码(右侧)

参考资料
- 实战数据集下载(百度网盘):公众号『ShowMeAI研究中心』回复『实战』,或者点击 这里 获取本文 [10] Lung medical image recognition and analysis using neural networks 『masked montgomery county x-ray set Pulmonary medical imaging dataset』
- ShowMeAI官方GitHub: https://github.com/ShowMeAI-Hub
- 深度学习教程:吴恩达专项课程 · 全套笔记解读: https://www.showmeai.tech/tutorials/35
- 深度学习与计算机视觉教程:斯坦福CS231n · 全套笔记解读: https://www.showmeai.tech/tutorials/37
- 深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet): https://www.showmeai.tech/article-detail/273

边栏推荐
- Word第一页不要页眉怎么设置?设置Word首页不要页眉方法教程
- Leetcode 93 IP addresses
- Deceptive Dice(期望计算)
- random.normal() and random.truncated_normal() in TF
- Don't use array.length-1 to get the last item of the array
- Usage of placeholder function in Tensorflow
- LeetCode26: remove duplicates in sorted array
- Unity_平滑移动
- 必看设计干货|易知微设计师是怎么做标准可视化设计服务的?
- json事例
猜你喜欢

RHEL7系统修复rm -rf /boot /etc/fstab

APP自动化测试框架-UiAutomator2基础入门

编程时请选择正确的输入法,严格区分中英文

AI识万物:从0搭建和部署手语识别系统

windos安装Mysql8.0,及解决重新登录异常问题 ERROR 1045 (28000)

如何让您的公司内容满足 GDPR 合规性
6个规则去净化你的代码

4D Summary: 38 Knowledge Points of Distributed Systems

TF generates uniformly distributed tensor

Pagoda measurement - building LightPicture open source map bed system
随机推荐
C语言中的文件是什么?
论文解读(DropEdge)《DropEdge: Towards Deep Graph Convolutional Networks on Node Classification》
【stack】【queue】【priority_queue】【deque】Detailed explanation
TF generates uniformly distributed tensor
FS4066耐高压1到4节内置MOS的锂电池充电管理芯片
Tensorflow中使用convert_to_tensor去指定数据的类型
Word怎么设置图片衬于文字下方?两种方法教你设置Word图片衬于文字下方
mysql多表左链接查询
Shanghai Konan SmartRocket series product introduction (3): SmartRocket iVerifier computer interlocking system verification tool
Interpretation of the paper (DropEdge) "DropEdge: Towards Deep Graph Convolutional Networks on Node Classification"
Install Mysql8.0 on windos, and solve the problem of re-login exception ERROR 1045 (28000)
STC8H开发(十五): GPIO驱动Ci24R1无线模块
How to Make Your Company Content GDPR Compliant
random.normal() and random.truncated_normal() in TF
hdu 1333 Smith Numbers(暴力思路)
MySQL慢查询的多个原因
技术分享 | 接口自动化测试之JSON Schema模式该如何使用?
微软Excel表格点击单元格行和列都显示颜色怎么弄?聚光灯效果设置
[Graphic and textual] How to reinstall Win7 system
XXE-XML外部实体注入-知识点