肺腺癌基因19突变 预后

凯拉斯vs法泰 (Keras vs fastai)

Machine learning (ML) has the potential for numerous applications in the health care field. One promising application is in the area of anatomic pathology. ML allows representative images to be used to train a computer to recognize patterns from labeled photographs. Based on a set of images selected to represent a specific tissue or disease process, the computer can be trained to evaluate and recognize new and unique images from patients and render a diagnosis.

机器学习(ML)在医疗保健领域具有众多应用潜力。 一种有希望的应用是解剖病理学领域。 ML允许使用代表性图像训练计算机来识别带有标签的照片中的图案。 基于选择的代表特定组织或疾病过程的一组图像,可以训练计算机以评估和识别来自患者的新的独特图像并进行诊断。

Lung and colon adenocarcinoma are some of the most common cancers affecting numerous patients throughout the world. They frequently spread to other sites of the body. It is not uncommon that the pathologist is faced with the question if biopsy showing adenocarcinoma originated from lung or colon primary site. Pathologists are often forced to use special stains to help them make this determination. In this post, I used two different machine learning libraries (fastai and Keras) to solve the origin of metastatic adenocarcinoma.

肺癌和结肠腺癌是影响世界各地众多患者的最常见癌症。 它们经常扩散到身体的其他部位。 病理学家面临的问题是活检显示腺癌是否起源于肺部或结肠原发部位并不少见。 病理学家常常被迫使用特殊的污渍来帮助他们做出这一决定。 在本文中,我使用了两个不同的机器学习库(fastai和Keras)来解决转移性腺癌的起源。

For this project, I used an image dataset containing 5000 color images of lung adenocarcinoma and 5000 color images of colon adenocarcinoma from the LC25000 dataset, which is freely available for ML researchers. I created a data folder with two subfolders for each class, lung adenocarcinoma class, and colon adenocarcinoma class.

对于这个项目,我使用了一个图像数据集,其中包含来自LC25000数据集的5000例肺腺癌彩色图像和5000例结肠腺癌彩色图像,这对于ML研究人员是免费的。 我为每个类别(肺腺癌类别和结肠腺癌类别)创建了一个包含两个子文件夹的数据文件夹。

My goal was not only to solve the metastatic adenocarcinoma classification problem but also to compare two deep learning libraries : Keras and fastai.

我的目标是不仅要解决转移性腺癌分类问题也比较两个深度学习库: Keras和fastai 。

Both fastai and Keras are high-level APIs build on the top of PyTorch and TensorFlow, respectively. Keras was fully integrated into version 2 of TensorFlow.

fastai和Keras都是分别在PyTorch和TensorFlow之上构建的高级API。 Keras已完全集成到TensorFlow的版本2中。

Following seven coding steps were used to solve the problem of metastatic adenocarcinoma classification:

以下七个编码步骤用于解决转移性腺癌分类问题:

  1. Importing relevant libraries导入相关库
  2. Specifying the path to the data directory指定数据目录的路径
  3. Preparing batches of tensor image data for ML model为ML模型准备一批张量图像数据
  4. Visualizing samples of training images (optional)可视化训练图像样本(可选)
  5. Creating ML model创建ML模型
  6. Fitting ML model拟合ML模型
  7. Visualizing results with confusion matrix使用混淆矩阵可视化结果

The Jupyter Notebooks for this post are available on my GitHub website.

这篇文章的Jupyter Notebooks可在我的GitHub网站上找到。

Let us start with the fastai. The first step is to import relevant libraries.

让我们从fastai开始。 第一步是导入相关库。

Next, we specify the path to the directory with our images.

接下来,我们使用图像指定目录的路径。

We create ImageDataBuch object with following parameters: the path to the data directory, validation split (in our case we pick 20% of images for validation and 80% for training), augmentation (False in our case since the LC25000 images are already augmented), image size (299x299 pixels is the native size for ResNet50) and batch size (I found 48 to be a right batch size for my 11 GB 2080Ti video card running fastai ResNet50 code on my Linux machine).

我们使用以下参数创建ImageDataBuch对象:数据目录的路径,验证拆分(在我们的示例中,我们选择20%的图像进行验证,在80%的图像中进行训练),扩充(在我们的示例中为False,因为LC25000图像已经被扩充) ,图片大小(ResNet50的原始大小为299x299像素)和批处理大小(我发现我的Linux计算机上运行fastai ResNet50代码的11 GB 2080Ti视频卡的正确批处理大小为48)。

We visualize some of the images from the training batch with single line of code.

我们用单行代码可视化训练批次中的某些图像。

Here we create our ML model with the following parameters: data object, the model for transfer learning (ResNet50 in this case), and metrics (I pick the accuracy).

在这里,我们使用以下参数创建ML模型:数据对象,用于转移学习的模型(在这种情况下为ResNet50)和指标(我选择准确性)。

Fastai automatically freezes the ResNet50 classifier layer and replaces it with a fastai code. Below is the summary of the fastai classifier. The whole model has approximately 25 million trainable parameters.

Fastai自动冻结ResNet50分类器层,并将其替换为fastai代码。 以下是fastai分类器的摘要。 整个模型具有约2500万个可训练参数。

Next, we fit and train the model. After only five epochs our model achieved 100% training accuracy

接下来,我们拟合并训练模型。 仅经过5个时期,我们的模型即可达到100%的训练精度

With only two lines of code, we visualize the confusion matrix of the validation dataset.

仅用两行代码,我们就能看到验证数据集的混淆矩阵。

Next, let’s move to Keras code. We will use TensorFlow 2 as a backend. As you can see already, to achieve the same results as with fastai, we need many more lines of code. First we import relevant libraries.

接下来,让我们转到Keras代码。 我们将使用TensorFlow 2作为后端。 正如您已经看到的,要获得与fastai相同的结果,我们需要更多的代码行。 首先,我们导入相关的库。

We specify the path to our data directory.

我们指定数据目录的路径。

We create ImageDataGenerator object with two parameters: validation split (20% images for validation and 80% for training) and normalization of images. We create two data objects: one for training and one for validation. We specify image size, batch size (had to pick the batch size of 32, my video card could not handle 48 with tf.keras version of the classifier). Since we don’t want to shuffle our validation set, we set shuffle to False.

我们使用两个参数创建ImageDataGenerator对象:验证分割(验证时使用20%的图像,训练时使用80%的图像)和图像的标准化。 我们创建两个数据对象:一个用于训练,一个用于验证。 我们指定图像大小,批处理大小(必须选择32的批处理大小,我的视频卡使用tf.keras版本的分类器无法处理48)。 由于我们不想改组验证集,因此将shuffle设置为False。

We visualize some of the images from the training batch with the following lines of code.

我们使用以下代码行可视化训练批次中的某些图像。

We create our ML model. We freeze the classifier layer of the ResNet50 model and create our classifier (I tried to replicate the fastai classifier as much as I could; however, Keras does not have AdaptiveAvgPool2d layer, so I used global_max_pooling2d instead).

我们创建我们的ML模型。 我们冻结ResNet50模型的分类器层并创建我们的分类器(我尝试了尽可能多的复制fastai分类器;但是,Keras没有AdaptiveAvgPool2d层,所以我改用global_max_pooling2d)。

The whole model has approximately 25 million trainable parameters, just like fastai model.

就像fastai模型一样,整个模型具有大约2500万个可训练参数。

We compile, fit, and train the ML model. After five epochs, our Keras model achieved 98% training accuracy.

我们编译,拟合和训练ML模型。 经过五个纪元,我们的Keras模型达到了98%的训练准确性。

With few lines of code, we visualize the confusion matrix of the validation dataset.

用几行代码,我们就能看到验证数据集的混淆矩阵。

Conclusion

结论

After only five epochs of training, both models achieved high training accuracy. The fastai required fewer lines of code to accomplish the same goals. Although both deep learning libraries are great for new practitioners of machine learning craft, the fastai library is more straightforward and user friendly. The fastai library has a great community of users, and you can find just about any answer on users’ forums. Ultimately, it is a personal preference as to which deep learning library to use.

仅经过五个时期的训练,两个模型均达到了很高的训练精度。 Fastai需要更少的代码行来实现相同的目标。 尽管这两个深度学习库都非常适合机器学习新手,但fastai库更简单易用。 fastai库拥有大量的用户社区,您可以在用户论坛上找到几乎所有答案。 最终,对于使用哪个深度学习库,这是个人喜好。

Note: All fastai code is written in version 1 of the fastai library. Version 2 of the fastai library is officially being released today (8/24/2020).

注意:所有fastai代码均使用fastai库的版本1编写。 fastai库的第2版今天(2020年8月24日)正式发布。

Best wishes to everyone in these difficult times. Stay healthy and safe!Andrew @tampapath

在这些困难时期向所有人致以最良好的祝愿。 保持健康安全!Andrew @tampapath

翻译自: https://medium.com/swlh/metastatic-adenocarcinoma-classification-using-convolutional-neural-networks-49de90b4cb7b

肺腺癌基因19突变 预后


http://www.taodudu.cc/news/show-7072742.html

相关文章:

  • 期权价格计算
  • 天九共享:以独有模式,提升独角兽价值
  • 创建企业孵化器,看天九共享让优良项目脱颖而出
  • 多元生态布局,天九共享保障联营企业家收益
  • 天九共享联袂重庆小面打造独特餐饮模式
  • 大数据赋能!天九共享集团打造“抱团三部曲”
  • 天九共享:公益创新,为扶贫提供范本
  • 全球化战略!天九共享携手戈峻点亮国际版图
  • 天九共享集团:打造幸福企业领航者
  • 天九共享加持指尖生活派打造快递便民服务店
  • 天九共享赋能新基建项目,易保全区块链存证助力应用场景多点开花
  • 幸福企业!天九共享开辟全球最短工时
  • 天九共享戈峻分享如何从逆境中涅槃
  • 天九共享:厉行节约开展光盘行动
  • 天九共享戈峻:全球企业实现资源共享
  • 天九共享集团:员工是自成体系的生态
  • 天九共享集团:利用资源优势 赋能企业发展
  • 零基础学Java基础培训还是自学?
  • 零基础可以学Python吗?
  • 零基础学Java基础培训还是自学
  • 0基础学java可行吗_零基础可以学习JAVA吗?
  • 零基础学Java,有必要上培训班吗?
  • python零基础培训班多少钱
  • Can‘t load IA 32-bit .dll on a AMD 64-bit platform Tomcat启动报错的解决办法
  • -包机制-
  • 【包机制】
  • 包的机制
  • Java的包结构
  • Package包的理解
  • java包结构

肺腺癌基因19突变 预后_转移性腺癌的分类使用相关推荐

  1. IF:11+ 鳞癌基因标记预测肺腺癌患者的预后和免疫治疗的敏感性

    这期分享2022年1月发表在Genome Medicine(IF:11.117)的一篇文章通过对多个肺腺癌数据集进行分析,构建的2基因特征并确定L-score和S-score与肺腺癌患者预后和免疫治疗 ...

  2. 文献分享 | 神经突生成相关基因的突变诱发脑瘫发生风险 (IF: 38.3)

    时间:2020 刊物:Nature Genetics 题目:神经突生成相关基因的突变诱发脑瘫发生风险 作者:Sheng Chih Jin等,耶鲁大学医学院遗传学系 链接:https://www.nat ...

  3. 双基因突变患者_宁夏发现世界首例双基因突变病例 患者矮小

    如果你看过<纳尼亚传奇>,一定会对里面的矮人印象深刻.他们虽然个头不高,却踏实能干.忠诚可靠.在我们的生活中,也有这么一个"矮人家庭".这一家的两个孩子,老大虽然已经1 ...

  4. 双基因突变患者_一例 Kallmann 综合征患者双基因突变分析

    一例 Kallmann 综合征患者双基因突变分析 曹 曦 1 , 2 谢荣荣 1 , 2 信 中 1 杨金奎 1 , 2* [摘 要] [摘要] 目的 分析 Kallmann 综合征 (Kallman ...

  5. 数学建模_随机森林分类模型详解Python代码

    数学建模_随机森林分类模型详解Python代码 随机森林需要调整的参数有: (1) 决策树的个数 (2) 特征属性的个数 (3) 递归次数(即决策树的深度)''' from numpy import ...

  6. 新动态视频壁纸微信小程序源码_支持多种分类短视频-也有静态壁纸

    这是一款主打动态视频壁纸的一款微信小程序源码,当然啦,里面也是有静态壁纸的. 其实这款小程序也可以说是短视频小程序都可以,该款小程序全采集,另外支持多种流量主!! 下载链接: 新动态视频壁纸微信小程序 ...

  7. 双基因突变患者_双任务干预对携带LRRK2基因突变的帕金森病患者手灵活性的影响...

    双任务干预对携带LRRK2基因突变的帕金森病患者手灵活性的影响 目的:观察执行单.双任务时LRRK2(+)帕金森病(PD)患者手灵活性变化及双任务干预情况.方法:受试者总数为122例,PD患者46例纳 ...

  8. [19/04/02-星期二] IO技术_字符流分类总结(含字符转换流InputStreamReader/ OutputStreamWriter,实现字节转字符)...

    一.概念 ------->1.BufferedReader/BufferedWriter [参考19.03.31文章] *Reader/Writer-------->2.InputStre ...

  9. mysql8.0.19.0安装_一、MySQL8.0.19 安装教程

    1. 下载MySQL 8.0.19(免安装版) 预览图 下载首页.png image.png image.png 2. 解压到相应的目录 D:\APPMULU\mysql-8.0.19 3. 配置环境 ...

最新文章

  1. Fiddler抓取移动端请求
  2. 图像降噪算法——小波硬阈值滤波(下)
  3. 洛谷P2462 [SDOI2007]游戏(哈希+最长路)
  4. JavaScript 中的闭包和作用域链(读书笔记)
  5. 用Python的Tultle模块创建一个五角星
  6. 计算机重启是什么原因,电脑自动重启,该怎么办,到底是什么原因,我来详细说明?...
  7. DataGrid 导出 EXCEL(简单,实用)
  8. 部门质量管理工作模板
  9. C# CollectionBase,ICloneeable
  10. tomcat修改http长度限制_解决浏览器与服务器请求url长度限制
  11. Android6.0 camera个数探测
  12. 微信小程序怎么做店铺_微信小程序如何开通店铺
  13. RISC-V MCU将常量定义到指定的Flash地址
  14. Chapter 5 Eigenvalues and Eigenvectors
  15. 读iOS开发进阶有感
  16. webrequest、httpwebrequest、webclient、HttpClient 四个类的区别?
  17. java毕业设计短视频网站mybatis+源码+调试部署+系统+数据库+lw
  18. 目前投资区块链三大风险
  19. 血战Maven,各种问题,Eclipse控制台乱码,Maven打包时Javadoc失败-UTF-8-BOM编码
  20. 阿里云aliyun 的SLB 对 ECS的健康检查

热门文章

  1. 软考笔记七、无线通信网
  2. 2021年熔化焊接与热切割考试及熔化焊接与热切割考试试题
  3. 队列的链式存储实现(简单的入队和出队操作)
  4. MODNet matting
  5. mysql全备份批处理命令
  6. 移植要领与策略分析android porting chen,hostapd-0.3.7的移植(Porting hostapd-0.3.7 to arm linu...
  7. 利用Canvas添加水印
  8. HRMS(人力资源管理系统)-SaaS架构设计-概要设计实践
  9. [华为机试真题][2015]65.和尚挑水
  10. Mellanox Infiniband 架构设计快速实战指南 - B