Lung cancer electronic nose data classification method based on adversarial training and multi-scale attention
The lung cancer electronic nose data classification method through adversarial training and multi-scale attention solves the problem of low classification accuracy of lung cancer electronic nose data, achieves higher classification accuracy and specificity, reduces the misdiagnosis rate, and is suitable for lung cancer screening check.
Patent Information
- Application Number
- CN202410670776.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-08-30
AI Technical Summary
The existing lung cancer electronic nose data classification method has low accuracy and is difficult to effectively detect lung cancer patients, leading to missed diagnosis and misdiagnosis. Moreover, the processing of multi-dimensional time series data is complex and it is difficult to automatically model the interaction between multi-dimensional variables.
A lung cancer electronic nose data classification method based on adversarial training and multi-scale attention is adopted. By establishing a TS-CATMA model, including a feature extractor, label classifier and domain classifier, adversarial training and multi-scale attention modules are used to extract domain invariants. features to improve classification accuracy.
It significantly improves the classification accuracy and specificity of lung cancer electronic nose data, reduces the misdiagnosis rate, is superior to traditional methods and deep learning models, and has significant advantages in lung cancer screening.
Smart Images

Figure CN118568565A
Abstract
Description
Technical Field
[0001] The invention relates to sensor data classification technology, and in particular to a classification method for lung cancer electronic nose data. Background Art
[0002] Lung cancer (LC) is one of the malignant tumors with the highest morbidity and mortality rates worldwide. According to statistics from the World Health Organization, there were approximately 2.282 million new cases of lung cancer and 1.796 million deaths worldwide in 2020. The high morbidity and mortality rates of lung cancer have placed a heavy burden on patients, their families, and society.
[0003] Early diagnosis of lung cancer is crucial to improving the survival rate of patients. At present, the commonly used diagnostic methods for lung cancer include imaging examinations (such as chest X-ray, CT, etc.), bronchoscopy, pathological examination, etc. However, these methods have some limitations, such as the high false positive rate of imaging examinations, the greater trauma of bronchoscopy, and the need for tissue biopsy for pathological examinations, which has certain risks.
[0004] Electronic nose (E-nose) is an instrument that simulates the biological olfactory system. It detects volatile organic compounds (VOCs) in gas samples through a sensor array and combines pattern recognition algorithms to perform qualitative or quantitative analysis of gas samples. Compared with traditional analytical methods such as gas chromatography-mass spectrometry (GC-MS), electronic nose has the advantages of being fast, portable, and does not require sample pretreatment. It has broad application prospects in food quality testing, environmental monitoring, medical diagnosis and other fields. In recent years, electronic noses have received widespread attention in the field of lung cancer diagnosis. Studies have found that the composition of VOCs in the exhaled gas of lung cancer patients is significantly different from that of healthy people, which provides the possibility of using electronic noses for lung cancer screening and diagnosis.
[0005] Although many studies on lung cancer detection based on electronic nose technology have been published, its accuracy is still low, resulting in missed diagnoses and misdiagnoses. This means that the electronic nose may not be able to detect some lung cancer patients, causing these patients to lose the opportunity for early diagnosis and treatment, affecting their prognosis and survival rate, or misdiagnosing some healthy people or other lung disease patients with lung cancer, leading to unnecessary panic and further invasive examinations, increasing medical burdens and patient suffering. Moreover, if the accuracy of the electronic nose in lung cancer diagnosis cannot meet clinical requirements, it will affect doctors and patients’ trust and acceptance of this technology, hindering its application and promotion in clinical practice.
[0006] Lung cancer data collected by the lung cancer electronic nose is a multivariate time series (MTS) data, so improving the classification performance of MTS is the key to improving the accuracy of lung cancer diagnosis. Traditional MTS classification methods often require feature extraction before classification. Feature engineering is relatively complex, and it is difficult to automatically model the complex interaction between multidimensional variables. In addition, training for high-dimensional data is time-consuming. Although deep learning methods can automatically learn feature representations, they require a large amount of labeled data for training. For lung cancer data with a small sample size, deep models are prone to overfitting and poor generalization performance. At the same time, the ability to extract spatiotemporal information in MTS is still limited. Summary of the invention
[0007] In view of this, the purpose of the present invention is to provide a lung cancer electronic nose data classification method based on adversarial training and multi-scale attention, so as to solve the technical problem of improving the accuracy of lung cancer electronic nose data classification.
[0008] The lung cancer electronic nose data classification method based on adversarial training and multi-scale attention of the present invention comprises the following steps:
[0009] 1) Establishing a model TS-CATMA for classifying electronic nose data, wherein the TS-CATMA includes a feature extractor, a label classifier and a domain classifier, wherein the feature extractor and the label classifier constitute a classification network;
[0010] The feature extractor comprises a backbone network, a multi-scale attention module and a Neck network connected in sequence, and the feature extractor is used to extract features from the electronic nose data;
[0011] The label classifier is used to receive the feature representation output by the feature extractor and predict the category label to which the sample belongs;
[0012] The domain classifier also receives the feature representation output by the feature extractor and distinguishes whether the sample is from the source domain or the target domain;
[0013] 2) Training TS-CATMA:
[0014] a) Training data As source domain data, test data As the target domain data, they are input into the feature extractor respectively; where M represents the input sample, Y represents the label, the superscripts tr and te represent the training set and the test set respectively, and the subscript represents the sample number; define d i is the domain label of the i-th training sample, where d i ∈{0,1}, if x i ~M tr , then d i =0; otherwise, if x i ~Mte , then d i =1;
[0015] b) Perform adversarial training: First fix the feature extractor G f and label predictor G y , optimize the domain classifier G d To maximize L all , that is, minimize Then fix the domain classifier G d , optimize G f and G y To minimize L all , that is, minimize maximize Through adversarial training, the feature extractor G f Learning to extract domain-invariant features makes the domain classifier G d It is impossible to distinguish between source domain and target domain samples; at the same time, the label predictor G y Perform supervised learning on the source domain to learn how to classify based on domain-invariant features; ultimately, a classification model that generalizes to the target domain is obtained;
[0016] Among them, L all is the total loss function:
[0017]
[0018] in, is the loss function for the label classification task, is the loss function of the domain classification task; the parameter λ is a hyperparameter used to balance the importance of the two loss functions; n is the number of training datasets, and N is the total number of training datasets and test datasets;
[0019] Use the cross entropy function to calculate the classification task of source domain data:
[0020]
[0021] The binary cross entropy loss function is used to distinguish the data in the source domain and the target domain:
[0022]
[0023] 3) Use TS-CATMA trained in step 2) to classify the electronic nose data.
[0024] Further, the backbone network includes a first feature extraction block, a second feature extraction block and a third feature extraction block connected in sequence,
[0025] The first feature extraction block consists of a one-dimensional convolution layer, a batch normalization layer and a ReLU activation layer, and the size of the convolution kernel of the convolution layer is 7; the first feature extraction block takes the electronic nose data as input;
[0026] The second feature extraction block consists of a one-dimensional convolution layer, a batch normalization layer and a ReLU activation layer, and the size of the convolution kernel of the convolution layer is 5; the second feature extraction block takes the output of the first feature extraction block as input;
[0027] The third feature extraction block is composed of a one-dimensional convolution layer and a batch normalization layer, and the size of the convolution kernel of the convolution layer is 3; the third feature extraction block takes the output of the second feature extraction block as input;
[0028] The backbone network also includes a residual connection block, the residual connection block is composed of a one-dimensional convolution layer and a batch normalization layer, and the residual connection block takes the electronic nose data as input;
[0029] The output of the third feature extraction block and the output of the residual connection block are added as the input of the multi-scale attention module.
[0030] Furthermore, the multi-scale attention module captures multi-scale features through the following steps:
[0031] (1) The feature X output by the backbone network is divided across the channel dimension so that the features are evenly distributed in each group to learn different semantic information; the feature X is grouped in the channel dimension as follows:
[0032] X=[X1,X2,...,X G ] (4)
[0033] in: Where C is the number of sequence channels, L is the sequence length; G is the number of groups, and each group has
[0034] (2) Three parallel branches are used to extract the attention weights of each group of features; the first branch uses a 1×1 convolution kernel, the second branch uses a 1×3 convolution kernel, and the third branch uses a 1×5 convolution kernel to obtain features with different receptive fields; for the i-th group of features X i , define a 1×1 convolution branch, a 1×3 convolution branch, and a 1×5 convolution branch:
[0035]
[0036] in, represents the output of the 1×1 convolution branch, represents the output of the 1×3 convolution branch, Represents the output of the 1×5 convolution branch, Conv 1×1 is a 1×1 convolutional layer, Conv 1×3 is a 1×3 convolutional layer, Conv 1×5 It is a 1×5 convolutional layer;
[0037] (3) Use global average pooling to encode the information of the feature channels of the outputs of the three branches respectively, and use Softmax to transform them to obtain the channel attention features corresponding to the three convolution branches:
[0038]
[0039] (4) Attention weight calculation: The outputs of the three convolution branches are multiplied by the outputs of their corresponding channel attention features to obtain the following three channel-space cross attention maps:
[0040]
[0041] in, It combines fine-grained temporal features with coarse-grained channel attention features;
[0042] (5) Map the output features in each group into a set of spatial attention weight values of the two branches, and apply the Sigmoid function to the set;
[0043] (6) Multiply the input of the group by the obtained attention weights item by item to obtain the attention-weighted features;
[0044] (7) The weighted attention features are restored to the state before grouping, which is the final output of the multi-scale attention module:
[0045]
[0046] The invention also discloses an intelligent machine system for lung cancer electronic nose data classification, which is loaded with the above-mentioned TS-CATMA model.
[0047] Beneficial effects of the present invention:
[0048] 1. The lung cancer electronic nose data classification method of the present invention is based on adversarial training and multi-scale attention. The structural selection of the backbone network has a significant impact on the performance of TS-CATMA. The backbone network selected in the present invention is superior to other commonly used backbone networks in various indicators.
[0049] 2. The present invention introduces a multi-scale attention module into the feature extractor, so that the feature extractor can extract rich features at multiple scales. At the same time, the parallel substructure and cross-space information aggregation improve the efficiency of the attention mechanism. The ablation experiment proves that the combination of the backbone network and the multi-scale attention module proposed in the present invention can not only improve the performance of the model, but also can obtain the TS-CATMA model in the present invention. Compared with other existing backbone networks and multi-scale attention modules, the accuracy, AUC value and specificity are significantly better than other model settings.
[0050] 3. The lung cancer electronic nose data classification method of the present invention is based on adversarial training and multi-scale attention. The proposed TS-CATMA model is trained through adversarial training. The final training model obtained in the lung cancer electronic nose data classification application not only has significant advantages over the traditional MTSC method, but also has the best overall classification performance compared with the existing deep learning methods such as InceptionTime, Resnet, FCN and LSTM-FCN, and has obvious advantages in specificity and accuracy. Therefore, if it is used in lung cancer screening, it can significantly reduce the misdiagnosis rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is the network structure of the feature extractor.
[0052] Figure 2 It is the network structure of the multi-scale attention module.
[0053] Figure 3 It is the overall framework of TS-CATMA.
[0054] Figure 4 This is the structure diagram of domain adversarial training.
[0055] Figure 5 Visualization of the intermediate layer feature map of the TS-CATMA model (first layer (b) vs third layer (c)), (a) is the original sequence image.
[0056] Figure 6 To visualize the attention weights, the first column (a) represents samples from healthy people, and the second column (b) represents samples from lung cancer patients.
[0057] Figure 7 Comparison of data distribution before and after feature extraction (t-SNE), (a) represents the original data, and (b) represents the extracted features. DETAILED DESCRIPTION
[0058] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0059] The lung cancer electronic nose data classification method based on adversarial training and multi-scale attention in this embodiment includes the following steps:
[0060] 1) A model TS-CATMA for classifying electronic nose data is established. The TS-CATMA includes a feature extractor, a label classifier and a domain classifier. The feature extractor and the label classifier constitute a classification network.
[0061] The feature extractor includes a backbone network, a multi-scale attention module and a Neck network connected in sequence, and the feature extractor is used to extract features from the electronic nose data. The network structure of the feature extractor is as follows Figure 1 shown.
[0062] The backbone network in this embodiment includes a first feature extraction block, a second feature extraction block and a third feature extraction block connected in sequence.
[0063] The first feature extraction block consists of a one-dimensional convolution layer, a batch normalization layer and a ReLU activation layer, and the size of the convolution kernel of the convolution layer is 7; the first feature extraction block takes the electronic nose data as input.
[0064] The second feature extraction block consists of a one-dimensional convolution layer, a batch normalization layer and a ReLU activation layer, and the size of the convolution kernel of the convolution layer is 5; the second feature extraction block takes the output of the first feature extraction block as input.
[0065] The third feature extraction block consists of a one-dimensional convolution layer and a batch normalization layer, and the size of the convolution kernel of the convolution layer is 3; the third feature extraction block takes the output of the second feature extraction block as input.
[0066] The backbone network also includes a residual connection block, which consists of a one-dimensional convolution layer and a batch normalization layer. The residual connection block takes the electronic nose data as input.
[0067] The output of the third feature extraction block and the output of the residual connection block are added as the input of the multi-scale attention module.
[0068] The network structure of the multi-scale attention module (MA) in this embodiment is as follows: Figure 2 As shown in Figure 2, the multi-scale attention module captures multi-scale features through the following steps:
[0069] (1) The feature X output by the backbone network is divided across the channel dimension so that the features are evenly distributed in each group to learn different semantic information; the feature X is grouped in the channel dimension as follows:
[0070] X=[X1,X2,...,XG ] (1)
[0071] in: Where C is the number of sequence channels, L is the sequence length; G is the number of groups, and each group has The grouping operation makes the channel features in each group semantically similar, which helps in the subsequent modeling of dependencies within and between channels.
[0072] (2) Three parallel branches are used to extract the attention weights of each group of features; the first branch uses a 1×1 convolution kernel, the second branch uses a 1×3 convolution kernel, and the third branch uses a 1×5 convolution kernel to obtain features with different receptive fields; for the i-th group of features X i , define a 1×1 convolution branch, a 1×3 convolution branch, and a 1×5 convolution branch:
[0073]
[0074] in, represents the output of the 1×1 convolution branch, represents the output of the 1×3 convolution branch, Represents the output of the 1×5 convolution branch, Conv 1×1 is a 1×1 convolutional layer, Conv 1×3 is a 1×3 convolutional layer, Conv 1×5 It is a 1×5 convolution layer. 1×1 convolution is used to capture fine-grained temporal features, which helps to obtain more accurate information; in contrast, 1×3 convolution and 1×5 convolution can capture coarser-grained local temporal features.
[0075] (3) Use global average pooling to encode the information of the feature channels of the outputs of the three branches respectively, and use Softmax to transform them to obtain the channel attention features corresponding to the three convolution branches:
[0076]
[0077] (4) Attention weight calculation: The outputs of the three convolution branches are multiplied by the outputs of their corresponding channel attention features to obtain the following three channel-space cross attention maps:
[0078]
[0079] in, It combines fine-grained temporal features with coarse-grained channel attention features. By aggregating the output features of two convolutional branches through cross-dimensional interactions, this cross-space learning method helps to establish short-range and long-range dependencies.
[0080] (5) The output features in each group are mapped into a set of spatial attention weight values of the two branches, and the Sigmoid function is applied to the set; this method can not only capture the contextual relationship of the time step, but also capture the correspondence between different channels and different granularity temporal features within the group.
[0081] (6) Multiply the input of the group by the obtained attention weights item by item to obtain the attention-weighted features.
[0082] (7) The weighted attention features are restored to the state before grouping, which is the final output of the multi-scale attention module:
[0083]
[0084] After the introduction of the MA module, the feature extractor is able to extract rich features at multiple scales. At the same time, the parallel substructure and cross-spatial information aggregation improve the efficiency of the attention mechanism.
[0085] The label classifier is used to receive the feature representation output by the feature extractor and predict the category label to which the sample belongs.
[0086] The domain classifier also receives the feature representation output by the feature extractor and distinguishes whether the sample comes from the source domain or the target domain.
[0087] 2) Training TS-CATMA:
[0088] a) Training data As source domain data, test data As the target domain data, they are input into the feature extractor respectively; where M represents the input sample, Y represents the label, the superscripts tr and te represent the training set and the test set respectively, and the subscript represents the sample number; define d i is the domain label of the i-th training sample, where d i ∈{0,1}, if x i ~M tr , then d i =0; otherwise, if x i ~M te , then d i =1;
[0089] b) Perform adversarial training: First fix the feature extractor G f and label predictor G y , optimize the domain classifier G d To maximize L all , that is, minimize Then fix the domain classifier G d , optimize G f and G y To minimize Lall , that is, minimize maximize Through adversarial training, the feature extractor G f Learning to extract domain-invariant features makes the domain classifier G d It is impossible to distinguish between source domain and target domain samples; at the same time, the label predictor G y Supervised learning is performed on the source domain to learn how to classify based on domain-invariant features; ultimately a classification model that generalizes to the target domain is obtained. all is the total loss function, expressed as follows:
[0090]
[0091] in, It is the loss function of the label classification task, which is used to measure the difference between the predicted label and the true label. By minimizing the loss function, the label classifier can learn the mapping relationship from input data to labels. It is the loss function of the domain classification task, which is used to measure the difference between the predicted domain label and the true domain label. By minimizing this loss function, the domain classifier can learn the ability to distinguish between source domain and target domain samples. The parameter λ is a hyperparameter used to balance the importance of the two loss functions; n is the number of training data sets, and N is the total number of training data sets and test data sets. During the training process, by minimizing the total loss function L all , the feature extractor can learn feature representations that can both predict accurate category labels and adapt to the target domain.
[0092] Use the cross entropy function to calculate the classification task of source domain data:
[0093]
[0094] The binary cross entropy loss function is used to distinguish the data in the source domain and the target domain:
[0095]
[0096] 3) Use TS-CATMA trained in step 2) to classify the electronic nose data.
[0097] The following experiments are conducted to verify the advantages of the lung cancer electronic nose data classification method based on adversarial training and multi-scale attention described in this embodiment.
[0098] The lung cancer dataset used in the experiment contains 169 samples, of which 107 are from lung cancer patients and 62 are from healthy controls, so the classification task is a binary classification problem. Each sample in the lung cancer dataset is a multidimensional time series, containing data collected by 22 channels (i.e., 22 sensors, as shown in Table 1). Each channel contains 360 data points collected during the sampling phase, denoted as X i =[x1, x2, ..., x N ] T , where N = 360, 1≤i≤M. The following experiments all use the sequences of these 360 time points, so the length of the time series of all samples is consistent with 360. Table 2 lists the training set of the lung cancer dataset (D tr ), and the test set (D te ) sample size. The training set contains samples for training and validation. The validation set is divided from the training set according to a certain proportion (about 10%).
[0099] Table 1 Information of gas sensors in the sensor array
[0100]
[0101] Table 2 Lung cancer dataset division
[0102]
[0103] For fair comparison, the experiment uses the average accuracy of five runs to reduce the bias caused by randomly initialized weights. The hyperparameter settings of the TS-CATMA model are shown in Table 3. All experiments are implemented based on the Pytorch deep learning architecture and Sklearn library in Python language and run on an NVIDIATITAN Xp graphics card with 3584 cores and 11GB global memory. For the binary classification task, the experiment uses the following evaluation indicators:
[0104] (1) Sensitivity (Sens): The proportion of samples that are correctly predicted to be positive among all samples whose true results are positive. That is, Sens = TP / (TP+FN), which reflects the ability of the classifier to identify positive samples. The higher the Sens, the fewer positive samples the classifier misses.
[0105] (2) Specificity (Spec): The proportion of samples that are correctly predicted as negative among all samples whose true results are negative. That is, Spec = TN / (TN+FP), which reflects the ability of the classifier to correctly predict negative samples. The higher the Spec, the less likely it is to misjudge negative samples as positive samples.
[0106] (3) Accuracy (Acc): The ratio of correctly classified samples to the total number of samples. That is, Acc = (TP+TN) / (TP+FP+TN+FN). It is an indicator for evaluating the overall classification performance, but when the samples are unbalanced, Acc cannot reflect the classifier performance well.
[0107] (4) Area under the ROC curve (AUC): The ROC curve is a curve that reflects the changes in sensitivity and specificity. The horizontal axis is (False positive rate, FPR), FPR = 1-Spec, and the vertical axis is the true positive rate (TPR), TPR = Sens. AUC is the area under the ROC curve, with a value between 0.5 and 1. The larger the AUC, the better the classifier performance. It can comprehensively consider the classifier's ability to classify positive and negative samples, and can better evaluate the classifier even if the training set is unbalanced.
[0108] Among them, TN (True negative) is true negative, FP (False positive) is false positive, TP (True positive) is true positive, and FN (False negative) is false negative.
[0109] Sensitivity and specificity evaluate classifier performance from positive and negative perspectives respectively; accuracy evaluates overall performance, but is easily affected by sample imbalance; while AUC evaluates the pros and cons of classifiers more comprehensively by considering both sensitivity and specificity. At the same time, when evaluating models, training and testing time are also important indicators, which reflect the computational efficiency and practical application capabilities of the model.
[0110] Table 3 Hyperparameter settings of TS-CATMA
[0111]
[0112] Ablation experiment
[0113] In order to verify the effectiveness of adversarial training (AT) and multi-scale attention mechanism (MA) in TS-CATMA, ablation experiments were conducted on the lung cancer electronic nose dataset. Table 4 shows the performance comparison under different model settings, including Base (baseline model, i.e., without AT and MA), Base+AT (only using adversarial training), Base+MA (only using multi-scale attention mechanism) and the complete TS-CATMA model.
[0114] Table 4 Ablation experiments on adversarial training and multi-scale attention mechanism
[0115]
[0116] As can be seen from Table 4, whether adversarial training or multi-scale attention mechanism is used alone, the performance of the baseline model can be improved to varying degrees. Specifically, after adding adversarial training (Base+AT), the accuracy of the baseline model is improved from 83.53% to 88.24%, and the specificity is greatly improved from 66.67% to 90.00%, which shows that adversarial training can effectively improve the model's ability to discriminate negative samples (i.e., healthy samples) and reduce the misdiagnosis rate. After adding the multi-scale attention mechanism (Base+MA), the AUC value is increased from 79.70% to 82.12%, and the sensitivity is also slightly improved, indicating that the multi-scale attention mechanism can help the model better capture the discriminative features of different scales. When combining adversarial training and multi-scale attention mechanism, TS-CATMA achieves the best performance, which is significantly better than other model settings in terms of accuracy, AUC value and specificity. In particular, TS-CATMA improved the specificity to 86.67% while maintaining a high sensitivity of 92.73%, achieving a good balance between sensitivity and specificity, which is crucial for early screening of high-risk diseases such as lung cancer.
[0117] Table 5 Ablation experiments of different backbone networks (preserving attention)
[0118]
[0119] Table 6 Ablation experiments of different backbone networks (removing attention)
[0120]
[0121] At the same time, in order to explore the impact of backbone network selection on model performance in TS-CATMA, a series of ablation experiments were conducted. Specifically, Resnet, LSTM, Transformer and the backbone network in this embodiment were used to compare their performance on the lung cancer electronic nose dataset. In addition, in order to study the role of MA, the performance of different backbone networks with and without MA was tested.
[0122] Tables 5 and 6 show the ablation experimental results of different backbone networks when retaining and removing MA, respectively. From the results, it can be seen that the backbone network (Backbone) proposed in this embodiment has achieved the best comprehensive performance regardless of whether MA is used or not. When retaining MA, the accuracy and AUC value of Backbone reach 90.59% and 89.70% respectively, which is significantly better than the other three backbone networks.
[0123] It is worth noting that the use of MA can improve the performance of most backbone networks. By comparing the two tables, it can be found that after adding MA, whether it is Resnet, Transformer or Backbone proposed in this embodiment, their AUC and have improved to varying degrees. This shows that MA can help the model better focus on features of different scales, thereby extracting more effective feature representations. MA captures multi-granular contextual information by fusing features of different scales. However, for LSTM, it affects its performance.
[0124] In terms of computational efficiency, Backbone's training and testing time are significantly shorter than other backbone networks, regardless of whether MA is used or not. This is due to the network structure of Backbone, which not only extracts highly discriminative features, but also takes into account the lightweight of the model. In contrast, LSTM has the longest training and testing time, which may be due to its sequential modeling characteristics that lead to low parallel computing efficiency. At the same time, the use of MA will increase training and testing time. By comparison, it is found that after adding MA, the training and testing time of all backbone networks has increased, because MA needs to calculate the attention weights of features at different scales, which brings additional calculations. However, the test time with MA retained in this embodiment is the least of all models.
[0125] Based on the above experimental results, the following conclusions can be drawn: (1) The choice of backbone network has a significant impact on the performance of TS-CATMA, and the backbone network (Backbone) proposed in the embodiment is superior to other commonly used backbone networks in all indicators; (2) Introducing the multi-scale attention mechanism into the feature extractor can effectively improve the discrimination ability of the model; (3) The feature extractor proposed in this embodiment also has obvious advantages in computational efficiency and is more suitable for the scenario of rapid screening of lung cancer.
[0126] Compared with other traditional methods
[0127] To evaluate the performance of TS-CATMA, experiments are conducted to compare it with five traditional MTSC methods, including CIF, DrCIF, HIVECOTE 2.0, ROCKET, and MiniROCKET.
[0128] Table 7 shows the performance comparison of the TS-CATMA model proposed in this embodiment and other traditional MTSC methods on the lung cancer electronic nose dataset. From the experimental results, it can be seen that TS-CATMA has achieved the best performance in multiple indicators. Its specificity, AUC and accuracy reached 86.67%, 89.70% and 90.59% respectively, which are the highest among all methods, and its training only takes 0.10 minutes and the test only takes 0.04 seconds. This shows that TS-CATMA can achieve higher classification efficiency than traditional methods while ensuring high sensitivity and accuracy, significantly improve specificity, and have the best overall classification performance.
[0129] The sensitivity of HIVE-COTE 2.0 and ROCKET reached 100%, which is higher than 92.73% of TS-CATMA, but their specificity and accuracy are significantly lower than TS-CATMA. This shows that although these two methods will not miss positive samples, they are prone to misclassify negative samples as positive, and the overall classification effect is not as good as TS-CATMA. The sensitivity of MiniROCKET is close to that of TS-CATMA, but its specificity, AUC and accuracy are all lower than TS-CATMA. This may be because MiniROCKET uses fewer convolution kernels and its feature extraction ability is reduced. The performance of CIF and DrCIF is relatively poor, and the sensitivity, specificity and accuracy are significantly lower than other methods. This shows that the methods based on interval features do not perform well on this dataset. In addition, in terms of training and testing time, TS-CATMA is the most efficient, with only 0.10 minutes for training and 0.04 seconds for testing. In contrast, the training time of HIVE-COTE 2.0 is as high as 282.97 minutes, and the test also takes 94.72 seconds, which has huge computational overhead. The training and testing efficiency of MiniROCKET is second only to TS-CATMA and is better than other methods such as ROCKET.
[0130] Table 7 Classification performance comparison with other traditional MTSC methods
[0131]
[0132] The reason why TS-CATMA can significantly improve computational efficiency while ensuring classification performance is mainly due to its end-to-end deep learning framework and carefully designed network structure. Traditional MTSC methods usually rely on manually designed features and complex ensemble learning strategies, resulting in high computational overhead and high model complexity. TS-CATMA automatically learns the discriminative features in time series data through CNN, and uses the attention mechanism to dynamically focus on key information at different scales, thus building an efficient and compact classification model. At the same time, the introduction of adversarial training strategies further improves the generalization ability of the model.
[0133] Comparison with other deep learning methods
[0134] To further evaluate the performance of TS-CATMA, this example compares it with four other classic deep learning multidimensional time series classification methods, including InceptionTime, Resnet, FCN, and LSTM-FCN. Table 8 shows the classification performance of each method on the lung cancer electronic nose dataset.
[0135] As can be seen from Table 8, TS-CATMA outperforms other deep learning methods in multiple indicators. Although the sensitivity of TS-CATMA is slightly lower than that of InceptionTime, Resnet, and FCN, its specificity, AUC, and accuracy are 86.67%, 89.70%, and 90.59%, respectively, which are significantly higher than all other methods. This shows that TS-CATMA has more advantages in improving specificity and overall classification accuracy. Lung cancer risk can be identified more accurately. In particular, the specificity of TS-CATMA reached 86.67%, which is significantly higher than other methods, indicating that it has a significant advantage in reducing the misdiagnosis rate. The sensitivity of InceptionTime, Resnet, and FCN reached 94.55%, which is higher than 92.73% of TS-CATMA, but their specificity and accuracy are significantly lower than TS-CATMA. This shows that these three methods perform well in detecting positive samples, but are also more likely to misjudge negative samples as positive, resulting in an overall classification effect that is not as good as TS-CATMA.
[0136] Although the training and testing time of TS-CATMA is slightly higher than other methods, this is because it introduces adversarial training and multi-scale attention mechanisms, which increase computational complexity. Considering its significant improvement in classification performance, this time overhead is acceptable. In addition, the testing time of TS-CATMA is still at the millisecond level, which fully meets the needs of rapid lung cancer screening.
[0137] In general, the comparison results with other deep learning MTSC methods confirm the superior performance of TS-CATMA in the task of lung cancer electronic nose data classification. It provides a novel and effective solution for early screening of lung cancer based on electronic nose technology.
[0138] Table 8 Classification performance comparison with other deep learning MTSC methods
[0139]
[0140] Visual Analytics
[0141] In order to gain a deeper understanding of the feature learning and decision-making process of the TS-CATMA model in the MTSC task, a visual analysis of the model’s intermediate layer features, attention weights, and feature distribution after t-SNE dimensionality reduction was performed.
[0142] The visualization of intermediate layer features aims to reveal the feature patterns learned by the TS-CATMA model at different depths, such as Figure 5 By comparing the shallow and deep feature maps, we can find the characteristics of the model in feature hierarchical learning: the shallow feature maps tend to capture local, fine-grained time series patterns (such as maximum values) and have a strong correlation with the original input signal. The deep feature maps reflect global, abstract semantic features.
[0143] A major innovation of TS-CATMA is the introduction of a multi-scale attention mechanism, which allows the model to assign different weights to different parts of the input, focusing on more important information and improving the model's expressiveness. This allows the model to focus on the time interval that is more critical to the classification task. In order to intuitively demonstrate the effect of the attention mechanism, we have performed a visual analysis of the attention weights, such as Figure 6 As shown in Figure 2. The visualization results reflect the importance of different parts of the input. The differences in attention weights between samples of different categories indicate that the model performs classification by focusing on different discriminative features rather than memorizing them by rote. This data-driven feature selection is reasonable.
[0144] In addition, in order to examine the discriminability of the high-dimensional feature space learned by TS-CATMA, we also use the t-SNE algorithm to reduce the dimensionality of the feature vector output by the feature extractor to a 2D plane and visualize it, and compare it with the original data. The principle of t-SNE is to map high-dimensional data points to low-dimensional space through nonlinear transformation while retaining the relative distance relationship of the data points in the high-dimensional space. Figure 7 As shown in the figure, the visualization results show that samples of different categories present an obvious clustering structure on the 2D plane, indicating that TS-CATMA can learn feature representations with intra-class compactness and inter-class differences. A few outliers are far away from the main cluster of their categories, which may be caused by data noise. But overall, the proportion of outliers is low and has limited impact on the generalization performance of the model.
[0145] From the comprehensive visualization results, we can see that different visualization analyses reflect different aspects of model learning. The visualization of the intermediate layer features reveals the hierarchical structure of the model's feature extraction, the attention weight map reflects the model's attention pattern on the input, and t-SNE shows the overall feature distribution. They complement each other and jointly depict the working mechanism of the model. In general, the visualization results show that the model can learn feature representations with certain discriminability and generalization, reflecting the advantages of TS-CATMA.
[0146] Through the above-mentioned experimental analysis proposed in this embodiment, it can be seen that the lung cancer electronic nose data classification method based on adversarial training and multi-scale attention proposed in this embodiment can automatically learn discriminative features from the original electronic nose time series data through a carefully designed TS-CATMA model, combined with an adversarial training strategy, and can quickly and accurately classify and identify lung cancer electronic nose data. TS-CATMA adopts an end-to-end deep learning framework, avoiding the tedious steps of manually designing features in traditional methods, greatly improving the efficiency of lung cancer screening. The 1DCNN in the feature extractor can automatically extract key patterns in time series data, the multi-scale attention mechanism further enhances the model's ability to capture information at different scales, and the adversarial training strategy improves the generalization ability of the model. The experimental results confirm the superior performance of TS-CATMA in the task of rapid screening of lung cancer. Compared with traditional methods, it reduces the training and testing time to seconds (6.15 seconds) and milliseconds (39.57 milliseconds) while maintaining a high accuracy rate (90.59%). Compared with existing deep learning methods such as InceptionTime, Resnet, FCN and LSTM-FCN, its classification performance is the best overall, with obvious advantages in specificity and accuracy. Using it in lung cancer screening can significantly reduce the misdiagnosis rate.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A lung cancer electronic nose data classification method based on adversarial training and multi-scale attention, characterized by: Includes steps: 1) Establishing a model TS-CATMA for classifying electronic nose data, wherein the TS-CATMA includes a feature extractor, a label classifier and a domain classifier, wherein the feature extractor and the label classifier constitute a classification network; The feature extractor comprises a backbone network, a multi-scale attention module and a Neck network connected in sequence, and the feature extractor is used to extract features from the electronic nose data; The label classifier is used to receive the feature representation output by the feature extractor and predict the category label to which the sample belongs; The domain classifier also receives the feature representation output by the feature extractor and distinguishes whether the sample is from the source domain or the target domain; 2) Training TS-CATMA: a) Training data As source domain data, test data As target domain data, they are input into the feature extractor respectively; Where M represents the input sample, Y represents the label, the superscripts tr and te represent the training set and the test set respectively, and the subscript represents the sample number; define d i is the domain label of the i-th training sample, where d i ∈{0,1}, if x i ~M tr , then d i =0; otherwise, if x i ~M te , then d i =1; b) Perform adversarial training: First fix the feature extractor G f and label predictor G y , optimize the domain classifier G d To maximize L all , that is, minimize Then fix the domain classifier G d , optimize G f and G y To minimize L all , that is, minimize maximize Through adversarial training, the feature extractor G f Learning to extract domain-invariant features makes the domain classifier G d It is impossible to distinguish between source domain and target domain samples; at the same time, the label predictor G y Perform supervised learning on the source domain to learn how to classify based on domain-invariant features; ultimately, a classification model that generalizes to the target domain is obtained; Among them, L all is the total loss function: in, is the loss function for the label classification task, is the loss function of the domain classification task; the parameter λ is a hyperparameter used to balance the importance of the two loss functions; n is the number of training datasets, and N is the total number of training datasets and test datasets; Use the binary cross entropy function to calculate the classification task for source domain data: The binary cross entropy loss function is used to distinguish the data in the source domain and the target domain: 3) Use TS-CATMA trained in step 2) to classify the electronic nose data.
2. The lung cancer electronic nose data classification method based on adversarial training and multi-scale attention according to claim 1 is characterized in that: The backbone network includes a first feature extraction block, a second feature extraction block and a third feature extraction block connected in sequence, The first feature extraction block consists of a one-dimensional convolution layer, a batch normalization layer, and a ReLU activation layer, and the convolution kernel size of the convolution layer is 7; The first feature extraction block takes the electronic nose data as input; The second feature extraction block consists of a one-dimensional convolution layer, a batch normalization layer and a ReLU activation layer, and the convolution kernel size of the convolution layer is 5; The second feature extraction block takes the output of the first feature extraction block as input; The third feature extraction block consists of a one-dimensional convolution layer and a batch normalization layer, and the size of the convolution kernel of the convolution layer is 3; The third feature extraction block takes the output of the second feature extraction block as input; The backbone network also includes a residual connection block, the residual connection block is composed of a one-dimensional convolution layer and a batch normalization layer, and the residual connection block takes the electronic nose data as input; The output of the third feature extraction block and the output of the residual connection block are added as the input of the multi-scale attention module.
3. The lung cancer electronic nose data classification method based on adversarial training and multi-scale attention according to claim 1, characterized in that: The multi-scale attention module captures multi-scale features through the following steps: (1) The feature X output by the backbone network is divided across the channel dimension so that the features are evenly distributed in each group to learn different semantic information; the feature X is grouped in the channel dimension as follows: X=[X1,X2,…,X G ] (4) in: Where C is the number of sequence channels, L is the sequence length; G is the number of groups, and each group has (2) Three parallel branches are used to extract the attention weights of each group of features; the first branch uses a 1×1 convolution kernel, the second branch uses a 1×3 convolution kernel, and the third branch uses a 1×5 convolution kernel to obtain features with different receptive fields; for the i-th group of features X i , define a 1×1 convolution branch, a 1×3 convolution branch, and a 1×5 convolution branch: in, represents the output of the 1×1 convolution branch, represents the output of the 1×3 convolution branch, Represents the output of the 1×5 convolution branch, Conv 1×1 is a 1×1 convolutional layer, Conv 1×3 is a 1×3 convolutional layer, Conv 1×5 It is a 1×5 convolutional layer; (3) Use global average pooling to encode the information of the feature channels of the outputs of the three branches respectively, and use Softmax to transform them to obtain the channel attention features corresponding to the three convolution branches: (4) Attention weight calculation: The outputs of the three convolution branches are multiplied by the outputs of their corresponding channel attention features to obtain the following three channel-space cross attention maps: in, It combines fine-grained temporal features with coarse-grained channel attention features; (5) Map the output features in each group into a set of spatial attention weight values of the two branches, and apply the Sigmoid function to the set; (6) Multiply the input of the group by the obtained attention weights item by item to obtain the attention-weighted features; (7) The weighted attention features are restored to the state before grouping, which is the final output of the multi-scale attention module:
4. An intelligent machine system for lung cancer electronic nose data classification, characterized by: The TS-CATMA model according to claim 1 is loaded.
Citation Information
Cited By
Lung cancer auxiliary diagnosis method based on exhaled gas base large model
CN120072276A
