Nose and throat endoscope multi-part classification method and system based on dynamic self-adaptive knowledge distillation
By optimizing the student network using a dynamic adaptive knowledge distillation method, the problem of difficult identification in nasopharyngeal classification was solved, achieving high-precision and fast classification results, which is applicable to multi-site classification in nasopharyngeal endoscopy.
Patent Information
- Application Number
- CN202411031388.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-22
AI Technical Summary
Existing nasopharyngeal classification methods require long-term training on medical datasets to improve recognition accuracy, which cannot meet the needs of clinical environments for immediacy and high accuracy. Furthermore, the high inter-class similarity of traditional models in the nasopharyngeal region makes recognition difficult.
A dynamic adaptive knowledge distillation method is adopted, which optimizes the student network through a hybrid loss function of dynamic distillation temperature and dynamic weight adjustment, automatically selects the optimal teacher network to guide the student network, and combines it with the Swing Transformer network for feature extraction and classification.
It significantly improves the recognition accuracy and speed of nasopharyngeal classification, with a test accuracy of 95.25%, which is superior to other methods and meets the needs of clinical practice.
Smart Images

Figure CN119006902A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision and image classification, and in particular relates to a nasopharyngeal endoscope multi-site classification method and system based on dynamic adaptive knowledge distillation. Background Art
[0002] The lesions of nasopharyngeal organs are hidden, complex in structure and often irregular, which increases the complexity of diagnosis. Although the remarkable progress of endoscopic technology in recent decades has greatly improved the diagnosis and treatment of nasopharyngeal diseases, improved the maneuverability, accuracy and safety of endoscopic instruments, and enabled doctors to observe these complex organs more deeply, in actual examinations, if the operating method of the examiner is improper, it may lead to delays in the diagnosis process, increase patient discomfort and treatment costs. Therefore, it is particularly important to implement standardized examination procedures. By adopting standardized examination procedures, endoscopic video and image data can be recorded in a systematic way to ensure comprehensive and uniform coverage of all parts of the nasopharynx. Standardized examinations greatly improve the ability of doctors to quickly and accurately locate and diagnose potential health problems. At the same time, standardized examination videos and images provide an ideal basis for the introduction of auxiliary diagnostic tools.
[0003] In the standardized inspection process, the first thing to do is to accurately locate the site, which is often regarded as a typical classification problem in many applications of deep learning. Although there are many mainstream classification methods, most models are designed for general data sets. Medical data sets, especially those in the nasopharynx and throat, usually have high inter-class similarity. Faced with such highly similar classification challenges, existing mainstream models often require long-term training to improve recognition accuracy, which not only increases the training cost, but also leads to a long reasoning time, which cannot meet the specific needs in clinical practice, because the clinical environment has extremely high requirements for accuracy and speed. Traditional electronic laryngoscopy must achieve instant detection and high-precision lesion site identification. Summary of the invention
[0004] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a nasopharyngeal endoscope multi-site classification method and system based on dynamic adaptive knowledge distillation to improve the recognition accuracy and detection speed of nasopharyngeal lesion sites.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] A multi-site classification method for nasopharyngeal endoscopes based on dynamic adaptive knowledge distillation is proposed. This method uses a mixed loss function with dynamic distillation temperature and dynamic weight adjustment to optimize the student network, so that it can not only maximize the knowledge of the teacher network within the knowledge distillation framework, but also autonomously learn features. In order to avoid performance problems caused by the gap between the teacher network and the student network, this method automatically selects the optimal generation of the teacher network to guide the student network through a designed algorithm.
[0007] Specifically, the first aspect of the present invention provides a nasopharyngeal endoscope multi-site classification method based on dynamic adaptive knowledge distillation, comprising the following steps:
[0008] Step 1, data preprocessing, including: cropping the black edge area of the endoscopic image and adjusting the direction and size of all images to be consistent;
[0009] Step 2: construct and train the teacher network to obtain the optimal teacher network;
[0010] Step 3: Use the optimal teacher network to create soft labels and train the student network. A dynamic distillation temperature adjustment method is used to reduce the distillation temperature as the performance of the student network improves. By comparing the probability distribution of the soft labels after temperature adjustment with the output of the student network, the performance is gradually corrected and improved. After the training, an optimized student network is obtained.
[0011] Step 4, the endoscopic image is subjected to the data preprocessing, and then input into the optimized student network to obtain the part classification result.
[0012] The second aspect of the present invention further provides a nasopharyngeal endoscope multi-site classification system based on dynamic adaptive knowledge distillation, comprising:
[0013] An image acquisition module, used for collecting or receiving endoscopic images of the nasopharynx and throat;
[0014] A data preprocessing module, which crops the black border area of the endoscopic image and adjusts the direction and size of all images to be consistent;
[0015] A classification module, comprising a teacher network and a student network, wherein the teacher network and the student network are trained by the nasopharyngeal endoscope multi-part classification method based on dynamic adaptive knowledge distillation described in the first aspect to obtain an optimal teacher network and an optimized student network; the preprocessed endoscope image is input into the optimized student network to obtain a part classification result;
[0016] The display module outputs and presents the part classification result.
[0017] Compared with the prior art, the present invention has the following beneficial effects:
[0018] 1. Compared with other methods, the method of the present invention enables the teacher network to output more refined soft labels through dynamic distillation temperature, which is beneficial to the training and adjustment of the student network and optimizes the information transmission process.
[0019] 2. The method of the present invention proposes a new dynamic adjustment strategy, which adjusts the distillation target according to the learning progress and performance of the student network, so that the student network can more effectively absorb and utilize the knowledge from the teacher network.
[0020] In general, the method of the present invention uses a mixed loss function of dynamic distillation temperature and dynamic weight adjustment to optimize the student network, and uses a designed algorithm to automatically select the optimal teacher network to guide the student network, which can effectively improve the classification accuracy. Test experiments have proved that the effectiveness of this method on the nasopharyngeal classification dataset has been verified, and the recognition accuracy has reached 95.25%, which is higher than other existing methods. This method provides a new idea for the development of multi-site classification methods for nasopharyngeal endoscopes based on knowledge distillation. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a flow chart of the classification algorithm used in an embodiment of the present invention (the image has been blurred to ensure patient privacy).
[0022] Figure 2 This is a flow chart of the knowledge distillation method used in the embodiments of the present invention. DETAILED DESCRIPTION
[0023] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0024] Since there are many organs in the nasopharynx and the organs are very similar, the classification problem of the nasopharynx is more challenging than the general classification problem. At present, most of the endoscopic site classification methods based on deep learning use classic neural network models. These models often require a long time of training to improve the recognition accuracy and cannot meet the specific needs in clinical practice. In order to solve this problem, the present invention proposes a nasopharyngeal endoscope multi-site classification method based on dynamic adaptive knowledge distillation. This method uses a mixed loss function of dynamic distillation temperature and dynamic adjustment of weights to optimize the student network, and automatically selects the optimal teacher network through a designed algorithm to guide the student network, thereby greatly improving the speed of the model while ensuring accuracy.
[0025] The specific steps of the present invention can be referred to Figure 1 As shown, it mainly includes the following steps:
[0026] Step 1: Data preprocessing.
[0027] The original endoscopic image contains the endoscope area and the black border area, in which the black border area contains a lot of irrelevant information. In the data preprocessing stage, the black border area is first cropped to remove irrelevant information. At the same time, according to the different shooting methods of different hospitals, the image direction needs to be uniformly rotated to ensure that the direction of all images is consistent. Subsequently, the size of all processed images is adjusted to a uniform size, for example, 224×224×3, which is more suitable for subsequent image recognition and classification tasks.
[0028] Step 2: Construction, training and selection of the teacher network, with the goal of obtaining the optimal teacher network.
[0029] The traditional definition of the optimal teacher network is the generation of teacher networks with the best accuracy. In the present invention, the definition of the optimal teacher network is the teacher network with the best guiding effect on the student network, that is, it has nothing to do with the accuracy of the teacher network itself. This step may specifically include:
[0030] Step 2.1: Construction and training of the teacher network.
[0031] The present invention is based on the characteristics of endoscopic images. The teacher network adopts the Swin Transformer network to extract image features and use them for recognition. The constructed Swin Transformer network contains four main parts: input layer, Swin Transformer layer, dropout layer and fully connected layer. The input layer receives an endoscopic image of size 224×224×3; the Swin Transformer layer is composed of multiple Transformer modules, each of which contains a self-attention mechanism and a multi-head attention mechanism to extract the global and local features of the image; in order to prevent the model from overfitting on the training set, a dropout layer is introduced, and the loss rate can be set to 0.2 to reduce the amount of calculation of the model during training; the fully connected layer as the output contains multiple nodes, which respectively represent the probability of the predicted sample belonging to different categories. In this embodiment, the number of nodes is set to 20. Finally, the output of the dropout layer is extracted as the deep feature set of the image.
[0032] Step 2.2: Selection of the optimal teacher network.
[0033] Since teacher networks with different training levels will result in different performances of student networks, the present invention uses an algorithm to automatically select the teacher network that best suits the student network. Through short-term training and testing, the effectiveness of the teacher network is quickly evaluated to ensure that the student network obtains the best training effect. Specifically, during the training process of the teacher network, the weights of the teacher network are regularly saved to generate candidate teacher networks for multiple stages. The formula is:
[0034] MT (k) =train(M T ,D,k×epochs)
[0035] Among them, M T represents the teacher network, M T (k) represents the teacher network saved for the kth time, D is the input data set, and epochs represents the number of training rounds.
[0036] Next, each candidate teacher network is used to preliminarily train and quickly evaluate the student network. In order to reduce time costs, the present invention adopts two strategies to quickly evaluate the effect of the current teacher network on the student network. First, a smaller subset is used in the data set for training, and secondly, the number of training rounds is reduced for preliminary training. The smaller subset refers to randomly extracting 10 to 30% of the images from the original data set as a subset, the purpose of which is to reduce the overhead required for training. In this embodiment, 20% is selected. The reduction in the number of training rounds is compared with the formal training of knowledge distillation (formal training is to train the student model using the teacher network selected by the algorithm). The training here refers to the use of an algorithm to select a suitable teacher network, reduce the number of training iterations, complete training and test in a shorter time, thereby reducing evaluation time.
[0037] In the initial training and quick evaluation of the student network, the following formula is used to calculate the quick evaluation loss:
[0038] L KD (k) =KL(p (T,k) ||q (S) )
[0039] Among them, L KD (k) is the distillation loss of the student network under the guidance of the teacher network at stage k, p (T,k) is the output probability distribution of the teacher network at stage k, q (S) is the output probability distribution of the student network, KL(p (T,k) ||q (S) ) is the KL divergence between the output distributions of the teacher network and the student network, which is used to measure the difference between the two distributions.
[0040] According to the evaluation results of the above formula, this embodiment selects a round of teacher network with the smallest distillation loss as the teacher network for final training, that is, the optimal teacher network, and the formula is as follows:
[0041] k * =argmin k L KD ( k )
[0042] Among them, k * Represents the number of rounds of the selected optimal teacher network.
[0043] Step 3: Adaptive knowledge distillation system construction.
[0044] The purpose of this step is to obtain an optimized student network based on the optimal teacher network obtained in the previous step. The main purpose is to use the optimal teacher network to create soft labels and train the student network. In order to better allow the student network to learn the knowledge of the teacher network, the present invention designs a dynamic adaptive distillation method, namely a dynamic distillation temperature adjustment method. As the performance of the student network improves, the distillation temperature is reduced. By comparing the probability distribution of the soft labels after temperature adjustment and the output of the student network, the performance is gradually corrected and improved, and an optimized student network is obtained after the training is completed. Reference Figure 2 , specifically:
[0045] Step 3.1: Dynamic distillation temperature.
[0046] In order to solve the problem of incorrect predictions and over-determined predictions of the teacher network, the present invention adopts the proposed dynamic distillation temperature adjustment method. The core of this method is to gradually adjust the distillation temperature according to the improvement of the student network performance to more accurately match the relationship between the target distribution and the actual probability distribution. The formula used is as follows:
[0047] T(t)=T0·e -λ·f(S(t))
[0048] Where T(t) is the distillation temperature at time t, T0 is the initial temperature, λ is the adjustment coefficient used to control the rate at which the temperature decreases over time, S(t) represents the performance index of the student network, and f(S(t)) is used to indicate the improvement of the student network performance, ensuring that the distillation temperature gradually decreases as the performance improves. Its specific form is:
[0049]
[0050] Where S0 is the initial performance of the student network, α and β are the linear and nonlinear adjustment coefficients, respectively, and γ is the exponential parameter of nonlinear control.
[0051] At time t, the output probability of the teacher network is adjusted by temperature, which makes the actual soft label closer to the learning needs of the student network. The probability distribution of the soft label after temperature adjustment is P T (x,t) is expressed as:
[0052]
[0053] Among them, z T (x) represents the original output of the teacher network on input x, zi T (x) represents the original prediction score of the teacher network for the i-th category, N is the total number of categories, and T(t) is the distillation temperature at time t.
[0054] The output of the student network is also affected by temperature. By comparing its own output with the dynamically adjusted soft label distribution, the performance is gradually corrected and improved. The output of the student network P S (x,t) is expressed as:
[0055]
[0056] Among them, z S (x) represents the original output of the student network when input x is given, z i S (x) represents the original prediction score of the student network for the i-th category.
[0057] Step 3.2: Dynamically adjust the hybrid loss function of weights.
[0058] In order to overcome the limitation of model training that relies solely on distillation loss, this paper adopts a strategy of integrating distillation loss and standard supervision loss (cross entropy loss) and introduces a dynamic weight adjustment mechanism. That is, the student network training adopts a hybrid loss function with dynamic weight adjustment, and defines the total loss L as the distillation loss L D and the standard supervision loss L S The weighted sum of:
[0059] L = λ(t)L D +(1-λ(t))L S
[0060] Among them, λ(t) is the weight parameter dynamically adjusted during the training process, which depends on the number of training iterations t and the performance of the student network.
[0061] Distillation loss L D It is mainly used to imitate the output of the teacher network and is usually calculated using the KL divergence. The formula is as follows:
[0062]
[0063] Where n represents the number of data samples, i represents the data sample sequence number, and τ represents a fixed distillation temperature. represents the predicted probability distribution of the student model at the distillation temperature τ, represents the predicted probability distribution of the teacher model at the distillation temperature τ.
[0064] Standard supervision loss L S Cross entropy loss is usually used to calculate directly for the true label. The formula is as follows:
[0065]
[0066] Among them, y i is the true label of the sample, p s (i) is the predicted probability of the student model for the i-th category.
[0067] The dynamic weight parameter λ(t) is adjusted according to the performance of the student network on the validation set. This adjustment strategy can more flexibly adapt to the actual situation of model training. The formula is as follows:
[0068]
[0069] Among them, κ is a parameter that controls the adjustment speed, which usually takes a large positive value. The larger its value, the higher the sensitivity of weight change; ρ t is the performance indicator of the student network at time t. The current F1-score is mainly used to measure the performance of the model. ρ0 is the preset benchmark performance value, which is used to normalize the performance indicator of the model in order to more accurately control the transition stage of training.
[0070] Step 3.3: Output processing: The trained student network is applied to the test phase, and a fully connected layer containing 20 nodes is used to classify the nasopharyngeal region.
[0071] Step 4: Preprocess the endoscopic image data and then input it into the optimized student network to obtain the part classification result.
[0072] A specific application embodiment of the present invention uses a data set that is a category-balanced high-quality nasopharyngeal image data set, which contains a total of 16,000 images, covering the left nasal cavity, right nasal cavity, left nasopharynx, right nasopharynx, oropharynx and hypopharynx (distant view), left pharyngeal epiglottic folds, right pharyngeal epiglottic folds, tongue root and epiglottic valley, soft palate (median position), left tonsil, right tonsil, hypopharynx and larynx median position (clothing sound phase), hypopharynx median position (exposing the post-cricoid area), left piriformis sinus, right piriformis sinus, panoramic view of the larynx (inspiratory phase), close-up of the lateral vocal cords (inspiratory phase), panoramic view of the oral cavity, hard palate, floor of the mouth, etc., a total of 20 key parts of the nasopharynx and throat, with 800 images for each part.
[0073] The steps are described as follows:
[0074] Step 1: Input the original image data in jpg, png, tif or bmp format.
[0075] Step 2: Crop the original image data and then feed each image into the model, which resizes it to 224×224. Figure 1 .
[0076] Step 3: Train the teacher network and use the designed algorithm to select the teacher network with the best guidance effect on the student network. The algorithm can be described as follows:
[0077] Input: training set D
[0078] Teacher Model M T
[0079] Student Model M S
[0080] Number of training rounds epochs
[0081] Save interval save_interval
[0082] Procedure: Enter the function AdaptiveTeacherSelection(D,M T ,M S ,epochs,save_interval)
[0083]
[0084]
[0085] Output: Optimal teacher model stage k *
[0086] Step 4: Use the designed knowledge distillation framework to train and test the student network, and output the results in the test phase. Figure 1 and Figure 2 .
[0087] The network constructed by the present invention is compared with other distillation technologies, and the results are shown in the following table:
[0088]
[0089] This method has achieved the best level in Precision, Recall, F1-score, and Accuracy of all knowledge distillation methods, and its recognition accuracy is significantly higher than other methods. At the same time, compared with the teacher model, although the model size and parameters of the lightweight model are much lower than those of the teacher model Swin-base, it still achieves a comparable accuracy.
[0090] The present invention also provides a nasopharyngeal endoscope multi-site classification system based on dynamic adaptive knowledge distillation, which mainly includes an image acquisition module, a data preprocessing module, a classification module and a display module, wherein:
[0091] The image acquisition module is used to acquire or receive endoscopic images of the nasopharynx and throat, for example, it can be an image acquisition device, i.e., an endoscopic device, or a device with a storage function connected to the image acquisition device in a wired or wireless manner.
[0092] The data preprocessing module is in communication with the image acquisition module and is used to preprocess the endoscopic image acquired by the image acquisition module, that is, the aforementioned cropping of the black border area, adjusting the direction and size of the image, and other operations.
[0093] The classification module includes a teacher network and a student network, wherein the teacher network and the student network are trained by the nasopharyngeal endoscope multi-part classification method based on dynamic adaptive knowledge distillation of the present invention to obtain the optimal teacher network and the optimized student network, or the optimal teacher network and the optimized student network obtained by pre-training can be directly loaded into this module. The pre-processed endoscopic image is input into the optimized student network to obtain the part classification result.
[0094] The display module outputs and presents the part classification results, which can be a medical device, a computer or even a mobile phone.
[0095] Furthermore, the present invention also provides an encoding device, comprising: a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute a method as described in the first aspect of the present invention or in its various embodiments.
[0096] Furthermore, the present invention also provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the method according to the first aspect of the present invention or its various embodiments.
[0097] Furthermore, the present invention also provides a computer program product, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the method according to the first aspect of the present invention or its various embodiments.
[0098] The above are only specific implementations of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be included in the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be based on the protection scope of the claims.
Claims
1. A multi-site classification method for nasopharyngeal endoscope based on dynamic adaptive knowledge distillation, characterized in that: The steps include: Step 1, data preprocessing, including: cropping the black edge area of the endoscopic image and adjusting the direction and size of all images to be consistent; Step 2: construct and train the teacher network to obtain the optimal teacher network; Step 3: Use the optimal teacher network to create soft labels and train the student network. A dynamic distillation temperature adjustment method is used to reduce the distillation temperature as the performance of the student network improves. By comparing the probability distribution of the soft labels after temperature adjustment with the output of the student network, the performance is gradually corrected and improved. After the training, an optimized student network is obtained. Step 4, the endoscopic image is subjected to the data preprocessing, and then input into the optimized student network to obtain the part classification result.
2. According to claim 1, the multi-site classification method for nasopharyngeal endoscope based on dynamic adaptive knowledge distillation is characterized in that: The teacher network adopts a Swin Transformer network, which includes an input layer, a Swin Transformer layer, a dropout layer and a fully connected layer, wherein the Swin Transformer layer is composed of multiple Transformer modules, each module includes a self-attention mechanism and a multi-head attention mechanism, which is used to extract global and local features of the image, and the dropout layer is used to prevent the model from overfitting on the training set. The fully connected layer contains multiple nodes, which respectively represent the probability of predicting that the sample belongs to different categories. The output of the dropout layer is extracted as the deep feature set of the image.
3. According to claim 2, the nasopharyngeal endoscope multi-site classification method based on dynamic adaptive knowledge distillation is characterized in that: During the training process of the teacher network, the weight of the teacher network is periodically saved to generate candidate teacher networks of multiple stages, and the formula is: M T (k) =train(M T ,D,k×epochs) Among them, M T represents the teacher network, M T (k) represents the teacher network saved for the kth time, D is the input data set, and epochs represents the number of training rounds; Use each candidate teacher network to preliminarily train and quickly evaluate the student network. In the preliminary training and fast evaluation of the student network, the loss of fast evaluation is calculated using the following formula: L KD (k) =KL(p (T,k) ||q (S) ) Among them, L KD (k) is the distillation loss of the student network under the guidance of the teacher network at stage k, p (T,k) is the output probability distribution of the teacher network at stage k, q (S) is the output probability distribution of the student network, KL(p (T,k) ||q (S) ) is the KL divergence between the output distributions of the teacher network and the student network, which is used to measure the difference between the two distributions; Select the teacher network with the smallest distillation loss as the teacher network for final training, that is, the optimal teacher network. The formula is as follows: <h2 style=";text-align:left;direction:ltr">k<h2 style=";text-align:left;direction:ltr"> * <h2 style=";text-align:left;direction:ltr"> =argmin<h2 style=";text-align:left;direction:ltr"> k <h2 style=";text-align:left;direction:ltr"> L<h2 style=";text-align:left;direction:ltr"> KD <h2 style=";text-align:left;direction:ltr"> (k) Among them, k * Represents the number of rounds of the selected optimal teacher network.
4. According to claim 3, the nasopharyngeal endoscope multi-site classification method based on dynamic adaptive knowledge distillation is characterized in that: The method uses each candidate teacher network to preliminarily train and quickly evaluate the student network. First, a smaller subset is used in the data set for training, and secondly, the number of training rounds is reduced for preliminary training. The smaller subset is a subset of 10 to 30% of the images randomly extracted from the original data set, so as to reduce the overhead required for training. The reduction in the number of training rounds refers to reducing the number of training iterations, completing training and testing in a shorter time, thereby reducing evaluation time.
5. According to claim 1, the multi-site classification method for nasopharyngeal endoscope based on dynamic adaptive knowledge distillation is characterized in that: The dynamic distillation temperature adjustment method gradually adjusts the distillation temperature according to the improvement of the student network performance to more accurately match the relationship between the target distribution and the actual probability distribution. The formula is as follows: T(t)=T0·e -λ·f(S(t)) Where T(t) is the distillation temperature at time t, T0 is the initial temperature, λ is the adjustment coefficient used to control the rate at which the temperature decreases over time, S(t) represents the performance index of the student network, and f(S(t)) is used to indicate the improvement of the student network performance, ensuring that the distillation temperature gradually decreases as the performance improves. Its form is: Where S0 is the initial performance of the student network, α and β are the linear and nonlinear adjustment coefficients, respectively, and γ is the exponential parameter of nonlinear control.
6. The nasopharyngeal endoscope multi-site classification method based on dynamic adaptive knowledge distillation according to claim 1 or 5, characterized in that: The soft label probability distribution P after temperature adjustment T (x,t) is expressed as: Among them, z T (x) represents the original output of the teacher network on input x, z i T (x) represents the original prediction score of the teacher network for category i, N is the total number of categories, and T(t) is the distillation temperature at time t; The output P of the student network S (x,t) is expressed as: Among them, z S (x) represents the original output of the student network when input x is given, z i S (x) represents the original prediction score of the student network for category i.
7. According to claim 1, the nasopharyngeal endoscope multi-site classification method based on dynamic adaptive knowledge distillation is characterized in that: In step 3, the student network training adopts a mixed loss function with dynamically adjusted weights, and the total loss L is the distillation loss L D and the standard supervision loss L S The weighted sum of: L=λ(t)L D +(1-λ(t))L S Among them, λ(t) is the weight parameter that is dynamically adjusted during the training process, which depends on the number of training iterations and the performance of the student network.
8. According to claim 7, the nasopharyngeal endoscope multi-site classification method based on dynamic adaptive knowledge distillation is characterized in that: The distillation loss L D Used to imitate the output of the teacher network, KL divergence is calculated using the following formula: Where n represents the number of data samples, i represents the data sample sequence number, and τ represents a fixed distillation temperature. represents the predicted probability distribution of the student model at the distillation temperature τ, represents the predicted probability distribution of the teacher model at the distillation temperature τ; The standard supervision loss L S Using cross entropy loss, we can directly calculate the true label. The formula is as follows: Among them, y i is the true label of the sample, p s (i) is the predicted probability of the student model for the i-th category.
9. The multi-site classification method for nasopharyngeal endoscope based on dynamic adaptive knowledge distillation according to claim 7 is characterized in that: The weight parameter λ(t) is adjusted according to the performance of the student network on the validation set, and the formula is as follows: Among them, κ is a parameter that controls the adjustment speed. The larger its value, the higher the sensitivity of weight change; ρ t is the performance index of the student network at time t, and ρ0 is the preset benchmark performance value, which is used to normalize the performance index of the model.
10. A multi-site classification system for nasopharyngeal endoscope based on dynamic adaptive knowledge distillation, characterized in that: include: An image acquisition module, used for collecting or receiving endoscopic images of the nasopharynx and throat; A data preprocessing module, which crops the black border area of the endoscopic image and adjusts the direction and size of all images to be consistent; A classification module, comprising a teacher network and a student network, wherein the teacher network and the student network are trained by the nasopharyngeal endoscope multi-part classification method based on dynamic adaptive knowledge distillation as described in any one of claims 1 to 9 to obtain an optimal teacher network and an optimized student network; the preprocessed endoscope image is input into the optimized student network to obtain a part classification result; The display module outputs and presents the part classification result.
Citation Information
Cited By
Image classification method based on responsive knowledge distillation and related equipment
CN120612531A
Dynamic multi-stage knowledge-based distillation model training method, medium and equipment
CN121480619A
