A mobile nasopharyngeal carcinoma identification system and method
By deploying a lightweight nasopharyngeal carcinoma recognition system on mobile devices and utilizing ResNet18 and ResNet152 residual neural network models, the problem of difficult deployment of nasopharyngeal carcinoma diagnostic systems on Android devices has been solved, achieving fast and accurate nasopharyngeal carcinoma recognition, reducing the workload of doctors, and making it suitable for telemedicine and consultation.
Patent Information
- Application Number
- CN202211731485.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Existing nasopharyngeal carcinoma diagnostic systems are difficult to deploy on Android devices, and the 3D deep learning models are difficult to interpret, resulting in low diagnostic accuracy and high time and effort consumption, making it impossible to effectively screen for nasopharyngeal carcinoma.
A mobile nasopharyngeal carcinoma recognition system was designed. Through an image preprocessing module and a recognition module, a lightweight ResNet18 and ResNet152 residual neural network model was used, combined with model distillation technology, to convert the 3D model into 2D and deploy it on the client to achieve fast and accurate nasopharyngeal carcinoma recognition.
It enables rapid and accurate identification of nasopharyngeal carcinoma on mobile devices, reducing doctors' workload, improving diagnostic efficiency, and is suitable for telemedicine and consultation needs.
Smart Images

Figure CN116385345B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of intelligent recognition systems, and more specifically, to a mobile nasopharyngeal carcinoma recognition system. The invention also relates to a recognition method for this system. Background Technology
[0002] Nasopharyngeal carcinoma (NPC) is an epithelial cancer originating from the inner lining of the nasopharyngeal mucosa, with a relatively wide distribution worldwide. In China, NPC accounts for 47% of the population, with South my country being a high-incidence area. Over 70% of NPC patients are diagnosed with locally advanced disease at their first visit. While the 5-year overall survival rate for early-stage NPC patients is as high as 90% due to the advantages of magnetic resonance imaging (MRI) and the development of radiotherapy, the survival rate for late-stage NPC is much lower, ranging from approximately 67% to 90%. Early treatment of early-stage NPC patients can effectively improve treatment outcomes and increase survival rates; therefore, early identification of NPC patients is crucial for improving their survival. On the other hand, my country's medical environment suffers from challenges such as a shortage of doctors, a large patient population, difficulty accessing medical care, high medical costs, and uneven distribution of medical resources across different regions. Furthermore, the lack of diagnostic experience among junior doctors leads to a lower accuracy rate in diagnosing NPC, resulting in a certain degree of misdiagnosis. Current nasopharyngeal carcinoma screening typically relies on doctors reviewing patients' medical images. This diagnostic process requires extensive experience and is inherently challenging. Furthermore, procedures such as transferring patients to other hospitals further burden doctors, consuming time and effort, which is detrimental to the screening and treatment of nasopharyngeal carcinoma. Therefore, establishing a rapid and accurate mobile-based nasopharyngeal carcinoma diagnostic database would facilitate early screening and convenient diagnosis of this disease.
[0003] Currently, there is still no complete system capable of diagnosing nasopharyngeal carcinoma on Android devices.
[0004] In recent years, some scholars have used MRI images to construct diagnostic models for nasopharyngeal carcinoma. In a 2020 paper, Ke et al. used a 3D DenseNet deep learning network to build a neural network model with an accuracy of 97.77%. In 2021, Wong et al. built a model with an AUC score of 0.96 based on 412 nasopharyngeal carcinoma patients. However, these studies have two problems. First, because they use 3D MRI image data to build deep learning models, the models are very large, making it difficult to deploy each model in actual industrial production processes. Second, due to the 3D structure used, it is difficult to understand what was specifically learned at each stage of model training, resulting in a lack of interpretability. Therefore, there is an urgent need to design a small-scale identification system that can help doctors better screen for nasopharyngeal carcinoma to solve these problems. Summary of the Invention
[0005] The primary objective of this invention is to provide a mobile nasopharyngeal carcinoma identification system. This system, after being trained with image information of the lesion site of a confirmed nasopharyngeal carcinoma patient, is able to identify the nature of lesions in the nasopharynx and features fast identification speed and high accuracy.
[0006] The second objective of this invention is to provide a mobile terminal nasopharyngeal carcinoma identification method, which can conveniently and effectively identify the nature of lesions in the nasopharynx, facilitating remote medical treatment or consultation.
[0007] The preceding technical solution adopted in this invention is as follows:
[0008] A mobile nasopharyngeal carcinoma identification system, comprising:
[0009] The image preprocessing module is used to preprocess the obtained images of the nasopharynx.
[0010] The recognition module is used to store the recognition model obtained through training.
[0011] The training and recognition module is used to train a recognition model using lesion images of known nasopharyngeal carcinoma patients.
[0012] The image preprocessing module is connected to both the recognition module and the training recognition module.
[0013] The training and recognition module includes:
[0014] A case database is used to store the identification and preprocessing data of each confirmed nasopharyngeal carcinoma patient;
[0015] The recognition model unit is used to store the trained recognition model or to analyze and output the results after recognizing the input patient's preprocessed recognition data.
[0016] The training unit is used to train a neural network recognition model from the preprocessed identification data in the case database within the recognition model unit.
[0017] The training unit is connected to the case database and the recognition model unit, respectively.
[0018] Furthermore, the identification module includes:
[0019] The client-side recognition module is used to store the trained recognition model on the client side.
[0020] The server-side recognition module is used to store the trained recognition model on the server side.
[0021] The client-side recognition module and the server-side recognition module are respectively connected to the image preprocessing module and the training recognition module, and the client-side recognition module is also connected to the server-side recognition module.
[0022] The latter technical solution adopted in this invention is as follows:
[0023] A mobile nasopharyngeal carcinoma identification method includes the following steps:
[0024] S1 acquires image information of the lesion site of confirmed nasopharyngeal carcinoma patients, performs preprocessing to obtain identification preprocessing data, and stores the obtained identification preprocessing data in the case database;
[0025] S2 uses data from the case database to train a complete neural network recognition model in the training unit;
[0026] S3 uses the complete neural network recognition model obtained from S2 to train a lightweight network model;
[0027] S4 Acquires image information of the lesion site of the patient to be identified, performs preprocessing, and obtains preprocessed data to be identified;
[0028] S5 imports the preprocessed data to be identified into a complete neural network recognition model or a lightweight network model to obtain the recognition result.
[0029] Furthermore, the specific process of preprocessing in step S1 is as follows:
[0030] S1.1 From the imaging information of the lesion sites of confirmed nasopharyngeal carcinoma patients, cross-sectional MR data of T1WI, T2WI fat-suppressed sequences and T1 enhanced sequences are selected and then converted into standard neuroimaging data images.
[0031] S1.2 Rotate and center-crop the standard neuroimaging data images that have been transformed.
[0032] Furthermore, in step S2, the specific process is as follows:
[0033] S2.1 The data in the case database are randomly divided into training set, validation set and test set. The data images of the training set and validation set are transformed into variables and then normalized.
[0034] S2.2 After performing five-fold cross-validation on the normalized training and validation sets of images, a neural network recognition model is constructed.
[0035] S2.3 After training the constructed neural network recognition model, multiple trained neural network recognition models are obtained;
[0036] S2.4 Evaluate multiple trained neural network recognition models using test set data, and select the trained neural network recognition model with the best evaluation value as the complete neural network recognition model.
[0037] Furthermore, in step S2.2, a ResNet152 residual neural network model is constructed for neural network recognition. After the large convolutional kernel layers and pooling layers of the model, four residual blocks are added. Each residual block consists of three layers, each containing one 3x3 convolutional layer and two 1x1 convolutional layers. Residual connections are added between the layers. After connecting fully connected layers and softmax layers, the final result is output. The softmax layer function is:
[0038] ;
[0039] in, Let be the output value of the i-th node, and n be the number of output nodes. This is the output of the softmax layer;
[0040] After the first convolutional pooling in the neural network recognition model, a compression and activation network block is added. This compression and activation network block is constructed using a global compression calculation formula and a dynamic activation calculation formula. The global compression calculation formula is as follows:
[0041] ;
[0042] Where u represents the feature space, c represents the number of feature maps, W represents the width of the feature space, and H represents the height of the feature space. For width is Height is passage eigenvalues, This is the global feature compression value for channel c;
[0043] The dynamic excitation calculation formula is as follows:
[0044] ;
[0045] in, This represents the Sigmoid activation function. Represents the ReLU activation function. The weights are dynamically learned. for W The parameters of the first connection layer are dynamically updated. for The parameters of the second connection layer are dynamically updated. The activation values are the input to the model, i.e., the feature values extracted from the image;
[0046] The output formula for the compression and excitation network block is:
[0047] ;
[0048] in, It is the product across channels, where x is the output result. For channel Feature map, The weights are the feature maps corresponding to channel c.
[0049] Furthermore, in step S2.3, when training the constructed neural network recognition model, the ImageNet dataset is first used for pre-training, and then the training rounds, learning rate and number of channels are adjusted to evaluate it. Multiple neural network recognition models with high evaluation indicators are selected for gradient class activation mapping, and the neural network recognition model with good classification effect is selected.
[0050] The formula for gradient class activation mapping is:
[0051] ;
[0052] ;
[0053] Where Z equals the width × height of the feature layer. This represents the data of feature layer A at coordinates i and j in channel k. The score predicted by the network for category c; Indicates to The weights are defined as follows: c represents the class, k represents the k-th channel in feature layer A, and A is the last feature layer. Activate the mapping value for the gradient class. This is the feature map of channel k in feature layer A.
[0054] Furthermore, the specific process of step S2.4 is as follows:
[0055] S2.4.1 Input the test set data into multiple trained neural network recognition models respectively, and compare the output results with the real results to obtain four values: TP, FP, FN, and TN. TP represents the number of positive cases predicted as positive, FP represents the number of negative cases predicted as positive, FN represents the number of positive cases predicted as negative, and TN represents the number of negative cases predicted as negative.
[0056] S2.4.2 Plot the ROC curve of the classification results using the four values TP, FP, FN, and TN. The horizontal axis of the curve represents recall R, and the vertical axis represents precision P. The calculation methods for recall R and precision P are as follows:
[0057] ;
[0058] ;
[0059] Obtain the harmonic score F1 and AUC value. Using recall R, precision P, harmonic score F1, and AUC value as evaluation values, select the training neural network recognition model with the best evaluation value as the complete neural network recognition model. The formula for calculating the harmonic score F1 is:
[0060] ;
[0061] The AUC value is the area enclosed by the ROC curve and the x-axis.
[0062] Furthermore, the specific steps of step S3 are as follows:
[0063] S3.1 A lightweight neural network recognition model is constructed using a ResNet18 residual neural network model. After large convolutional kernels and pooling layers in the residual neural network model, compressed and activated network blocks and four residual blocks are added sequentially. Each residual block consists of two layers, each containing one or two convolutional layers. Residual connections are added between the layers. Then, a fully connected layer and a softmax layer are sequentially connected before the output is given. The calculation formula for the softmax layer is:
[0064] ;
[0065] in, Let be the output value of the i-th node, and n be the number of output nodes. This is the output of the softmax layer;
[0066] S3.2 Train the residual neural network model using the complete neural network recognition model obtained in S2, where the loss function formula is:
[0067] ;
[0068] Where LossT represents the difference loss between the teacher network and the student network, LossS represents the cross-entropy loss during student network training, λ and θ are the weights balancing the difference loss and the cross-entropy loss, and Loss is the loss function.
[0069] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0070] 1. A mobile nasopharyngeal carcinoma recognition system of the present invention includes an image preprocessing module for preprocessing acquired nasopharyngeal images, a recognition module for storing trained recognition models, and a training recognition module for training recognition models using lesion images of known nasopharyngeal carcinoma patients. The training recognition module includes a case database for storing preprocessed recognition data of each confirmed nasopharyngeal carcinoma patient, a recognition model unit for storing trained recognition models or outputting results after analyzing and recognizing the preprocessed recognition data of input patients, and a training unit for training a neural network recognition model using the preprocessed recognition data from the case database within the recognition model unit. By inputting image information of the lesion locations of known nasopharyngeal carcinoma patients into the system, the system trains a recognition model using this image information. Inputting image information of the lesion location of the patient to be identified into the system yields the recognition result. This recognition system helps doctors identify nasopharyngeal carcinoma with fast recognition speed and high accuracy.
[0071] The recognition module includes a client-side recognition module for storing the trained recognition model on the client side and a server-side recognition module for storing the trained recognition model on the server side. Because the server-side recognition module is large, consumes significant memory resources, and has high deployment requirements, it is only suitable for deployment on a server and not for use by doctors in outpatient clinics or remote consultation rooms. The client-side recognition module distills the server-side recognition module, transforming the recognition model from 3D to 2D. This improves the accuracy of utilizing transfer learning results and, through model distillation, reduces the size of the recognition model, making it easier to deploy on the client side and effectively address real-world clinical situations.
[0072] 2. A mobile nasopharyngeal carcinoma identification method of the present invention involves acquiring image information of the lesion site of a confirmed nasopharyngeal carcinoma patient, preprocessing it to obtain identification preprocessed data, and storing the obtained identification preprocessed data in a case database; training a complete neural network identification model in a training unit using data from the case database; training a lightweight network model using the complete neural network identification model; acquiring image information of the lesion site of the patient to be identified, preprocessing it to obtain identification preprocessed data; and importing the identification preprocessed data into the neural network identification model or the lightweight network model to obtain the identification result. Through this identification process, the nature of lesions in the nasopharynx can be effectively identified, effectively reducing the workload and qualification requirements of doctors, enabling them to serve more patients. Attached Figure Description
[0073] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0074] Figure 1 This is a schematic diagram of the process of the system of the present invention;
[0075] Figure 2 This is a flowchart of the image information collection, data filtering, and data preprocessing process in this invention;
[0076] Figure 3 This is a structural diagram of the complete neural network recognition model in this invention;
[0077] Figure 4 This is a schematic diagram of the complete neural network recognition model training process in this invention;
[0078] Figure 5 This is a distribution diagram of the accuracy of the complete neural network recognition model training process in this invention;
[0079] Figure 6 These are the 2D and 3D feature maps of t-SNE in this invention;
[0080] Figure 7 This is a structural diagram of the lightweight network model in this invention;
[0081] Figure 8 This is a schematic diagram of the lightweight network model training process in this invention. Detailed Implementation
[0082] The technical solution of the present invention will be further described in detail below with reference to specific embodiments, but this does not constitute any limitation on the present invention.
[0083] Reference Figure 1 As shown, a mobile nasopharyngeal carcinoma identification system of the present invention includes:
[0084] The image preprocessing module is used to preprocess the obtained images of the nasopharynx.
[0085] The recognition module is used to store the recognition model obtained through training.
[0086] The training and recognition module is used to train a recognition model using lesion images of known nasopharyngeal carcinoma patients.
[0087] The image preprocessing module is connected to both the recognition module and the training recognition module.
[0088] The training and recognition module includes:
[0089] A case database is used to store the identification and preprocessing data of each confirmed nasopharyngeal carcinoma patient;
[0090] The recognition model unit is used to store the trained recognition model or to analyze and output the results after recognizing the input patient's preprocessed recognition data.
[0091] The training unit is used to train a neural network recognition model from the preprocessed identification data in the case database within the recognition model unit.
[0092] The training unit is connected to both the case database and the recognition model unit. By inputting image information of known nasopharyngeal carcinoma patient lesion locations into the system, the system is trained using this image information to obtain the recognition model. Inputting image information of the lesion site of the patient to be identified into the system yields the recognition result. This recognition system helps doctors identify nasopharyngeal carcinoma quickly and with high accuracy.
[0093] The identification module includes:
[0094] The client-side recognition module stores the trained recognition model on the client side. It is developed using Android Studio and deployed using Java and the `org.pytorch:pytorch_android` package to create a lightweight network model. Remote diagnostic functionality is also added to establish an intelligent nasopharyngeal carcinoma recognition system.
[0095] The server-side recognition module stores the trained recognition model on the server. The client for the server-side recognition module is developed using C++, Qt 5.13.0, and OpenCV, and the complete neural network recognition model is deployed using OpenCV.
[0096] Both the client-side and server-side recognition modules are connected to the image preprocessing module and the training recognition module, respectively. The client-side recognition module is also connected to the server-side recognition module. Because the server-side recognition module is large, consumes significant memory resources, and has high deployment requirements, it is only suitable for deployment on a server and not for use by doctors in outpatient clinics or those seeing patients in the field. The client-side recognition module distills the server-side recognition module, transforming the recognition model from 3D to 2D. This improves the accuracy of the results using transfer learning and, through model distillation, reduces the size of the recognition model, making it easier to deploy on the client side and effectively address real-world clinical situations.
[0097] A mobile terminal nasopharyngeal carcinoma identification method of the present invention includes the following steps:
[0098] S1 acquires image information of the lesion site of confirmed nasopharyngeal carcinoma patients, performs preprocessing to obtain identification preprocessing data, and stores the obtained identification preprocessing data in the case database.
[0099] When acquiring imaging information of lesions in confirmed nasopharyngeal carcinoma patients, it is necessary to collect MRI images of nasopharyngeal carcinoma patients, as well as MRI images of patients with adenoid hyperplasia, nasopharyngeal mucosal thickening, lymphoma, and healthy individuals who are being differentiated from nasopharyngeal carcinoma. The collected Digital Imaging and Communications in Medicine (DICOM) format data is then filtered to obtain T1WI, T2WI fat-suppressed sequences, and T1-enhanced sequences of cross-sectional MR data. The filtered raw data is then read and processed using the nibabel and SimpleITK libraries (used for medical image processing) in the Python programming language and converted into standard Neuroimaging Informatics Technology Initiative (NIFTI) format data.
[0100] After obtaining the three-dimensional NIFTI format data, it is segmented into two-dimensional layers using the Python programming language. Then, two experienced radiologists filter out the nasopharyngeal carcinoma lesion layers. If they disagree, they need to consult another radiologist for confirmation.
[0101] The specific preprocessing steps are as follows:
[0102] S1.1 From the imaging information of the lesion sites of confirmed nasopharyngeal carcinoma patients, cross-sectional MR data of T1WI, T2WI fat-suppressed sequences, and T1 enhanced sequences are selected and then converted into standard neuroimaging data images.
[0103] S1.2 The standard neuroimaging data images that have been transformed are rotated and cropped at the center. Since the data input to the neural network recognition model requires a consistent data size, but the original data sizes are different, it is necessary to combine the location of nasopharyngeal carcinoma in the images and crop the processed data to a uniform size. After this operation, the size of the input dataset can be expanded to increase the robustness of the recognition model.
[0104] S2 uses data from the case database to train a complete neural network recognition model in the training unit.
[0105] The specific process is as follows:
[0106] S2.1 The case database data is randomly divided into training, validation, and test sets, with a data ratio of 8:1:1. First, the training and validation sets are used with augmented datasets for model training and validation. Then, an independent dataset is used as the test set for final model evaluation. Next, the data images from the training and validation sets are converted into variables and normalized to a range of [0, 1] to avoid errors caused by uneven data distribution and facilitate model optimization.
[0107] S2.2 After normalizing the training and validation sets, five-fold cross-validation is performed on the images to construct a neural network recognition model. Five-fold cross-validation divides the training and validation sets into five parts, four for training and one for validation, resulting in five models to increase the reliability and accuracy of the models. The process of collecting, filtering, and preprocessing image information of lesions in confirmed nasopharyngeal carcinoma patients is as follows: Figure 2 As shown.
[0108] A residual neural network model based on ResNet152 was constructed for neural network recognition. The structure of the constructed neural network recognition model is as follows: Figure 3 As shown. `conv` (convolutional layer) refers to the 7x7 or 3x3 convolutional kernel following the convolutional layer; `pool` (average pooling layer) refers to the average pooling layer; `SE-BLOCK` (Squeeze-and-Excitation Block) refers to the compression and excitation block; `Res Block` represents the residual block; and `fc` (fully connected) represents the fully connected layer. After the large convolutional kernel and pooling layers in the model, four residual blocks are added. Each residual block consists of three layers: each layer contains one 3x3 convolutional layer and two 1x1 convolutional layers. Residual connections are added between the layers. Finally, a fully connected layer and a softmax layer are connected to output the final result. The softmax layer function is:
[0109] ;
[0110] in, Let n be the output value of the i-th node, and n be the number of output nodes, i.e. the number of categories. The Softmax function can be used to convert the output values of multi-class classification into a probability distribution with a range of [0, 1] and a value of 1. The output of the softmax layer contains two neurons: one outputs the probability that it is nasopharyngeal carcinoma, and the other outputs the probability that it is not nasopharyngeal carcinoma.
[0111] Based on the ResNet152 network model, certain improvements were made. After extracting the low-level features of the image, i.e., after the first convolutional pooling in the neural network recognition model, a squeeze-and-excitation block (SE block, a channel attention mechanism) was added. Figure 3 As shown, adding this module allows for explicit modeling of the interdependencies between network evolution feature channels, thereby improving model accuracy. The compressed and activated network blocks are constructed using a global compression calculation formula and a dynamic activation calculation formula. The global compression calculation formula is as follows:
[0112] ;
[0113] Where u represents the feature space, c represents the number of feature maps, W represents the width of the feature space, and H represents the height of the feature space. For width is Height is passage The eigenvalues are obtained by compressing each feature map using global average pooling, transforming c feature maps into a 1×1×c sequence of real numbers. This is the global feature compression value for channel c.
[0114] The dynamic excitation calculation formula is as follows:
[0115] ;
[0116] in, This represents the Sigmoid activation function. Represents the ReLU activation function. The weights are dynamically learned. for W The parameters of the first connection layer are dynamically updated. for The parameters of the second connection layer are dynamically updated. The activation values are the input to the model, i.e., the feature values extracted from the image;
[0117] The output formula for the compression and excitation network block is:
[0118] ;
[0119] in, It is the product across channels, where x is the output result. For channel Feature map, The weights corresponding to the feature map of channel c are used. After convolution, n channels are obtained. This operation is performed on each channel, and finally the weight ratio of each channel is obtained. This allows us to pay more attention to the more important channels, thus improving the model training results.
[0120] Finally passed The final output is obtained. It is the product of the channels, and x is our final output.
[0121] Global compression obtains global information through global pooling, and dynamic activation uses the global information z and the weights W obtained through continuous training to represent the weights s of each channel feature. This allows the network to perform feature recalibration; through this mechanism, it can learn to selectively emphasize informative features and suppress less reliable features using global information.
[0122] S2.3 After training the constructed neural network recognition model, multiple trained neural network recognition models are obtained.
[0123] When training the constructed neural network recognition model, pre-training is first performed using the ImageNet dataset to accelerate and improve model accuracy through transfer learning. Then, the model is evaluated by adjusting the training epochs, learning rate (LR), and number of channels. Several neural network recognition models with high evaluation metrics are selected for Gradient Class Activation Mapping (Grad-CAM), and the model with the best classification performance is chosen. The selected neural network recognition model undergoes model distillation, and the resulting model files with a certain number of epochs are saved. Grad-CAM technology is used to visualize the model. Grad-CAM utilizes the high-order semantic information extracted from the last convolutional layer, obtaining the gradient information of that layer through backpropagation. The gradient value represents the contribution of each element to the final classification result. After weighted summation of the gradients at the channel level, the final class activation map is obtained by applying the ReLU function f(x) = max(0,x).
[0124] The formula for gradient class activation mapping is:
[0125] ;
[0126] ;
[0127] Where Z equals the width × height of the feature layer. This represents the data of feature layer A at coordinates i and j in channel k. The score predicted by the network for category c; Indicates to The weights are defined as follows: c represents the class, k represents the k-th channel in feature layer A, and A is the last feature layer. Activate the mapping value for the gradient class. This is the feature map of channel k in feature layer A.
[0128] Gradient class activation map (Grad-cam) diagram as follows Figure 4 As shown in the figure, the model's accuracy increases with the number of training epochs. In the Grad-cam class activation graph, the darker the area within the box, the more the model focuses on it; the box in the figure represents the region where nasopharyngeal carcinoma is located. We can see that the model's focus is becoming increasingly precise, down to the region where nasopharyngeal carcinoma is located, indicating that the model can now identify the area where nasopharyngeal carcinoma is located, thus solving the "black box" problem of deep learning models in the medical field to some extent.
[0129] The hyperparameters we used during model training were: learning rate (LR) of 0.0001, epochs of 100, batch size of 64, and the Adam optimizer (an optimizer combining momentum and gradient descent). The accuracy distribution during training is shown below. Figure 5 As shown in the figure, the model tends to plateau after 20 training epochs. The features obtained from the final convolutional layer (fully connected layer, fc) are extracted from the plateaued model and then subjected to t-SNE dimensionality reduction. t-SNE dimensionality reduction involves selecting a random data point and calculating its relationship with other data points (|x... i —x j The probability distribution is created using the Euclidean distance (|). Data points near the selected data point will receive more similarity values, while data points farther away will receive fewer similarity values. Using these similarity values, a similarity matrix is created for each data point. The fully connected layer features are then reduced to 2D and 3D values, as shown below. Figure 6 As shown, the classification effect is quite good.
[0130] S2.4 Multiple trained neural network recognition models are evaluated using test set data, and the training neural network recognition model with the best evaluation value is selected as the complete neural network recognition model. The specific process is as follows:
[0131] S2.4.1 Input the test set data into multiple trained neural network recognition models, and compare the output results with the actual results to obtain four values: TP, FP, FN, and TN, as shown in Table 1. TP represents the number of positive cases predicted as positive, FP represents the number of negative cases predicted as positive, FN represents the number of positive cases predicted as negative, and TN represents the number of negative cases predicted as negative.
[0132] Table 1. Distribution of Output Results and Actual Results
[0133]
[0134] S2.4.2 ROC curves for the classification results are plotted using the four values TP, FP, FN, and TN. The horizontal axis of the curve represents recall (R), and the vertical axis represents precision (P). The closer the curve is to the upper right corner, the better the performance. The calculation methods for recall (R) and precision (P) are as follows:
[0135] ;
[0136] ;
[0137] The harmonic mean F1 score is a metric designed to comprehensively consider precision and recall. The F1 score is the harmonic mean of precision and recall. By obtaining the harmonic mean F1 and the area under curve (AUC), and using recall (R), precision (P), harmonic mean F1, and AUC as evaluation values, the training neural network recognition model with the best evaluation value is selected as the complete neural network recognition model. The formula for calculating the harmonic mean F1 is:
[0138] ;
[0139] The ROC (receiver operating characteristic curve) curve has its ordinate as the true positive rate and its abscissa as the false positive rate. The AUC value is the area enclosed by the ROC curve and the x-axis. The formulas for calculating the x-axis and y-axis are as follows:
[0140] The True Positive Rate is
[0141] The false positive rate is
[0142] The AUC calculation method considers the learner's ability to classify both positive and negative examples, allowing for a reasonable evaluation of the classifier even in imbalanced datasets. AUC is not sensitive to class imbalance, which is one reason why it's commonly used to evaluate learner performance in imbalanced datasets. Therefore, we comprehensively evaluate the complete neural network recognition model using AUC, precision, recall, and the harmonic sum F1 score.
[0143] S3 uses the complete neural network recognition model obtained in S2 to train a lightweight network model. The specific steps are as follows:
[0144] S3.1 Constructs a lightweight neural network recognition model using a ResNet18 residual neural network model, the specific structure of which is as follows: Figure 7 As shown, the structure of ResNet18 is similar to that of ResNet152. Both first extract low-level features through convolutional pooling. After large convolutional kernels and pooling layers in the residual neural network model, compression and activation network blocks and four residual blocks (Res Blocks) are added sequentially. The residual blocks are used to extract higher-level image features. Unlike ResNet152, each residual block consists of two layers, each containing two convolutional layers (with significantly fewer parameters than ResNet152). Residual connections are added between the layers. After that, fully connected layers and softmax layers are sequentially connected to output the results. The fully connected layer (fc) combines these features, and the softmax function is used to finally obtain the classification result. The calculation formula for the softmax layer is as follows:
[0145] ;
[0146] in, Let be the output value of the i-th node, and n be the number of output nodes. The output of the softmax layer contains two neurons: one outputs the probability that it might be nasopharyngeal carcinoma, and the other outputs the probability that it is not nasopharyngeal carcinoma.
[0147] S3.2 Train the residual neural network model using the complete neural network recognition model obtained in S2. The training process is as follows: Figure 8 As shown in the figure, the loss function at this point consists of two parts: one part is the distillation loss / KL divergence calculated using the outputs of the full neural network recognition model and the lightweight network model, i.e. Figure 8 The lossT in the model consists of two parts: one is the cross-entropy loss calculated using the output of the lightweight network model and the data labels, and the other is the cross-entropy loss. Figure 8 The loss function consists of two parts, λ and θ, with a ratio of 7:3. The formula for the loss function is:
[0148] ;
[0149] In this model, LossT represents the difference loss between the teacher and student networks, LossS represents the cross-entropy loss during student network training, λ and θ are the weights balancing the difference loss and cross-entropy loss, and Loss is the loss function used during model training. After each batch of training data is fed into the model, it outputs predicted values through forward propagation. The loss function then calculates the difference between the predicted and true values, i.e., the loss value. After obtaining the loss value, the model updates its parameters through backpropagation to reduce the loss between the true and predicted values, making the model's predicted values closer to the true values, thus achieving the learning objective.
[0150] The lightweight network model obtained after training is smaller in size and easier to deploy to clients, so as to effectively deal with actual clinical situations.
[0151] S4 acquires image information of the lesion site of the patient to be identified, performs preprocessing, and obtains preprocessed data to be identified.
[0152] S5 imports the preprocessed data to be identified into a complete neural network recognition model or a lightweight network model to obtain the recognition result.
[0153] Both the fully trained neural network recognition model and the lightweight network model can identify the nature of lesions in the nasopharynx through imaging information. The lightweight model, with its smaller size, is more suitable for clinical use, effectively reducing the workload and qualification requirements for doctors, allowing them to serve more patients. After practical comparison, the accuracy rate of the lightweight network model is only 0.5% lower than that of the fully trained neural network recognition model, fully meeting the needs of the application.
[0154] The above description is only a preferred embodiment of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A mobile terminal nasopharyngeal carcinoma identification method, characterized in that, Includes the following steps: S1 acquires image information of the lesion site of confirmed nasopharyngeal carcinoma patients, performs preprocessing to obtain identification preprocessing data, and stores the obtained identification preprocessing data in the case database; S2 uses data from the case database to train a complete neural network recognition model in the training unit; S3 uses the complete neural network recognition model obtained from S2 to train a lightweight network model; S4 Acquires image information of the lesion site of the patient to be identified, performs preprocessing, and obtains preprocessed data to be identified; S5 imports the preprocessed data to be identified into a complete neural network recognition model or a lightweight network model to obtain the recognition result; The specific process of preprocessing in step S1 is as follows: S1.1 From the imaging information of the lesion sites of confirmed nasopharyngeal carcinoma patients, cross-sectional MR data of T1WI, T2WI fat-suppressed sequences and T1 enhanced sequences are selected and then converted into standard neuroimaging data images. S1.2 Rotate and center-crop the standard neuroimaging data images that have been transformed; The specific process in step S2 is as follows: S2.1 The data in the case database are randomly divided into training set, validation set and test set. The data images of the training set and validation set are transformed into variables and then normalized. S2.2 After performing five-fold cross-validation on the normalized training and validation sets of images, a neural network recognition model is constructed. S2.3 After training the constructed neural network recognition model, multiple trained neural network recognition models are obtained; S2.4 Evaluate multiple trained neural network recognition models using test set data, and take the trained neural network recognition model with the best evaluation value as the complete neural network recognition model; In step S2.2, a ResNet152 residual neural network model is constructed for neural network recognition. After the large convolutional kernel layers and pooling layers of the model, four residual blocks are added. Each residual block consists of three layers, each containing one 3x3 convolutional layer and two 1x1 convolutional layers. Residual connections are added between layers. After connecting fully connected layers and softmax layers, the final result is output. The softmax layer function is: ; in, Let be the output value of the i-th node, and n be the number of output nodes. This is the output of the softmax layer; After the first convolutional pooling in the neural network recognition model, a compression and activation network block is added. This compression and activation network block is constructed using a global compression calculation formula and a dynamic activation calculation formula. The global compression calculation formula is as follows: ; Where W is the width of the feature space and H is the height of the feature space. For width is Height is passage eigenvalues, This is the global feature compression value for channel c; The dynamic excitation calculation formula is as follows: ; in, This represents the Sigmoid activation function. Represents the ReLU activation function. The weights are dynamically learned. for W The parameters of the first connection layer are dynamically updated. for The parameters of the second connection layer are dynamically updated. The activation values are the input to the model, i.e., the feature values extracted from the image; The output formula for the compression and excitation network block is: ; in, It is the product across channels, where x is the output result. For channel Feature map, The weights corresponding to the feature map of channel c; The specific steps of step S3 are as follows: S3.1 A lightweight neural network recognition model is constructed using a ResNet18 residual neural network model. After large convolutional kernels and pooling layers in the residual neural network model, compressed and activated network blocks and four residual blocks are added sequentially. Each residual block consists of two layers, each containing one or two convolutional layers. Residual connections are added between the layers. Then, a fully connected layer and a softmax layer are sequentially connected before the output is given. The calculation formula for the softmax layer is: ; in, Let be the output value of the i-th node, and n be the number of output nodes. This is the output of the softmax layer; S3.2 Train the residual neural network model using the complete neural network recognition model obtained in S2, where the loss function formula is: ; Where LossT represents the difference loss between the teacher network and the student network, LossS represents the cross-entropy loss during the training of the student network, λ and θ are the weights that balance the difference loss and the cross-entropy loss, and Loss is the loss function.
2. The mobile terminal nasopharyngeal carcinoma identification method according to claim 1, characterized in that, In step S2.3, when training the constructed neural network recognition model, the ImageNet dataset is first used for pre-training, and then the training rounds, learning rate and number of channels are adjusted to evaluate it. Multiple neural network recognition models with high evaluation indicators are selected for gradient class activation mapping, and the neural network recognition model with good classification effect is selected. The formula for gradient class activation mapping is: ; ; Where Z equals the width × height of the feature layer. This represents the data of feature layer A at coordinates i and j in channel k. The score predicted by the network for category c; Indicates to The weights are defined as follows: c represents the class, k represents the k-th channel in feature layer A, and A is the last feature layer. Activate the mapping value for the gradient class. This is the feature map of channel k in feature layer A.
3. The mobile terminal nasopharyngeal carcinoma identification method according to claim 1, characterized in that, The specific process of step S2.4 is as follows: S2.4.1 Input the test set data into multiple trained neural network recognition models respectively, and compare the output results with the real results to obtain four values: TP, FP, FN, and TN. TP represents the number of positive cases predicted as positive, FP represents the number of negative cases predicted as positive, FN represents the number of positive cases predicted as negative, and TN represents the number of negative cases predicted as negative. S2.4.2 Plot the ROC curve of the classification results using the four values TP, FP, FN, and TN. The horizontal axis of the curve represents recall R, and the vertical axis represents precision P. The calculation methods for recall R and precision P are as follows: ; ; Obtain the harmonic score F1 and AUC value. Using recall R, precision P, harmonic score F1, and AUC value as evaluation values, select the training neural network recognition model with the best evaluation value as the complete neural network recognition model. The formula for calculating the harmonic score F1 is: ; The AUC value is the area enclosed by the ROC curve and the x-axis.
4. A mobile nasopharyngeal carcinoma identification system, used to implement the mobile nasopharyngeal carcinoma identification method according to claim 1, characterized in that, include: The image preprocessing module is used to preprocess the obtained images of the nasopharynx. The recognition module is used to store the recognition model obtained through training. The training and recognition module is used to train a recognition model using lesion images of known nasopharyngeal carcinoma patients. The image preprocessing module is connected to both the recognition module and the training recognition module. The training and recognition module includes: A case database is used to store the identification and preprocessing data of each confirmed nasopharyngeal carcinoma patient; The recognition model unit is used to store the trained recognition model or to analyze and output the results after recognizing the input patient's preprocessed recognition data. The training unit is used to train a neural network recognition model from the preprocessed identification data in the case database within the recognition model unit. The training unit is connected to the case database and the recognition model unit, respectively.
5. A mobile nasopharyngeal carcinoma identification system according to claim 4, characterized in that, The identification module includes: The client-side recognition module is used to store the trained recognition model on the client side. The server-side recognition module is used to store the trained recognition model on the server side. The client-side recognition module and the server-side recognition module are respectively connected to the image preprocessing module and the training recognition module, and the client-side recognition module is also connected to the server-side recognition module.
Citation Information
Patent Citations
Construction method of medical induction data flow classification model
CN112185543A
Pulmonary nodule recognition system and method based on time sequence image
CN115239695A