Intelligence Classification Algorithm-Based Drug-Resistant Pulmonary Tuberculosis Computed Tomography Imaging Features and Influencing Factors

The drug resistance and influencing factors of patients with pulmonary tuberculosis were investigated, and a dual attention dilated residual network (DADRN) algorithm was proposed. The algorithm was applied to process and analyze lung computed tomography (CT) images of 400 included patients with pulmonary tuberculosis. Besides, sparse code book algorithm and bag of visual word (BOVW) algorithms were introduced and compared, and the influencing factors of pulmonary tuberculosis drug resistance were analyzed. The results demonstrated that the localization precision of lung consolidation, nodules, and cavities by the DADRN algorithm reached 91.2%, 92.5%, and 93.8%, respectively. The recall rate of the three algorithms amounted to 83.55%, 84.5%, and 86.4%, respectively. Both localization precision and recall rate of the DADRN algorithm were higher than those of other two algorithms (P < 0.05). The drug resistance rate of streptomycin, isoniazid, and rifampin of the patients aged between 40 and 59 was all higher than those of the patients in other age groups. The drug resistance rate of streptomycin, isoniazid, and rifampin of retreated patients was all higher than those of patients initially treated. The drug resistance rate of streptomycin, isoniazid, and rifampin of the patients with tuberculosis contact was all higher than those of the patients without tuberculosis contact (P < 0.05). Based on the above results, the accuracy of CT images processed by dual attention-based dilated residual classification network algorithm was higher than that processed by other two algorithms. Age, medical history, and history of exposure to tuberculosis were the influencing factors of the drug resistance of patients with pulmonary tuberculosis.


Introduction
Tuberculosis is an ancient disease with a history of more than 4000 years, and it still seriously threatens human health [1]. With the infection of the human immunodeficiency virus, the increase in the floating population, and the decline of the body's immune level, the drug resistance of Mycobacterium tuberculosis continues to increase, and tuberculosis spreads around the world. People begin to pay attention to the drug-resistance phenomenon of Mycobacterium tuberculosis [2,3]. Pulmonary tuberculosis is a dangerous and incurable disease with a long course. It increases mortality among patients and causes negative impacts on patients' life and safety. Mycobacterium tuberculosis is the main cause of chronic infectious lung diseases [4]. e drug-resistance rate of pulmonary tuberculosis continues to increase, and drug-resistance strains continue to spread, making treatment more difficult. It is very important to formulate a reasonable and effective diagnosis and treatment plan [5].
ere are many lesions in pulmonary tuberculosis, among which the basic ones include exudative, proliferative, caseous, pulmonary cavities, fibrosis, and calcification. However, many lesions are not typical on imaging images, and it is difficult to identify [6]. e diagnostic methods for pulmonary tuberculosis patients mainly include chest X-ray examination, computed tomography (CT) examination, and magnetic resonance imaging (MRI). At present, chest X-ray is the common one [7]. However, there are tissues with high overlapping density around the lung tissue, and the resolution is low. It is difficult to clearly display the lesion tissue and the shape of the lesion by X-ray, which has certain limitations [8]. Some studies reveal that CT can detect misdiagnosed cases by X-ray and determine if pulmonary tuberculosis is active, which shows a very high application value of CT. Hence, it is widely applied in clinical practice [9]. In recent years, the application of artificial intelligence technology to computer-aided diagnosis has become a hot topic of exploration, and intelligent classification of lung lesions is an important issue [10]. e existing automatic classification algorithms for pulmonary lesions must first label the lesion area in the image and then classify the extracted features of the lesion area. e workload of image labeling is large, and the efficiency is low [11]. Compared with other images, medical images have the characteristics of small sample size and difficulty in labeling, which reduces the workload of labeling and improves the efficiency of classification, which has become a current research hotspot [12].
A dual attention-based dilated residual classification network algorithm was proposed. e algorithm was aimed at establishing a global dependency relationship for a highlevel semantic feature map from two dimensions, including the position attention module and channel attention module, which enables similar positions or channels to gain each other. e algorithm could automatically enhance the feature differences of normal lung tissue and tuberculosis lesion tissue and predict as well as judge the types of lesions. A set of fully automatic high-precision solution provided the reference for the prevention of the drug resistance of pulmonary tuberculosis patients.

Research Objects.
A total of 400 pulmonary tuberculosis patients admitted to the hospital between January 2018 and June 2021 were selected, including 206 males and 194 females aged between 19 and 75. e patients included were treated with pulmonary tuberculosis drugs, including streptomycin, rifampicin, and isoniazid, and the drug resistance of different drugs in the patients was counted. All the patients and their families understood the study and signed informed consent. is study had been approved by the ethics committee of the hospital.
Inclusion criteria were as follows: patients with a complete medical history and imaging data; patients without mental disorder; patients without genetic disease; patients and their family members who had signed informed consent forms.
Exclusion criteria were as follows: patients who combined with major organ diseases; patients who combined with malignant tumors; patients who are unwilling to participate in the research.

CT Examination.
A 64-slice spiral CT scanner was used to scan patients' chests. e scanning method was double-slice spiral CT. Scanning parameters were set as follows. Tube voltage was 120 kV, tube current was 45 mAs, layer thickness amounted to 5.0 mm, and pitch was 1.25 mm.

CT Image Lesion Localization Based on DADRN Algorithm
2.3.1. Image Preprocessing. Usually, one scan of each patient's lung CT will generate dozens or even hundreds of files, each corresponding to a two-dimensional slice image. e views of the CT image in three standard directions were set as (xy, yz, xz), and the related data of the Dicom file can be directly read through pydicom plug-in, including the original gray value, slope value, and intercept value. e CT value corresponding to the Dicom image a was set to H a , and the calculation method was shown in equation (1). In the equation, G a represented the original gray value corresponding to Dicom image a, S a represented the slope corresponding to Dicom image a, and T a referred to the intercept corresponding to Dicom image a. (1) e CT value of the CT image was truncated according to the window width and window level in the file. WCa represented the window level corresponding to Dicom image a, Ww a represented the window width corresponding to Dicom image a, L a referred to the lower bound of the truncation range, and U a was the upper bound of the truncation range. e calculation method was shown in equations (2) and (3), and the cut-off range was expressed as [L a , U a ].
e fixed resolution used was 1 mm × 1 mm × 1 mm. I ab represented the pixel value at coordinates [a, b] in the image, and the calculation method was shown in the following equation:

Image Segmentation.
e simple threshold method is difficult to automatically segment the lungs from the CT images. In this work, the postprocessing optimization was carried out through the fully connected conditional random field, and the segmentation results of the liver organs were further improved. e flowchart of image segmentation and lesion localization was shown in Figure 1.

Dual Attention Mechanism.
e positional attention module establishes long-distance dependencies for any two points in the spatial position, captures global similar features, and utilizes global information when synthesizing output features. e input high-dimensional semantic feature map was set to be M∈R C× H × W , and the input feature M was mapped into two feature spaces E 1 , E 2 ∈R C1×(H × W) through 1 × 1 convolutional layer and batch normalization layer. It could multiply the transpose of the matrix E 1 and the matrix E 2 and normalize it with the sigmoid function to obtain the global position similarity matrix α ba ∈ R N × N . Among them, N � H × W, α ab represented the similarity between the position a th and the position b th , and the calculation method was shown in equation (5). Similarity represented the cosine distance of any two locations in space. In fact, the result of matrix multiplication was equal to the cosine distance of each position and all positions in space.
ere were eigenvectors M and eigenvectors E, and the calculation method of cosine distance was shown in equation (6).
After the input feature M was passed through a 1 × 1 convolutional layer, a feature map O∈R C × H × W was obtained, and the dimension of the feature map remained unchanged. Multiplying the normalized global position similarity matrix α and the feature map O was the new position attention feature map P b , and the calculation method was shown in equation (7). When the feature vector of the position b th of P b was synthesized, the feature information of all other positions would be integrated, and α a,b represented the importance of the position a th when the feature vector of the position b th was synthesized.
Finally, the output of the position attention module was y∈R C × H × W , which represented the result of the elementlevel addition of the original feature map and the new synthetic feature map. e calculation method was shown in equation (8). β was an adaptive parameter, which was initialized to 0 at the beginning of training, and its weight was continuously increased through network backpropagation.
e channel attention module emphasizes the dependencies between learning channels. e two-dimensional feature map corresponding to each channel is regarded as the response corresponding to a category. e channel attention module is computed directly based on the high-level semantic features M. First, the input feature M was directly , then the transformed M and its transpose were multiplied, and the sigmoid activation function was adopted to normalize the result to get outgoing channel global similarity matrix. e calculation method was given in the following equation: en, the feature M and the channel global similarity matrix y were multiplied to obtain a new synthetic feature map.
e synthetic result was multiplied by the adaptive learning parameter μ, the result and the original input feature map M were performed with element-wise addition, and the output of the final channel attention module was x∈R C × H × W (equation (10)). e output of the location attention and channel attention modules was superimposed in the channel dimension to obtain the feature z∈R (C × 2) × H × W , which was input into the classification branch to obtain the final classification result. e specific flow chart of the algorithm was shown in Figure 2.

Objective Function.
e weighted cross-entropy function was selected as the objective function of the network. is function can assign different weight values to samples of different categories when the loss function was calculated according to the number of samples of different categories. e calculation method of the normal binary cross-entropy loss function was as equation (11). In order to make the model close to the distribution of the real data, the minimized KL divergence between the model data distribution and the training data was undertaken as a supervised loss function, where r represented the true label of the data, and p represented the model output prediction result. e weighted cross-entropy function would weight a class with a smaller number of samples, as shown in equation (12). e positive and negative samples showed different weights. e weights of positive and negative samples were normalized, as Computational Intelligence and Neuroscience shown in equation (13), where A represented the number of negative samples, and B referred to the number of positive samples.

Observation Indicators.
e lung lesion classification accuracy, precision, recall rate, and F1-score of the three algorithms were calculated, respectively. e main categories were consolidation, nodules, and cavities. It was assumed that the class of interest was the positive class, and the other classes were the negative class. According to the correctness of the prediction result of the classifier, it was divided into four cases: TP meant predicting positive samples as positive, FN meant predicting positive samples as negative, FP meant predicting negative samples as positive, and TN meant predicting negative samples as negative.
e calculation methods of the four evaluation indicators were shown in equations (14)- (17), respectively, where β � 1 was the F1score. Precision e drug resistance of the patients included was counted, and the selected drugs were mainly streptomycin, isoniazid, and rifampicin. e drug-resistance influencing factors of pulmonary tuberculosis patients were analyzed, including gender, age, medical history, and history of exposure to tuberculosis.

Statistical
Analysis. SPSS 20.0 software was used for the statistical analysis of data, and a t-test was used. e count data were expressed as a rate (%), and P < 0.05 meant the difference was statistically significant.

Comparison of Accuracy and Precision of Lesion Diagnosis in Different Types of Pulmonary Tuberculosis Patients by ree
Algorithms. Figure 3 shows the comparison of the accuracy of lesion localization for different types of pulmonary tuberculosis patients using the three algorithms. Figure 4 illustrates the comparison of the localization precision of different types of pulmonary tuberculosis patients by the three algorithms. Compared with the SCB algorithm and the BOVW algorithm, the DADRN algorithm showed higher positioning accuracy and precision for lung consolidation, nodules, and cavities, and the differences were statistically significant (P < 0.05). Figure 5 shows the comparison of the recall rate of lesion localization in different types of pulmonary tuberculosis patients by the three algorithms. Figure 6 shows the comparison of the F1-score of the lesion location of different types of pulmonary tuberculosis patients by the three algorithms. Compared with the SCB algorithm and the BOVW algorithm, the DADRN algorithm showed a higher diagnostic recall rate and F1-score for lung consolidation, nodules, and cavities, and the differences were statistically significant (P < 0.05). Figure 7 shows the statistics of the drug-resistance rate of three drugs in pulmonary tuberculosis patients. Among the 400 pulmonary tuberculosis patients included, there were 52 drug-resistance patients, and the overall drug-resistance rate was 13%. Among them, there were 22 patients with streptomycin resistance, the drug-resistance rate was 5.5%, and the proportion of drug-resistance patients was 42%. ere were 18 patients with isoniazid resistance, the drug-resistance rate was 4.5%, and the proportion of drug-resistance patients was 35%. ere were 12 patients with rifampicin drug resistance, the drug-resistance rate was 3%, and the proportion of drugresistance patients was 23%. It can be concluded that the streptomycin resistance rate was higher, and the rifampin resistance rate was the lowest. Figure 8 shows the statistics of influencing factors of drug resistance for pulmonary tuberculosis patients. Among them, A showed the effect of gender on drug resistance, B was the effect of age on drug resistance, C was the effect of medical history on drug resistance, and D showed the effect of history of exposure to tuberculosis on drug resistance. It can be found that there was no significant difference in the drug resistance of pulmonary tuberculosis patients of different genders, which was not statistically significant (P > 0.05). e drug resistance of pulmonary tuberculosis patients aged 40-59 was significantly higher than that of other age groups. e drug resistance of the three drugs in retreated patients was significantly higher than that of patients initially treated, and the drug resistance of the three drugs in patients with a history of exposure to tuberculosis was significantly higher than that in patients without a history of exposure to tuberculosis, showing statistically significant differences (P < 0.05).

Discussion
Pulmonary tuberculosis is a specific infectious disease with a high incidence in young and elderly people [13]. e main Computational Intelligence and Neuroscience 5 clinical manifestations of patients are low-grade fever, cough, night sweats, chest pain, etc. If the treatment is not timely, it will seriously affect their physical and mental health [14]. In recent years, due to the extensive use of antibiotics, the drug resistance of Mycobacterium tuberculosis has been increasing, and the efficacy of drugs has become more and more limited [15]. Patients with pulmonary tuberculosis generally have low immunity. If they are not diagnosed and treated in a timely manner, serious complications such as respiratory tract infection and severe pneumonia will occur, threatening the life safety of patients [16]. e long-term stimulation of pulmonary tuberculosis in patients can cause metaplasia of the lesion tissue and adjacent parts of the epithelial tissue, stimulate cell proliferation and spread, and easily develop into lung cancer. erefore, early diagnosis and treatment are extremely important [17,18]. CT shows the advantages of fast scanning speed, clear images, and high security, provides a large amount of information, and is widely used in clinical practice [19]. e lung lesion automatic classification algorithm shows positive significance in clinical adjuvant diagnosis. Facing a large amount of medical imaging data, the support from the computer-aided diagnostic system is very important [20]. With the continuous development of modern medical imaging equipment technology, it becomes a common method to initially diagnose and classify diseases based on digital imaging data [21]. e current classification algorithm relies heavily on the fine labeling of lesion regions, which increases the workload of data labeling and causes inconvenience to operation. Some researchers [22] put forward an integrated deep learning-based adjuvant diagnosis algorithm. Stacked generalization ensemble learning was combined with VGG16 deep learning to form cascade connection classifiers to classify and verify novel coronavirus pneumonia patients, common pneumonia patients, and normal control patients. e predictive accuracy, sensitivity, specificity, and precision of the algorithm were 93.57%, 94.21%, 93.93%, and 89.40%, respectively. Zhang et al. [23] proposed a CT image hybrid feature-based pulmonary nodule classification method. Besides, they fused 3D deep dual-path network (DPN) features, local binary pattern (LBP)-based texture features, and histogram of directional gradient (HOG)-based shape features to characterize pulmonary nodules. e method shows very significant robustness in the classification of nodule pictures and can help radiologists interpret diagnostic data and make decisions in clinical practice. Xu et al. [24] proposed a texture specificity BoVW method and a spatial cone matching (SCM)-based presentation strategy to represent focal hepatic lesions. e discovery of texture specificity SCM-based BoVW features could effectively represent various hepatic lesions and improve the diagnostic accuracy of radiologists. A dual attention-based dilated residual classification network algorithm was proposed to automatically classify the lesions of CT images of patients with the weakly labeled pulmonary nodule. e dilated residual network fused with a dual attention mechanism could capture global features. It not only could enhance the correct rate and precision of classification but also improve the localization accuracy of weakly labeled lesions. e classification of lesions in CT images of pulmonary tuberculosis patients was explored based on the DADRN algorithm, and the accuracy, accuracy, recall rate, and F1score of three algorithms for the classification of pulmonary tuberculosis lesions were compared. e drug resistance and influencing factors of pulmonary tuberculosis patients were analyzed. e results showed that the accuracy, precision, recall rate, and F1-score of the DADRN algorithm for localization of lung consolidation, nodules, and cavities were higher than those of the SCB algorithm and BOVW algorithm, and the differences were statistically significant (P < 0.05). e total drug-resistance rate of pulmonary tuberculosis patients included was 13%, the drug-resistance rate of streptomycin was higher, and the rifampin resistance rate was the lowest.
ere was no  significant difference in the drug resistance of pulmonary tuberculosis patients of different genders (P > 0.05). e drug-resistance rate of pulmonary tuberculosis patients aged 40-59 was significantly higher than that of other age groups. e drug resistance of the three drugs in retreated patients was significantly higher than that of patients initially treated, and the drug resistance of the three drugs in patients with a history of exposure to tuberculosis was significantly higher than that in patients without a history of exposure to tuberculosis, showing statistically significant differences (P < 0.05). e DADRN algorithm can be applied to the intelligent classification of lung CT image lesions in pulmonary tuberculosis patients and has good application effects.

Conclusion
A dual attention-based dilated residual classification network algorithm could realize intelligent classification of the lesions of CT images of pulmonary tuberculosis patients with high accuracy. e algorithm could be applied in clinical practice to reduce workload and improve the processing efficiency of CT images. Hence, it could be promoted and applied in clinical diagnosis and treatment. e Further studies and verification are necessary. e sample size should be enlarged and compared with other algorithms to seek an optimal intelligent classification method of lung CT image lesions.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.