[go: up one dir, main page]

CN116740463B - SMRI image sequential multi-classification method - Google Patents

SMRI image sequential multi-classification method Download PDF

Info

Publication number
CN116740463B
CN116740463B CN202310822010.2A CN202310822010A CN116740463B CN 116740463 B CN116740463 B CN 116740463B CN 202310822010 A CN202310822010 A CN 202310822010A CN 116740463 B CN116740463 B CN 116740463B
Authority
CN
China
Prior art keywords
sample
image
images
label
smri
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310822010.2A
Other languages
Chinese (zh)
Other versions
CN116740463A (en
Inventor
王如冰
高琳琳
余明行
林晨阳
禚世豪
陈俊初
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo University
Original Assignee
Ningbo University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ningbo University filed Critical Ningbo University
Priority to CN202310822010.2A priority Critical patent/CN116740463B/en
Publication of CN116740463A publication Critical patent/CN116740463A/en
Application granted granted Critical
Publication of CN116740463B publication Critical patent/CN116740463B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Molecular Biology (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a sMRI image sequential multi-classification method, which comprises the following steps: dividing a certain number sMRI of images into a training set, a verification set and a test set; constructing a network model, wherein the constructed network model comprises a feature extraction and classification model, a sorting model and a difficult sample identification correction model; inputting all sample images in the training set into the constructed network model in batches for training, and verifying the performance of the trained network model by using all images in the verification set; after multiple training and verification, screening out an optimal network model; and finally, inputting the to-be-tested image to be tested in the test set into an optimal network model to obtain a classification result of the to-be-tested image. The advantages are that: the distance between feature vectors obtained by the samples of different categories through the model and the distance in actual pathology are kept consistent through the sequencing model, so that the extracted features among sMRI images of different categories have sequential characteristics, and the network classification performance is improved.

Description

一种sMRI图像顺序多分类方法A sequential multi-classification method for sMRI images

技术领域Technical Field

本发明涉及图像处理技术领域,尤其涉及一种sMRI图像顺序多分类方法。The invention relates to the technical field of image processing, and in particular to a sequential multi-classification method for sMRI images.

背景技术Background Art

结构核磁共振成像(structural Magnetic Resonance Imaging,简称sMRI)是脑疾病诊断的重要工具,它以非侵入性的方式捕获脑疾病引起的脑形态学变化,例如,脑皮质和海马体收缩、脑室增大等。Structural Magnetic Resonance Imaging (sMRI) is an important tool for diagnosing brain diseases. It captures brain morphological changes caused by brain diseases in a non-invasive manner, such as shrinkage of the cerebral cortex and hippocampus, and enlargement of the ventricles.

随着计算机软硬件的不断发展,卷积神经网(Convolutional Neural Network,CNN)以其优秀的特征提取和特征分类能力成为图像处理和分析领域的热点。近年来,一些基CNN的sMRI图像分类方法在脑疾病诊断上的性能优于传统机器学习方法,例如,基于CNN的感兴趣区域特征提取及分类、基于CNN和注意力机制的sMRI图像分类方法。然而,以上方法仅考虑单个样本的学习,却忽略了样本之间的关系。基于成对的方法则考虑了由正样本和负样本组成的样本对之间的关系,这类方法能通过鼓励模型通过缩小正对样本之间的距离且扩大负对样本之间的距离来学习样本间的真实关系,以帮助模型更好区分不同类别的样本。基于成对的方法虽然大多数在sMRI图像二分类任务上表现较好,但对于图像多分类,仍面临精度不高的问题,因而很少直接应用于脑疾病多阶段的诊断。With the continuous development of computer hardware and software, Convolutional Neural Network (CNN) has become a hot topic in the field of image processing and analysis with its excellent feature extraction and feature classification capabilities. In recent years, some CNN-based sMRI image classification methods have outperformed traditional machine learning methods in the diagnosis of brain diseases, such as CNN-based feature extraction and classification of regions of interest, and CNN-based and attention-based sMRI image classification methods. However, the above methods only consider the learning of a single sample, but ignore the relationship between samples. Pair-based methods consider the relationship between sample pairs consisting of positive and negative samples. Such methods can help the model better distinguish samples of different categories by encouraging the model to learn the true relationship between samples by reducing the distance between positive pairs and expanding the distance between negative pairs. Although most pair-based methods perform well in the binary classification task of sMRI images, they still face the problem of low accuracy for multi-classification of images, and are therefore rarely directly applied to the diagnosis of multi-stage brain diseases.

相关研究表明,疾病的多阶段顺序发展特性有利于不同阶段图像特征的准确提取及后续的分类,且使方法输出更逼近真实形式。利用疾病发展的顺序性来提升sMRI图像多分类的性能,但是,目前在脑疾病诊断上使用这种顺序特性约束的相关研究较少,且研究不深。因此,需要对现有技术作进一步的改进。Related studies have shown that the multi-stage sequential development characteristics of the disease are conducive to the accurate extraction of image features at different stages and subsequent classification, and make the method output closer to the real form. The sequentiality of disease development is used to improve the performance of sMRI image multi-classification. However, there are currently few studies on the use of this sequential characteristic constraint in brain disease diagnosis, and the research is not in-depth. Therefore, further improvements to the existing technology are needed.

发明内容Summary of the invention

本发明所要解决的技术问题是针对上述现有技术,而提供一种分类准确率更高的sMRI图像顺序多分类方法。The technical problem to be solved by the present invention is to provide a sMRI image sequential multi-classification method with higher classification accuracy in view of the above-mentioned prior art.

本发明解决上述技术问题所采用的技术方案为:一种sMRI图像顺序多分类方法,其特征在于包括如下步骤:The technical solution adopted by the present invention to solve the above technical problem is: a sMRI image sequential multi-classification method, characterized by comprising the following steps:

步骤1、获取一定数量的sMRI图像及每张sMRI图像所对应的标签,形成样本集;Step 1, obtaining a certain number of sMRI images and the labels corresponding to each sMRI image to form a sample set;

步骤2、将样本集分成训练集、验证集和测试集;Step 2: Divide the sample set into training set, validation set and test set;

步骤3、构建网络模型;构建的网络模型包括特征提取和分类模型、排序模型和困难样本识别矫正模型;其中特征提取和分类模型包括特征提取模块和与特征提取模块相连接的分类模块;Step 3, constructing a network model; the constructed network model includes a feature extraction and classification model, a sorting model and a difficult sample recognition and correction model; wherein the feature extraction and classification model includes a feature extraction module and a classification module connected to the feature extraction module;

每批次训练时均选择至少一张标签为c1的样本图像、至少一张标签为c2的样本图像…至少一张标签为cn的样本图像,n为标签的总数;其中,c1>c2>…>cn,>为偏序关系;In each batch of training, at least one sample image with label c 1 , at least one sample image with label c 2 , ... at least one sample image with label c n is selected, where n is the total number of labels; among them, c 1 >c 2 >... >c n , and > is a partial order relationship;

使用任一批次的样本图像对网络模型进行训练的具体过程为:The specific process of training the network model using any batch of sample images is as follows:

步骤4-1、对当前批次选择的每张样本图像分别进行预处理,得到第一图像;Step 4-1, preprocessing each sample image selected in the current batch to obtain a first image;

步骤4-2、将当前批次选择的所有样本图像以及所有第一图像同时输入到特征提取模块中,得到特征向量;其中该特征向量包括所有样本图像所对应的第一特征向量和所有第一图像所对应的第二特征向量;Step 4-2, inputting all sample images and all first images selected in the current batch into the feature extraction module at the same time to obtain a feature vector; wherein the feature vector includes the first feature vectors corresponding to all sample images and the second feature vectors corresponding to all first images;

步骤4-3、将步骤4-2中得到的特征向量分别输入到排序模型、困难样本识别矫正模型和分类模块中,并分别计算得到排序模型所对应的第一损失函数、困难样本识别矫正模型所对应的第二损失函数和分类模块所对应的第三损失函数;Step 4-3, input the feature vector obtained in step 4-2 into the sorting model, the difficult sample identification and correction model and the classification module respectively, and calculate the first loss function corresponding to the sorting model, the second loss function corresponding to the difficult sample identification and correction model and the third loss function corresponding to the classification module respectively;

第一损失函数Lrank的具体计算过程为:The specific calculation process of the first loss function L rank is:

步骤4-31、从当前批次选择的所有样本图像分别选择一张标签为c1的样本图像、一张标签为c2的样本图像、…一张标签为cn的样本图像,将其组成图像集 k的初始值为1,对应为第k次选择出的标签为c1的样本图像,对应为第k次选择出的标签为c2的样本图像,对应为第k次选择出的标签为cn的样本图像;Step 4-31: Select a sample image with label c1 , a sample image with label c2 , ..., and a sample image with label cn from all sample images selected in the current batch, and form an image set The initial value of k is 1. Corresponding to the sample image with label c 1 selected for the kth time, Corresponding to the sample image with label c 2 selected for the kth time, The corresponding sample image is the one with label c n selected for the kth time;

并获取所对应的第一图像所对应的第一图像所对应的第一图像 and get The first image corresponding to The first image corresponding to The first image corresponding to

计算sMRI图像之间的距离关系矩阵S,S的计算公式为:Calculate the distance relationship matrix S between sMRI images. The calculation formula of S is:

其中S中第p行的数值分别表示所对应的标签距离关系度量值,p为奇数,并分别取值为1、3、5、…n;The values in the pth row of S represent and The corresponding label distance relationship metric value, p is an odd number, and takes values of 1, 3, 5, ... n respectively;

S中第q行的数值分别表示所对应的标签距离关系度量值,q为偶数,并分别取值为2、4、6、…n+1;The values in the qth row of S represent and The corresponding label distance relationship metric value, q, is an even number and takes values of 2, 4, 6, ...n+1 respectively;

S1、S2、S3…Sn均为任意两张图像的标签距离关系度量值,并且S1>S2>S3>SnS 1 , S 2 , S 3 …S n are all the label distance relationship measurement values of any two images, and S 1 >S 2 >S 3 >S n ;

步骤4-32、计算sMRI图像之间的真实距离矩阵的计算公式为:Step 4-32: Calculate the true distance matrix between sMRI images The calculation formula is:

其中第p行的数值分别表示之间的真实距离,p为奇数,并分别取值为1、3、5、…n;中第q行的数值分别表示之间的真实距离,q为偶数,并分别取值为2、4、6、…n+1;in The values in row p represent and The true distance between them, p is an odd number, and takes values of 1, 3, 5, ... n respectively; The values in the qth row represent and The real distance between them, q is an even number, and takes the values of 2, 4, 6, ...n+1 respectively;

即:输入到特征提取模块Fθ中而得到的第一特征向量;e∈{1、…n} Right now: for The first feature vector obtained by inputting it into the feature extraction module F θ ; e∈{1,…n}

即:输入到特征提取模块Fθ中而得到的第二特征向量; Right now: for The second feature vector obtained by inputting into the feature extraction module F θ ;

步骤4-33、计算步骤4-31中Gk所对应的排序损失 Step 4-33: Calculate the sorting loss corresponding to G k in step 4-31

其中,∏(.)为连乘符号, 为指示函数,若Sa,b=Sf,则II(Sa,b=Sf)=1;若Sa,b≠Sf,则II(Sa,b=Sf)=0;Sa,b为S中第a行第b列的值,中第c行第d列的值,Sc,d为S中第c行第d列的值;Among them, ∏(.) is the multiplication symbol, is the indicator function. If Sa,b = Sf , then II(Sa ,b = Sf ) = 1; if Sa ,bSf , then II( Sa,b = Sf ) = 0; Sa ,b is the value of the ath row and bth column in S. for S c,d is the value of the cth row and dth column in S;

步骤4-34、使k的值加上1,重新构建图像集Gk+1,并按照步骤4-31~步骤4-33中相同的方式,得到 Step 4-34, add 1 to the value of k, reconstruct the image set G k+1 , and follow the same method as in steps 4-31 to 4-33 to obtain

步骤4-35、依次类推以此构建图像集Gk+2、…Gg,其中每次构建的图像集G1、G2、…Gg各不相同,g=Nc1×Nc2×…×Ncn,Nc1为当前批次训练时选择的标签为c1的样本图像数量,Nc2为当前批次训练时选择的标签为c2的样本图像数量,…Ncn为当前批次训练时选择的标签为cn的样本图像数量;Step 4-35, and so on to construct image sets G k+2 , …G g , wherein the image sets G 1 , G 2 , …G g constructed each time are different, g=Nc 1 ×Nc 2 × …×Nc n , Nc 1 is the number of sample images with label c 1 selected in the current batch training, Nc 2 is the number of sample images with label c 2 selected in the current batch training, …Nc n is the number of sample images with label c n selected in the current batch training;

并按照步骤4-31~步骤4-33中相同的方式,依次得到 And follow the same method as in step 4-31 to step 4-33 to obtain

则第一损失函数Lrank的计算公式为:Then the calculation formula of the first loss function L rank is:

步骤4-4、根据第一损失函数、第二损失函数和第三损失函数,计算得到网络模型的总损失函数,并根据总损失函数更新网络模型的各个参数,即得到一次训练完成后的网络模型;Step 4-4: Calculate the total loss function of the network model according to the first loss function, the second loss function and the third loss function, and update the parameters of the network model according to the total loss function, so as to obtain the network model after one training is completed;

步骤5、将测试集中的待测试图像输入到最优的网络模型中,即得到待测试图像的分类结果。Step 5: Input the image to be tested in the test set into the optimal network model to obtain the classification result of the image to be tested.

作为改进,所述步骤4-3中第二损失函数Lhcr的具体计算过程为:As an improvement, the specific calculation process of the second loss function L hcr in step 4-3 is:

步骤4-a、将当前批次选择的所有样本图像以及所有第一图像组成样本集X″,X″=X∪X′,并将样本集X″输入到特征提取模块Fθ中得到Z″=Fθ(X″),计算Z″中每个样本zi属于其自身类别的后验概率Q(zi),zi∈Z″,Q(zi)的计算公式如下:Step 4-a, all sample images selected in the current batch and all first images are combined into a sample set X″, X″=X∪X′, and the sample set X″ is input into the feature extraction module F θ to obtain Z″=F θ (X″), and the posterior probability Q(z i ) of each sample z i in Z″ belonging to its own category is calculated, z i ∈ Z″, and the calculation formula of Q(z i ) is as follows:

其中,C为标签类别集合,C={c1、c2、…cn},Ni是zi的K近邻距离,其值由欧几里德距离计算得到,K=|Ni|;zj为Z″中的第j个样本,yj为zj的标签,N为当前批次的样本图像总数量;Where C is the label category set, C = {c 1 , c 2 , … c n }, Ni is the K nearest neighbor distance of z i , whose value is calculated by Euclidean distance, K = |N i |; z j is the jth sample in Z″, y j is the label of z j , and N is the total number of sample images in the current batch;

步骤4-b、利用交叉熵函数得到zi的标签确实是yi的概率di,di的计算公式如下:Step 4-b: Use the cross entropy function to get the probability d i that the label of z i is indeed y i . The calculation formula of d i is as follows:

di=l(Q(zi),yi);d i = l(Q(z i ),y i );

l为交叉熵函数;l is the cross entropy function;

步骤4-c、根据样本标签将所有的di划分为n个集合,其中第k个集合表示为Step 4-c: Divide all d i into n sets according to the sample labels, where the kth set is represented as

Dck={di|i=1~2N&yi=ck,ck∈C}D ck ={d i |i=1~2N&y i =c k ,c k ∈C}

将Dck中的元素按降序进行排列,并将Dck中前α%数量的元素作为困难样本,记为并且将Dck中剩余的1-α%数量的元素作为简单样本,记为Tck;α为经验值;Arrange the elements in D ck in descending order, and take the first α% of the elements in D ck as difficult samples, denoted as The remaining 1-α% of the elements in D ck are taken as simple samples and are recorded as T ck ; α is an empirical value;

则困难样本集合简单样本集合 The difficult sample set Simple sample set

步骤4-d、从简单样本集合T中任意选择一个简单样本za作为锚定样本,在困难样本集合中选择一个与za持有相同标签的困难样本zp作为正样本,并且从简单样本集合T中选择一个与za持有不同标签的简单样本zn作为负样本,以构造一个三元组gr={za,zp,zn},则第二损失函数Lhcr的计算公式为:Step 4-d: randomly select a simple sample z a from the simple sample set T as an anchor sample, and A difficult sample zp with the same label as za is selected as a positive sample from the set of simple samples T, and a simple sample zn with a different label from za is selected as a negative sample to construct a triplet gr = { za , zp , zn }. The calculation formula of the second loss function Lhcr is:

其中,是由三元组组合而成的三元组集合,NG是三元组的数量,是L2范式,Φ是一个边际值。in, is a set of triples composed of triples, N G is the number of triples, is the L2 norm, and Φ is a marginal value.

进一步地,所述步骤4-3中第三损失函数Lcls的计算过程为:Furthermore, the calculation process of the third loss function L cls in step 4-3 is:

其中,xe为当前批次中所有样本图像以及所有第一图像中的任一张图像,ye为x所对应的标签,Hθ(Fθ(xe))为将Fθ(xe)输入到分类模块Hθ中而得到的分类结果。Wherein, xe is any image among all sample images and all first images in the current batch, ye is the label corresponding to x, and ( ( xe )) is the classification result obtained by inputting ( xe ) into the classification module .

优选地,所述步骤4-4中总损失函数的计算公式为:Preferably, the calculation formula of the total loss function in step 4-4 is:

Lsum=Lcls+λ1*Lrank+λ2*LhcrL sum =L cls +λ1*L rank +λ2*L hcr ;

其中,λ1为预设的第一加权系数,λ2为预设的第二加权系数。Among them, λ1 is a preset first weighting coefficient, and λ2 is a preset second weighting coefficient.

与现有技术相比,本发明的优点在于:通过排序模型使不同标签的sMRI图像在特征嵌入空间呈现顺序分布,使这些不同类别的样本通过模型得到的特征向量之间的距离和在实际病理中的距离保持一致,从而使提取的不同类别的sMRI图像间的特征具有顺序特性,并提升网络分类性能;另外通过困难样本识别矫正模型使训练集中可能存在的少量困难样本的特征表示趋近大量的简单样本的特征表示,从而提高网络分类性能。因此该分类方法简单且提高了分类准确率。Compared with the prior art, the advantages of the present invention are: through the sorting model, sMRI images with different labels are sequentially distributed in the feature embedding space, so that the distance between the feature vectors of these samples of different categories obtained through the model is consistent with the distance in the actual pathology, so that the features between the extracted sMRI images of different categories have sequential characteristics and improve the network classification performance; in addition, through the difficult sample recognition correction model, the feature representation of a small number of difficult samples that may exist in the training set is made to approach the feature representation of a large number of simple samples, thereby improving the network classification performance. Therefore, the classification method is simple and improves the classification accuracy.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明实施例中sMRI图像顺序多分类方法的原理框图;FIG1 is a principle block diagram of a sequential multi-classification method for sMRI images according to an embodiment of the present invention;

图2为本发明实施例中排序模型的示意图;FIG2 is a schematic diagram of a sorting model in an embodiment of the present invention;

图3为本发明实施例中困难样本识别矫正模型的示意图。FIG. 3 is a schematic diagram of a difficult sample recognition and correction model according to an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

以下结合附图实施例对本发明作进一步详细描述。The present invention is further described in detail below with reference to the accompanying drawings.

如图1~3所示,本实施例中的sMRI图像顺序多分类方法包括如下步骤:As shown in FIGS. 1 to 3 , the sMRI image sequential multi-classification method in this embodiment includes the following steps:

步骤1、获取一定数量的sMRI图像及每张sMRI图像所对应的标签,形成样本集;Step 1, obtaining a certain number of sMRI images and the labels corresponding to each sMRI image to form a sample set;

本实施例中,将所有的sMRI图像都按照统一的操作进行预处理,首先利用FMRIB软件工具2实现原始图像的颅骨剥离和仿射配准操作,其中仿射配准步骤将sMRI图像与MNI152模板进行线性对齐,以消除全局线性差异,并将sMRI图像重新采样到1×1×1mm的空间分辨率;然后将sMRI图像归一化到[0,1]之间后按照最小外接立体框将每一幅sMRI图像的背景去除;最后使用背景零填充的方法将所有sMRI图像的大小都统一调整到160×160×160;In this embodiment, all sMRI images are preprocessed according to a unified operation. First, the skull stripping and affine registration operations of the original image are implemented using the FMRIB software tool 2. In the affine registration step, the sMRI image is linearly aligned with the MNI152 template to eliminate the global linear difference, and the sMRI image is resampled to a spatial resolution of 1×1×1mm; then the sMRI image is normalized to [0,1] and the background of each sMRI image is removed according to the minimum external stereo frame; finally, the size of all sMRI images is uniformly adjusted to 160×160×160 using the background zero filling method;

此外,由于数据量相对较少,所有的实验中使用五折交叉验证,将所有的sMRI图像随机分成5个相等的子集,依次将其中4个用于训练,其余一个用于验证;不在这5个子集中的数据被丢弃;In addition, due to the relatively small amount of data, five-fold cross-validation was used in all experiments, and all sMRI images were randomly divided into five equal subsets, four of which were used for training and the remaining one for validation; data not in these five subsets were discarded;

步骤2、将样本集分成训练集、验证集和测试集;Step 2: Divide the sample set into training set, validation set and test set;

步骤3、构建网络模型;构建的网络模型包括特征提取和分类模型、排序模型和困难样本识别矫正模型;其中特征提取和分类模型包括特征提取模块和与特征提取模块相连接的分类模块;Step 3, constructing a network model; the constructed network model includes a feature extraction and classification model, a sorting model and a difficult sample recognition and correction model; wherein the feature extraction and classification model includes a feature extraction module and a classification module connected to the feature extraction module;

Plackett-Luce(PL)模型是一个经典的排名模型,如图2所示,本实施例中,首先设计一个顺序距离关系矩阵来描述不同病程中sMRI图像之间顺序性质,接着提出一个PL约束的排序损失,来量化所估计出的不同标签的sMRI图像之间顺序关系与实际顺序关系之间的差异;The Plackett-Luce (PL) model is a classic ranking model, as shown in FIG2 . In this embodiment, a sequential distance relationship matrix is first designed to describe the sequential nature of sMRI images in different disease courses, and then a PL-constrained ranking loss is proposed to quantify the difference between the estimated sequential relationship between sMRI images with different labels and the actual sequential relationship;

如图3所示,本实施例中利用基于KNN和交叉熵损失的后验概率估计来识别困难和简单的样本,以简单样本的方法,诱导具有相同标签的困难样本来逼近简单样本;As shown in FIG3 , in this embodiment, the posterior probability estimation based on KNN and cross entropy loss is used to identify difficult and simple samples, and the method of simple samples is used to induce difficult samples with the same labels to approximate simple samples;

步骤4、将训练集中所有的样本图像分批次输入到步骤3中构建的网络模型中进行训练,并使用验证集中所有图像验证训练后的网络模型性能;经过多次训练与验证后,筛选出最优的网络模型;Step 4: Input all sample images in the training set into the network model constructed in step 3 in batches for training, and use all images in the validation set to verify the performance of the trained network model; after multiple training and validation, select the optimal network model;

每批次训练时均选择至少一张标签为c1的样本图像、至少一张标签为c2的样本图像…至少一张标签为cn的样本图像,n为标签的总数;其中,c1>c2>…>cn,>为偏序关系;In each batch of training, at least one sample image with label c 1 , at least one sample image with label c 2 , ... at least one sample image with label c n is selected, where n is the total number of labels; among them, c 1 >c 2 >... >c n , and > is a partial order relationship;

使用任一批次的样本图像对网络模型进行训练的具体过程为:The specific process of training the network model using any batch of sample images is as follows:

步骤4-1、对当前批次选择的每张样本图像分别进行预处理,得到第一图像;Step 4-1, preprocessing each sample image selected in the current batch to obtain a first image;

步骤4-2、将当前批次选择的所有样本图像以及所有第一图像同时输入到特征提取模块中,得到特征向量;其中该特征向量包括所有样本图像所对应的第一特征向量和所有第一图像所对应的第二特征向量;Step 4-2, inputting all sample images and all first images selected in the current batch into the feature extraction module at the same time to obtain a feature vector; wherein the feature vector includes the first feature vectors corresponding to all sample images and the second feature vectors corresponding to all first images;

步骤4-3、将步骤4-2中得到的特征向量分别输入到排序模型、困难样本识别矫正模型和分类模块中,并分别计算得到排序模型所对应的第一损失函数、困难样本识别矫正模型所对应的第二损失函数和分类模块所对应的第三损失函数;Step 4-3, input the feature vector obtained in step 4-2 into the sorting model, the difficult sample identification and correction model and the classification module respectively, and calculate the first loss function corresponding to the sorting model, the second loss function corresponding to the difficult sample identification and correction model and the third loss function corresponding to the classification module respectively;

第一损失函数Lrand的具体计算过程为:The specific calculation process of the first loss function L rand is:

第一损失函数Lrank的具体计算过程为:The specific calculation process of the first loss function L rank is:

步骤4-31、从当前批次选择的所有样本图像分别选择一张标签为c1的样本图像、一张标签为c2的样本图像、…一张标签为cn的样本图像,将其组成图像集 k的初始值为1,对应为第k次选择出的标签为c1的样本图像,对应为第k次选择出的标签为c2的样本图像,对应为第k次选择出的标签为cn的样本图像;Step 4-31: Select a sample image with label c1 , a sample image with label c2 , ..., and a sample image with label cn from all sample images selected in the current batch, and form an image set The initial value of k is 1. Corresponding to the sample image with label c 1 selected for the kth time, Corresponding to the sample image with label c 2 selected for the kth time, The corresponding sample image is the one with label c n selected for the kth time;

并获取所对应的第一图像所对应的第一图像所对应的第一图像 and get The first image corresponding to The corresponding first image The corresponding first image

计算sMRI图像(该sMRI图像为上述的样本图像和第一图像)之间的距离关系矩阵S,S的计算公式为:The distance relationship matrix S between the sMRI images (the sMRI images are the sample image and the first image) is calculated. The calculation formula of S is:

其中S中第p行的数值分别表示所对应的标签距离关系度量值,p为奇数,并分别取值为1、3、5、…n;The values in the pth row of S represent and The corresponding label distance relationship metric value, p is an odd number, and takes values of 1, 3, 5, ... n respectively;

S中第q行的数值分别表示所对应的标签距离关系度量值,q为偶数,并分别取值为2、4、6、…n+1;The values in the qth row of S represent and The corresponding label distance relationship metric value, q, is an even number, and takes values of 2, 4, 6, ...n+1 respectively;

S1、S2、S3…Sn均为任意两张图像的标签距离关系度量值,并且S1>S2>S3>SnS 1 , S 2 , S 3 …S n are all the label distance relationship measurement values of any two images, and S 1 >S 2 >S 3 >S n ;

步骤4-32、计算sMRI图像之间的真实距离矩阵的计算公式为:Step 4-32: Calculate the true distance matrix between sMRI images The calculation formula is:

其中第p行的数值分别表示之间的真实距离,p为奇数,并分别取值为1、3、5、…n;中第q行的数值分别表示之间的真实距离,q为偶数,并分别取值为2、4、6、…n+1;in The values in row p represent and The true distance between them, p is an odd number, and takes values of 1, 3, 5, ... n respectively; The values in the qth row represent and The real distance between them, q is an even number, and takes the values of 2, 4, 6, ...n+1 respectively;

即:输入到特征提取模块Fθ中而得到的第一特征向量;e∈{1、…n} Right now: for The first feature vector obtained by inputting it into the feature extraction module F θ ; e∈{1,…n}

即:输入到特征提取模块Fθ中而得到的第二特征向量; Right now: for The second feature vector obtained by inputting into the feature extraction module F θ ;

步骤4-33、计算步骤4-31中Gk所对应的排序损失 Step 4-33: Calculate the sorting loss corresponding to G k in step 4-31

其中,∏(.)为连乘符号, 为指示函数,若Sa,b=Sf,则II(Sa,b=Sf)=1;若Sa,b≠Sf,则II(Sa,b=Sf)=0;Sa,b为S中第a行第b列的值,中第c行第d列的值,Sc,d为S中第c行第d列的值;Among them, ∏(.) is the multiplication symbol, is the indicator function. If Sa,b = Sf , then II(Sa ,b = Sf ) = 1; if Sa ,bSf , then II( Sa,b = Sf ) = 0; Sa ,b is the value of the ath row and bth column in S. for S c,d is the value of the cth row and dth column in S;

步骤4-34、使k的值加上1,重新构建图像集Gk+1,并按照步骤4-31~步骤4-33中相同的方式,得到 Step 4-34, add 1 to the value of k, reconstruct the image set G k+1 , and follow the same method as in steps 4-31 to 4-33 to obtain

步骤4-35、依次类推以此构建图像集Gk+2、…Gg,其中每次构建的图像集G1、G2、…Gg各不相同,g=Nc1×Nc2×…×Ncn,Nc1为当前批次训练时选择的标签为c1的样本图像数量,Nc2为当前批次训练时选择的标签为c2的样本图像数量,…Ncn为当前批次训练时选择的标签为cn的样本图像数量;Step 4-35, and so on to construct image sets G k+2 , …G g , wherein the image sets G 1 , G 2 , …G g constructed each time are different, g=Nc 1 ×Nc 2 × …×Nc n , Nc 1 is the number of sample images with label c 1 selected in the current batch training, Nc 2 is the number of sample images with label c 2 selected in the current batch training, …Nc n is the number of sample images with label c n selected in the current batch training;

并按照步骤4-31~步骤4-33中相同的方式,依次得到 And follow the same method as in step 4-31 to step 4-33 to obtain

则第一损失函数Lrank的计算公式为:Then the calculation formula of the first loss function L rank is:

上述第二损失函数Lhcr的具体计算过程为:The specific calculation process of the second loss function L hcr is as follows:

步骤4-a、将当前批次选择的所有样本图像以及所有第一图像组成样本集X″,X″=X∪X′,并将样本集X″输入到特征提取模块Fθ中得到Z″=Fθ(X″),计算Z″中每个样本zi属于其自身类别的后验概率Q(zi),zi∈Z″,Q(zi)的计算公式如下:Step 4-a, all sample images selected in the current batch and all first images are combined into a sample set X″, X″=X∪X′, and the sample set X″ is input into the feature extraction module F θ to obtain Z″=F θ (X″), and the posterior probability Q(z i ) of each sample z i in Z″ belonging to its own category is calculated, z i ∈ Z″, and the calculation formula of Q(z i ) is as follows:

其中,C为标签类别集合,C={c1、c2、…cn},Ni是zi的K近邻距离,其值由欧几里德距离计算得到,K=|Ni|;zj为Z″中第j个样本,yj为zj的标签,N为当前批次的样本图像总数量;本实施例中K=8;Wherein, C is a set of label categories, C = {c 1 , c 2 , ... c n }, Ni is the K nearest neighbor distance of z i , and its value is calculated by Euclidean distance, K = |N i |; z j is the jth sample in Z″, y j is the label of z j , and N is the total number of sample images in the current batch; in this embodiment, K = 8;

步骤4-b、利用交叉熵函数得到zi的标签确实是yi的概率di,di的计算公式如下:Step 4-b: Use the cross entropy function to get the probability d i that the label of z i is indeed y i . The calculation formula of d i is as follows:

di=l(Q(zi),yi);d i = l(Q(z i ),y i );

l为交叉熵函数;l is the cross entropy function;

步骤4-c、根据样本标签将所有的di划分为n个集合,其中第k个集合表示为Step 4-c: Divide all d i into n sets according to the sample labels, where the kth set is represented as

Dck={di|i=1~2N&yi=ck,ck∈C}D ck ={d i |i=1~2N&y i =c k ,c k ∈C}

将Dck中的元素按降序进行排列,并将Dck中前α%数量的元素作为困难样本,记为并且将Dck中剩余的1-α%数量的元素作为简单样本,记为Tck;α为经验值;Arrange the elements in D ck in descending order, and take the first α% of the elements in D ck as difficult samples, denoted as The remaining 1-α% of the elements in D ck are taken as simple samples and are recorded as T ck ; α is an empirical value;

则困难样本集合简单样本集合 The difficult sample set Simple sample set

步骤4-d、从简单样本集合T中任意选择一个简单样本za作为锚定样本,在困难样本集合中选择一个与za持有相同标签的困难样本zp作为正样本,并且从简单样本集合T中选择一个与za持有不同标签的简单样本zn作为负样本,以构造一个三元组gr={za,zp,zn},则第二损失函数Lhcr的计算公式为:Step 4-d: randomly select a simple sample z a from the simple sample set T as an anchor sample, and A difficult sample zp with the same label as za is selected as a positive sample from the set of simple samples T, and a simple sample zn with a different label from za is selected as a negative sample to construct a triplet gr = { za , zp , zn }. The calculation formula of the second loss function Lhcr is:

其中,是由三元组组合而成的三元组集合,NG是三元组的数量,是L2范式,Φ是一个边际值;本实施例中Φ=0.2;in, is a set of triples composed of triples, N G is the number of triples, is the L2 norm, Φ is a marginal value; in this embodiment, Φ = 0.2;

本实施例中,在图像输入处使用在线数据增强方法,包括简单的随机旋转和随机平移方法。具体来说,在任何小批次中,对于输入的图像数据集X,使用数据增强方法后就能生成一个同等数据量和尺寸的增强数据集X′,原始数据集X和增强数据集X′被同时输入到网络中,经过模型推理后能得到对应的预测结果,并最终根据由交叉熵损失计算得到的分类损失优化模型;In this embodiment, an online data enhancement method is used at the image input, including a simple random rotation and random translation method. Specifically, in any small batch, for the input image dataset X, an enhanced dataset X′ with the same data volume and size can be generated after using the data enhancement method. The original dataset X and the enhanced dataset X′ are simultaneously input into the network, and the corresponding prediction results can be obtained after model inference, and finally the model is optimized according to the classification loss calculated by the cross entropy loss;

第三损失函数Lcls的计算过程为:The calculation process of the third loss function L cls is:

其中,xe为当前批次中所有样本图像以及所有第一图像中的任一张图像,ye为xe所对应的标签,Hθ(Fθ(xe))为将Fθ(xe)输入到分类模块Hθ中而得到的分类结果;Wherein, x e is any image among all sample images and all first images in the current batch, ye is the label corresponding to x e , and H θ (F θ (x e )) is the classification result obtained by inputting F θ (x e ) into the classification module H θ ;

本实施例中,特征提取和分类模型的网络结构如下表1所示,其中特征提取模块Fθ是以3D-ResNet18为基础的特征提取器,分类模块Hθ是一个将高维特征向量映射到类别数的线性分类器。需要注意的是,3D-ResNet18的全局平均池化层和分类器中间插入了一个特征映射层,它实质上是一个512×128的全连接层。通过这个特征映射层,所有图像能被映射为在一个统一的特征空间中的特征表示,所提出的排序模型、困难样本识别矫正模型将这些特征表示作为输入,并计算相应的损失;In this embodiment, the network structure of the feature extraction and classification model is shown in Table 1 below, where the feature extraction module F θ is a feature extractor based on 3D-ResNet18, and the classification module H θ is a linear classifier that maps high-dimensional feature vectors to the number of categories. It should be noted that a feature mapping layer is inserted between the global average pooling layer and the classifier of 3D-ResNet18, which is essentially a 512×128 fully connected layer. Through this feature mapping layer, all images can be mapped into feature representations in a unified feature space. The proposed sorting model and difficult sample recognition and correction model take these feature representations as input and calculate the corresponding losses;

表1特征提取和分类模型的网络结构Table 1 Network structure of feature extraction and classification model

步骤4-4、根据第一损失函数、第二损失函数和第三损失函数,计算得到网络模型的总损失函数,并根据总损失函数更新网络模型的各个参数,即得到一次训练完成后的网络模型;Step 4-4: Calculate the total loss function of the network model according to the first loss function, the second loss function and the third loss function, and update the parameters of the network model according to the total loss function, so as to obtain the network model after one training is completed;

总损失函数的计算公式为:The calculation formula of the total loss function is:

Lsum=Lcls+λ1*Lrank+λ2*LhcrL sum =L cls +λ1*L rank +λ2*L hcr ;

其中,λ1为预设的第一加权系数,λ2为预设的第二加权系数;本实施例中λ1=0.01且λ2=0.001;Wherein, λ1 is a preset first weighting coefficient, and λ2 is a preset second weighting coefficient; in this embodiment, λ1=0.01 and λ2=0.001;

步骤5、将测试集中的待测试图像输入到最优的网络模型中,即得到待测试图像的分类结果。Step 5: Input the image to be tested in the test set into the optimal network model to obtain the classification result of the image to be tested.

考虑到脑疾病是一个渐进过程,假设c1,c2和c3分别表示阿尔茨海默疾病的三个渐进过程的标签,即C={c1,c2,c3}且c1>c2>c3(该偏序关系表示阿尔茨海默疾病的具体三个严重程度,如c1表示为正常,c2表示为轻度认知障碍,c3表示为阿尔茨海默病,标签级别越高则表示当前疾病越严重),每张SMRI图像所对应的标签提取方法可参考专利号为ZL202010772776.0(授权公告号为CN111738363B)的发明专利《基于改进的3D CNN网络的阿尔茨海默病分类方法》中所披露的内容,则 G1′为图像集G1所对应的第一图像集合,其中的标签是相同的,即为cr,r∈{1,2,3}。Considering that brain disease is a progressive process, it is assumed that c 1 , c 2 and c 3 represent the labels of the three progressive processes of Alzheimer's disease, that is, C = {c 1 , c 2 , c 3 } and c 1 >c 2 >c 3 (this partial order relationship represents the three specific severity levels of Alzheimer's disease, such as c 1 represents normal, c 2 represents mild cognitive impairment, and c 3 represents Alzheimer's disease. The higher the label level, the more serious the current disease). The label extraction method corresponding to each SMRI image can refer to the content disclosed in the invention patent "Alzheimer's disease classification method based on improved 3D CNN network" with patent number ZL202010772776.0 (authorization announcement number CN111738363B), then G 1 ′ is the first image set corresponding to the image set G 1 , where and The labels are the same, that is, cr , r∈{1,2,3}.

在脑疾病的进展中可以发现处于某一阶段的sMRI图像与其处于相同阶段的增强图像之间的距离最近,与持有相邻标签的sMRI图像之间的距离次之,与持有非相邻标签的sMRI图像之间的距离最远;则本实施例中S的计算公式为:In the progression of brain diseases, it can be found that the distance between the sMRI image at a certain stage and the enhanced image at the same stage is the shortest, the distance between the sMRI image with adjacent labels is the second shortest, and the distance between the sMRI image with non-adjacent labels is the farthest; the calculation formula of S in this embodiment is:

其中,S1,S2和S3分别表示不同sMRI图像之间标签在病理阶段上最近、第二近和第三近的距离关系,并且S1>S2>S3;值得注意的是,Si并不是一个距离值,而是一个对距离关系的度量值,并且重要的不是Si的值,而是S1,S2和S3之间的关系可以看到,设计的顺序距离关系矩阵S描述了sMRI图像之间的距离的顺序性质。Among them, S 1 , S 2 and S 3 respectively represent the closest, second closest and third closest distance relationships between labels of different sMRI images in pathological stages, and S 1 >S 2 >S 3 ; it is worth noting that S i is not a distance value, but a measure of the distance relationship, and what is important is not the value of S i , but the relationship between S 1 , S 2 and S 3. It can be seen that the designed sequential distance relationship matrix S describes the sequential nature of the distance between sMRI images.

中,从上到下的行和从左到右的列所表示的含义与S中相同。本模型的目标是通过使用PL模型来驱动特征提取模块Fθ提取的图像特征间的距离关系满足S中的距离关系。exist In , the meanings of the rows from top to bottom and the columns from left to right are the same as those in S. The goal of this model is to drive the distance relationship between image features extracted by the feature extraction module F θ using the PL model Satisfy the distance relation in S.

其中,P表示预测的真实距离矩阵VΩ满足S中顺序距离关系的概率,量化了中元素的得分,此元素对应在S中的元素值为Sf,详细地说,可以通过平均化中所有具有距离关系值Sf的元素值得到。Among them, P represents the probability that the predicted true distance matrix V Ω satisfies the order distance relationship in S, Quantified The score of the element in S is S f . Specifically, By averaging The values of all elements with distance relationship value S f in are obtained.

本实施例还涉及一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如上述的sMRI图像顺序多分类方法。The present embodiment further relates to a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the sMRI image sequential multi-classification method as described above is executed.

Claims (4)

1.一种sMRI图像顺序多分类方法,其特征在于包括如下步骤:1. A sequential multi-classification method for sMRI images, comprising the following steps: 步骤1、获取一定数量的sMRI图像及每张sMRI图像所对应的标签,形成样本集;Step 1, obtaining a certain number of sMRI images and the labels corresponding to each sMRI image to form a sample set; 步骤2、将样本集分成训练集、验证集和测试集;Step 2: Divide the sample set into training set, validation set and test set; 步骤3、构建网络模型;构建的网络模型包括特征提取和分类模型、排序模型和困难样本识别矫正模型;其中特征提取和分类模型包括特征提取模块和与特征提取模块相连接的分类模块;Step 3, constructing a network model; the constructed network model includes a feature extraction and classification model, a sorting model and a difficult sample recognition and correction model; wherein the feature extraction and classification model includes a feature extraction module and a classification module connected to the feature extraction module; 步骤4、将训练集中所有的样本图像分批次输入到步骤3中构建的网络模型中进行训练,并使用验证集中所有图像验证训练后的网络模型性能;经过多次训练与验证后,筛选出最优的网络模型;Step 4: Input all sample images in the training set into the network model constructed in step 3 in batches for training, and use all images in the validation set to verify the performance of the trained network model; after multiple training and validation, select the optimal network model; 每批次训练时均选择至少一张标签为c1的样本图像、至少一张标签为c2的样本图像....至少一张标签为cn的样本图像,n为标签的总数;其中,c1>c2>…>cn,>为偏序关系;In each batch of training, at least one sample image with label c 1 , at least one sample image with label c 2 , ... at least one sample image with label c n is selected, where n is the total number of labels; among them, c 1 >c 2 >…>c n , and > is a partial order relationship; 使用任一批次的样本图像对网络模型进行训练的具体过程为:The specific process of training the network model using any batch of sample images is as follows: 步骤4-1、对当前批次选择的每张样本图像分别进行预处理,得到第一图像;Step 4-1, preprocessing each sample image selected in the current batch to obtain a first image; 步骤4-2、将当前批次选择的所有样本图像以及所有第一图像同时输入到特征提取模块中,得到特征向量;其中该特征向量包括所有样本图像所对应的第一特征向量和所有第一图像所对应的第二特征向量;Step 4-2, inputting all sample images and all first images selected in the current batch into the feature extraction module at the same time to obtain a feature vector; wherein the feature vector includes the first feature vectors corresponding to all sample images and the second feature vectors corresponding to all first images; 步骤4-3、将步骤4-2中得到的特征向量分别输入到排序模型、困难样本识别矫正模型和分类模块中,并分别计算得到排序模型所对应的第一损失函数、困难样本识别矫正模型所对应的第二损失函数和分类模块所对应的第三损失函数;Step 4-3, input the feature vector obtained in step 4-2 into the sorting model, the difficult sample identification and correction model and the classification module respectively, and calculate the first loss function corresponding to the sorting model, the second loss function corresponding to the difficult sample identification and correction model and the third loss function corresponding to the classification module respectively; 第一损失函数Lrank的具体计算过程为:The specific calculation process of the first loss function L rank is: 步骤4-31、从当前批次选择的所有样本图像中分别选择一张标签为c1的样本图像、一张标签为c2的样本图像、…一张标签为cn的样本图像,将其组成图像集 k的初始值为1,对应为第k次选择出的标签为c1的样本图像,对应为第k次选择出的标签为c2的样本图像,对应为第k次选择出的标签为cn的样本图像;Step 4-31: Select a sample image with label c1 , a sample image with label c2 , ..., and a sample image with label cn from all sample images selected in the current batch, and form them into an image set The initial value of k is 1. Corresponding to the sample image with label c 1 selected for the kth time, Corresponding to the sample image with label c 2 selected for the kth time, The corresponding sample image is the one with label c n selected for the kth time; 并获取所对应的第一图像所对应的第一图像所对应的第一图像 and get The first image corresponding to The corresponding first image The corresponding first image 计算sMRI图像之间的距离关系矩阵S,S的计算公式为:Calculate the distance relationship matrix S between sMRI images. The calculation formula of S is: 其中S中第p行的数值分别表示所对应的标签距离关系度量值,p为奇数,并分别取值为1、3、5、…n;The values in the pth row of S represent and The corresponding label distance relationship metric value, p is an odd number, and takes values of 1, 3, 5, ... n respectively; S中第q行的数值分别表示所对应的标签距离关系度量值,q为偶数,并分别取值为2、4、6、…n+1;The values in the qth row of S represent and The corresponding label distance relationship metric value, q, is an even number and takes values of 2, 4, 6, ...n+1 respectively; S1、S2、S3…Sn均为任意两张图像的标签距离关系度量值,并且S1>S2>S3>SnS 1 , S 2 , S 3 …S n are all the label distance relationship measurement values of any two images, and S 1 >S 2 >S 3 >S n ; 步骤4-32、计算sMRI图像之间的真实距离矩阵 的计算公式为:Step 4-32: Calculate the true distance matrix between sMRI images The calculation formula is: 其中第p行的数值分别表示之间的真实距离,p为奇数,并分别取值为1、3、5、…n;中第q行的数值分别表示之间的真实距离,q为偶数,并分别取值为2、4、6、…n+1;in The values in row p represent and The true distance between them, p is an odd number, and takes values of 1, 3, 5, ... n respectively; The values in the qth row represent and The real distance between them, q is an even number, and takes the values of 2, 4, 6, ...n+1 respectively; 即:输入到特征提取模块Fθ中而得到的第一特征向量;e∈{1、…n} Right now: for The first feature vector obtained by inputting it into the feature extraction module F θ ; e∈{1,…n} 即:输入到特征提取模块Fθ中而得到的第二特征向量; Right now: for The second feature vector obtained by inputting into the feature extraction module F θ ; 步骤4-33、计算步骤4-31中Gk所对应的排序损失 Step 4-33: Calculate the sorting loss corresponding to G k in step 4-31 其中,∏(.)为连乘符号,II(.)为指示函数,若Sa,b=Sf,则II(Sa,b=Sf)=1;若Sa,b≠Sf,则II(Sa,b=Sf)=0;Sa,b为S中第a行第b列的值,中第c行第d列的值,Sc,d为S中第c行第d列的值;Among them, ∏(.) is the multiplication symbol, II(.) is the indicator function. If Sa ,b = Sf , then II(Sa ,b = Sf ) = 1; if Sa ,bSf , then II(Sa ,b = Sf ) = 0; Sa ,b is the value of the ath row and bth column in S. for S c,d is the value of the cth row and dth column in S; 步骤4-34、使k的值加上1,重新构建图像集Gk+1,并按照步骤4-31~步骤4-33中相同的方式,得到 Step 4-34: Add 1 to the value of k, reconstruct the image set G k+1 , and follow the same method as in steps 4-31 to 4-33 to obtain 步骤4-35、依次类推以此构建图像集Gk+2、…Gg,其中每次构建的图像集G1、G2、…Gg各不相同,g=Nc1×Nc2×…×Ncn,Nc1为当前批次训练时选择的标签为c1的样本图像数量,Nc2为当前批次训练时选择的标签为c2的样本图像数量,…Ncn为当前批次训练时选择的标签为cn的样本图像数量;Step 4-35, and so on to construct image sets G k+2 , …G g , wherein the image sets G 1 , G 2 , …G g constructed each time are different, g=Nc 1 ×Nc 2 × …×Nc n , Nc 1 is the number of sample images with label c 1 selected in the current batch training, Nc 2 is the number of sample images with label c 2 selected in the current batch training, …Nc n is the number of sample images with label c n selected in the current batch training; 并按照步骤4-31~步骤4-33中相同的方式,依次得到 And follow the same method as in step 4-31 to step 4-33 to obtain 则第一损失函数Lrank的计算公式为:Then the calculation formula of the first loss function L rank is: 步骤4-4、根据第一损失函数、第二损失函数和第三损失函数,计算得到网络模型的总损失函数,并根据总损失函数更新网络模型的各个参数,即得到一次训练完成后的网络模型;Step 4-4: Calculate the total loss function of the network model according to the first loss function, the second loss function and the third loss function, and update the parameters of the network model according to the total loss function, so as to obtain the network model after one training is completed; 步骤5、将测试集中的待测试图像输入到最优的网络模型中,即得到待测试图像的分类结果。Step 5: Input the image to be tested in the test set into the optimal network model to obtain the classification result of the image to be tested. 2.根据权利要求1所述的sMRI图像顺序多分类方法,其特征在于:所述步骤4-3中第二损失函数Lhcr的具体计算过程为:2. The sMRI image sequential multi-classification method according to claim 1, characterized in that: the specific calculation process of the second loss function L hcr in step 4-3 is: 步骤4-a、将当前批次选择的所有样本图像以及所有第一图像组成样本集X″,X″=X∪X′,并将样本集X″输入到特征提取模块Fθ中得到Z″=Fθ(X″),计算Z″中每个样本zi属于其自身类别的后验概率Q(zi),zi∈Z″,Q(zi)的计算公式如下:Step 4-a, all sample images selected in the current batch and all first images are combined into a sample set X″, X″=X∪X′, and the sample set X″ is input into the feature extraction module F θ to obtain Z″=F θ (X″), and the posterior probability Q(z i ) of each sample z i in Z″ belonging to its own category is calculated, z i ∈ Z″, and the calculation formula of Q(z i ) is as follows: 其中,C为标签类别集合,C={c1、c2、…cn},Ni是zi的K近邻距离,其值由欧几里德距离计算得到,K=|Ni|;zj为Z″中的第j个样本,yj为zj的标签,N为当前批次的样本图像总数量;Where C is the label category set, C = {c 1 , c 2 , … c n }, Ni is the K nearest neighbor distance of z i , whose value is calculated by Euclidean distance, K = |N i |; z j is the jth sample in Z″, y j is the label of z j , and N is the total number of sample images in the current batch; 步骤4-b、利用交叉熵函数得到zi的标签确实是yi的概率di,di的计算公式如下:Step 4-b: Use the cross entropy function to get the probability d i that the label of z i is indeed y i . The calculation formula of d i is as follows: di=l(Q(zi),yi);d i = l(Q(z i ),y i ); l为交叉熵函数;l is the cross entropy function; 步骤4-c、根据样本标签将所有的di划分为n个集合,其中第k个集合表示为Step 4-c: Divide all d i into n sets according to the sample labels, where the kth set is represented as Dck={di|i=1~2N&yi=ck,ck∈C}D ck ={d i |i=1~2N&y i =c k ,c k ∈C} 将Dck中的元素按降序进行排列,并将Dck中前α%数量的元素作为困难样本,记为并且将Dck中剩余的1-α%数量的元素作为简单样本,记为Tck;α为经验值;Arrange the elements in D ck in descending order, and take the first α% of the elements in D ck as difficult samples, denoted as The remaining 1-α% of the elements in D ck are taken as simple samples and recorded as T ck ; α is an empirical value; 则困难样本集合简单样本集合 The difficult sample set Simple sample set 步骤4-d、从简单样本集合T中任意选择一个简单样本za作为锚定样本,在困难样本集合中选择一个与za持有相同标签的困难样本zp作为正样本,并且从简单样本集合T中选择一个与za持有不同标签的简单样本zn作为负样本,以构造一个三元组gr={za,zp,zn},则第二损失函数Lhcr的计算公式为:Step 4-d: randomly select a simple sample z a from the simple sample set T as an anchor sample, and A difficult sample zp with the same label as za is selected as a positive sample from the set of simple samples T, and a simple sample zn with a different label from za is selected as a negative sample to construct a triplet gr = { za , zp , zn }. The calculation formula of the second loss function Lhcr is: 其中,是由三元组组合而成的三元组集合,NG是三元组的数量,是L2范式,Φ是一个边际值。in, is a set of triples composed of triples, N G is the number of triples, is the L2 norm, and Φ is a marginal value. 3.根据权利要求2所述的sMRI图像顺序多分类方法,其特征在于:所述步骤4-3中第三损失函数Lcls的计算过程为:3. The sMRI image sequential multi-classification method according to claim 2, characterized in that: the calculation process of the third loss function L cls in step 4-3 is: 其中,xe为当前批次中所有样本图像以及所有第一图像中的任一张图像,ye为xe所对应的标签,Hθ(Fθ(xe))为将Fθ(xe)输入到分类模块Hθ中而得到的分类结果。Wherein, xe is any image among all sample images and all first images in the current batch, ye is the label corresponding to xe , and ( ( xe )) is the classification result obtained by inputting ( xe ) into the classification module . 4.根据权利要求3所述的sMRI图像顺序多分类方法,其特征在于:所述步骤4-4中总损失函数的计算公式为:4. The sMRI image sequential multi-classification method according to claim 3, characterized in that: the calculation formula of the total loss function in step 4-4 is: Lsum=Lcls+λ1*Lrank+λ2*LhcrL sum =L cls +λ1*L rank +λ2*L hcr ; 其中,λ1为预设的第一加权系数,λ2为预设的第二加权系数。Among them, λ1 is a preset first weighting coefficient, and λ2 is a preset second weighting coefficient.
CN202310822010.2A 2023-07-05 2023-07-05 SMRI image sequential multi-classification method Active CN116740463B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310822010.2A CN116740463B (en) 2023-07-05 2023-07-05 SMRI image sequential multi-classification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310822010.2A CN116740463B (en) 2023-07-05 2023-07-05 SMRI image sequential multi-classification method

Publications (2)

Publication Number Publication Date
CN116740463A CN116740463A (en) 2023-09-12
CN116740463B true CN116740463B (en) 2024-08-13

Family

ID=87913350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310822010.2A Active CN116740463B (en) 2023-07-05 2023-07-05 SMRI image sequential multi-classification method

Country Status (1)

Country Link
CN (1) CN116740463B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117218447B (en) * 2023-09-27 2024-08-02 宁波大学 Multi-center sMRI image multi-classification method based on generative adversarial network
CN119559659B (en) * 2025-01-27 2025-04-29 中通服创立信息科技有限责任公司 Certificate type identification method, device, equipment and medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113221964A (en) * 2021-04-22 2021-08-06 华南师范大学 Single sample image classification method, system, computer device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3888456B2 (en) * 2002-09-10 2007-03-07 ソニー株式会社 Digital still camera
CN110263697A (en) * 2019-06-17 2019-09-20 哈尔滨工业大学(深圳) Pedestrian based on unsupervised learning recognition methods, device and medium again

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113221964A (en) * 2021-04-22 2021-08-06 华南师范大学 Single sample image classification method, system, computer device and storage medium

Also Published As

Publication number Publication date
CN116740463A (en) 2023-09-12

Similar Documents

Publication Publication Date Title
CN116740463B (en) SMRI image sequential multi-classification method
CN111461232A (en) An MRI Image Classification Method Based on Multi-Strategy Batch Active Learning
CN115393269B (en) Extensible multi-level graph neural network model based on multi-mode image data
CN110363760B (en) Computer system for recognizing medical images
CN113616184A (en) Brain network modeling and individual prediction method based on multi-mode magnetic resonance image
CN113705670B (en) Brain image classification method and device based on magnetic resonance imaging and deep learning
CN110934587A (en) Alzheimer disease auxiliary diagnosis method based on atlas neural network
CN114187258B (en) Autism classifier construction method and system based on human brain functional magnetic resonance imaging
CN110070935A (en) Medical image synthetic method, classification method and device based on confrontation neural network
CN107480702B (en) Feature selection and feature fusion method for HCC pathological image recognition
CN111540467B (en) Schizophrenia classification identification method, operation control device and medical equipment
WO2020103683A1 (en) Method and system for individualized prediction of mental illness on basis of brain function map monkey-human cross-species migration
CN107133461B (en) Medical image processing device and method based on self-encoder
WO2022205502A1 (en) Image classification model construction method, image classification method, and storage medium
WO2022127500A1 (en) Multiple neural networks-based mri image segmentation method and apparatus, and device
CN111127490A (en) Medical image segmentation method based on cyclic residual U-Net network
CN116468655B (en) Brain development atlas and image processing system based on fetal magnetic resonance imaging
CN113786185B (en) Static brain network feature extraction method and system based on convolutional neural network
Ding et al. High-order correlation detecting in features for diagnosis of Alzheimer’s disease and mild cognitive impairment
CN110349170A (en) A kind of full connection CRF cascade FCN and K mean value brain tumor partitioning algorithm
CN116306773B (en) An interpretable neural network high-dimensional data dimensionality reduction analysis system
CN117457184A (en) A Parkinson's disease detection model and detection system based on multi-modal image fusion
Lin et al. Hybrid CNN-SVM for alzheimer’s disease classification from structural MRI and the alzheimer’s disease neuroimaging initiative (ADNI)
CN103927540B (en) A kind of invariant feature extraction method based on biological vision hierarchical mode
Chen et al. Shared manifold regularized joint feature selection for joint classification and regression in Alzheimer’s disease diagnosis

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant