Đồ án tốt nghiệp chuyên ngành Kĩ thuật máy tính: Phân loại ảnh MRI u não

74 224 2
Đồ án tốt nghiệp chuyên ngành Kĩ thuật máy tính: Phân loại ảnh MRI u não

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Đồ án tốt nghiệp chuyên ngành Kĩ thuật máy tính: Phân loại ảnh MRI u não trình bày tổng quan, cơ sở lý thuyết và các thuật toán về xử lý ảnh; xây dựng chương trình phân loại ảnh MRI não; thực nghiệm và đánh giá kết quả. Hi vọng tài liệu sẽ giúp ích cho các bạn trong quá trình học tập cũng như nghiên cứu của mình.

ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH LỜI CAM ĐOAN Em xin cam đoan nội dung đồ án tốt nghiệp chép đồ án cơng trình có từ trước Nếu vi phạm em xin chịu hình thức kỷ luật Khoa Đà Nẵng, ngày 18 tháng 12 năm 2016 Sinh viên thực Phạm Đức Thiện Nguyễn Văn Duy Vũ ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH BẢNG PHÂN CƠNG NHIỆM VỤ Tìm hiểu nội dung lý thuyết xử lý NGUYỄN VĂN DUY VŨ ảnh não, viết chương trình Matlab 11DT3 kĩ thuật sử dụng để giảm đặc trưng, trích xuất đặc trưng phân loại ảnh não Xây dựng sở liệu chạy thử nghiệm, làm slide PHẠM ĐỨC THIỆN Tìm hiểu nội dung chương trình giao 11DT3 diện GUI, xây dưng sở liệu mẫu chạy thử nghiệm, viết chương trình Matlab tiền xử lý, lấy ngưỡng xử lý ảnh, làm báo cáo ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH MỤC LỤC Lời cam đoan ………………………………………………………………………… Bảng phân công công việc ………………………………………………………… Mục lục ……………………………………………………………………………… Danh mục hình ảnh …………………………………………….…………………… Các từ viết tắt ………………………………………………………………………… Lời mở đầu ……….………………………………………………………………… Chương Tổng quan, sở lý thuyết thuật toán xử lý ảnh MRI não…… 12 1.1 Giới thiệu ảnh MRI phân loại ảnh não ……………………… 12 1.2 Giới thiệu thuật toán liên quan đến xử lý ảnh ……………… 14 1.2.1 Thuật toán nhị phân phân ngưỡng otsu……………………….… 14 1.2.1.1 Nhị phân ảnh …………………………………………………….… 14 1.2.1.2 Thuật toán phân ngưỡng Otsu …………………………………… 14 1.2.2 Biến đổi wavelet rời rạc …………………………………………… 16 1.2.2.1 Phân tích wavelet, xấp xỉ chi tiết ………………………… 16 1.2.2.2 Phân tích đa phân giải …………………………………………… 18 1.2.2.3 Một số ứng dụng bật wavelet …………………………… 20 1.2.3 Thuật toán PCA …………………………………………………… 21 1.2.4 Ma trận đồng mức xám ……………………………………… 24 1.2.5 Máy vecto hỗ trợ SVM …………………………………………… 26 1.2.5.1 Bài toán nhị phân ………………………………………………… 26 1.2.5.2 SVM cho tốn phân lớp tuyến tính …………………………… 26 1.2.5.3 SVM biên cứng …………………………………………………… 28 1.2.5.4 SVM biên mềm …………………………………………………… 30 1.2.5.5 SVM cho phân lớp tuyến tính …………………………………… 30 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH 1.3 Kết luận chương ………………………………………………… 34 Chương 2: Xây dựng chương trình phân loại MRI não ………………………… 35 2.1 Đề xuất tổng quan chương trình ………………………………… 35 2.2 Xây dựng thuật toán ………………………………………… 36 2.2.1 Các thuật toán giảm đặc trưng …………………………………… 36 2.2.2 Trích xuất đặc trưng sử dụng ma trận đồng mức xám ( GLCM) … 43 2.2.3 Phâm lớp sử dụng SVM ………………………………………… 44 2.3 Kết luận chương ………………………………………………… 44 Chương 3: Thực nghiệm đánh giá kết …………………………………… 45 3.1 Giới thiệu chương ………………………………………………… 45 3.2 Giao diện chương trình …………………………………………… 45 3.3 Kết thực nghiệm ……………………………………………… 46 3.3.1 Cơ sở liệu kiểm tra …………………………………………… 46 3.3.2 Kết thực nghiệm với mẫu u lành tính ………………………… 47 3.3.3 Kết thực nghiệm với mẫu u ác tính ………………………… 49 3.4 Mơ hình đánh giá ………………………………………………… 50 3.5 Phân tích thời gian thực …………………………………… 52 3.6 Kết luận chương ………………………………………………… 53 Kết luận hướng phát triển đề tài ……………………………………………… 54 Tài liệu tham khảo ………………………………………………………………… 55 Phụ lục ……………………………………………………………………………… 57 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH DANH MỤC HÌNH ẢNH Hình 1.1 Biến đổi wavelet rời rạc tín hiệu ………………………………… 16 Hình 1.2 Q trình phân tích biến đổi tín hiệu dung DWT chiều ………… 17 Hình 1.3 Minh họa DWT hai chiều cho ảnh …………………………………… 18 Hình 1.4 Phân tích tín hiệu đa mức …………………………………………… 19 Hình 1.5 Minh họa DWT kiểu dynamic mức ………………………………… 19 Hình 1.6 Ảnh DWT MRI não ……………………………………………… 20 Hình 1.7 Minh họa PCA: phép chiếu lên trục tọa độ khác cho cách nhìn khác liệu ………………………… 22 Hình 1.8 Minh họa PCA: tìm trục tọa độ cho liệu có độ biến thiên cao ……………………………………………………………… 22 Hình 1.9 Phân chia biên rộng …………………………………………………… 27 Hình 1.10 Ảnh hưởng số biên mềm C ranh giới định ……… 29 Hình 1.11 SVM cho phân lớp phi tuyến ………………………………………… 31 Hình 1.12 Ảnh hưởng đa chiều Gaussian kernel cho giá trị cố định …33 số biên mềm …………………………………………………… Hình 2.1 Sơ đồ chung hệ thống xử lý phân loại ảnh …………………… 35 Hình 2.2 Ảnh MRI sau biến đổi DWT ba mức …………………………… 37 Hình 2.3 Tập sở liệu hình ảnh MRI não ………………………………… 38 Hình 3.1 Giao diện chương trình ……………………………………………… 45 Hình 3.2 Các mẫu ảnh bệnh MRI não ………………………………………… 47 Hình 3.3 Kết thực nghiệm với u lành tính …………………………… …… 47 Hình 3.4 Kết thực nghiệm với u lành tính khác …………………………… 48 Hình 3.5 Kết thực nghiệm đo tỉ lệ % xác Kernel ……………… 49 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH Hình 3.6 Kết thực nghiệm với u ác tính …………………………………… 50 Hình 3.7 Mơ hình hold-old để tiến hành đánh giá ……………………………… 51 Hình 3.8 Kết đánh giá Kernel Linear GRB ……………………… 51 Hình 3.9 Tính tốn thời gian giai đoạn …………………………… 52 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH CÁC TỪ VIẾT TẮT G GUI Graphic User Interface GLCM Gray-Level Co-Occurrence Matrix DWT Discrete Wavelet Transform PCA Principal Component Analysis MRI Magnetic resonance imaging SVM Support Vector Machine O P M S ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH LỜI MỞ ĐẦU Lý chọn đề tài Ngày nay, dòng chảy sống hối dường người khơng thể kiểm sốt loại thực phẩm mà ăn phải, thực phẩm có hại cho sức khỏe, thực phẩm bẩn, đồ ăn nhanh ngày gia tăng Điều gây phát sinh nhiều bệnh cho người, mục đích y tế thiết kế hệ thống nhằm chẩn đốn bệnh cách nhanh xác Vì kĩ thuật phổ biến sử dụng lĩnh vực y tế kĩ thuật “Xử Lý Ảnh“ , kĩ thuật sử dụng nhiều phương pháp khác nhằm cải thiện hiệu suất độ xác hệ thống Một bệnh nguy hiểm giới bệnh u não Nó xảy phát triển bất thường tế bào não Những khối u não có nhiều hình dạng kích cỡ Các khối u não lành tính ác tính Các nguồn để có hình ảnh y tế ảnh X-quang ảnh MRI MRI tốt biết đến với đặc điểm khác biệt vượt trội mô mềm, độ phân giải khơng gian cao độ tương phản Nó khơng sử dụng xạ ion hóa có hại cho bệnh nhân, khối u lành tính có cấu trúc đồng không chứa tế bào ung thư Khối u ác tính có cấu trúc khơng đồng có chứa tế bào ung thư Những tế bào điều trị kỹ thuật xạ trị, hóa trị liệu kết hợp họ đe dọa tính mạng, lĩnh vực y tế vượt trội cách sử dụng cơng nghệ chẩn đốn tự động hiệu thời gian ngắn Với vai trò ý nghĩa to lớn mà việc phân loại ảnh u não mang lại, chúng em chọn đề tài “Phân loại ảnh MRI u não” để phần hiểu nguyên lý, ý nghĩa áp dụng đề tài vào thực tế Phương pháp nghiên cứu đồ án Tìm hiểu lý thuyết: ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH  Tìm hiểu phần mềm Toolbox Matlab R2013a  Tìm hiểu lý` thuyết ảnh MRI  Tìm hiểu kỹ thuật xử lý ảnh  Tìm hiểu phương pháp học máy  Tìm hiểu sở liệu Nội dung đồ án Đồ án gồm chương: Chương 1: Tổng quan, sở lý thuyết thuật toán xử lý ảnh 1) Giới thiệu ảnh MRI phân loại ảnh não 2) Giới thiệu thuật toán liên quan đến xử lý ảnh a Nhị phân ảnh thuật toán phân ngưỡng Otsu b Thuật toán biến đổi wavelet rời rạc (DWT) c Thuận tốn phân tích thành phần (PCA) d Ma trận đồng mức xám (GLCM ) e Vector máy hỗ trợ (SVM) f Kết luận chương Chương : Xây dựng chương trình phân loại ảnh MRI não 1) Đề xuất sơ đồ tổng quan chương trình 2) Xây dựng thuật tốn a Các thuật tốn giảm đặc trưng b Trích xuất đặc trưng sử dụng ma trận đồng mức xám ( GLCM) c Phân lớp ảnh sử dụng thuật toán SVM 3) Kết luận chương Chương 3: Thực nghiệm đánh giá kết Để hỗ trợ cho việc mơ q trình nhận dạng, chúng em sử dụng matlab làm chương trình hỗ trợ tiện ích hữu dụng q trình xử lý ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH phân loại ảnh Từ kết mơ phỏng, ta nhận ưu, nhược thuật toán xử lý nhiễu, phân đoạn phân loại ảnh Kết đồ án Trong đồ án này, nhóm em đạt kết sau:  Xây dựng hệ thống phân loại u não để nhận biết ụ ác tính lành tính  Xử lý ảnh MRI đầu vào khác gồm loại : ảnh não có u ác tính ảnh não có u lành tính 10 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH svmStruct1_new = svmtrain(data1,group,'kernel_function', 'linear','showplot',false); species_Linear_new = svmclassify(svmStruct1_new,newfeat,'showplot',false); %% % Multiple runs for accuracy highest is 90% load Trainset.mat %data = [meas(:,1), meas(:,2)]; data = meas; groups = ismember(label,'BENIGN '); groups = ismember(label,'MALIGNANT'); [train,test] = crossvalind('HoldOut',groups); cp = classperf(groups); %svmStruct = svmtrain(data(train,:),groups(train),'boxconstraint',Inf,'showp lot',false,'kernel_function','rbf'); svmStruct = svmtrain(data(train,:),groups(train),'showplot',false,'kernel_f unction','linear'); classes = svmclassify(svmStruct,data(test,:),'showplot',false); classperf(cp,classes,test); Accuracy_Classification = cp.CorrectRate.*100; sprintf('Accuracy of Linear kernel is: %g%%',Accuracy_Classification) %% Accuracy with RBF svmStruct_RBF = svmtrain(data(train,:),groups(train),'boxconstraint',Inf,'showp lot',false,'kernel_function','rbf'); classes2 = svmclassify(svmStruct_RBF,data(test,:),'showplot',false); classperf(cp,classes2,test); Accuracy_Classification_RBF = cp.CorrectRate.*100; sprintf('Accuracy of RBF kernel is: %g%%',Accuracy_Classification_RBF) %% Accuracy with Polynomial svmStruct_Poly = svmtrain(data(train,:),groups(train),'Polyorder',2,'Kernel_Func tion','polynomial'); classes3 = svmclassify(svmStruct_Poly,data(test,:),'showplot',false); classperf(cp,classes3,test); 60 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH Accuracy_Classification_Poly = cp.CorrectRate.*100; sprintf('Accuracy of Polynomial kernel is: %g%%',Accuracy_Classification_Poly) %% % fold cross validation % fold cross validation load Normalized_Features.mat xdata = norm_feat; group = norm_label; indicies = crossvalind('Kfold',label,5); cp = classperf(label); for i = 1:length(label) test = (indicies==i);train = ~ test; svmStruct = svmtrain(xdata(train,:),group(train),'boxconstraint',Inf,'showp lot',false,'kernel_function','rbf'); classes = svmclassify(svmStruct,xdata(test,:),'showplot',false); %class = svmclassify(meas(test,:),meas(train,:),label(train,:)); classperf(cp,classes,test); end  Chương trình giao diện: function varargout = BrainMRI_GUI(varargin) gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, 'gui_Singleton', gui_Singleton, 'gui_OpeningFcn', @BrainMRI_GUI_OpeningFcn, 'gui_OutputFcn', @BrainMRI_GUI_OutputFcn, 'gui_LayoutFcn', [] , 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 61 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % - Executes just before BrainMRI_GUI is made visible function BrainMRI_GUI_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject; ss = ones(200,200); axes(handles.axes1); imshow(ss); axes(handles.axes2); imshow(ss); % Update handles structure guidata(hObject, handles); % - Outputs from this function are returned to the command line function varargout = BrainMRI_GUI_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output; % - Executes on button press in pushbutton1 function pushbutton1_Callback(hObject, eventdata, handles) [FileName,PathName] = uigetfile('*.jpg;*.png;*.bmp','Pick an MRI Image'); if isequal(FileName,0)||isequal(PathName,0) warndlg('User Press Cancel'); else P = imread([PathName,FileName]); P = imresize(P,[200,200]); % input =imresize(a,[512 512]); axes(handles.axes1) imshow(P);title('Brain MRI Image'); handles.ImgData = P; % handles.FileName = FileName; 62 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH guidata(hObject,handles); end % - Executes on button press in pushbutton2 function pushbutton2_Callback(hObject, eventdata, handles) if isfield(handles,'ImgData') %if isfield(handles,'imgData') I = handles.ImgData; gray = rgb2gray(I); % Otsu Binarization for segmentation level = graythresh(I); %gray = gray>80; img = im2bw(I,.6); img = bwareaopen(img,80); img2 = im2bw(I); axes(handles.axes2) imshow(img);title('Segmented Image'); %imshow(tumor);title('Segmented Image'); handles.ImgData2 = img2; guidata(hObject,handles); signal1 = img2(:,:); %Feat = getmswpfeat(signal,winsize,wininc,J,'matlab'); %Features = getmswpfeat(signal,winsize,wininc,J,'matlab'); [cA1,cH1,cV1,cD1] = dwt2(signal1,'db4'); [cA2,cH2,cV2,cD2] = dwt2(cA1,'db4'); [cA3,cH3,cV3,cD3] = dwt2(cA2,'db4'); DWT_feat = [cA3,cH3,cV3,cD3]; G = pca(DWT_feat); whos DWT_feat whos G g = graycomatrix(G); stats = graycoprops(g,'Contrast Correlation Energy Homogeneity'); Contrast = stats.Contrast; Correlation = stats.Correlation; Energy = stats.Energy; Homogeneity = stats.Homogeneity; 63 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH Mean = mean2(G); Standard_Deviation = std2(G); Entropy = entropy(G); RMS = mean2(rms(G)); %Skewness = skewness(img) Variance = mean2(var(double(G))); a = sum(double(G(:))); Smoothness = 1-(1/(1+a)); Kurtosis = kurtosis(double(G(:))); Skewness = skewness(double(G(:))); % Inverse Difference Movement m = size(G,1); n = size(G,2); in_diff = 0; for i = 1:m for j = 1:n temp = G(i,j)./(1+(i-j).^2); in_diff = in_diff+temp; end end IDM = double(in_diff); feat = [Contrast,Correlation,Energy,Homogeneity, Mean, Standard_Deviation, Entropy, RMS, Variance, Smoothness, Kurtosis, Skewness, IDM]; load Trainset.mat xdata = meas; group = label; svmStruct1 = svmtrain(xdata,group,'kernel_function', 'linear'); species = svmclassify(svmStruct1,feat,'showplot',false); if strcmpi(species,'MALIGNANT') helpdlg(' Malignant Tumor '); disp(' Malignant Tumor '); else helpdlg(' Benign Tumor '); disp(' Benign Tumor '); end set(handles.edit4,'string',species); % Put the features in GUI set(handles.edit7,'string',Entropy); 64 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH set(handles.edit14,'string',Contrast); set(handles.edit15,'string',Correlation); set(handles.edit16,'string',Energy); set(handles.edit17,'string',Homogeneity); end % - Executes on button press in pushbutton3 function pushbutton4_Callback(hObject, eventdata, handles) load Trainset.mat %data = [meas(:,1), meas(:,2)]; Accuracy_Percent= zeros(200,1); itr = 80; hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 100 iterations'); for i = 1:itr data = meas; %groups = ismember(label,'BENIGN '); groups = ismember(label,'MALIGNANT'); [train,test] = crossvalind('HoldOut',groups); cp = classperf(groups); %svmStruct = svmtrain(data(train,:),groups(train),'boxconstraint',Inf,'showp lot',false,'kernel_function','rbf'); svmStruct_RBF = svmtrain(data(train,:),groups(train),'boxconstraint',Inf,'showp lot',false,'kernel_function','rbf'); classes2 = svmclassify(svmStruct_RBF,data(test,:),'showplot',false); classperf(cp,classes2,test); %Accuracy_Classification_RBF = cp.CorrectRate.*100; Accuracy_Percent(i) = cp.CorrectRate.*100; sprintf('Accuracy of RBF Kernel is: %g%%',Accuracy_Percent(i)) waitbar(i/itr); end delete(hWaitBar); Max_Accuracy = max(Accuracy_Percent); sprintf('Accuracy of RBF kernel is: %g%%',Max_Accuracy) set(handles.edit1,'string',Max_Accuracy); guidata(hObject,handles); % - Executes on button press in pushbutton4 function pushbutton3_Callback(hObject, eventdata, handles) load Trainset.mat 65 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH %data = [meas(:,1), meas(:,2)]; Accuracy_Percent= zeros(200,1); itr = 100; hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 100 iterations'); for i = 1:itr data = meas; %groups = ismember(label,'BENIGN '); groups = ismember(label,'MALIGNANT'); [train,test] = crossvalind('HoldOut',groups); cp = classperf(groups); svmStruct = svmtrain(data(train,:),groups(train),'showplot',false,'kernel_f unction','linear'); classes = svmclassify(svmStruct,data(test,:),'showplot',false); classperf(cp,classes,test); %Accuracy_Classification = cp.CorrectRate.*100; Accuracy_Percent(i) = cp.CorrectRate.*100; sprintf('Accuracy of Linear Kernel is: %g%%',Accuracy_Percent(i)) waitbar(i/itr); end delete(hWaitBar); Max_Accuracy = max(Accuracy_Percent); sprintf('Accuracy of Linear kernel is: %g%%',Max_Accuracy) set(handles.edit2,'string',Max_Accuracy); % - Executes on button press in pushbutton5 function pushbutton5_Callback(hObject, eventdata, handles) load Trainset.mat %data = [meas(:,1), meas(:,2)]; Accuracy_Percent= zeros(200,1); itr = 100; hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 100 iterations'); for i = 1:itr data = meas; groups = ismember(label,'BENIGN '); groups = ismember(label,'MALIGNANT'); [train,test] = crossvalind('HoldOut',groups); cp = classperf(groups); 66 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH svmStruct_Poly = svmtrain(data(train,:),groups(train),'Polyorder',2,'Kernel_Func tion','polynomial'); classes3 = svmclassify(svmStruct_Poly,data(test,:),'showplot',false); classperf(cp,classes3,test); Accuracy_Percent(i) = cp.CorrectRate.*100; sprintf('Accuracy of Polynomial Kernel is: %g%%',Accuracy_Percent(i)) waitbar(i/itr); end delete(hWaitBar); Max_Accuracy = max(Accuracy_Percent); %Accuracy_Classification_Poly = cp.CorrectRate.*100; sprintf('Accuracy of Polynomial kernel is: %g%%',Max_Accuracy) set(handles.edit3,'string',Max_Accuracy); function edit1_Callback(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit1 as text % str2double(get(hObject,'String')) returns contents of edit1 as a double % - Executes during object creation, after setting all properties function edit1_CreateFcn(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end 67 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double % - Executes during object creation, after setting all properties function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % - Executes during object creation, after setting all properties function edit4_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end 68 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit6_Callback(hObject, eventdata, handles) function edit6_CreateFcn(hObject, eventdata, handles) % hObject handle to edit6 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit7_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit7_CreateFcn(hObject, eventdata, handles) % hObject handle to edit7 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit8_Callback(hObject, eventdata, handles) 69 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH % - Executes during object creation, after setting all properties function edit8_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit9_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit9_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit10_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit10_CreateFcn(hObject, eventdata, handles) % hObject handle to edit10 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit11_Callback(hObject, eventdata, handles) 70 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH % - Executes during object creation, after setting all properties function edit11_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit12_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit12_CreateFcn(hObject, eventdata, handles) % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit13_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit13_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit14_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit14_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end 71 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH function edit15_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit15_CreateFcn(hObject, eventdata, handles) % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit16_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit16_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit17_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit17_CreateFcn(hObject, eventdata, handles) % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % - Executes on button press in pushbutton6 function pushbutton6_Callback(hObject, eventdata, handles) % hObject handle to pushbutton6 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) load Trainset.mat %data = [meas(:,1), meas(:,2)]; 72 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH Accuracy_Percent= zeros(200,1); itr = 100; hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 100 iterations'); for i = 1:itr data = meas; groups = ismember(label,'BENIGN '); groups = ismember(label,'MALIGNANT'); [train,test] = crossvalind('HoldOut',groups); cp = classperf(groups); svmStruct4 = svmtrain(data(train,:),groups(train),'showplot',false,'kernel_f unction','quadratic'); classes4 = svmclassify(svmStruct4,data(test,:),'showplot',false); classperf(cp,classes4,test); %Accuracy_Classification_Quad = cp.CorrectRate.*100; Accuracy_Percent(i) = cp.CorrectRate.*100; sprintf('Accuracy of Quadratic Kernel is: %g%%',Accuracy_Percent(i)) waitbar(i/itr); end delete(hWaitBar); Max_Accuracy = max(Accuracy_Percent); sprintf('Accuracy of Quadratic kernel is: %g%%',Max_Accuracy) set(handles.edit19,'string',Max_Accuracy); function edit19_Callback(hObject, eventdata, handles) % - Executes during object creation, after setting all properties function edit19_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % - Executes during object creation, after setting all properties function axes6_CreateFcn(hObject, eventdata, handles) imshow('D:\Brain_Tumor5\1.bmp') % - Executes during object creation, after setting all properties 73 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH function axes7_CreateFcn(hObject, eventdata, handles) imshow('D:\Brain_Tumor5\2.png') % - Executes during object creation, after setting all properties function axes8_CreateFcn(hObject, eventdata, handles) imshow('D:\Brain_Tumor5\3.bmp') 74 ... ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH phân loại ảnh Từ kết mơ phỏng, ta nhận u, nhược thuật toán xử lý nhi u, phân đoạn phân loại ảnh Kết đồ án Trong đồ án này, nhóm em đạt kết sau:... li u Nội dung đồ án Đồ án gồm chương: Chương 1: Tổng quan, sở lý thuyết thuật toán xử lý ảnh 1) Giới thi u ảnh MRI phân loại ảnh não 2) Giới thi u thuật toán liên quan đến xử lý ảnh a Nhị phân. .. hệ thống phân loại u não để nhận biết ụ ác tính lành tính  Xử lý ảnh MRI đ u vào khác gồm loại : ảnh não có u ác tính ảnh não có u lành tính 10 ĐỒ ÁN TỐT NGHIỆP – CHUYÊN NGÀNH KĨ THUẬT MÁY TÍNH

Ngày đăng: 15/01/2020, 14:22

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan