[{"data":1,"prerenderedAt":210},["ShallowReactive",2],{"content-query-Wt5jZWHxvY":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":204,"_id":205,"_source":206,"_file":207,"_stem":208,"_extension":209},"/technology-blogs/zh/3414","zh",false,"","用AI助力医疗诊断：基于昇思MindSpore实现角膜溃疡类型识别","作者：谢好冉 昇思布道师","2024-10-09","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/11/28/6fcd8478af9849c8938bad94d8b5ee14.png","technology-blogs","实践",{"type":15,"children":16,"toc":199},"root",[17,25,44,49,63,71,79,84,92,97,102,109,114,124,129,138,145,150,155,162,167,174,179,186,194],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"用ai助力医疗诊断基于昇思mindspore实现角膜溃疡类型识别",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29,31,37,39],{"type":24,"value":30},"**作者：**",{"type":18,"tag":32,"props":33,"children":34},"strong",{},[35],{"type":24,"value":36},"谢好冉",{"type":24,"value":38}," ",{"type":18,"tag":32,"props":40,"children":41},{},[42],{"type":24,"value":43},"昇思布道师",{"type":18,"tag":26,"props":45,"children":46},{},[47],{"type":24,"value":48},"由于各种电子产品的大量使用，现如今近视的群体不断扩大，向着低龄化发展，由于未成年人正处于身体发育期，所以近视度数增长较快，市场上除了框架眼镜，还有角膜接触镜，而对于角膜接触镜佩戴者，会有角膜溃疡的发生风险。本次案例将基于昇思MindSpore AI框架来对角膜溃疡的类型进行识别，根据荧光素染色后表现的形状分为点状、点片混合和片状角膜溃疡。",{"type":18,"tag":26,"props":50,"children":51},{},[52,54],{"type":24,"value":53},"项目代码：",{"type":18,"tag":55,"props":56,"children":60},"a",{"href":57,"rel":58},"https://xihe.mindspore.cn/projects/G%5C_washington/mindspore%5C_corn",[59],"nofollow",[61],{"type":24,"value":62},"https://xihe.mindspore.cn/projects/G\\_washington/mindspore\\_corn",{"type":18,"tag":26,"props":64,"children":65},{},[66],{"type":18,"tag":32,"props":67,"children":68},{},[69],{"type":24,"value":70},"案例实践",{"type":18,"tag":26,"props":72,"children":73},{},[74],{"type":18,"tag":32,"props":75,"children":76},{},[77],{"type":24,"value":78},"1、神经网络模型介绍：ResNet50",{"type":18,"tag":26,"props":80,"children":81},{},[82],{"type":24,"value":83},"本次案例使用的是ResNet50，该模型是2015年由微软实验室的何恺明提出，在该网络模型提出之前，传统的神经网络随着网络层数的不断叠加，出现了网络退化问题，而残差网络提出的残差网络结构(Residual Network)，主要就是用来减轻退化问题。",{"type":18,"tag":26,"props":85,"children":86},{},[87],{"type":18,"tag":88,"props":89,"children":91},"img",{"alt":7,"src":90},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/11/8cdd9a0679bf4e7d9075fa2f551f2ced.png",[],{"type":18,"tag":26,"props":93,"children":94},{},[95],{"type":24,"value":96},"ResNet系列的网络结构",{"type":18,"tag":26,"props":98,"children":99},{},[100],{"type":24,"value":101},"残差网络结构由两个分支构成：一个主分支，一个shortcuts（图中弧线表示）。主分支通过堆叠一系列的卷积操作得到，shotcuts从输入直接到输出，主分支输出的特征矩阵$F(x)$加上shortcuts输出的特征矩阵$x$得到$F(x)+x$，通过Relu激活函数后即为残差网络最后的输出。该残差网络结构主要由两种，一种是Building Block，适用于较浅的ResNet网络；另一种是Bottleneck，适用于层数较深的ResNet网络。",{"type":18,"tag":26,"props":103,"children":104},{},[105],{"type":18,"tag":88,"props":106,"children":108},{"alt":7,"src":107},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/11/8ef6bc44582649ea9d4727bdb84a9c10.png",[],{"type":18,"tag":26,"props":110,"children":111},{},[112],{"type":24,"value":113},"残差网络结构",{"type":18,"tag":115,"props":116,"children":118},"h2",{"id":117},"_2案例简介",[119],{"type":18,"tag":32,"props":120,"children":121},{},[122],{"type":24,"value":123},"2、案例简介",{"type":18,"tag":26,"props":125,"children":126},{},[127],{"type":24,"value":128},"首先要导入mindspore模块库，需要用到dataset、vision和download。",{"type":18,"tag":26,"props":130,"children":131},{},[132,136],{"type":18,"tag":88,"props":133,"children":135},{"alt":7,"src":134},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/11/9e25fefec5664bd5b35cc5ea8f004f7c.png",[],{"type":24,"value":137}," 设置超参，包括学习率，动量、训练批次、训练周期数等等。",{"type":18,"tag":26,"props":139,"children":140},{},[141],{"type":18,"tag":88,"props":142,"children":144},{"alt":7,"src":143},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/11/2dbe2c7f3dc549ad800f200caed09ec6.png",[],{"type":18,"tag":26,"props":146,"children":147},{},[148],{"type":24,"value":149},"数据集是自己构建的，官方并没有直接的接口加载，需要将数据集创建为树状结构，然后使用dataset.ImageFolderDataset接口来加载数据集，MindSpore框架采用dataset.transforms接口来进行数据增强，可以进行各种数据处理操作。",{"type":18,"tag":26,"props":151,"children":152},{},[153],{"type":24,"value":154},"ResNet50使用的残差结构是Bottleneck，该结构使用的参数数量更少，该结构的主分支有三层卷积结构，分别为1*1的卷积层、3*3卷积层和1*1的卷积层，其中1*1的卷积层分别起降维和升维的作用。",{"type":18,"tag":26,"props":156,"children":157},{},[158],{"type":18,"tag":88,"props":159,"children":161},{"alt":7,"src":160},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/11/dfab451e4b7c41a8bcbf2135e01ab74a.png",[],{"type":18,"tag":26,"props":163,"children":164},{},[165],{"type":24,"value":166},"重写ResNet类的init和construct函数，将各种结构和层级堆积在一起，构成resnet50网络。",{"type":18,"tag":26,"props":168,"children":169},{},[170],{"type":18,"tag":88,"props":171,"children":173},{"alt":7,"src":172},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/11/3a57551a30e6410699efbef4cd423f17.png",[],{"type":18,"tag":26,"props":175,"children":176},{},[177],{"type":24,"value":178},"模型训练结果如下:",{"type":18,"tag":26,"props":180,"children":181},{},[182],{"type":18,"tag":88,"props":183,"children":185},{"alt":7,"src":184},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/11/aa43cc5928b64c13b9e95687afcb7f3f.png",[],{"type":18,"tag":26,"props":187,"children":188},{},[189],{"type":18,"tag":32,"props":190,"children":191},{},[192],{"type":24,"value":193},"项目总结",{"type":18,"tag":26,"props":195,"children":196},{},[197],{"type":24,"value":198},"角膜溃疡的形状识别，能够帮助眼科医生做出初步的筛选，减轻工作量，更好的帮助医生做出诊断，其他用户可以在此基础上，进行优化，然后可以将分类更加的细化，也可以基于数据，将角膜溃疡进行其他的分类，做出更加准确的判断。",{"title":7,"searchDepth":200,"depth":200,"links":201},4,[202],{"id":117,"depth":203,"text":123},2,"markdown","content:technology-blogs:zh:3414.md","content","technology-blogs/zh/3414.md","technology-blogs/zh/3414","md",1776506129537]