前沿拓展:
matlab官方下載
網(wǎng)絡(luò)異常。
1、m負松atlab2022a是最新出的一款功能強大的專業(yè)的數(shù)學(xué)計算變
糖尿病性視網(wǎng)膜病變 (DR) 是導(dǎo)致失明的一大元兇,全世界有 9,300 萬人受此疾病困擾。DR 是一種與糖尿病有關(guān)的眼部疾病。在早期對 DR 進行檢測和分級有助于預(yù)防**性視力喪失。在視網(wǎng)膜病變篩查過程中進行自動檢測和分級,則有助于提供寶貴的第二診療意見。來自代頓大學(xué)研究院(UDRI))的 Barath Narayanan 博士將為我們介紹使用深度卷積神經(jīng)網(wǎng)絡(luò) (CNN) 來實現(xiàn)一種簡單的基于遷移學(xué)習(xí)的 DR 檢測方法。
作者:Barath Narayanan,代頓大學(xué)研究院 (UDRI)。
合著者:Russell C. Hardie 博士,代頓大學(xué) (UD)。
Barath Narayanan 博士畢業(yè)于代頓大學(xué) (UD),分別于 2013 年和 2017 年獲得理學(xué)碩士學(xué)位和電氣工程博士學(xué)位。他目前擔任 UDRI 軟件系統(tǒng)小組研究科學(xué)家,兼任代頓大學(xué) (UD) 電子和計算機工程 (ECE) 系客座教授。他的研究方向包括深度學(xué)習(xí)、機器學(xué)習(xí)、計算機視覺和模式識別。
數(shù)據(jù)集
Kaggle 失明檢測競賽數(shù)據(jù)集(APTOS 2019 Datasetwww.kaggle.com/c/aptos2019-blindness-detection)包含單獨的訓(xùn)練和測試用例。在這篇博文中,我們只利用訓(xùn)練數(shù)據(jù)集來研究和估計性能。這些影像采集于印度亞拉文眼科醫(yī)院。訓(xùn)練數(shù)據(jù)集中包含 3,662 張影像,這些影像由臨床專家標記為不同的類別(正常、輕度 DR、中度 DR、重度 DR 和增殖性 DR)。請注意,在這篇博文中,我們只關(guān)注 DR 的檢測,如需分級架構(gòu)的詳細信息,請參見我們的論文。
按類別進行數(shù)據(jù)分組
我們從 Excel 工作表中提取標簽,將這些影像分到"Yes"和"No"兩個文件夾中,因為本文只關(guān)注 DR 的檢測。用于劃分數(shù)據(jù)類別的輔助函數(shù)代碼位于本文結(jié)尾處。
加載數(shù)據(jù)庫第一,使用
imageDatastore(www.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.html) 加載數(shù)據(jù)庫。該函數(shù)用于加載影像及其標簽以執(zhí)行分析,具有較高的計算效率。
算效率。
%Two-classDatapathtwo_class_datapath ='Train Dataset Two Classes';%ImageDatastoreimds=imageDatastore(two_class_datapath,… 'IncludeSubfolders',true,… 'LabelSource','foldernames');%Determine the split uptotal_split=countEachLabel(imds)
影像可視化
可視化影像,了解各個類之間的影像差異。這也有助于我們確定采用何種分類方法來區(qū)分兩個類。根據(jù)影像,我們可以確定有助于完成分類的預(yù)處理方法。根據(jù)類內(nèi)相似性及類間差異性,我們可以確定可用于研究的 CNN 架構(gòu)類型。在這篇文章中,我們將使用 inception-v3 架構(gòu)來實現(xiàn)遷移學(xué)習(xí)。您可以閱讀我們的論文,了解各種預(yù)處理**作和其他現(xiàn)有架構(gòu)的性能。
%Number of Imagesnum_images=length(imds.Labels);%Visualize random 20 imagesperm=randperm(num_images,20);figure;for idx=1:20 subplot(4,5,idx); imshow(imread(imds.Files{perm(idx)})); title(sprintf('%s',imds.Labels(perm(idx)))) end
訓(xùn)練、測試和驗證
我們將數(shù)據(jù)集分為訓(xùn)練、驗證和測試三個部分。第一,我們將數(shù)據(jù)集中的 80% 分為一組(訓(xùn)練和驗證),20% 分為另一組(測試)。確保各組中兩類的數(shù)量均衡。
%Split the TrainingandTestingDatasettrain_percent=0.80;[imdsTrain,imdsTest]=splitEachLabel(imds,train_percent,'randomize'); %Split the Trainingan**alidationvalid_percent=0.1;[imdsValid,imdsTrain]=splitEachLabel(imdsTrain,valid_percent,'randomize');
這樣,我們就得到以下計數(shù):
深度學(xué)習(xí)方法
我們采用遷移學(xué)習(xí)方法來對視網(wǎng)膜影像進行分類。在這篇文章中,我將利用 Inception-v3 進行分類。您可以利用這篇論文中提到的其他遷移學(xué)習(xí)方法,或者您認為可能適合此應(yīng)用的其他架構(gòu)。如需使用其他現(xiàn)有網(wǎng)絡(luò)進行遷移學(xué)習(xí),可以參考我的 MathWorks 博文:AlexNet、ResNet。
訓(xùn)練我們將驗證容忍度設(shè)為 3,作為停止條件。訓(xùn)練最開始,我們將"MaxEpochs"設(shè)為 2,但可以根據(jù)訓(xùn)練進度進一步調(diào)整。理想情況下,我們希望在訓(xùn)練過程停止時達到較高的驗證性能。我們根據(jù)硬件內(nèi)存限制將小批量大小設(shè)為 32,您也可以選更大的值,但要確保相應(yīng)更改其他參數(shù)。
%Converting images to 299 x 299 to suit the architectureaugimdsTrain = augmentedImageDatastore([299299],imdsTrain);augimdsValid = augmentedImageDatastore([299299],imdsValid);%Set the training optionsoptions = trainingOptions('adam','MaxEpochs',2,'MiniBatchSize',32,…'Plots','training-progress','Verbose',0,'ExecutionEnvironment','parallel',…'ValidationData',augimdsValid,'ValidationFrequency',50,'ValidationPatience',3);netTransfer = trainNetwork(augimdsTrain,incepnet,options);
測試和性能評估
%Reshape the test images match with the network augimdsTest = augmentedImageDatastore([299299],imdsTest);%PredictTestLabels[predicted_labels,posterior]= classify(netTransfer,augimdsTest);%ActualLabelsactual_labels = imdsTest.Labels;%ConfusionMatrixfigureplotconfusion(actual_labels,predicted_labels)title('Confusion Matrix: Inception v3');
% ROC Curvetest_labels=double(nominal(imdsTest.Labels));[fp_rate,tp_rate,T,AUC]= perfcurve(test_labels,posterior(:,2),2);figure;plot(fp_rate,tp_rate,'b-');hold on;grid on;xlabel('False Positive Rate');ylabel('Detection Rate');
類激活映射結(jié)果
使用以下代碼,將不同 DR 病例經(jīng)過這些網(wǎng)絡(luò)處理后得到的類激活映射 (CAM) 結(jié)果可視化:www.mathworks.com/help/deeplearning/examples/investigate-network-predictions-using-class-activation-mapping.html。這有助于醫(yī)生了解算法決策背后的依據(jù)。以下是不同病例的相應(yīng)結(jié)果:
結(jié)論本文介紹了一種基于深度學(xué)習(xí)的簡單分類方法,可用于視網(wǎng)膜影像 DR 的計算機輔助診斷 (CAD)。在沒有任何預(yù)處理的情況下,使用 Inception-v3 的分類算法表現(xiàn)相對出色,總體準確度為 98.0%,AUC 為 0.9947(結(jié)果可能會因隨機拆分而異)。在這篇論文中,我們研究了各種現(xiàn)有 CNN 架構(gòu)在不同預(yù)處理條件下用于同一組訓(xùn)練和測試用例集時的性能。綜合各種架構(gòu)的結(jié)果,將有助于從 AUC 和總體準確度兩方面提高性能。如果能就計算量(內(nèi)存和時間)和性能兩方面綜合研究這些算法,將有助于相關(guān)專家有所側(cè)重地選擇算法。此外,我們還在這篇論文中提出了 DR 檢測和分級的創(chuàng)新架構(gòu)方法。
輔助函數(shù)代碼
按 DR 類別(Yes 或No)進行數(shù)據(jù)分組的代碼從網(wǎng)站下載 ZIP 文件并解壓到名為 train_images 的文件夾中。確保下載的是包含臨床專家提供的真值標簽的 Excel 工作表 train.csv,將其轉(zhuǎn)換為 .xlsx 以用于此代碼。我們從 Excel 工作表中提取標簽,將這些影像分到"Yes"和"No"兩個文件夾中,因為本文只關(guān)注 DR 的檢測。
% Training Data pathdatapath='train_images';% Two-class Data pathtwo_class_datapath='Train Dataset Two Classes';% Class Namesclass_names={'No','Yes'};mkdir(sprintf('%s%s',two_class_datapath,class_names{1}))mkdir(sprintf('%s%s',two_class_datapath,class_names{2}))% Read the Excel Sheet with Labels[num_data,text_data]=xlsread('train.xlsx');% Determine the Labelstrain_labels=num_data(:,1);% Merge all labels marked into Mild, Medium, Severe and Proliferative DR % into a single category 'Yes' train_labels(train_labels~=0)=2;% Rest of the dataset belongs to 'No' categorytrain_labels(train_labels==0)=1;% Filenamefilename=text_data(2:end,1);% Now, write these images 2-folders 'Yes' or 'No' for us to develop a deep% learning architecture utilizing Deep learning toolbox% Determine the Files put them in separate folderfor idx=1:length(filename) % You could uncomment if you would like to see live progress % fprintf('Processing %d among %d files:%s n',idx,length(filename),filename{idx})[/%] % Read the image current_filename=strrep(filename{idx}, char(39), ''); img=imread(sprintf('%s%s.png',datapath,current_filename)); % Write the image in the respective folder imwrite(img,sprintf('%s%s%s%s.png',two_class_datapath,class_names{train_labels(idx)},'',current_filename)); clear img; end
#醫(yī)療##科技##科技快訊##科技曼曼談##matlab#
拓展知識:
matlab官方下載
《mathematica安裝包》百度網(wǎng)盤高清資源免費在線觀看
下載地址:https://pan.baidu.com/s/1gkrYotP3EDAcuUOMGI582Q
提取碼: kpy6
作品相關(guān)介紹:
Wolfram Mathematica (簡稱:Mathematica)是一款科學(xué)計算軟件,有時候也被稱為計算機代數(shù)系統(tǒng),廣泛使用于科學(xué)、工程、數(shù)學(xué)、計算等領(lǐng)域。
原創(chuàng)文章,作者:九賢生活小編,如若轉(zhuǎn)載,請注明出處:http://cxzzxj.cn/68492.html