Analysis and Application of Antibacterial Drug Resistance Based on Deep Learning

—The continuous improvement of deep learning technology has led to its deeper application in related fields, especially in the detection of antimicrobial resistance in the medical field. In drug resistance detection, the CNN-ATT-TChan model based on the fusion of CNN algorithm and attention mechanism can classify and organize a large amount of antimicrobial resistance data, achieving standardized processing. Based on mature chemical analysis and testing methods, drug resistance test data was obtained, and the training duration and classification accuracy F of the model were discussed in combination with the test data. At the same time, based on relevant research literature, the changes in ROC curves and AUC values between different models were compared. The results showed that the CNN algorithm using fusion attention mechanism can improve the training time of the model and also improve the classification accuracy of the model. Therefore, the application of CNN-ATT-TChan model combined with attention mechanism in the detection of antimicrobial resistance provides more support for the development of antimicrobial resistance testing.


I. INTRODUCTION
The development of antibiotics, especially antibiotics, has greatly reduced the incidence rate and mortality of many infectious diseases.However, with the continuous use of antibiotics, bacteria can develop resistance to antibiotics, which has become one of the main challenges threatening global public health.Antibiotic resistance refers to the ability of bacteria to resist or become tolerant to chemotherapy agents, antimicrobial agents, or antibiotics.This tolerance may be achieved through gene mutations or exogenous DNA in the transmission of R-factors.Bacteria that are resistant to multiple antibiotics are also known as multidrug-resistant, while bacteria that are considered to be extensively or completely resistant are referred to as super bacteria [1][2].Resistance generally occurs when many infectious bacteria gradually adapt to first-line or even second-line antibiotics and develop bacterial resistance in the context of antibiotic abuse and overuse.This type of problem poses a huge burden and impact on medical hygiene, veterinarians, agriculture, and society.Affected by drug resistance, treatment plans may be limited or unavailable, posing a higher risk of death, longer hospital stays, and recovery processes for patients, sometimes even leading to long-term incapacity.Therefore, it is necessary to fully analyze the internal reasons for the formation and development of antimicrobial resistance, and based on this, study the role of antimicrobial resistance as shown in Fig. 1.The process of antibiotic resistance occurrence is presented from the perspective of drug resistance gene transfer.Antimicrobial resistance analysis is a complex process, and deep learning, as one of the key core technologies of big data analysis, provides more means for the improvement and development of antimicrobial resistance analysis.At present, the basic data in the medical field is complex, and electronic medical records, diagnosis and treatment data, laboratory and inspection data, as well as various management data, have become major issues faced by drug resistance analysis.Therefore, further improving the intelligent analysis and processing technology of antimicrobial resistance in the medical field has become a key link in drug detection in this field [3][4].In the medical field, although there are already many chemical testing methods such as drug resistance test kits and analysis software being applied, with the continuous improvement of data utilization and analysis requirements, relying solely on traditional chemical testing methods cannot provide better support for drug resistance analysis in the in the medical field.The use of antibacterial drugs is mainly determined based on experience and habits, resulting in a lack of comprehensive analysis of the indications and contraindications of antibacterial drugs, as well as the personal characteristics of patients, and the inability to achieve the best expected treatment effect.

Drug resistance gene transfer
www.ijacsa.thesai.org In the medical field, traditional bacterial culture methods are often used for drug resistance testing, which takes at least 3-5 days from identifying bacteria to completing drug sensitivity testing [5].This traditional testing method delays the optimal time for doctors to analyze patients' antimicrobial resistance, posing challenges and difficulties for clinical drug use.At present, there is relatively little research on data analysis and processing of antibacterial drugs based on deep learning algorithms.Researchers have used the XGBoost algorithm of machine learning to construct MIC prediction models between the genome of non-Salmonella typhimurium and multiple antibiotics.Some scholars have also conducted exploratory research on the rational use of antibiotics using machine learning immune genetic algorithms and deep learning short-term memory network models [6][7][8].Based on deep learning algorithms and combined with modern chemical methods, it provides a more accurate and efficient means for the analysis of antimicrobial resistance in the medical field.At the same time, it can significantly shorten the testing cycle and provide testing results in a timelier manner [9][10].Chemical methods play an important role in drug analysis and research and development.Through their diverse analytical methods, from molecular structure to compound labeling, from component testing to local drug analysis, this method provides an effective way to solve drug analysis problems.In the field of medicine, the updates in deep learning technology and the development of chemical methods have provided more comprehensive analytical methods for the analysis of antimicrobial resistance.This article combines the convolutional neural network (CNN) algorithm in deep learning and proposes a dual channel CNN terminal model in the medical field that integrates attention mechanisms based on the analysis and summary of completed drug resistance experimental data.Using a CNN model for feature extraction and completing self-learning, assigning different weights to information of different importance, and constructing a classification model between testing samples and antibacterial drugs.Using this model to determine the tolerance level of the test samples to antibiotics can provide auxiliary effects for the rational use of antibiotics in the medical field.At the same time, doctors in Harbin can provide the most suitable decision support for individual patients in clinical medication.

A. Analysis of Deep Learning Algorithms
Deep learning is an important branch of machine learning.By learning deep nonlinear network structures, deep learning trains features layer by layer, gradually transforming the feature representation of samples in the original space into a new feature space, demonstrating the powerful ability to learn the essential features of datasets from the sample set.The biggest advantage of deep learning is that it can automatically learn features and achieve the abstraction process of features.It adopts multi-layer complex structures or multiple layers composed of multiple nonlinear transformations for data processing.The use of deep learning for drug resistance testing and analysis in the medical field has unique advantages.
It can fully explore the deep relationships hidden in a large amount of medical data, obtain more abstract feature values through learning neural networks, and improve the feasibility and accuracy of antimicrobial resistance analysis in the medical field [11][12].As shown in Fig. 2, a schematic diagram of the network structure of the deep learning algorithm is provided.The algorithm consists of three dimensions: input layer, hidden layer, and output layer, with relevant nodes processing and analyzing data in each layer.

B. Application Status of Deep Learning Algorithms in Drug Resistance Testing
The continuous development of deep learning algorithms has led to the application of more and more technologies in the medical field, promoting the continuous updating and progress of drug resistance testing methods in the medical field.At the same time, thanks to the application of deep learning technology in drug research and development, people have also made many beneficial explorations and attempts [13][14][15].The study of gene expression and protein structure, compound screening, and the design and analysis of clinical trials for drug design are all influenced by artificial technology.In addition, the application of various digital devices in clinical trials and daily patient monitoring will also benefit from the help of artificial intelligence technology.Driven by machine learning and deep learning technologies, significant progress has been made in the analysis of antimicrobial resistance testing in the medical field.By using CNN technology in deep learning, testers can obtain more detailed data on antimicrobial resistance testing and analysis, and conduct more effective research and analysis on drug resistance, Furthermore, more accurate drug resistance diagnosis and prediction can be made for patients [16].The application of deep learning algorithms in the testing of antimicrobial resistance can help evaluate drug resistance in a shorter time with fewer cases and reduce the cost of clinical trials.As shown in Fig. 3, a schematic diagram of the application of the CNN algorithm model in drug resistance testing and analysis is provided.
Based on deep learning algorithms, comprehensive analysis of a large amount of antimicrobial resistance testing data has become a trend in the medical field.In traditional medical practices, doctors also use antibiotics based on their

A. CNN Algorithm Theory
CNNs are mainly used in fields such as image processing and recognition.They are a multi-layer perception mechanism mainly used to process two-dimensional images.As shown in Fig. 4, a schematic diagram of the CNN module in deep learning algorithms is provided.The basic structure of CNN consists of an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer.The pooling layer merges adjacent multiple nodes into a similar feature to reduce the amount of training data, extract hidden features from the project, conduct multi-layer training, and perform dimensionality reduction processing.Finally, the CNN is trained as a whole [19][20].represents the weighted input of the h-th neuron in layer l.The weighted input of the h-th neuron in the l-th layer can be represented by Formula (1): For convolutional layers, their main function is to extract features, perform convolution calculations on the vectorized text vector and the convolution sum, and perform operations on extracting word information before and after.The obtained convolution results are processed through activation function operations, and the convolution function results are used as the output results of this layer.The convolutional kernel is represented by w, where w∈R hk .Where h represents the height of the convolutional kernel window, and k represents the dimensional size of the word vector.Wih represents a sequence of words with a length of h (Wi, Wi+1, …, Wi+h), Wi represents a word, and the value of each eigenvalue can be calculated using Formula (2): , , , , () Among them, n represents the height and width of the convolutional kernel, m represents the depth of the convolutional kernel, b represents the bias of the convolutional kernel, and f(•) represents the activation function.In addition, the input layer x is convolved to obtain the feature vector y, which can be represented by Formula (3): In addition, the pooling layer can reduce the dimensionality of the extracted feature information, reducing the size of the feature map, simplifying the computational complexity of the network, and avoiding overfitting to a certain extent.On the one hand, feature compression is performed to extract the main features.This layer is mainly used to reduce the dimensionality of the feature map obtained by convolution, and the maximum pooling method shown in Formula ( 4) is often used to extract local optimal values: The fully connected layer in a CNN is usually located after several convolutional and pooling layers, and is also the last few layers of the CNN.Its essence is a multi-layer perceptron model, where each neuron in the fully connected layer is connected to all neurons in the previous layer.The most direct function of the fully connected layer is to compress the two-dimensional feature map into a one-dimensional feature vector, in order to connect with the final output layer of the network to output the final classification results [21].At the same time, it can also to some extent integrate local information with class differentiation in convolutional and pooling layers.The role of the previous convolutional and www.ijacsa.thesai.orgpooling layers is to map a shallow feature into a deep feature space, while the fully connected layer maps these deep feature representations into the classification space of the class.Therefore, the fully connected layer also has a certain classification effect.
The use of nonlinear factors can better solve complex problems, and activation functions can help introduce nonlinear factors, adding some nonlinear factors to neural networks, and enabling neural networks to better solve more complex problems.Common saturated linear functions include Sigmoid, Tanh function, and Tanh activation function, which converge faster than Sigmoid, but there is still a phenomenon of gradient vanishing during training [22][23].As shown in Formulas ( 5) and ( 6), the activation function expression is given: () In this article, the specific method is first based on deep learning methods.The input part involves the name, function, dosage, indication, contraindications, etc. of antibacterial drugs.The word vector tool is used to train the word vector, and then the transformed sentence is input into a CNN for convolution and pooling.Then, the fully connected deep learning features are obtained.

B. Construction of Drug Testing Model Based on CNN Algorithm 1) Text classification:
In the medical field, text classification of data is required when using CNN algorithm for antibiotic resistance testing and analysis.Text vector is a higher-level expression of text, which can be used as a partial feature vector for antibacterial drug text data classification.After training and learning through standard neural networks, vector V is obtained as another basis for antibacterial drug text data classification [24].The weights of feature vectors in classification are α and (1-α).The probability calculation formula for text belonging to a certain type of effect is shown in equation ( 7): (1 ) Using the negative logarithmic likelihood of the correct label as the training loss, the calculation formula is shown in formula (8): Where j is the label of text d, the probability that text d belongs to effect j.

2) Modeling of drug sensitivity testing data:
The dual channel CNN model proposed in this article integrates attention mechanism.After preprocessing the original test data, it is vectorized and modeled.As input data, it is sent to the CNN of two independent and different depth channels.After each channel undergoes several convolutional and pooling operations, attention mechanism is introduced.By fitting multiple sets of weight vectors to characterize the importance of each feature component, the feature data of the two channels is fused, and finally, the softmax function is used to achieve classification output.The data source studied in this article is bacterial drug sensitivity testing data.Each   Select multiple attributes from the submitted data that may affect the tolerance value of antibacterial drugs as input features, and use the testing result MIC as a classification label.Considering that different bacterial strains have different sensitivities to the same antibacterial drug, and the sensitivity values of the same bacterial strain to the same antibacterial drug vary among different specimens [27].Therefore, it is necessary to establish a classification model for each antibacterial drug, and output its MIC classification value for the current antibacterial drug based on the input multi feature test data.The vectorized representation of sample data containing multiple features is an important prerequisite for feature extraction and fusion using CNNs.This article draws inspiration from the approach of constructing a word vector model in text problems, where each attribute feature value corresponds to a word and is represented by a vector.The dimension of the feature vector is the number of all feature values.As the feature vector dimension of the drug sensitivity data selected in this article is 48, there is no problem of dimensional disaster, and the correlation between various features is relatively weak.Therefore, the traditional One-hot method is used to construct the feature vector model.A sample www.ijacsa.thesai.orgdata containing multiple features corresponds to a sentence in the text problem, which is modeled as a two-dimensional matrix, and each row of the matrix is a feature vector.As shown in Fig. 5, a dual channel convolutional neural network model structure diagram integrating attention mechanism is presented.The features extracted by CNNs are often related to the depth of the network.The deeper the network level, the easier it is to extract abstract features that represent the whole.The shallower the network level, the easier it is to extract detailed features that represent local regions.In view of this, this article designs two types of dual channel CNNs with depths of six and four layers, respectively, to extract features at different levels of abstraction in deep and shallow layers.In addition, considering that the feature matrix size of the testing sample is not large, pooling dimensionality reduction is weakened.The upper channel network consists of five convolutional layers with different kernel sizes and numbers, three maximum pooling layers with the same step size, and 1 fully connected layer, the down channel network consists of three convolutional layers with different kernel sizes and numbers, one maximum pooling layer, and one fully connected layer.

3) Attention mechanism and model training:
The implementation of the Attention Mechanism is achieved by preserving the intermediate output results of the CNN encoder on the input sequence, and then training a model to selectively learn these inputs and associate the output sequence with them when the model outputs [28][29].Although the model may increase computational complexity after using this mechanism, its performance level can be improved.In addition, using this mechanism helps to analyze the impact relevant information on the final generated sequence.
The attention mechanism assigns appropriate weights to each feature component, selects important features, and focuses on this information.It is divided into three parts, namely Squeeze, Excitation, and Attention.Assuming that the feature information after convolution and pooling is a two-dimensional matrix containing n feature vectors, denoted as mn U  , after squeezing, the vector Z is obtained.The calculation of the squeezing function (Fsq) is shown in Formula (9): The vector Z is stimulated by Formula ( 10) to obtain the attention weight vector a.Multiply the weight vector a with the feature matrix U to generate a feature output U' with attention mechanism, and U'=aU.
() sz a softmax w tanh w z      (10) where, m is the dimension of the feature vector, Ui is the i-th feature vector, softmax (•) and tanh(•) are activation functions, and ws and wz are learnable weight matrices.
In addition, during the model training process in the CNN algorithm, the softmax function is used to classify the feature vectors after dual channel fusion, and the predicted probability value () P k x of the output result category is shown in Formula (11): 1 () The cross-entropy loss function is used to measure the difference between the predicted probability and the real label, and the calculation is shown in Formula (12).This is used for backpropagation training of the model, with the goal of minimizing the loss of the function [30]: where, () q k x represents the actual encoding vector of the corresponding category k of the current sample, which is the real label.

IV. ANALYSIS OF DRUG RESISTANCE TESTING AND MODEL APPLICATION
A. Drug Resistance Testing 1) Source of strains and testing instruments: When using a deep learning CNN algorithm to detect antimicrobial resistance, the relevant data comes from bacterial drug sensitivity testing data in a tertiary hospital's intensive care  2) Drug resistance testing methods: The sensitivity of antibacterial drugs was determined using K-B agar diffusion method and M-H agar dilution method.The screening criteria for multiple drug resistance were: Acinetobacter Baumanii against cephalosporins, aminoglycosides, carbapenems, and enzyme inhibitors β Individuals with resistance to three or more antibiotics, including lactams and fluoroquinolones, are identified as multidrug-resistant Acinetobacter baumannii.
For the preparation of flat plates, it is necessary to mark the different concentrations on the plates, dilute the antibiotic stock solution, and then pour the antibiotics into the plates using a double dilution method.Wait for M-H agar to cool to about 50℃, and pour a certain amount of antibacterial drugs into the plate with the calculated final concentration.Inoculate the quality control strain and the test strain onto an M-H agar plate, incubate overnight at 37℃, and then select 4~5 colonies to be cultured overnight in 1ml of M-H broth.Dilute 10 times, which is equivalent to 0.5 Mach's turbidity.Dip the bacterial solution with a multi-point inoculum and inoculate it onto an antibacterial drug plate.The amount of inoculation per point is approximately 10 4 ~10 5 CFU.Place the inoculated antibacterial drug plate in an incubator at 35℃ for 20~24 hours and observe the results.Each operation includes quality control strains.
In addition, for the drug sensitivity testing process, the antibacterial K-B method is used to determine the size of the antibacterial zone.The fresh pure bacterial solution with a concentration of 0.5 microns is uniformly coated with sterile cotton swabs on a 4mm thick and 90mm diameter M-H agar drug sensitive plate.Each plate is coated with six pieces of drug sensitive paper, and incubated at 35℃ for 16~18 hours to measure the size of the antibacterial zone on the plate and interpret the results.The results were determined to be sensitive, medium sensitive, or resistant according to the relevant regulations regarding the size of the antibacterial zone.

B. Application and Analysis of Testing Models
Based on the above statistics of antimicrobial resistance testing results, a total of 12765 related data were completed.The actual production data is quite complex and must be preprocessed before being used in experiments.The data preprocessing work in this article includes data filtering and screening, outlier testing, and standardization.Firstly, data filtering involves screening raw data, removing irrelevant indicators, and selecting six attribute features that may affect antimicrobial resistance values as inputs.The corresponding feature inputs are patient gender, patient age, source department, specimen type, bacterial species, and related chemical detection methods.Secondly, outlier testing is mainly based on expert testing experience to identify unreasonable testing results in the original data.At the same time, testing samples with more missing values and fewer records are also included in the outlier data.The final dataset used for the experiment consists of 3562 pieces.Then there is the standardization of data processing, mainly for the convenience of later data processing, quantifying the five features using numerical values to achieve unified quantization methods.

1) Evaluating indicators:
In the process of detecting antimicrobial resistance, this article uses the F metric value as the evaluation criterion for the classification results.The process of classifying the test text d in this method is as follows: first, calculate the text similarity between d and each text in the training sample set.The similarity is generally measured using Euclidean distance, and based on the text similarity, find the most similar K closest training texts.The K sample categories are used as candidate categories for d, Then, based on the similarity between the text to be classified d and these K neighbors, the weight of the K nearest neighbor text category is used.The sum of the class weights of the neighboring texts in each category is used as the similarity between the category and the test text.Then, the text to be classified d is divided into the category with the highest weight.The calculation process of text similarity between the text d and di to be classified is given by Formula (13): For the weight of the sample d to be classified and the cj of each class, Formula ( 14) can be used to calculate: www.ijacsa.thesai.org 1 ( , )= ( , ) ( , ) where, y(di,cj) is a class attribute function, and when di∈cj, there exists y(di, cj)=1.When di∉cj, y(di, cj)=0.
In addition, this method takes into account both precision (P) and recall (R) indicators, with P, R, and F calculated by Formula (15): where, TP represents the number of samples divided into positive classes, FP represents the number of samples divided into positive classes for negative classes, FN represents the number of samples divided into negative classes for positive classes, TP+FP represents the actual number of samples classified, and TP+FN represents the expected number of samples.
To further analyze the accuracy of antimicrobial resistance testing, Formula ( 16) can be used to determine the accuracy of the test results: 2) Experimental environment and parameters: To ensure the objectivity and effectiveness of antimicrobial resistance testing results, a ten fold cross validation method was adopted in the experiment.The dataset was divided into te parts, with 1 part being the test set and the remaining nine parts being the training set.The 10 samples were randomly rotated for 10 experiments, and the average value was taken as the final result of the model.After multiple experiments, a set of optimal model parameters was determined, and the relevant values are shown in Table III.To better evaluate the classification performance of the dual channel CNN model (CNN-ATT-TChan) proposed in this article, which integrates attention mechanisms, in antimicrobial resistance testing data, comparative experiments were designed between different models.As shown in Table IV, the types and basic information of the models used for comparison are provided.

CNN-2D
The convolution kernel of this model is two-dimensional, including multi-layer convolution and pooling operations.

CNN-2D-ATT
This model adds an attention mechanism based on feature components on the basis of CNN-2D.

CNN-2D-TChan
This model is based on CNN-2D and designed with two upper and lower channels, which perform multiple convolution and pooling operations for feature fusion and achieve classification output.

CNN-1D-MChan
This model adopts multiple one-dimensional convolutional kernels with different widths but the same length, each with a length equal to the feature vector dimension of drug sensitivity data.

CNN-1D-Mchan-NP
This model is based on CNN-1D-MChan and removes pooling operations.After each channel undergoes one-dimensional convolution, it directly performs vector fusion and enters the fully connected layer.

ResNet-18
The basic architecture of this model is ResNet, with a depth of 18 layers (referring to the weight layer of the network), excluding the batch normalization layer and pooling layer

RF
The random forest algorithm model is a mainstream ensemble learning method used for classification and regression.
3) Analysis of model testing results: Based on the sorting and analysis of the above basic models, in order to verify the impact of adding attention mechanisms in one-dimensional and two-dimensional convolution models on model performance, as shown in Fig. 6, the impact of attention mechanisms on model training duration in one-dimensional and two-dimensional convolution cases is presented.As shown in the figure, for a two-dimensional convolutional model, with the assistance of spatial domain attention mechanism and mixed attention mechanism (spatial+channel), the main role of attention mechanism in one-dimensional convolution and two-dimensional convolution is to significantly increase the training time of the model.For the two-dimensional convolutional model, with the introduction of attention mechanism, when Epochs is 500, the two are 604s and 501s respectively, with a difference of 103s, which is about 20.5% higher overall.In the one-dimensional convolutional model, after introducing attention mechanism, the training duration of the two is 298s and 258s respectively (when Epochs is 500), with a difference of 15.5% between the two.Therefore, it can be seen that when attention mechanism is introduced, the training duration of both will increase to varying degrees.After adding attention mechanism, the training duration has been improved to a certain extent.The training duration of one-dimensional convolutional network www.ijacsa.thesai.org(CNN-1D-ATT) with added attention mechanism is relatively small compared to one-dimensional convolutional network (CNN-1D) without added attention mechanism.The two-dimensional convolutional network (CNN-2D-ATT) with added attention mechanism has significantly improved and improved training time compared to the two-dimensional convolutional network without added attention mechanism (CNN-2D), which also lays the foundation for the accuracy of antimicrobial resistance analysis.Based on the analysis of the training duration of relevant models, in order to further analyze the impact of attention mechanism introduction on the accuracy of different models, as shown in Fig. 7, the trend of F values of one-dimensional convolutional models and two-dimensional convolutional models under different Epochs is presented.As shown in the figure, for the two-dimensional CNN model, with the introduction of attention mechanism, the classification accuracy of CNN-2D-ATT is significantly higher than that of CNN-2D.For example, when Epochs is 500, the F values of the two are 76.1% and 66.4%, respectively, with an overall difference of 9.7%.At the same time, comparing one-dimensional CNN models that also introduce attention training mechanism with two-dimensional CNN models, it can be found that when Epochs is 500, the former has an F-value of 57.2%, while the latter has an F-value of 76.1%, an improvement of about 18.9%, and the improvement effect is significant.The main reason for the improvement and enhancement of this effect is, on the one hand, due to the small number of layers in the one-dimensional convolutional network model, resulting in a decrease in the overall complexity of the network model.On the other hand, the reduction in the size of the convolutional kernel and output feature during the one-dimensional convolutional process leads to a decrease in the time complexity of individual convolutional layers.As shown in Fig. 10, a comparison of the ROC curves between this model and other model is presented.From the figure, it can be seen that the AUC corresponding to the ROC curve in this paper is 0.86, while the AUC of the VGGC16+LSTM model in study [31] is about 0.71.Therefore, the model in this article has better detection performance.Through the comparison of the above models and related indicators, it can be found that the CNN ATT Tchan model constructed in this article can effectively improve the problems of low detection accuracy and relatively long detection time in traditional models in drug detection.While solving the problem of low detection accuracy, it achieves the goal of shortening the detection cycle of antibiotic resistance.In this article, improvements have been made in model detection efficiency and detection cycle performance, but further research on drug resistance detection is still a worthwhile direction.For example, deeper research can be conducted by combining a large amount of clinical data, providing more support for drug resistance testing work.

Fig. 3 .
Fig. 3. Application of CNN algorithm in drug resistance testing and analysis.

Fig. 4 .
Fig. 4. Schematic diagram of CNN model.In the CNN model algorithm, L represents the number of layers of the neural network, i represents the label of a certain layer, then , i hw w represents the connection weight from the wth neuron in layer i-1 to the h-th neuron in layer i, i h b represents the bias of the h-th neuron in layer i, and i h Z at the region connected to the convolutional kernel (h, w, d ), parameter at the convolutional kernel (h, w, d ), i
Fig. 6.Impact of introducing attention mechanism into 1D/2D models on training duration.

Fig. 7 .Fig. 8 .Fig. 9 .
Fig. 7.The influence of attention mechanism on F-value in 1D/2D models.In addition, in order to compare the overall performance of the model constructed in this article (CNN-ATT-TChan) with other models, based on the analysis of the overall performance of different models, as shown in Fig. 8 and Fig. 9, the F-values of different models and the changes in training time of different models were presented.From Fig. 8, it can be seen that in the comparison of the F values of the above models, the maximum value is the CNN-ATT-TChan model, which is about 72.4%, indicating that the model has better overall performance and can demonstrate better classification accuracy.The model with the lowest F-value is the CNN-1D Mchan model, which is approximately 50.6%.In addition, in Fig. 7, the comparison of the training time of different models with Epoch of 50 is shown.The average time of the above models is about 166 seconds, and the ResNet-18 model with the longest required time is about 653 seconds.The training duration of the CNN-ATT-TChan model is approximately 103 seconds, which is a decrease of 63 seconds compared to the average.Therefore, the CNN-ATT-TChan model constructed in this paper exhibits good classification performance when the experimental data for antimicrobial resistance testing is large and the amount of feature engineering is increased.
V. CONCLUSIONS The continuous development and application of CNN algorithm in deep learning technology have promoted the continuous progress of antimicrobial resistance testing technology in the medical field.This article constructs a CNN-ATT-TChan model based on the application of CNN algorithm in drug resistance testing, and compares and analyzes the performance of this model in antimicrobial drug resistance testing.The changes in the training time and classification accuracy of the model are presented.The main conclusions are as follows: By combining the CNN algorithm and attention mechanism, the constructed CNN-ATT-TChan antibacterial drug resistance testing and analysis model can achieve better overall testing performance compared to other models.It can effectively improve important parameters such as training time and classification accuracy in the antibacterial drug resistance testing process in the medical field, and achieve improved testing performance.By integrating attention mechanism into one-dimensional CNN and two-dimensional CNN models, for two-dimensional CNN models, with the introduction of attention mechanism, when Epochs is 500, the training duration is increased by about 20.5%.In the one-dimensional CNN model, the introduction of attention mechanism resulted in a 15.5% increase in training time.The constructed CNN-ATT-TChan antibacterial drug resistance testing model exhibits better overall classification accuracy and small sample classification, with certain feasibility and effectiveness.Compared to other models, the classification accuracy can be improved by up to 21.8%.C N N -A T T -T C h a n C N N -2 D C N N -2 D -A T T C N N -2 D -T c h a n C N N -1 D -M c h a n C N N -1 D -M C h a n -

ELU ••• Cross Entropy Error Soft max Input layer Hidden layer Output layer Input node Hidden node Output node
test sample includes the patient's age, gender, department, submission date, sample type, bacterial species, testing chemical reagents, testing report date, and other submission data, as well as the patient's minimum inhibitory concentration (MIC) testing results for each antibacterial drug.With the development of physical, chemical, and molecular biology technologies, various new bacterial resistance testing technologies have emerged.As shown in Table I, common chemical methods and their characteristics for detecting antimicrobial resistance are presented.

TABLE I .
[25][26] METHODS AND CHARACTERISTICS OF ANTIMICROBIAL RESISTANCE TESTING[25][26] In addition, the culture medium is Mueller Hunton (M-H) agar and broth.As shown in TableII, the relevant equipment for drug resistance testing is provided.

TABLE III .
SETTING OF MAIN PARAMETERS OF THE MODEL

TABLE IV .
COMPARISON OF DIFFERENT TYPES OF MODELS