【CDBS】凹边界的修改形状特征描述:应用于皮肤病变分类(Matlab代码实现)

简介: 【CDBS】凹边界的修改形状特征描述:应用于皮肤病变分类(Matlab代码实现)

💥1 概述

作为计算机视觉的基本研究内容,图像局部特征描述的目的是利用特征向量来稳定地表达被检测图像的局部特征,从而利用这些特征构成的描述子来稳定进行图像的匹配,具有一定的理论研究价值和实际工程应用价值。特别是随着近年来深度学习技术的兴起与快速发展,该领域的研究者们都相继提出了许多不同的研究方法。如今,基于学习的局部特征描述方法在该领域越来越受欢迎。然而,在不同场景和任务要求中,研究者都在致力于如何设计在精确性、鲁棒性和效率方面具有卓越性能的图像局部特征描述方法。本文对经典的手工设计和主流的基于学习两类方法分别进行全面而系统的分析与总结。最后总结了图像局部特征描述的现状,并为未来的工作提供参考。在本文中,我们提出了一种用于检测黑色素瘤皮肤病变的计算机辅助诊断(CAD)系统。本文的目的是开发一种新的形状描述符来分析形状的轮廓不规则性,称为基于凸缺陷的特征(CDBS)。 主要m_file(CDBS_curve.m)首先计算典型黑色素瘤病变的CDBS。然后,将使用CAD方案呈现病变类型(黑色素瘤或非黑色素瘤)。


📚2 运行结果

部分代码:

% compute Convex Deficiency-Based Signature for an examplary melanoma lesion
% exctracting 5 proposed features from CDBS curve
% exctracting 12 shape & textural features
% plotting CDBS curve
% detecting type of the lesion
clc
clear all
close all
% reading original melanoma image & its binary mask
I=imread('./SSM25_orig.jpg');
imBW=imread('./SSM25_contour.png');
% Preprocessing the input RGB image
im = PREPROCESS(I);
% obtaining coordinates of lesion contour
[B,L] = bwboundaries(imBW,'noholes');
bn=B{1,1};
% obtaining convex hull of lesion shape
s1=regionprops(L,'ConvexHull','Area','Perimeter','centroid',...
    'PixelList','Solidity','Extent','BoundingBox');
ch=cat(1,s1.ConvexHull);
% calculating CDBS
di=zeros(length(ch),length(bn));
for j=1:length(bn)
    for k=1:length(ch)
        di(k,j)=sqrt( (bn(j,1)-ch(k,2))^2+(bn(j,2)-ch(k,1))^2 );
    end  
end
CDBS=min(di);
%% Extracting features from CDBS Curve
% Finding Local Extrema
[ymax1,imax1,ymin1,imin1] = extrema(CDBS);
% Variance of CDBS curve
Fp(1,1) = var(CDBS,1);
% 10th order central standardized moment of CDBS curve
Fp(2,1) = normoment(CDBS,10);
% Ratio of Median point of CDBS curve 
% to number of boundary points
Fp(3,1) = median(CDBS)/length(CDBS);
% Ratio of number of zero-incidence points on 
% CDBS curve to number of boundary points
Fp(4,1) = (length(find(CDBS==min(CDBS))))/length(CDBS);
% Ratio of number of zero-incidence points to the   
% number of maximum extrema on CDBS curve
Fp(5,1) = (length(find(CDBS==min(CDBS))))/length(ymax1);
%% Extracting shape & textural features
% Transforming main image to gray scale
imgray=rgb2gray(im);
% Transforming main image to HSV color space
imhsv=rgb2hsv(im);
% lesion area
A=cat(1,s1.Area);
% lesion perimeter
P=cat(1,s1.Perimeter);
% coordinate of lesion center
centroids=cat(1,s1.Centroid);
% bounding box information
Box=cat(1,s1.BoundingBox);
% coordinates of lesion pixels
Pix_list=cat(1,s1.PixelList);
% obtaining lesion Major axis & Minor axis information
s2=diameter(L);
maj_co=s2.MajorAxis;
min_co=s2.MinorAxis;
% Computing Major Axis Length 
max_axis=sqrt((maj_co(1,1)-maj_co(2,1))^2+...
    (maj_co(1,2)-maj_co(2,2))^2);
% Computing Minor Axis Length
min_axis=sqrt((min_co(1,1)-min_co(2,1))^2+...
    (min_co(1,2)-min_co(2,2))^2);
% Computing distance of left corner of bounding box
% from centroid of the lesion
dist_Cbox=((Box(1,1)-centroids(1,1))^2+...
    (Box(1,2)-centroids(1,2))^2);
% Computing sum of entire gray scale values of lesion 
for j=1:length(Pix_list)
    gray1(j,1)=imgray(Pix_list(j,2),Pix_list(j,1));
end
% Computing sum of all lesion region values in HSV color space
for k=1:3
    for j=1:length(Pix_list)
        hsv1(j,k)=imhsv(Pix_list(j,2),Pix_list(j,1),k);
    end
    Shsv(1,k)=sum(hsv1(:,k));
end
% Ratio of lesion area to its bounding box area.
Fl(1,1)=cat(1,s1.Extent);
% Ratio of maximum axis of the lesion to its minimum axis
Fl(2,1)=max_axis/min_axis;
% Ratio of the lesion bounding box length to its bounding box width
Fl(3,1)=Box(1,3)/Box(1,4);
% Ratio of lesion area to its convex hull area
Fl(4,1)=cat(1,s1.Solidity);
% Ratio of the lesion area to the distance of leftcorner
% of bounding box from centroid of the lesion
Fl(5,1)=A/dist_Cbox;
% Ratio of sum of entire gray scale values of
% lesion region to its area 
Fl(6,1)=sum(gray1)/A;
% Ratio of the lesion area to its squared perimeter
Fl(7,1)=A/(P^2);
% Ratio of the lesion perimeter to its bounding box perimater
Fl(8,1)=P/(2*(Box(1,3) + Box(1,4)));
% Ratio of the sum of all lesion region values 
% in HSV color space to the lesion area
Fl(9,1)=Shsv(1,1)/A;
Fl(10,1)=Shsv(1,2)/A;
Fl(11,1)=Shsv(1,3)/A;
% A nonlinear combination of Fl(6,1) & Fl(11,1)
Fl(12,1) = Fl(6,1)^2 + Fl(11,1)^2;
%% figures 
% displaying melanoma lesion with its convex hull
figure(1),
plot(bn(:,2),bn(:,1),'Color','k','LineWidth',2)
hold on
plot(ch(:,1),ch(:,2),'Color','k',...
    'LineWidth',3,'LineStyle','--')
legend('C(t)','H(l)')
hold off
saveas(gcf, './imBW.png')
% plotting CDBS curve of a melanoma lesion
figure(2),plot(CDBS,'Color','b','LineWidth',3)
grid on
xlabel('t','FontSize',10,'FontWeight','bold')
ylabel('RCH(t)','FontSize',10,'FontWeight','bold')
title('CDBS Curve')
saveas(gcf, './CDBScurve.png')
%% Estimating type of lesion
% combining Fp & Fl
F = [Fl; Fp];
% loading data: weight matrices, randomly split trainset, 
% testset and their targets
load('./Preset.mat')
% loading normalizing factors of each fold
load('./mMax.mat')
M = 0;
nM = 0;
% detecting types of the lesion by performing the classification 
% algorithm over 10 separate trials
for kk = 1:10
    % loading weight matrices for each trials
    Pre = Preset{kk,1};
    Weight = Pre{1,3};
    % 
    minmax1 = mMax{kk,1};
    % calculating the output of sample during 5-fold cross-validation
    for gg = 1:5
        % min features
        min_f = minmax1{gg,1};
        % max features
        max_f = minmax1{gg,2};
        % Normalizing Test data
        Testdata = (F'-min_f)./(max_f-min_f);
        % loading wieght matrix of first layer in each trial
        v = Weight{gg,2};
        % loading wieght matrix of second layer in each trial
        w = Weight{gg,1};
        % compute output for testset
        y = Output(Testdata,v,w);
        % counting the number of times that test data is detected as 
        % melanoma or non-melanoma in each fold and each trial
        if y(1,1)>y(2,1)
            M = M + 1;
        else 
            nM = nM + 1;
        end
        w=[];v=[];
    end
    Pre = []; minmax1 = [];
end
% detecting the type of the lesion by majority voting
if M > nM
    display('Melanoma Detected')
else 
    display('non-Melanoma Detected')
end


🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。


[1]Saeid Amouzad Mahdiraji, Yasser Baleghi, Sayed Mahmoud Sakhaei (2018) CDBS: Modified Shape Signature for Concave Boundaries Description: Application to Skin Lesion Classification


[2]付苗苗,杜光星.基于局部特征描述的图像匹配方法分析[J].信息记录材料,2022,23(10):135-137.DOI:10.16009/j.cnki.cn13-1295/tq.2022.10.027.


🌈4 Matlab代码实现

相关文章
|
4月前
|
Perl
【MFAC】基于全格式动态线性化的无模型自适应控制(Matlab代码)
【MFAC】基于全格式动态线性化的无模型自适应控制(Matlab代码)
|
4天前
|
SQL 移动开发 算法
MATLAB改进模糊C均值聚类FCM在电子商务信用评价应用:分析淘宝网店铺数据|数据分享
MATLAB改进模糊C均值聚类FCM在电子商务信用评价应用:分析淘宝网店铺数据|数据分享
10 1
|
7天前
|
数据采集 算法 数据可视化
MATLAB、R用改进Fuzzy C-means模糊C均值聚类算法的微博用户特征调研数据聚类研究
MATLAB、R用改进Fuzzy C-means模糊C均值聚类算法的微博用户特征调研数据聚类研究
14 1
|
26天前
|
存储 人工智能 机器人
【Matlab】Matlab 汉/英语(A/a)声学特征比较与基音频率分析(源码+音频文件)【独一无二】
【Matlab】Matlab 汉/英语(A/a)声学特征比较与基音频率分析(源码+音频文件)【独一无二】
|
26天前
|
存储 人工智能 机器人
【Matlab】Matlab电话拨号音合成与识别(代码+论文)【独一无二】
【Matlab】Matlab电话拨号音合成与识别(代码+论文)【独一无二】
|
1月前
|
存储
【Matlab】Matlab电话拨号音合成与识别(代码+论文)【独一无二】
【Matlab】Matlab电话拨号音合成与识别(代码+论文)【独一无二】
|
3月前
|
机器学习/深度学习 算法 计算机视觉
霍夫变换车道线识别-车牌字符识别代码(matlab仿真与图像处理系列第5期)
霍夫变换车道线识别-车牌字符识别代码(matlab仿真与图像处理系列第5期)
31 2
|
3月前
|
算法
MATLAB | 插值算法 | 一维interpl插值法 | 附数据和出图代码 | 直接上手
MATLAB | 插值算法 | 一维interpl插值法 | 附数据和出图代码 | 直接上手
46 0
|
3月前
|
算法
MATLAB | 插值算法 | 二维interp2插值法 | 附数据和出图代码 | 直接上手
MATLAB | 插值算法 | 二维interp2插值法 | 附数据和出图代码 | 直接上手
93 0
|
3月前
|
算法
MATLAB | 插值算法 | 二维griddata插值法 | 附数据和出图代码 | 直接上手
MATLAB | 插值算法 | 二维griddata插值法 | 附数据和出图代码 | 直接上手
44 0

热门文章

最新文章