CN114463583A - Deep hashing method for pneumonia CT image classification - Google Patents

Deep hashing method for pneumonia CT image classification Download PDF

Info

Publication number
CN114463583A
CN114463583A CN202210093092.7A CN202210093092A CN114463583A CN 114463583 A CN114463583 A CN 114463583A CN 202210093092 A CN202210093092 A CN 202210093092A CN 114463583 A CN114463583 A CN 114463583A
Authority
CN
China
Prior art keywords
pneumonia
image
hash
feature
bilinear
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.)
Granted
Application number
CN202210093092.7A
Other languages
Chinese (zh)
Other versions
CN114463583B (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.)
Nantong University
Original Assignee
Nantong 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 Nantong University filed Critical Nantong University
Priority to CN202210093092.7A priority Critical patent/CN114463583B/en
Publication of CN114463583A publication Critical patent/CN114463583A/en
Application granted granted Critical
Publication of CN114463583B publication Critical patent/CN114463583B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10072Tomographic images
    • G06T2207/10081Computed x-ray tomography [CT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30061Lung

Landscapes

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

Abstract

The invention relates to the technical field of medical image processing, in particular to a depth hashing method for pneumonia CT image classification. The pneumonia CT image data set is established, the sizes of pneumonia CT images are unified, and the pneumonia CT images are divided into training sets TrAnd test set Te(ii) a Then, a deep Hash network model is constructed, and the similarity loss L is calculated according to Hash codesSAnd the contrast loss LclConstructing a total loss function L; second, multi-task Hash training is introducedStrategy, optimizing a loss function L by using an alternative learning algorithm, and storing a deep Hash network model; and finally, reading the test set to classify the CT images. The method has the advantages that the deep hash method can accurately find out the tiny difference among CT images of different lungs, so that the training model greatly reduces the storage space and the training time, the efficiency of classifying large-scale pneumonia CT images is effectively improved, the advantage of extracting the characteristics of fine-grained CT images by the bilinear convolutional neural network is fully exerted, and the identification accuracy and the generalization robustness are effectively improved.

Description

Deep hashing method for pneumonia CT image classification
Technical Field
The invention relates to the technical field of medical image processing, in particular to a depth hashing method for pneumonia CT image classification.
Background
The lung CT image is the gold standard for the diagnosis of pneumonia, and different pneumonia types are shown differently on the lung CT image. The bilateral thorax of the lung CT image of a normal person is symmetrical, the lung permeability and the lung texture are normal, thickening and disorder are avoided, and obvious abnormal density shadow is avoided in the field of the two lungs; the lung CT image of a patient with COVID-19 has the early change of the small spot sheet-shaped shadow of the extrapulmonary zone and the pulmonary interstitium, and further develops the frosted shadow, the infiltration shadow and the lung consolidation of two lungs, and chest and abdomen effusion, lung pathological change and lung consolidation in different degrees can also appear in serious cases, consolidation areas mainly present diffuse alveolar injury and exudative alveolitis, serous fluid, fibrin exudate and transparent film can be seen in the alveolar cavity, and the small bronchus and the bronchiole are also formed by mucus plugs; for a CT image of the lung of a patient with common pneumonia, if the common community acquired pathogenic bacteria cause lobar pneumonia, the lobar pneumonia is often represented by a spot-shaped density increase image with limited distribution of lung lobes or lung segments in an imaging way, the patient often has a clear history of respiratory tract infection, and if the pulmonary inflammation exudation of the patient with lobular pneumonia is caused, the spot-shaped exudation is often taken as the main factor.
However, in the current big data environment, tens of thousands of CT images are generated every day, and how to effectively classify the CT images is a difficult problem to be solved. Conventionally, the subjective judgment of doctors is usually needed, so that a large amount of manpower is consumed, a large amount of time is wasted, the conditions of wrong judgment and misjudgment are caused more seriously, and the life health of a patient is also influenced to a certain extent.
The rise of deep learning has driven the development of the field of medical image processing, especially in the field of lung CT image classification. At present, the deep features of images are mostly extracted by Convolutional Neural Networks (CNNs) in the classification of lung CT images, so that different types are distinguished. However, the difference between the lung CT images often appears in the lesion region, and other regions are similar, that is, the similarity of the medical images of the same part is often very large, which has a certain influence on the accuracy of classification.
Under the background, the invention provides a method for extracting fine-grained features of lung CT images by using a Bilinear Convolutional Neural Network (BCNN), finding out small differences among different lung CT images, and mapping the extracted depth features to a binary Hamming space so as to classify the lung CT images. Therefore, the classification accuracy is improved, and the classification time is saved.
Disclosure of Invention
The invention aims to solve the problems and provides a deep hash method for pneumonia CT image classification.
In order to achieve the purpose, the invention adopts the following technical scheme:
a depth hashing method for pneumonia CT image classification comprises the following steps:
s10: establishing a pneumonia CT image data set;
s20: data preprocessing, namely firstly enhancing and expanding the data of the data set, and dividing the data set into training sets T according to the proportion of 80 percent and 20 percentr=(x1,x2,...,xn) N1, 2, N and test set Te=(y1,y2,...,ym) M 1, 2.. multidot.m, then the size of the pneumonia CT images is uniformly adjusted to 224 × 224, the number of channels is 1, 3 types of CT images are included in the data set, namely, the lung CT image of a normal person, the lung CT image of a COVID-19 patient and the lung CT image of a general pneumonia patient,finally constructing a training set TrOf the similarity matrix S, wherein
Figure BDA0003489957840000021
And Sij∈RN×N,i,j=1,2,...,N;
S30: the method comprises the steps that a deep hash network model is built, wherein the model comprises a bilinear feature learning module and a hash coding learning module, when the model is trained, fine-grained features of a pneumonia CT image are extracted by using a Bilinear Convolutional Neural Network (BCNN), and then the extracted fine-grained features are input into the hash coding learning module, so that the fine-grained features of the corresponding pneumonia CT image are mapped into binary hash codes;
s40: calculating 2 losses, i.e. similarity loss L, from the hash code obtained in step S30SAnd the contrast loss LclAnd defining the total loss function as: l ═ LS+αLclWherein α ═ 0.1 is a weighting factor;
s50: introducing a multi-task Hash training strategy, repeatedly using a bilinear feature learning module, and extracting a bilinear feature vector v' (x) of the pneumonia CT imagei)∈R262144×1,v'(xj)∈R262144×1I, j is 1, 2.. times, N, and i ≠ j is respectively learned through a hash code learning module comprising 4 branches, and each branch comprises 2 fully-connected layers and 1 fully-connected hash layer, so that the model can learn 12,24,32 and 48-bit hash codes at the same time;
s60: using alternate learning algorithm to target function
Figure BDA0003489957840000022
Performing optimization updating on the depth Hash network model parameter theta, the Hash coding matrix B, the weight matrix W and the offset vector V, and storing the model;
s70: first read test set T using a pre-trained modelePneumonia CT image ykK 1, 2.. times.m, which yields its hash code
Figure BDA0003489957840000024
C is 12,24,32,48, then
Figure BDA0003489957840000023
And Hash coding matrix B belongs to Rc×NC is compared with each column of 12,24,32 and 48, the first 5 with smaller Hamming distance are compared, and the number of the categories belonging to the same is larger, then y is comparedkAnd classifying the test set into the categories, and finally calculating the average accuracy of the classification of the test set.
As a preferred technical scheme of the invention: in step S30, the bilinear feature learning module mainly includes two branches a and B, and branch a and branch B are composed of two identical VGG16 models, the convolutional layer conv of each branch is divided into 5 segments, 13 convolutional layers in total, and the size of the convolutional core of each convolutional layer is 3 × 3, the step size stride and padding are both set to 1, there is a maximum pooling layer maxpool after the first 4 segments of convolutional layers, and the pooling frame size is 2 × 2, the step size stride is set to 2, taking branch a as an example, the specific steps of the designed network structure are as follows:
s31: firstly, training set T of pneumonia CT imagerRandomly partitioning into image pairs (x)i,xj) I, j is 1, 2.. multidot.n, and i ≠ j, reads the image pair and the similarity matrix S, and then after passing through the 1 st convolution layer conv1, conv2 with the filter number of 64, the size of the extracted pneumonia CT image feature map is 224 × 224 × 64, and then passes through the maximum pooling layer maxpool1, and the final output size of the pneumonia CT image feature map is 112 × 112 × 64;
s32: after the output of the maxpool1 passes through the 2 nd convolution layers conv3 and conv4 with the filter number of 128, the size of the extracted pneumonia CT image feature map is 112 × 112 × 128, and then the pneumonia CT image feature map passes through the maximum pooling layer maxpool2, and the final output size of the pneumonia CT image feature map is 56 × 56 × 128;
s33: after passing the output of maxpool2 through the 3 rd convolution layers conv5, conv6 and conv7 with the filter number of 256, the size of the extracted pneumonia CT image feature map is 56 × 56 × 256, and then the extracted pneumonia CT image feature map passes through the maximum pooling layer maxpool3, and the final output size of the pneumonia CT image feature map is 28 × 28 × 256;
s34: after the output of maxpool3 passes through 4 th convolution layers conv8, conv9 and conv10 with the number of filter 512, the size of the extracted pneumonia CT image feature map is 28 × 28 × 512, and then the feature map passes through the maximum pooling layer maxpool4, and the final output size of the pneumonia CT image feature map is 14 × 14 × 512;
s35: after the output of maxpool4 passes through 5 th convolution layers conv11, conv12 and conv13 with the number of filter 512, the output size of the feature map of the extracted pneumonia CT image is 14 multiplied by 512;
in this case, the feature of the CT image of pneumonia extracted from the branch A is denoted by FA(xi)∈R14×14×512、FA(xj)∈R14 ×14×512The feature of the pneumonia CT image extracted by the branch B is FB(xi)∈R14×14×512、FB(xj)∈R14×14×512
S36: the outputs of branch A and branch B were passed through bilinear pooling layer bilinearcholing to obtain a CT image (x) of pneumoniai,xj) I, j ≠ N, 1,2, and i ≠ j is a deep feature f at position lA(l,xi)∈R1×512、fB(l,xi)∈R1 ×512And fA(l,xj)∈R1×512、fB(l,xj)∈R1×512The following operations were carried out:
(1) calculating pneumonia CT image pair (x)i,xj) I, j ≠ N, is 1,2, and i ≠ j is a bilinear feature at position l
Figure BDA0003489957840000031
Figure BDA0003489957840000032
(2) Pooling pneumonia CT image pairs by summation pooling (x)i,xj) I, j ≠ N, i ≠ j, which is a bilinear feature of all positions to obtain global bilinearFeature(s)
Figure BDA0003489957840000041
Figure BDA0003489957840000042
(3) Global bilinear feature matrix xi (x)i) And xi (x)j) Stretch into a vector to obtain v (x)i)=vec(ξ(xi))∈R262144×1、v(xj)=vec(ξ(xj))∈R262144×1Where vec (·) represents the operation of expanding the matrix into vectors;
(4) feature vector v (x) of pneumonia CT imagei) And v (x)j) Performing normalization operation to obtain
Figure BDA0003489957840000043
Figure BDA0003489957840000044
Wherein | · | purple2An L2 norm representing a vector;
s37: the feature vector v' (x) of the normalized pneumonia CT image is obtainedi)∈R262144×1、v'(xj)∈R262144×1V "(x) was obtained after passing 2 full-junction layers FC1 and FC2 in this orderi)、v”(xj)∈Rc×1C is 12,24,32,48, c represents the number of bits of the hash code;
s38: feature vector v ″ (x) of the pneumonia CT image after passing through the full connection layeri)、v”(xj) Mapping to binary hash b according to hash function h (·)i,bj∈Rc×1C is 12,24,32,48, finally obtaining the training set TrIs the hash coding matrix B ∈ Rc×N
Figure BDA0003489957840000045
Where h (-) represents a hash function and sign (-) represents a sign function.
As an originalThe preferred technical scheme of the invention is as follows: the step S40 obtains the hash code B e R according to S38c×NC-12, 24,32,48 calculates 2 losses, i.e. the similarity loss LSAnd the contrast loss LclThe method comprises the following specific steps:
s41: for the input pneumonia CT image pair (x)i,xj) I, j ≠ N, 1,2, and i ≠ j, with similarity penalty LSTo optimize the distance between similar samples and to enlarge the distance between dissimilar samples, the formula is as follows:
Figure BDA0003489957840000046
wherein
Figure BDA0003489957840000047
Hash coding bi、bj∈Rc×1,c=12,24,32,48;
S42: in pneumonia CT image xnN1, 2, a deep level characteristic v (x) of Nn) And corresponding hash codes bnSolving the contrast loss LclThe formula is as follows:
Figure BDA0003489957840000051
wherein v (x)n)=WTΦ(xn(ii) a Theta) + V, theta representing all parameters of the deep hash network model, phi (x)n;θ)∈R262144×1Represents an input into the full connectivity layer FC1, W ∈ R262144×cIs a weight matrix, V ∈ Rc×1Is a bias vector, | · | | non-conducting phosphor2An L2 norm representing a vector;
s43: the overall loss function is defined as: l ═ LS+αLclWhere α ═ 0.1 is a weighting factor, so when optimizing the network model, the objective function should be set to minimize the loss function, which is formulated as follows:
Figure BDA0003489957840000052
wherein SijIs a matrix of the degree of similarity, and,
Figure BDA0003489957840000053
and is
Figure BDA0003489957840000054
bjIs a pneumonia CT image xiTransposed, pneumonia CT image x of hash coding of (a)jHash coding of bnRepresentative pneumonia CT image xnN1, 2, hash coding of N, W ∈ R262144×cIs a weight matrix, phi (x)n;θ)∈R262144×1Representing the input into the full connectivity layer FC1, V ∈ Rc×1Is a bias vector, | · Lixian2Representing the L2 norm of the vector.
As a preferred technical scheme of the invention: step S50 introduces a multitask hash training strategy, and reuses the bilinear feature learning module to extract bilinear feature vector v '(x') of the CT image of pneumoniai)∈R262144×1,v'(xj)∈R262144×1I, j ≠ N, and i ≠ j passes through the hash code learning modules of 4 branches, and each branch includes 2 fully-connected hash layers and 1 fully-connected hash layer, so that the model can learn 12,24,32, and 48-bit hash codes at the same time, taking branch 1 as an example, and then c ═ 12, the specific steps are as follows:
s51: firstly, a feature vector v' (x) of a pneumonia CT image is obtainedi)∈R262144×1,v'(xj)∈R262144×1V "(x) is obtained by the full junction layers FC11, FC12 of Branch 1i)∈R12×1、v”(xj)∈R12×1
S52: then, the feature vector v ″ (x) of the pneumonia CT image is determinedi)、v”(xj) Mapping to binary hash code b according to hash function h (·)i、bj∈R12×1Finally, a training set T is formedrIs the hash coding matrix B ∈ R12×N
Figure BDA0003489957840000055
Where h (-) represents a hash function and sign (-) represents a sign function.
Compared with other lung CT image classification methods, the lung CT image classification method has the beneficial effects that:
firstly, the convolutional neural network CNN can extract deep features of an image, but the difference between lung CT images is not too large, which results in that the accuracy of lung CT image classification is not very high. Therefore, the method effectively extracts the subtle differences among different symptoms of the lung CT image by using the bilinear convolutional neural network BCNN, fully exerts the extraction advantages of the bilinear convolutional neural network on the fine-grained image characteristics, and effectively improves the identification accuracy and the generalization robustness of the model;
secondly, if the real-value features extracted by the bilinear convolutional neural network BCNN are directly classified, the problems of overlarge storage space and overlong training time can be caused. Therefore, Hash coding learning is introduced, and real-value features extracted by the bilinear convolutional neural network BCNN are mapped to a binary Hamming space, so that the storage space is greatly reduced and the training time is shortened when a model is trained;
the bilinear feature learning module can be repeatedly used, so that the lung CT image can be simultaneously generated into Hash codes with different code lengths by the model, and the calculation time and the storage space are further saved.
Drawings
FIG. 1 is a flow chart of the present invention for data enhancement and augmentation of a collected CT image dataset of pneumonia;
FIG. 2 is a block diagram of a depth hash method for classifying CT images of pneumonia according to the present invention;
fig. 3 is a final frame diagram of a depth hashing method for classifying pneumonia CT images, which introduces a multitask hashing training strategy.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. Of course, the examples described by reference to the drawings are only for the purpose of illustrating the invention and are not to be construed as limiting the invention.
As shown in fig. 1 to 3, a depth hashing method for pneumonia CT image classification includes the following steps:
s10: establishing a pneumonia CT image data set;
s20: data preprocessing, namely firstly enhancing and expanding the data of the data set, and dividing the data set into training sets T according to the proportion of 80 percent and 20 percentr=(x1,x2,...,xn) N1, 2, N and test set Te=(y1,y2,...,ym) M is 1,2, 1, m, then the sizes of the pneumonia CT images are uniformly adjusted to 224 multiplied by 224, the number of channels is 1, 3 types of CT images are contained in the data set, namely, the lung CT image of a normal person, the lung CT image of a COVID-19 patient and the lung CT image of a common pneumonia patient, and finally a training set T is constructedrOf the similarity matrix S, wherein
Figure BDA0003489957840000071
And Sij∈RN×N,i,j=1,2,...,N;
S30: the method comprises the steps that a deep hash network model is built, wherein the model comprises a bilinear feature learning module and a hash coding learning module, when the model is trained, fine-grained features of a pneumonia CT image are extracted by using a Bilinear Convolutional Neural Network (BCNN), and then the extracted fine-grained features are input into the hash coding learning module, so that the fine-grained features of the corresponding pneumonia CT image are mapped into binary hash codes;
s40: calculating 2 losses, i.e. similarity loss L, from the hash code obtained in step S30SAnd the contrast loss LclAnd defining the total loss function as: l ═ LS+αLclWherein α ═ 0.1 is a weighting factor;
s50: introducing multitask Hash trainingRepeating the bilinear feature learning module to extract bilinear feature vector v '(x') of the pneumonia CT imagei)∈R262144×1,v'(xj)∈R262144×1I, j is 1, 2.. times, N, and i ≠ j is respectively learned through a hash code learning module comprising 4 branches, and each branch comprises 2 fully-connected layers and 1 fully-connected hash layer, so that the model can learn 12,24,32 and 48-bit hash codes at the same time;
s60: using alternate learning algorithm to target function
Figure BDA0003489957840000072
Performing optimization updating on the depth Hash network model parameter theta, the Hash coding matrix B, the weight matrix W and the offset vector V, and storing the model;
s70: first read test set T using a pre-trained modelePneumonia CT image ykK 1, 2.. times.m, which yields its hash code
Figure BDA0003489957840000073
C is 12,24,32,48, then
Figure BDA0003489957840000074
And Hash coding matrix B belongs to Rc×NC is compared with each column of 12,24,32 and 48, the first 5 with smaller Hamming distance are compared, and the number of the categories belonging to the same is larger, then y is comparedkAnd classifying the test set into the categories, and finally calculating the average accuracy of the classification of the test set.
In step S30, the bilinear feature learning module mainly includes two branches a and B, and branch a and branch B are composed of two identical VGG16 models, the convolutional layer conv of each branch is divided into 5 segments, 13 convolutional layers in total, and the size of the convolutional core of each convolutional layer is 3 × 3, the step size stride and padding are both set to 1, there is a maximum pooling layer maxpool after the first 4 segments of convolutional layers, and the pooling frame size is 2 × 2, the step size stride is set to 2, taking branch a as an example, the specific steps of the designed network structure are as follows:
s31: firstly, a pneumonia CT image is obtainedTraining set T ofrStochastic partitioning into image pairs (x)i,xj) I, j is 1, 2.. multidot.n, and i ≠ j, reads the image pair and the similarity matrix S, and then after passing through the 1 st convolution layer conv1, conv2 with the filter number of 64, the size of the extracted pneumonia CT image feature map is 224 × 224 × 64, and then passes through the maximum pooling layer maxpool1, and the final output size of the pneumonia CT image feature map is 112 × 112 × 64;
s32: after the output of the maxpool1 passes through the 2 nd convolution layers conv3 and conv4 with the filter number of 128, the size of the extracted pneumonia CT image feature map is 112 × 112 × 128, and then the pneumonia CT image feature map passes through the maximum pooling layer maxpool2, and the final output size of the pneumonia CT image feature map is 56 × 56 × 128;
s33: after passing the output of maxpool2 through the 3 rd convolution layers conv5, conv6 and conv7 with the filter number of 256, the size of the extracted pneumonia CT image feature map is 56 × 56 × 256, and then the extracted pneumonia CT image feature map passes through the maximum pooling layer maxpool3, and the final output size of the pneumonia CT image feature map is 28 × 28 × 256;
s34: after the output of maxpool3 passes through 4 th convolution layers conv8, conv9 and conv10 with the number of filter 512, the size of the extracted pneumonia CT image feature map is 28 × 28 × 512, and then the feature map passes through the maximum pooling layer maxpool4, and the final output size of the pneumonia CT image feature map is 14 × 14 × 512;
s35: after the output of maxpool4 passes through 5 th convolution layers conv11, conv12 and conv13 with the number of filter 512, the output size of the feature map of the extracted pneumonia CT image is 14 multiplied by 512;
in this case, the feature of the CT image of pneumonia extracted from the branch A is denoted by FA(xi)∈R14×14×512、FA(xj)∈R14 ×14×512The pneumonia CT image extracted from branch B is characterized by FB(xi)∈R14×14×512、FB(xj)∈R14×14×512
S36: the outputs of branch A and branch B were passed through bilinear pooling layer bilinearcholing to obtain a CT image (x) of pneumoniai,xj) I, j ≠ N, 1,2, and i ≠ j is a deep feature f at position lA(l,xi)∈R1×512、fB(l,xi)∈R1 ×512And fA(l,xj)∈R1×512、fB(l,xj)∈R1×512The following operations were carried out:
(1) calculating pneumonia CT image pair (x)i,xj) I, j ≠ N, is 1,2, and i ≠ j is a bilinear feature at position l
Figure BDA0003489957840000081
Figure BDA0003489957840000082
(2) Pooling pneumonia CT image pairs by summing pooled samplingi,xj) I, j ≠ N, i ≠ j, which is a bilinear feature at all positions to obtain a global bilinear feature
Figure BDA0003489957840000083
Figure BDA0003489957840000084
(3) Global bilinear feature matrix xi (x)i) And xi (x)j) Stretch into a vector to obtain v (x)i)=vec(ξ(xi))∈R262144×1、v(xj)=vec(ξ(xj))∈R262144×1Where vec (·) represents the operation of expanding the matrix into vectors;
(4) feature vector v (x) of pneumonia CT imagei) And v (x)j) Performing normalization operation to obtain
Figure BDA0003489957840000085
Figure BDA0003489957840000091
Wherein | · | purple2An L2 norm representing a vector;
s37: the feature vector v' (x) of the normalized pneumonia CT image is obtainedi)∈R262144×1、v'(xj)∈R262144×1V "(x) was obtained after passing 2 full-junction layers FC1 and FC2 in this orderi)、v”(xj)∈Rc×1C is 12,24,32,48, c represents the number of bits of the hash code;
s38: feature vector v ″ (x) of the pneumonia CT image after passing through the full connection layeri)、v”(xj) Mapping to binary hash b according to hash function h (·)i,bj∈Rc×1C is 12,24,32,48, finally obtaining the training set TrIs the hash coding matrix B ∈ Rc×N
Figure BDA0003489957840000092
Where h (-) represents a hash function and sign (-) represents a sign function.
The step S40 obtains the hash code B e R according to S38c×NC-12, 24,32,48 calculates 2 losses, i.e. the similarity loss LSAnd the contrast loss LclThe method comprises the following specific steps:
s41: for the input pneumonia CT image pair (x)i,xj) I, j ≠ N, and i ≠ j, with similarity penalties LSTo optimize the distance between similar samples and to enlarge the distance between dissimilar samples, the formula is as follows:
Figure BDA0003489957840000093
wherein
Figure BDA0003489957840000094
Hash coding bi、bj∈Rc×1,c=12,24,32,48;
S42: in pneumonia CT image xnN1, 2, a deep level characteristic v (x) of Nn) And corresponding hash codes bnSolving the contrast loss LclThe formula is as follows:
Figure BDA0003489957840000095
wherein v (x)n)=WTΦ(xn(ii) a Theta) + V, theta representing all parameters of the deep hash network model, phi (x)n;θ)∈R262144×1Represents an input into the full connectivity layer FC1, W ∈ R262144×cIs a weight matrix, V ∈ Rc×1Is a bias vector, | · | | non-conducting phosphor2An L2 norm representing a vector;
s43: the overall loss function is defined as: l ═ LS+αLclWhere α ═ 0.1 is a weighting factor, so when optimizing the network model, the objective function should be set to minimize the loss function, which is formulated as follows:
Figure BDA0003489957840000101
wherein SijIs a matrix of the degree of similarity, and,
Figure BDA0003489957840000102
and is
Figure BDA0003489957840000103
bjIs a pneumonia CT image xiTransposed, pneumonia CT image x of hash coding of (a)jHash coding of bnRepresentative pneumonia CT image xnN1, 2, hash coding of N, W ∈ R262144×cIs a weight matrix, phi (x)n;θ)∈R262144×1Representing the input into the full connectivity layer FC1, V ∈ Rc×1Is a bias vector, | · | | non-conducting phosphor2Representing the L2 norm of the vector.
Step S50, a multi-task Hash training strategy is introduced, a bilinear feature learning module is repeatedly used, and the extracted bilinear feature vector v' (x) of the pneumonia CT image is extractedi)∈R262144×1,v'(xj)∈R262144×1I, j ≠ N, 1,2Through the hash code learning modules of 4 branches respectively, and each branch includes 2 fully-connected hash layers and 1 fully-connected hash layer, the model can learn 12,24,32,48 bits of hash codes simultaneously, taking branch 1 as an example, at this time, c is 12, and the specific steps are as follows:
s51: firstly, a feature vector v' (x) of a pneumonia CT image is obtainedi)∈R262144×1,v'(xj)∈R262144×1V "(x) is obtained through the full connection layers FC11 and FC12 of the branch 1i)∈R12×1、v”(xj)∈R12×1
S52: then, the feature vector v ″ (x) of the pneumonia CT image is determinedi)、v”(xj) Mapping to binary hash code b according to hash function h (·)i、bj∈R12×1Finally, a training set T is formedrIs the hash coding matrix B ∈ R12×N
Figure BDA0003489957840000104
Where h (-) represents a hash function and sign (-) represents a sign function.
Although the convolutional neural network CNN can extract deep features of an image, since the difference between the lung CT images is not too large, the accuracy of classification of the lung CT images is not very high. Therefore, the method effectively extracts the subtle differences among different symptoms of the lung CT image by using the bilinear convolutional neural network BCNN, fully exerts the extraction advantages of the bilinear convolutional neural network on the fine-grained image characteristics, and effectively improves the identification accuracy and the generalization robustness of the model; if the real-value features extracted by the bilinear convolutional neural network BCNN are directly classified, the problems of overlarge storage space and overlong training time can be caused. Therefore, Hash coding learning is introduced, and real-value features extracted by the bilinear convolutional neural network BCNN are mapped to a binary Hamming space, so that the storage space is greatly reduced and the training time is shortened when a model is trained; the invention can repeatedly use the bilinear feature learning module, so that the lung CT image can be simultaneously generated into Hash codes with different code lengths by the model, and the calculation time and the storage space are further saved.
The above-mentioned embodiments, objects, technical solutions and advantages of the present invention are further described in detail, it should be understood that the above-mentioned embodiments are only illustrative of the present invention, and are not intended to limit the scope of the present invention, and any person skilled in the art should understand that equivalent changes and modifications made without departing from the concept and principle of the present invention should fall within the protection scope of the present invention.

Claims (4)

1. A depth hash method for pneumonia CT image classification is characterized by comprising the following steps:
s10: establishing a pneumonia CT image data set;
s20: data preprocessing, namely firstly enhancing and expanding the data of the data set, and dividing the data set into training sets T according to the proportion of 80 percent and 20 percentr=(x1,x2,...,xn) N1, 2, N and test set Te=(y1,y2,...,ym) M is 1,2, 1, m, then the sizes of the pneumonia CT images are uniformly adjusted to 224 multiplied by 224, the number of channels is 1, 3 types of CT images are contained in the data set, namely, the lung CT image of a normal person, the lung CT image of a COVID-19 patient and the lung CT image of a common pneumonia patient, and finally a training set T is constructedrOf the similarity matrix S, wherein
Figure FDA0003489957830000011
And Sij∈RN×N,i,j=1,2,...,N;
S30: the method comprises the steps that a deep hash network model is built, wherein the model comprises a bilinear feature learning module and a hash coding learning module, when the model is trained, fine-grained features of a pneumonia CT image are extracted by using a Bilinear Convolutional Neural Network (BCNN), and then the extracted fine-grained features are input into the hash coding learning module, so that the fine-grained features of the corresponding pneumonia CT image are mapped into binary hash codes;
s40: calculating 2 losses, namely similarity loss L according to the hash codes obtained in the step S30SAnd the contrast loss LclAnd defining the total loss function as: l ═ LS+αLclWherein α ═ 0.1 is a weighting factor;
s50: introducing a multi-task Hash training strategy, repeatedly using a bilinear feature learning module, and extracting a bilinear feature vector v' (x) of the pneumonia CT imagei)∈R262144×1,v'(xj)∈R262144×1I, j is 1, 2.. times, N, and i ≠ j is respectively learned through a hash code learning module comprising 4 branches, and each branch comprises 2 fully-connected layers and 1 fully-connected hash layer, so that the model can learn 12,24,32 and 48-bit hash codes at the same time;
s60: using alternate learning algorithm to target function
Figure FDA0003489957830000012
Performing optimization updating on the depth Hash network model parameter theta, the Hash coding matrix B, the weight matrix W and the offset vector V, and storing the model;
s70: first read test set T using a pre-trained modelePneumonia CT image ykK 1, 2.. times.m, which yields its hash code byk∈Rc×1C is 12,24,32,48, then bykAnd Hash coding matrix B belongs to Rc×NC is compared with each column of 12,24,32 and 48, the first 5 with smaller Hamming distance are compared, and the number of the categories belonging to the same is larger, then y is comparedkAnd classifying the test set into the categories, and finally calculating the average accuracy of the classification of the test set.
2. The deep hashing method for pneumonia CT image classification according to claim 1, wherein in step S30, the bilinear feature learning module mainly includes two branches A and B, and branch A and branch B are composed of two same VGG16 models, the convolutional layer conv of each branch is divided into 5 segments, 13 convolutional layers in total, the convolutional core size of each convolutional layer is 3 x 3, the step length stride and the padding are both set to 1, there is one maximum pooling layer maxpool after the first 4 segments of convolutional layers, and the pooling frame size is both 2 x 2, the step length stride is set to 2, and the concrete steps of the designed network structure are as follows:
s31: firstly, training set T of pneumonia CT imagerStochastic partitioning into image pairs (x)i,xj) I, j is 1, 2.. multidot.n, and i ≠ j, reads the image pair and the similarity matrix S, and then after passing through the 1 st convolution layer conv1, conv2 with the filter number of 64, the size of the extracted pneumonia CT image feature map is 224 × 224 × 64, and then passes through the maximum pooling layer maxpool1, and the final output size of the pneumonia CT image feature map is 112 × 112 × 64;
s32: after the output of the maxpool1 passes through the 2 nd convolution layers conv3 and conv4 with the filter number of 128, the size of the extracted pneumonia CT image feature map is 112 × 112 × 128, and then the pneumonia CT image feature map passes through the maximum pooling layer maxpool2, and the final output size of the pneumonia CT image feature map is 56 × 56 × 128;
s33: after passing the output of maxpool2 through the 3 rd convolution layers conv5, conv6 and conv7 with the filter number of 256, the size of the extracted pneumonia CT image feature map is 56 × 56 × 256, and then the extracted pneumonia CT image feature map passes through the maximum pooling layer maxpool3, and the final output size of the pneumonia CT image feature map is 28 × 28 × 256;
s34: after the output of maxpool3 passes through 4 th convolution layers conv8, conv9 and conv10 with the number of filter 512, the size of the extracted pneumonia CT image feature map is 28 × 28 × 512, and then the feature map passes through the maximum pooling layer maxpool4, and the final output size of the pneumonia CT image feature map is 14 × 14 × 512;
s35: after the output of maxpool4 passes through 5 th convolution layers conv11, conv12 and conv13 with the number of filter 512, the output size of the feature map of the extracted pneumonia CT image is 14 multiplied by 512;
in this case, the feature of the CT image of pneumonia extracted from the branch A is denoted by FA(xi)∈R14×14×512、FA(xj)∈R14×14×512The feature of the pneumonia CT image extracted by the branch B is FB(xi)∈R14×14×512、FB(xj)∈R14×14×512
S36: the outputs of branch A and branch B were passed through bilinear pooling layer bilinearcholing to obtain a CT image (x) of pneumoniai,xj) I, j ≠ N, 1,2, and i ≠ j is a deep feature f at position lA(l,xi)∈R1×512、fB(l,xi)∈R1×512And fA(l,xj)∈R1×512、fB(l,xj)∈R1×512The following operations were carried out:
(1) calculating pneumonia CT image pair (x)i,xj) I, j ≠ N, is 1,2, and i ≠ j is a bilinear feature at position l
Figure FDA0003489957830000021
Figure FDA0003489957830000022
(2) Pooling pneumonia CT image pairs by summation pooling (x)i,xj) I, j ≠ N, i ≠ j, which is a bilinear feature at all positions to obtain a global bilinear feature
Figure FDA0003489957830000031
Figure FDA0003489957830000032
(3) Global bilinear feature matrix xi (x)i) And xi (x)j) Stretch into a vector to obtain v (x)i)=vec(ξ(xi))∈R262144×1、v(xj)=vec(ξ(xj))∈R262144×1Where vec (·) represents the operation of expanding the matrix into vectors;
(4) feature vector v (x) of pneumonia CT imagei) And v (x)j) Performing normalization operation to obtain
Figure FDA0003489957830000033
Figure FDA0003489957830000034
Wherein | · | purple2An L2 norm representing a vector;
s37: the feature vector v' (x) of the normalized pneumonia CT image is obtainedi)∈R262144×1、v'(xj)∈R262144×1V "(x) was obtained after passing 2 full-junction layers FC1 and FC2 in this orderi)、v”(xj)∈Rc×1C is 12,24,32,48, c represents the number of bits of the hash code;
s38: feature vector v ″ (x) of the pneumonia CT image after passing through the full connection layeri)、v”(xj) Mapping to binary hash b according to hash function h (·)i,bj∈Rc×1C is 12,24,32,48, finally obtaining the training set TrIs the hash coding matrix B ∈ Rc×N
Figure FDA0003489957830000035
Where h (-) represents a hash function and sign (-) represents a sign function.
3. The depth hashing method for pneumonia CT image classification according to claim 1, wherein said step S40 obtains Hash code B e R according to S38c×NC-12, 24,32,48 calculates 2 losses, i.e. the similarity loss LSAnd the contrast loss LclThe method comprises the following specific steps:
s41: for the input pneumonia CT image pair (x)i,xj) I, j ≠ N, 1,2, and i ≠ j, with similarity penalty LSTo optimize the distance between similar samples and to enlarge the distance between dissimilar samples, the formula is as follows:
Figure FDA0003489957830000036
wherein
Figure FDA0003489957830000037
Hash coding bi、bj∈Rc×1,c=12,24,32,48;
S42: in pneumonia CT image xnN1, 2, a deep level characteristic v (x) of Nn) And corresponding hash codes bnSolving the contrast loss LclThe formula is as follows:
Figure FDA0003489957830000041
wherein v (x)n)=WTΦ(xn(ii) a Theta) + V, theta representing all parameters of the deep hash network model, phi (x)n;θ)∈R262144×1Represents an input into the full connectivity layer FC1, W ∈ R262144×cIs a weight matrix, V ∈ Rc×1Is a bias vector, | · | | non-conducting phosphor2An L2 norm representing a vector;
s43: the overall loss function is defined as: l ═ LS+αLclWhere α ═ 0.1 is the weighting factor, LSFor loss of similarity, LclTo compare the losses, therefore, when optimizing the network model, the objective function should be set to minimize the loss function, which is formulated as follows:
Figure FDA0003489957830000042
wherein SijIs a matrix of the degree of similarity, and,
Figure FDA0003489957830000043
and is
Figure FDA0003489957830000044
bjIs a pneumonia CT image xiHash ofTransposition of code, pneumonia CT image xjHash coding of bnRepresentative pneumonia CT image xnN1, 2, hash coding of N, W ∈ R262144×cIs a weight matrix, phi (x)n;θ)∈R262144×1Represents an input into the full connectivity layer FC1, V ∈ Rc×1Is a bias vector, | · | | non-conducting phosphor2Representing the L2 norm of the vector.
4. The deep hashing method for classifying CT pneumonia images as claimed in claim 1, wherein said step S50 introduces a multitask Hash training strategy, and reuses a bilinear feature learning module to extract bilinear feature vector v '(x') of CT pneumonia imagesi)∈R262144×1,v'(xj)∈R262144×1I, j ≠ N, and i ≠ j passes through the hash code learning modules of 4 branches, and each branch includes 2 fully-connected hash layers and 1 fully-connected hash layer, so that the model can learn 12,24,32, and 48-bit hash codes at the same time, taking branch 1 as an example, and then c ═ 12, the specific steps are as follows:
s51: firstly, a feature vector v' (x) of a pneumonia CT image is obtainedi)∈R262144×1,v'(xj)∈R262144×1V "(x) is obtained by the full junction layers FC11, FC12 of Branch 1i)∈R12×1、v”(xj)∈R12×1
S52: then, the feature vector v ″ (x) of the pneumonia CT image is determinedi)、v”(xj) Mapping to binary hash code b according to hash function h (·)i、bj∈R12×1Finally, a training set T is formedrIs the hash coding matrix B ∈ R12×N
Figure FDA0003489957830000051
Where h (-) represents a hash function and sign (-) represents a sign function.
CN202210093092.7A 2022-01-26 2022-01-26 Deep hashing method for pneumonia CT image classification Active CN114463583B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210093092.7A CN114463583B (en) 2022-01-26 2022-01-26 Deep hashing method for pneumonia CT image classification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210093092.7A CN114463583B (en) 2022-01-26 2022-01-26 Deep hashing method for pneumonia CT image classification

Publications (2)

Publication Number Publication Date
CN114463583A true CN114463583A (en) 2022-05-10
CN114463583B CN114463583B (en) 2024-03-19

Family

ID=81411989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210093092.7A Active CN114463583B (en) 2022-01-26 2022-01-26 Deep hashing method for pneumonia CT image classification

Country Status (1)

Country Link
CN (1) CN114463583B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116128846A (en) * 2023-02-01 2023-05-16 南通大学 Visual transducer hash method for lung X-ray image retrieval

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783682A (en) * 2019-01-19 2019-05-21 北京工业大学 It is a kind of based on putting non-to the depth of similarity loose hashing image search method
JP2019219712A (en) * 2018-06-15 2019-12-26 日本電信電話株式会社 Image feature learning device, image feature learning method, image feature extraction device, image feature extraction method, and program
CN112395438A (en) * 2020-11-05 2021-02-23 华中科技大学 Hash code generation method and system for multi-label image
CN112597324A (en) * 2020-12-15 2021-04-02 武汉工程大学 Image hash index construction method, system and equipment based on correlation filtering

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019219712A (en) * 2018-06-15 2019-12-26 日本電信電話株式会社 Image feature learning device, image feature learning method, image feature extraction device, image feature extraction method, and program
CN109783682A (en) * 2019-01-19 2019-05-21 北京工业大学 It is a kind of based on putting non-to the depth of similarity loose hashing image search method
CN112395438A (en) * 2020-11-05 2021-02-23 华中科技大学 Hash code generation method and system for multi-label image
CN112597324A (en) * 2020-12-15 2021-04-02 武汉工程大学 Image hash index construction method, system and equipment based on correlation filtering

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116128846A (en) * 2023-02-01 2023-05-16 南通大学 Visual transducer hash method for lung X-ray image retrieval
CN116128846B (en) * 2023-02-01 2023-08-22 南通大学 Visual transducer hash method for lung X-ray image retrieval

Also Published As

Publication number Publication date
CN114463583B (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN109166105B (en) Tumor malignancy risk layered auxiliary diagnosis system based on artificial intelligent medical image
Wang et al. An improved dice loss for pneumothorax segmentation by mining the information of negative areas
CN108446730B (en) CT pulmonary nodule detection device based on deep learning
Li et al. Efficient and effective training of COVID-19 classification networks with self-supervised dual-track learning to rank
CN112101451B (en) Breast cancer tissue pathological type classification method based on generation of antagonism network screening image block
CN112017198A (en) Right ventricle segmentation method and device based on self-attention mechanism multi-scale features
CN107480702B (en) Feature selection and feature fusion method for HCC pathological image recognition
CN110889853A (en) Tumor segmentation method based on residual error-attention deep neural network
CN109300136B (en) Automatic segmentation method for organs at risk based on convolutional neural network
CN110889852A (en) Liver segmentation method based on residual error-attention deep neural network
CN111340816A (en) Image segmentation method based on double-U-shaped network framework
CN114548265B (en) Crop leaf disease image generation model training method, crop leaf disease identification method, electronic equipment and storage medium
Kole et al. Automatic brain tumor detection and isolation of tumor cells from MRI images
CN114463583A (en) Deep hashing method for pneumonia CT image classification
CN114419000B (en) Femoral head necrosis index prediction system based on multi-scale geometric embedded convolutional neural network
CN117036288A (en) Tumor subtype diagnosis method for full-slice pathological image
CN113807497B (en) Unpaired image translation method for enhancing texture details
WO2024104035A1 (en) Long short-term memory self-attention model-based three-dimensional medical image segmentation method and system
CN113052857A (en) Lung lesion image segmentation method based on CovSegNet
Lin et al. Lesion detection of chest X-Ray based on scalable attention residual CNN
CN114693698B (en) Computer-aided lung airway segmentation method based on neural network
Liu et al. Recognition of cervical precancerous lesions based on probability distribution feature guidance
Wu et al. Mscan: Multi-scale channel attention for fundus retinal vessel segmentation
CN112508958B (en) Lightweight multi-scale biomedical image segmentation method
CN112862761B (en) Brain tumor MRI image segmentation method and system based on deep neural network

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