Incremental learning method for mobile phone radiation source spectrum graph categories based on deep neural network
By combining the deep neural network method of distillation loss function and cross entropy loss function, the problem of underutilizing known information in the existing technology is solved, and efficient class incremental learning of mobile phone radiation source spectrograms is realized, which improves the accuracy of new category recognition and reduces storage requirements.
Patent Information
- Application Number
- CN202211569854.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-08
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-12-08
AI Technical Summary
The existing class incremental recognition model does not fully utilize known information when initializing new classification parameters, and retains too many or too few old class samples, resulting in storage burden and unbalanced training data, making it difficult to achieve efficient incremental learning of mobile phone radiation source spectrogram categories.
The deep neural network-based method is adopted, and the distillation loss function is combined with the cross entropy loss function and the distance-based metric loss function, the parameters of the model classification layer are updated, and the new category is initialized using the learned knowledge, and the mobile phone radiation source spectrogram category is gradually learned to avoid the forgetting of old knowledge.
It realizes efficient category incremental learning without old-class training data, improves the accuracy of new categories, reduces storage requirements, and improves the recognition accuracy of the model to more than 80%.
Smart Images

Figure CN115828100B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for incremental recognition of image categories, and in particular to a method for incremental learning of mobile phone radiation source spectrum graph categories based on a deep neural network. Background Art
[0002] A mobile phone radiation source spectrogram refers to the spectrogram obtained by processing signals from different mobile phone models. Existing incremental class recognition models typically retain some data from previously learned categories and combine it with data from new categories for learning. Knowledge distillation techniques are used to prevent the model from forgetting knowledge from old categories. Existing incremental class recognition models for images typically use random initialization strategies to initialize the newly added parameters in the model's classification layer. These methods have the following drawbacks:
[0003] 1. When retaining some old class samples, too many of them will easily cause storage burden, and too few of them will easily cause imbalance in the training data of new and old categories, and will not meet the requirements of incremental learning.
[0004] 2. The newly added classification parameters are randomly initialized, which does not fully utilize the known information of the model to promote the learning of new categories. Summary of the Invention
[0005] The purpose of the present invention is to provide a solution to the above-mentioned problems, which can complete the model's incremental learning of the categories of mobile phone radiation source spectra without old category training data, fully utilize the model's currently learned knowledge to initialize new category classification parameters, and promote new category learning. The method is based on deep neural networks for incremental learning of mobile phone radiation source spectrum categories.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows: a method for incremental learning of mobile phone radiation source spectrum graph categories based on deep neural network, comprising the following steps;
[0007] (1) Obtain a dataset of mobile phone radiation source spectrograms and determine N tasks t1 to t2 based on the number of categories in the dataset. N , the t1 is used to learn B1 categories, t2~t N They are used to learn B2 categories respectively, and the categories of different tasks are not repeated;
[0008] Obtain N training data sets for tasks from the mobile phone radiation source spectrum graph dataset, forming a data stream D = {D1, D2, ..., D N}, the training data set of t1 is D1, the category set is C1, t n The training data set is D n , the category set is C n , n=2~N, and the nth category incremental learning stage can only obtain task t ntraining data sets, each training data set contains multiple samples;
[0009] (2) In the first category incremental learning stage, task t1 is learned, with samples in D1 as input and the category of the sample as the expected output, and the RestNet-18 network is trained to obtain a network model; the RestNet-18 network includes a feature extractor and a classification layer. After learning t1, the feature extractor is f1(·), and the classification layer is C1(·);
[0010] (3) In each subsequent incremental learning phase, tasks t2 to t N , each time a task is learned, the network model is updated once, and after learning t n The feature extractor obtained is f n (·), the classification layer is C n (·), can identify B1+(n-1)×B2 categories;
[0011] Update n The corresponding network model is as follows:
[0012] (31) Let task t n Contains B2 categories, each category in D n There are S samples in the corresponding
[0013] (32) For one of the categories, use t n-1 The obtained feature extractor f n-1 (·) Take the features of the corresponding S samples, where the kth sample x k The characteristic is f n-1 (x k ), k = 1 ~ S, and calculate the center value of the category
[0014] (33) Follow step (32) to get t n The central values of all categories in , a total of B2 central values;
[0015] (34) in t n-1 Add t to the classification layer obtained n The corresponding classification parameters of B2 categories are obtained, and the B2 center values obtained in step (33) are used to replace the B2 newly added classification parameters;
[0016] (35) Calculate the distillation loss L according to the following formula D ;
[0017]
[0018] Where U is D n The total number of samples in, U = B2 × S;
[0019] (36) Computational task t n The total loss function loss n ;
[0020] loss n =L CE +αL m +βL D
[0021] Where, L CE is the cross entropy loss function, L m is the distance-based metric loss function, α is L m The weight of L D The weight of
[0022] (37) Training t based on the total loss function n-1 The network model is obtained by n network model.
[0023] As a preference: in said step (36);
[0024] The cross entropy loss function L is calculated according to the following formula CE ;
[0025]
[0026] Where i is D n The i-th sample in, i=1~U; M is C1~C n The sum of categories, c is one category in M; y is the sample x i The label is 1 when y = category c, otherwise it is 0. is the current network model pair x i The predicted probability of belonging to category c;
[0027] The distance-based metric loss function L is calculated according to the following formula: m ;
[0028] L m =max(0,d(f n (x i ),f n (x p ))-d(f n (x i ),f n (x q ))+D)
[0029] x p D n Zhong and x i The number of samples belonging to the same category is S-1, xq D n Zhong and x i The number of samples that do not belong to the same category is US, d(·,·) is the Euclidean distance between two features, and D is the preset distance threshold.
[0030] Preferably, α=0.001, β=0.05.
[0031] As a preference: when learning task t1, the loss function for training the RestNet-18 network is loss1 = L CE +αL m .
[0032] Preferably, step (37) is to back-propagate the total loss function value, use the gradient descent algorithm to reduce the total loss function value and update the model parameters.
[0033] When learning task t1, the loss function is loss1=L CE +αL m , in learning t2~t N When each training uses the total loss function loss n =L CE +αL m +βL D In each learning, since the training data set is different, L CE , L m , L D The values of are different.
[0034] When learning task t1, classification parameters of B1 categories are added to the classification layer of the RestNet-18 network. When learning task t2, classification parameters of B2 categories need to be added to the classification layer of the network model obtained in t1.
[0035] Compared with existing technologies, the advantages of this invention are: it fully utilizes the model's existing knowledge to promote the model's learning of unknown new classes, thereby improving the model's recognition accuracy for these new classes. It can achieve incremental category learning without the need for old class data, eliminating the need for extensive storage resources. Furthermore, this invention introduces a distillation loss function, which, together with the cross-entropy loss function and the distance-based metric loss function, constitutes the model's overall loss function. Distillation loss reduces the difference in the features of new class samples before and after the model is updated, thereby mitigating the model's forgetting of information learned on previous tasks.
[0036] In summary, the accuracy of the method of the present invention for incremental recognition of the category of mobile phone radiation source spectra can reach an average of more than 80%. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a schematic diagram of category incremental recognition in the prior art;
[0038] Figure 2 Flowchart of the present invention;
[0039] Figure 3 This is a schematic diagram of the network model of updating t2 based on t1 according to the present invention. DETAILED DESCRIPTION
[0040] The present invention will be further described below with reference to the accompanying drawings.
[0041] Example 1: See Figure 1 , is a schematic diagram of the category incremental recognition method in the prior art. In task t1, the model is trained using the training dataset D1 using cross entropy loss to obtain Model 1. Then, some samples are selected from D1 to obtain the dataset R1 for continued training in the next task to retain the model's memory of the old category data. In task t2, the dataset R1 retained from the previous task is merged with the dataset D2 of the current task to obtain the final training dataset for task t2. Used to train and update Model 1. When updating Model 1, the cross entropy loss is calculated for the samples in the dataset D2, and the distillation loss is calculated separately for the samples in the dataset R1. Finally, the two losses are combined as the total loss of the model for training to obtain Model 2. Then from A portion of the samples are selected and retained to obtain dataset R2 for training the next task. Similarly, the network model obtained in the previous task is updated in the new task, and the network model corresponding to the Nth task is model N.
[0042] Example 2: See Figure 2 and Figure 3 A method for incremental learning of mobile phone radiation source spectrum graph categories based on deep neural networks, comprising the following steps:
[0043] (1) Obtain a dataset of mobile phone radiation source spectrograms and determine N tasks t1 to t2 based on the number of categories in the dataset. N , the t1 is used to learn B1 categories, t2~t N They are used to learn B2 categories respectively, and the categories of different tasks are not repeated;
[0044] Obtain N training data sets for tasks from the mobile phone radiation source spectrum graph dataset, forming a data stream D = {D1, D2, ..., D N}, the training data set of t1 is D1, the category set is C1, t n The training data set is D n , the category set is C n , n=2~N, and the nth category incremental learning stage can only obtain task t n training data sets, each training data set contains multiple samples;
[0045] (2) In the first category incremental learning stage, task t1 is learned, with samples in D1 as input and the category of the sample as the expected output, and the RestNet-18 network is trained to obtain a network model; the RestNet-18 network includes a feature extractor and a classification layer. After learning t1, the feature extractor is f1(·), and the classification layer is C1(·);
[0046] (3) In each subsequent incremental learning phase, tasks t2 to t N , each time a task is learned, the network model is updated once, and after learning t n The feature extractor obtained is f n (·), the classification layer is C n (·), can identify B1+(n-1)×B2 categories;
[0047] Update n The corresponding network model is as follows:
[0048] (31) Let task t n Contains B2 categories, each category in D n There are S samples in the corresponding
[0049] (32) For one of the categories, use t n-1 The obtained feature extractor f n-1 (·) Take the features of the corresponding S samples, where the kth sample x k The characteristic is f n-1 (x k ), k = 1 ~ S, and calculate the center value of the category
[0050] (33) Follow step (32) to get t n The central values of all categories in , a total of B2 central values;
[0051] (34) in t n-1 Add t to the classification layer obtained n The corresponding classification parameters of B2 categories are obtained, and the B2 center values obtained in step (33) are used to replace the B2 newly added classification parameters;
[0052] (35) Calculate the distillation loss L according to the following formula D ;
[0053]
[0054] Where U is D n The total number of samples in, U = B2 × S;
[0055] (36) Computational task t n The total loss function loss n ;
[0056] loss n =L CE +αL m +βL D
[0057] Where, L CE is the cross entropy loss function, L m is the distance-based metric loss function, α is L m The weight of L D The weight of
[0058] (37) Training t based on the total loss function n-1 The network model is obtained by n network model.
[0059] In said step (36);
[0060] The cross entropy loss function L is calculated according to the following formula CE ;
[0061]
[0062] Where i is D n The i-th sample in, i=1~U; M is C1~C n The sum of categories, c is one category in M; y is the sample x i The label is 1 when y = category c, otherwise it is 0. is the current network model pair x i The predicted probability of belonging to category c;
[0063] The distance-based metric loss function L is calculated according to the following formula: m ;
[0064] L m =max(0,d(f n (x i ),f n (x p ))-d(f n (x i ),f n (x q ))+D)
[0065] x p D n Zhong and x i The number of samples belonging to the same category is S-1, x q D n Zhong and xi The number of samples that do not belong to the same category is US, d(·,·) is the Euclidean distance between two features, and D is the preset distance threshold.
[0066] The α=0.001, β=0.05.
[0067] When learning task t1, the loss function of training the RestNet-18 network is loss1=L CE +αL m .
[0068] Step (37) is to back-propagate the total loss function value, use the gradient descent algorithm to reduce the total loss function value and update the model parameters.
[0069] Example 3: See Figure 2 and Figure 3 , based on Example 2, we give a specific example.
[0070] Step (1) is the same as step (1) of Example 2. The data set of the spectrum diagram of the mobile phone radiation source we obtained contains a total of 22 categories. We determine N=5 tasks, namely t1~t5, where t1 is used to identify 6 categories, t2-t5 each identify 4 categories, and the categories of different tasks are not repeated; the spectrum diagrams in the data set are collected by ourselves, and the spectrum diagram of the mobile phone radiation source refers to the spectrum diagram obtained by processing the signals of mobile phones of different models; the training data sets of the 5 tasks t1~t5 are D1~D5 respectively, and the category sets are C1~C5, C1 contains 6 categories, and C2~C5 each contains 4 categories.
[0071] Step (2) is the same as step (2) of Example 2, and its purpose is to train the initial task t1 to obtain a network model. Here, t1 can be called the initial task, and the network model is called the initial network model. When training the initial task t1, the input of the RestNet-18 network is a picture P1 in D1, and the output is the probability that P1 belongs to the six categories in C1, which is a 6-dimensional vector, such as [0.1, 0.9, 0.4, 0.3, 0.8, 0.6], indicating that the probability that P1 belongs to category 1 is 0.1, the probability that it belongs to category 2 is 0.9, and so on. Finally, we compare the output with the class label corresponding to P1. The class label is also a 6-dimensional vector. For example, the label for class 1 is [1, 0, 0, 0, 0], and the label for class 2 is [0, 1, 0, 0, 0, 0]. Similarly, by comparing the output with the corresponding class label, we update the model based on the difference between the labels. Here, P1 corresponds to class 2, and the expected output should be [0, 1, 0, 0, 0]. Based on the difference between the actual and expected outputs, we adjust and update the model parameters. Finally, we obtain the network model of t1.
[0072] When learning task t1, the loss function of training the RestNet-18 network is loss1=L CE +αL m When actually training the network model, we will divide the data set into a training set and a test set, use the data of the training set for training, and use the data of the test set for testing. For example, for an input test sample P2, the model outputs its predicted probability and compares it with the labels of all categories that the model can recognize. By seeing which label the output is close to, we can determine which category P2 belongs to.
[0073] Step (3): Same as step (3) of embodiment 2, this step is a process of repeatedly updating the network model, and each time it is updated, the network model has the ability to recognize multiple B2 categories.
[0074] Taking n=2 as an example, update the network model corresponding to t2. Then in step (31), task t2 contains B2=4 categories, each category in D n There are 250 samples in the sample, so D n A total of 1000 samples are included;
[0075] After steps (32) and (33), a total of 4 center values corresponding to 4 categories are obtained;
[0076] In step (35), U=B2×S=4×250=1000.
[0077] It should be noted that there are only 4 new categories in D2, so the input samples when calculating the total loss function value are also only 4 categories. However, when the model determines the category to which the input sample belongs, it will judge all 10 categories in t1 and t2, and M is the sum of the 10 categories.
[0078] (37) Training t based on the total loss function n-1 The network model is obtained by n network model.
[0079] After learning the network model of t1, the present invention can identify 6 categories in C1. After learning the network model of t2, it can identify 6+4=10 categories in C1 and C1. And so on. Finally, after learning t5, it can identify 22 categories.
[0080] Each layer of the neural network model has parameters, and the parameters of the classification layer are generally called classification parameters. For example, the feature dimension extracted by the feature extractor is 512, and 6 classes need to be identified at t1. The parameters of the classification layer are 512×6, and each class corresponds to a 512×1 classification parameter. This classification parameter is generally randomly initialized, and the present invention can use random initialization when learning t1. At t2, 4 categories are added, that is, 4 classification parameters, and the classification layer parameters become 512×10, with 4 additional 512×1 randomly initialized classification parameters. Each new category corresponds to a classification parameter. The present invention replaces the 4 randomly initialized classification parameters with 4 center values. Because the center value is the mean of the feature, it is also 512*1.
[0081] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for incremental learning of mobile phone radiation source spectrum graph categories based on deep neural networks, characterized by: The following steps are included: (1) Obtain a dataset of mobile phone radiation source spectrograms and determine N tasks t1 to t2 based on the number of categories in the dataset. N , the t1 is used to learn B1 categories, t2~t N They are used to learn B2 categories respectively, and the categories of different tasks are not repeated; Obtain N training data sets for tasks from the mobile phone radiation source spectrum graph dataset, forming a data stream D = {D1, D2, ..., D N }, the training data set of t1 is D1, the category set is C1, t n The training data set is D n , the category set is C n , n=2~N, and the nth category incremental learning stage can only obtain task t n training data sets, each training data set contains multiple samples; (2) In the first category incremental learning stage, task t1 is learned, with samples in D1 as input and the category of the sample as the expected output, and the RestNet-18 network is trained to obtain a network model; the RestNet-18 network includes a feature extractor and a classification layer. After learning t1, the feature extractor is f1(·), and the classification layer is C1(·); (3) In each subsequent incremental learning phase, tasks t2 to t N , each time a task is learned, the network model is updated once, and after learning t n The feature extractor obtained is f n (·), the classification layer is C n (·), can identify B1+(n-1)×B2 categories; Update n The corresponding network model is as follows: (31) Let task t n Contains B2 categories, each category in D n There are S samples in the corresponding (32) For one of the categories, use t n-1 The obtained feature extractor f n-1 (·) Take the features of the corresponding S samples, where the kth sample x k The characteristic is f n-1 (x k ), k = 1 ~ S, and calculate the center value of the category (33) Follow step (32) to get t n The central values of all categories in , a total of B2 central values; (34) in t n-1 Add t to the classification layer obtained n The corresponding classification parameters of B2 categories are obtained, and the B2 center values obtained in step (33) are used to replace the B2 newly added classification parameters; (35) Calculate the distillation loss L according to the following formula D ; Where U is D n The total number of samples in, U = B2 × S; (36) Computational task t n The total loss function loss n ; loss n =L CE +αL m +βL D Where, L CE is the cross entropy loss function, L m is the distance-based metric loss function, α is L m The weight of L D The weight of (37) Training t based on the total loss function n-1 The network model is obtained by n network model.
2. The method for incremental learning of mobile phone radiation source spectrum graph categories based on deep neural networks according to claim 1 is characterized by: In said step (36); The cross entropy loss function L is calculated according to the following formula CE ; Where i is D n The i-th sample in, i=1~U; M is C1~C n The sum of categories, c is one category in M; y is the sample x i The label is 1 when y = category c, otherwise it is 0. is the current network model pair x i The predicted probability of belonging to category c; The distance-based metric loss function L is calculated according to the following formula: m ; L m =max(0,d(f n (x i ),f n (x p ))-d(f n (x i ),f n (x q ))+D) x p D n Zhong and x i The number of samples belonging to the same category is S-1, x q D n Zhong and x i The number of samples that do not belong to the same category is US, d(·,·) is the Euclidean distance between two features, and D is the preset distance threshold.
3. The method for incremental learning of mobile phone radiation source spectrum graph categories based on a deep neural network according to claim 1 or 2, characterized in that: The α=0.001, β=0.
05.
4. The method for incremental learning of mobile phone radiation source spectrum graph categories based on a deep neural network according to claim 1 or 2, characterized in that: When learning task t1, the loss function of training the RestNet-18 network is loss1=L CE +αL m .
5. The method for incremental learning of mobile phone radiation source spectrum graph categories based on deep neural networks according to claim 1 is characterized by: Step (37) is to back-propagate the total loss function value, use the gradient descent algorithm to reduce the total loss function value and update the model parameters.
Citation Information
Patent Citations
Semi-supervised small sample category incremental learning method and device and classification identification method
CN113344144A
Sample incremental learning method based on deep neural network
CN114529752A