A two-stage feature optimization method for microwave frequency sweep data based on hybrid ant colony algorithm
Through the two-stage feature optimization method of the hybrid ant colony algorithm, combined with filtering-embedded and ridge regression-recursive feature selection, combined with k-fold cross-validation and hybrid ant colony optimization, the problem of redundant and noisy data in the swept-frequency microwave signal is solved, and the accuracy and stability of the microwave detection frequency is achieved.
Patent Information
- Application Number
- CN202211326489.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-10-27
AI Technical Summary
The prior art is difficult to effectively remove redundant and noise data in the swept microwave signal, and the sample set division method has a great impact on the randomness of the optimization results, resulting in inaccuracy of the microwave detection frequency.
The hybrid ant colony algorithm is used for two-stage feature optimization. First, the low correlation and high redundant features are removed through the filter-embedded feature selection method. Then, the features are further screened using the ridge regression-recursive feature elimination algorithm, combined with k-fold cross-validation and hybrid ant colony optimization algorithm, and the cumulative selection probability of the features is statistically measured to generate the optimal frequency subset.
The redundancy and noise data in the swept-frequency microwave signal are effectively removed, which reduces the randomness of the sample set division method for optimization results, improves the objectivity and accuracy of microwave detection frequency, and improves the quality of the feature subset.
Smart Images

Figure CN116148278B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of moisture detection and feature selection of agricultural products, and in particular to a two-stage feature optimization method for microwave frequency sweep data based on a hybrid ant colony algorithm. Technical Background
[0002] The microwave free-space transmission method can indirectly measure the moisture content of wet materials based on the interaction between microwaves and water molecules. It offers the advantages of non-contact, high penetration, and rapid detection, making it an ideal nondestructive technique for moisture testing in agricultural materials. The principle is that when microwaves penetrate the material being tested, the microwave energy loss caused by water molecules far exceeds the loss caused by other dry matter. Therefore, by measuring the basic characteristics of the microwave signal related to the dielectric properties of the material (such as attenuation and phase shift), the moisture content can be calculated. Research by researchers such as Ma and Okamura has demonstrated that using a single-frequency microwave signal is difficult to fully detect the diverse signal changes caused by different chemical species in multi-component materials. Using a set of swept-frequency microwave signals containing different frequencies can effectively broaden the moisture detection range and improve moisture detection accuracy. However, microwave signals of different frequencies exhibit varying sensitivity to moisture, and swept-frequency microwave data exhibit high correlation and multicollinearity. In practical applications, a comprehensive method is needed to specifically optimize microwave swept-frequency data and objectively and accurately select the microwave detection frequency suitable for a specific material type. The present invention proposes a two-stage feature optimization method for microwave sweep data based on a hybrid ant colony algorithm, which removes redundant and noisy data in the swept microwave signal and reduces the randomness injected into the optimization result by the sample set division method, thereby achieving objective and accurate optimization of the swept microwave signal frequency. Summary of the Invention
[0003] The purpose of the present invention is to provide a two-stage feature optimization method for microwave sweep data based on a hybrid ant colony algorithm, which removes redundant and noisy data in the swept microwave signal and reduces the randomness injected into the optimization result by the sample set division method, thereby effectively and objectively optimizing the microwave detection frequency.
[0004] The technical solutions of the present invention are as follows:
[0005] A two-stage feature optimization method for microwave frequency sweep data based on a hybrid ant colony algorithm, comprising:
[0006] (1) Use a swept-frequency microwave device to detect the samples to be tested, and mark the moisture content label values of all samples to obtain a swept-frequency microwave dataset FS;
[0007] The first stage is feature space reduction based on filter-embedded feature selection, which includes:
[0008] (2) Using the maximum information coefficient evaluation method to perform filter feature selection on the obtained swept frequency microwave data set FS, the first frequency subset FS1 is generated;
[0009] (3) Using the ridge regression-recursive feature elimination algorithm, wrapper feature selection is performed on the first frequency subset FS1 to generate the second frequency subset FS2;
[0010] The second stage is feature selection and evaluation based on the hybrid ant colony optimization algorithm, including:
[0011] (4) Use the k-fold cross-validation method to divide the second frequency subset FS2. FS2 is divided into k parts on average, and k-1 parts are combined as the training set. The remaining 1 is used as a test set There are k types of training sets and test set The division method;
[0012] (5) Using hybrid ant colony optimization algorithm in the training set Perform feature selection on it to obtain the training subset Then in the test set Screening and training subsets The same features get the test subset For the training subset and the test subset Take the union and generate a candidate frequency subset
[0013] (6) Using the k-fold cross validation method described in step (4) and the hybrid ant colony optimization algorithm described in step (5) to perform feature selection on the second frequency subset FS2, traversing k training sets and test set The partitioning method generates a set of k candidate frequency subsets in represents the i-th candidate frequency subset;
[0014] (7) Count each feature in the second frequency subset FS2 in all candidate frequency subset sets The cumulative number of times selected C(F j ), and then the cumulative selection times of each feature C(F j ) divided by the number of cross-validation k to obtain the cumulative selection probability P(F j );
[0015] (8) Using the threshold analysis method, select the cumulative selection probability P(F j )≥P0 features, forming the optimal frequency subset FS bestAs the result of feature optimization; where P0 is the threshold.
[0016] Furthermore, the swept frequency microwave data set FS obtained in step (1) is expressed as:
[0017] FS={(f t ,y t )|t=1,2,…,m}
[0018] Among them, f t ={f t1 ,f t2 ,…,f tn} represents the feature vector of the tth sample, y t represents the moisture content label of the t-th sample, n represents the number of initial features, and each initial feature is numbered. The initial feature number set is recorded as L0 = {1, 2, ..., n}; m represents the number of samples, f tn represents the nth eigenvalue of the tth sample, where the eigenvalue is a microwave attenuation value or a microwave phase shift value.
[0019] Furthermore, the step (2) is specifically as follows:
[0020] (2.1) Calculate the single eigenvector F in the swept frequency microwave dataset FS based on the maximum information coefficient theory j The maximum information coefficient A between the moisture content label of the sample j , the specific calculation formula is:
[0021] A j =MIC(F j ;Y),j∈L0
[0022] Among them, F j ={f 1j ,f 2j ,…,f mj} represents the jth eigenvector, f mj represents the jth eigenvalue of the mth sample, Y={y1,y2,…,y m} represents the sample label set, y m represents the label of the mth sample, L0 represents the initial feature sequence number set;
[0023] (2.2) Set the number of screening to N1, and sort the numbers corresponding to all eigenvectors in the swept frequency microwave data set FS in reverse order according to the maximum information coefficient calculated in step (2.1), retain the N1 eigenvectors with the highest number, and generate the first frequency subset L1 represents a set of feature sequence numbers in the first frequency subset FS1.
[0024] Furthermore, the step (3) is specifically as follows:
[0025] (3.1) The ridge regression algorithm is used to train the sample moisture content prediction model based on the first frequency subset FS1 to obtain the weight ω corresponding to each feature j , according to ω j Arrange all the feature vectors in the first frequency subset FS1 in reverse order, remove the feature with the lowest weight, and update the first frequency subset FS1;
[0026] (3.2) Set the number of screening to N2, repeat step (3.1) until the number of features in the first frequency subset FS1 reaches the preset number of features N2, retain the remaining features in the first frequency subset FS1, and generate the second frequency subset L2 represents a set of feature sequence numbers in the second frequency subset FS2.
[0027] Furthermore, the step (5) is specifically as follows:
[0028] (5.1) The training set obtained by dividing the second frequency subset FS2 in step (4) For the target dataset, map the target dataset into an undirected fully connected graph G, where each node represents a feature. The specific form is:
[0029] G=(F,E)
[0030] in, represents the set of all feature vectors in the target data set, N2 represents the number of features in the target data set, m1 represents the number of samples in the target data set, E={(F i ,F j )|F i ,F j ∈F,i≠j} represents the path connecting any two nodes, F i ,F j denote the i-th eigenvector and the j-th eigenvector respectively;
[0031] (5.2) Initialization of algorithm parameters, including the number of selected features N f , the number of ants in the ant colony N a , the maximum number of ant colony iterations I max , initial pheromone concentration τ0, pheromone weight α, pheromone release coefficient e, pheromone evaporation coefficient ρ, heuristic factor weight β;
[0032] (5.3) Based on the Pearson correlation coefficient theory, the similarity between feature vectors is calculated, and the inverse of the similarity is used as the inspiration factor η of the ant colony. The specific calculation formula is:
[0033]
[0034]
[0035] Among them, i,j∈L2 and i≠j, represents the mean of the i-th feature of all samples in the target dataset, f ti represents the i-th eigenvalue of the t-th sample in the target data set, ∑ t It means to traverse all samples in the target data set and sum them up. Sim(.,.) means the similarity between two feature vectors in the target data set.
[0036] (5.4) Calculate the probability P of each feature being selected by the kth ant based on the state probability transition rule k , the specific formula is:
[0037]
[0038] in, Indicates the currently selected feature F i The candidate feature set of the kth ant in the ant colony, F u Represents a set of candidate features Any candidate feature in τ j Represents feature F j , α and β represent the weights of pheromone and heuristic factors respectively;
[0039] (5.5) Each candidate feature F calculated according to step (5.4) j The transition probability value P k , the roulette rule is used to determine the next feature selected by the kth ant;
[0040] (5.6) Repeat steps (5.4)-(5.5) until the number of features visited by the kth ant reaches the preset number of features N. f ;
[0041] (5.7) Repeat steps (5.4)-(5.6) until all ants in the ant colony have visited N f features, generate N a Candidate feature subsets L3 represents the feature sequence number set in the candidate feature subset S′;
[0042] (5.8) Based on the elite ant colony system theory, the pheromone value τ of each node is updated. The specific formula is:
[0043] τ i (t+1)=(1-ρ)τ i (t)+eΔτ i (t)
[0044]
[0045] Where: e and ρ represent the release and evaporation coefficients of pheromone, respectively, τ i (t) represents the characteristic F of the tth generation ant colony i The pheromone concentration, Δτ i (t) represents the tth generation of ant colony in the feature F i The pheromone value released on the associated path, I b represents the feature subset visited by the elite ant with the highest fitness in the t-th generation ant colony, and fitness represents the fitness function;
[0046] (5.9) Repeat steps (5.4)-(5.8) until the number of population iterations reaches the maximum number of iterations I max , retain the feature subset with the highest fitness and generate the optimal frequency subset FS HACO :
[0047]
[0048] Among them, FS HACO Represents the frequency subset obtained by feature selection using the HACO algorithm, recorded as the training subset L4 represents the optimal frequency subset FS HACO The set of feature numbers in ;
[0049] (5.10) In the test set Screening and training subsets Features with the same feature number get the test subset For the training subset and the test subset Take the union and generate the candidate frequency subset FS3.
[0050] Furthermore, the cumulative number of times C(F j ) and the cumulative selection probability P(F j ) is calculated as:
[0051]
[0052]
[0053] Among them, k represents the number of cross-validation folds, h i (F j ) is a binary label, if the feature F in the frequency subset FS2 j The i-th candidate frequency subset Select, h i (F j ) is 1, otherwise it is 0.
[0054] The present invention has the following advantages:
[0055] (1) In the first stage, the present invention reduces the feature space of microwave sweep data based on the filter-wrapper feature selection method, quickly removes low-correlation and high-redundancy features, and effectively improves the search efficiency of the HACO algorithm in the second stage;
[0056] (2) In the first stage, the present invention uses MIC to calculate the correlation between features and sample labels, and uses Ridge's regression coefficient to evaluate the importance of individual features. In the second stage, PCC is used to calculate the correlation between features, and SVR's mean square error is used to evaluate the entire candidate feature subset. Feature selection is performed from multiple aspects, effectively improving the final quality of the feature subset.
[0057] (3) The present invention takes into account the uncertainty injected into the optimization results of the swept-frequency microwave data by the data set division method, combines the majority voting method and the cross-validation method to evaluate the cumulative probability of each feature being selected, and enhances the objectivity and stability of the microwave frequency feature optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is the attenuation characteristic spectrum diagram obtained by detecting tea samples with different moisture contents using a swept frequency microwave measurement system;
[0059] Figure 2 This is a schematic diagram of a specific process of the feature space simplification method based on filter-wrapper feature selection proposed in the present invention;
[0060] Figure 3 It is a specific flow chart of the feature selection and evaluation method based on the HACO algorithm proposed in the present invention. DETAILED DESCRIPTION
[0061] In order to enable those skilled in the art to understand and implement the present invention more clearly, the present invention will be further described below in conjunction with the specific implementation methods and related drawings. It should be understood that the specific factual examples described below are only used to illustrate and explain the present invention, and are not limited to the present invention.
[0062] Step 1: Use a swept-frequency microwave measurement system to test the samples to be tested, mark the moisture content label values of all samples, and obtain a swept-frequency microwave dataset.
[0063] In this example, a self-made swept-frequency microwave measurement system was used as the experimental device. Specifically, it can be divided into four subsystems: an antenna transceiver module, a signal processing system, an industrial computer, and a measurement chamber. The antenna transceiver module consists of a pair of broadband horn antennas, one for transmitting and the other for receiving. The transmitting antenna sequentially transmits a series of swept-frequency microwave signals (2.00-10.00 GHz, a total of 801 frequencies) toward the sample under test. The microwave signals that penetrate the sample are received by the receiving antenna. The signal processing system calculates the attenuation and phase shift values of the swept-frequency microwave signals, converts the data, and transmits it to the industrial computer for storage. The inner walls of the measurement chamber are decorated with microwave absorbing material to shield other measurement interference. A transparent, open sample box made of acrylic is placed inside, with the center of the sample box aligned with the centers of the two antennas.
[0064] In this embodiment, tea leaves with different moisture contents are used as experimental objects, and the fresh leaves are flatly spread on a disc-shaped bamboo sieve, and then naturally dried in a cool and ventilated environment to simulate the withering process in tea processing. The moisture content of tea decreases with the increase of drying time, so samples are taken every 10 hours, and 4 parallel samples are made for each group of samples. The above-mentioned experimental device is used to repeat the measurement of the sample at this moisture content 5 times, and the actual measured values of microwave attenuation and phase shift at this moisture content are calculated based on the reference values of microwave attenuation and phase shift in the no-load state to obtain swept-frequency microwave data; after completing the microwave measurement, about 10g of sample is taken, and its true moisture content is determined based on the current national standard GB 5009.3-2016 as the sample label value; a total of 11 groups of tea samples with different moisture contents (16.25%-77.65%) are prepared and measured in the experiment, and 220 groups of microwave attenuation data and 220 groups of microwave phase shift data are obtained, as shown in FIG. Figure 1 Here, microwave attenuation and phase shift are both used as frequency features to generate a frequency sweep microwave dataset FS, where FS∈R 220*1602 .
[0065] In the first stage, the feature space simplification method based on filter-wrapper feature selection is used to quickly remove low-relevance and high-redundancy features. The specific process is as follows: Figure 2 As shown:
[0066] Step 2: Use the maximum information coefficient (MIC) evaluation method to perform filter feature selection on the swept frequency microwave dataset FS obtained in step 1 to generate the first frequency subset FS1;
[0067] In a specific implementation of the present invention, step 2 is implemented as follows:
[0068] 2.1, Calculate the single eigenvector F in the swept frequency microwave dataset FS based on the maximum information coefficient theory j The maximum information coefficient A between the sample attributes j, the specific calculation formula is:
[0069] A j =MIC(F j ; Y)
[0070] Among them, A j represents the maximum information coefficient of the j-th eigenvector, j = 1, 2, ..., n, n represents the number of features, in this embodiment, n = 1602; F j ={f 1j ,f 2j ,…,f mj}, F j represents the jth eigenvector, f mj represents the jth eigenvalue of the mth sample, Y={y1,y2,…,y m}, Y represents the sample label set, y m represents the label of the mth sample, where m represents the number of samples. In this embodiment, m=220;
[0071] 2.2, set the number of screening N1 = 800, according to the maximum information coefficient A calculated in step 2.1 = {A1, A2, ..., A n Arrange all the eigenvectors in the swept frequency microwave dataset FS in reverse order, retain the first 800 eigenvectors, and generate the first frequency subset FS1, where FS1∈R 220U800 .
[0072] The effect of step 2 is to filter out the frequency features in the swept frequency microwave dataset FS that have low linear or nonlinear correlation with the sample labels, and preliminarily reduce the dimension of FS;
[0073] Step 3: Use the Ridge Regression-Recursive Feature Elimination (Ridge-RFE) algorithm to perform wrapper feature selection on the first frequency subset FS1 to generate the second frequency subset FS2;
[0074] In a specific implementation of the present invention, step three is implemented as follows:
[0075] 3.1, the ridge regression algorithm is used to train the sample moisture content prediction model based on the first frequency subset FS1 to obtain the weight ω corresponding to each feature j , according to ω j Arrange all the feature vectors in the first frequency subset FS1 in reverse order, remove the feature with the lowest weight, and update the first frequency subset FS1;
[0076] 3.2, set the number of screening N2 = 400, repeat step 3.1 until the number of features in the first frequency subset FS1 is reduced to 400, retain the remaining features in the first frequency subset FS1, and generate the second frequency subset FS2, where FS2∈R220*400 .
[0077] The effect of step three is to further eliminate features in frequency subset FS1 that contribute less to the learning model, further reducing the dimensionality of FS1. After steps two and three, a large number of low-relevance and low-contribution features in the swept-frequency microwave dataset FS are eliminated, effectively streamlining the original feature space and improving the search efficiency of the HACO algorithm in the second stage.
[0078] In the second stage, based on the feature selection and evaluation method of the hybrid ant colony optimization (HACO) algorithm, PCC is used to calculate the correlation between features, and the mean square error of SVR is used to evaluate the entire candidate feature subset. Feature selection is performed from multiple aspects to improve the final quality of the feature subset. The specific process is as follows: Figure 3 shown.
[0079] Step 4: Use the 10-fold cross-validation method to divide the second frequency subset FS2. FS2 is divided into 10 parts, and 9 of them are combined as the training set. The remaining 1 is used as a test set There are 10 test sets in total and training set The division method, in which
[0080] Step 5: Use the HACO algorithm in the training set Perform feature selection on it to obtain the training subset Then in Screening and The same features in the test subset are obtained For the training subset and the test subset Take the union and generate the candidate frequency subset FS3;
[0081] In a specific implementation of the present invention, the main execution steps of the HACO algorithm described in step 3 are as follows:
[0082] 5.1, the test set As the target dataset, it is mapped into an undirected fully connected graph G, where each node represents a feature, and its specific form is:
[0083] G=(F,E)
[0084] Where F={F1,F2,…,F 400}, represents the set of all feature vectors in the target data set, E={(F i ,F j )|F i ,F j∈F}, represents the set of paths connecting any two nodes (features);
[0085] 5.2, Algorithm parameter initialization, set the number of selected features N f =70, the number of ants in the ant colony N a =20, the maximum number of ant colony iterations I max =100, initial pheromone concentration z0 = 1.0, pheromone weight α = 1.0, pheromone release coefficient e = 0.2, pheromone evaporation coefficient ρ = 0.2, heuristic factor weight β = 2.0;
[0086] 5.3, based on the Pearson correlation coefficient (PCC) theory, the similarity between feature vectors is calculated, and the inverse of the similarity is used as the inspiration factor η of the ant colony. The specific calculation formula is:
[0087]
[0088]
[0089] Among them, i,j=1,2,…,400 (i≠j), softmax is a normalization method used to amplify the differences between features. and Respectively represent the means of the i-th and j-th feature vectors in the target data set;
[0090] 5.4, Calculate the probability P of each feature being selected by the kth ant based on the state probability transition rule k , the specific formula is:
[0091]
[0092] in, Indicates the current selected feature F i The candidate feature set of the kth ant in the ant colony, F u Represents a set of candidate features Any candidate feature in τ j Represents feature F j , α and β represent the weights of pheromone and heuristic factors respectively;
[0093] 5.5, each candidate feature F calculated according to step 5.4 j The transition probability value P k , the roulette rule is used to determine the next feature selected by the kth ant;
[0094] 5.6, repeat steps 5.4-5.5 until the number of features visited by the kth ant reaches the preset number of features N f =70;
[0095] 5.7, repeat steps 5.4-5.6 until all ants in the ant colony have visited N f =70 features, generating N a = 20 candidate feature subsets
[0096] 5.8, based on the elite ant colony system theory, the pheromone value τ of each node (feature) is updated. The specific formula is:
[0097] τ i (t+1)=(1-ρ)τ i (t)+eΔτ i (t)
[0098]
[0099] Where: e and ρ represent the release and evaporation coefficients of pheromone, respectively, τ i (t) represents the characteristic F of the tth generation ant colony i The pheromone concentration, Δτ i (t) represents the tth generation of ant colony in the feature F i The pheromone value released on the associated path, I b represents the feature subset visited by the elite ant with the highest fitness in the t-th generation ant colony. The fitness function fitness is defined as the root mean square error (RMSE) of the prediction of the support vector machine (SVR) regression model constructed based on the feature subset. P ), taking the average of the 5-fold cross validation.
[0100] 5.9, repeat steps 5.4-5.8 until the number of population iterations t reaches 100, retain the feature subset visited by the ant with the highest fitness in the last generation of population, and generate the optimal frequency subset FS HACO ∈R 198*70 :
[0101] FS HACO ={F1,F2,…,F 70}
[0102] Among them, FS HACO Indicates the use of HACO algorithm in The training subset obtained by feature selection is recorded as
[0103] The effect of step 5 is based on the HACO algorithm to analyze the training set divided from the second frequency subset FS2 from the perspectives of feature correlation and feature subset quality. Perform further feature selection and combine with the corresponding test set Generate candidate frequency subset FS3. Step 6: Use the 10-fold cross validation method mentioned in step 4 and the HACO optimization algorithm mentioned in step 5 to perform feature selection on the second frequency subset FS2, and traverse all test subsets. and training subset The division method generates a set of 10 candidate frequency subsets
[0104] The effect of step six is to collect a set of 10 candidate frequency subsets obtained by performing feature selection on the 10 combinations of training subsets and test subsets divided in a cross-validation manner.
[0105] Step 7: Count each feature F in the second frequency subset FS2 j In the set of all candidate frequency subsets The cumulative number of times selected C(F j ), and then the cumulative selection times of each feature C(F j ) divided by the number of cross-validation 10 to obtain the cumulative selection probability P(F j );
[0106]
[0107]
[0108] Among them, k = 10, which represents the number of cross-validation folds, h i (F j ) is a binary label, if the feature F in the frequency subset FS2 j Candidate frequency subset Select, h i (F j ) is 1, otherwise it is 0.
[0109] The effect of step seven is to calculate the cumulative probability of each feature being selected in the second frequency subset FS2 based on the majority voting method, so as to reduce the uncertainty introduced to the feature selection results by the partitioning method of the data set.
[0110] Step 8: Use the threshold analysis method, set the threshold P0 = 0.5, and select the cumulative selection probability P(F j )≥0.5, forming the optimal frequency subset FS best , where FS best ∈R 220*10 .
[0111] The effect of step eight is to determine the optimal frequency subset FS based on the threshold analysis method. best .
[0112] Step 9: Use random forest, support vector machine regression, extreme gradient boosting and multi-layer perceptron algorithms based on the optimal frequency subset FS best The water content prediction model was established and the mean absolute error (MAE), root mean square error (RMSE) and coefficient of determination (R 2 )Evaluate the performance of the model on the test set, as shown in Table 1:
[0113] Table 1 Performance of four regression models on the test set
[0114]
[0115] As shown in Table 1, all four algorithms demonstrated ideal predictive performance on the frequency subsets obtained through feature selection using the method of the present invention. The coefficients of determination for all models exceeded 0.95, with the extreme gradient boosting model and the multilayer perceptron model achieving coefficients of determination exceeding 0.99. This demonstrates that the two-stage feature optimization method, which simplifies the feature space of the original dataset using filter-wrapper feature selection and then combines cross-validation and the HACO algorithm for further feature selection and evaluation, achieves ideal optimization results for swept-frequency microwave data, generating high-quality frequency subsets and rationally optimizing detection frequencies.
[0116] The above examples are merely specific embodiments of the present invention. Obviously, the present invention is not limited to the above examples, and many variations are possible. All variations that can be directly derived or imagined by a person skilled in the art from the disclosure of the present invention should be considered to be within the scope of protection of the present invention.
Claims
1. A two-stage feature optimization method for microwave sweep frequency data based on a hybrid ant colony algorithm, characterized in that: include: (1) Use a swept-frequency microwave device to detect the samples to be tested, and mark the moisture content label values of all samples to obtain a swept-frequency microwave dataset FS; The first stage is feature space reduction based on filter-embedded feature selection, which includes: (2) Using the maximum information coefficient evaluation method to perform filter feature selection on the obtained swept frequency microwave data set FS, the first frequency subset FS1 is generated; (3) Using the ridge regression-recursive feature elimination algorithm, wrapper feature selection is performed on the first frequency subset FS1 to generate the second frequency subset FS2; The second stage is feature selection and evaluation based on the hybrid ant colony optimization algorithm, including: (4) Use the k-fold cross-validation method to divide the second frequency subset FS2. FS2 is divided into k parts on average, and k-1 parts are combined as the training set. The remaining 1 is used as a test set There are k types of training sets and test set The division method; (5) Using hybrid ant colony optimization algorithm in the training set Perform feature selection on it to obtain the training subset Then in the test set Screening and training subsets The same features get the test subset For the training subset and the test subset Take the union and generate the candidate frequency subset FS3; (6) Using the k-fold cross validation method described in step (4) and the hybrid ant colony optimization algorithm described in step (5) to perform feature selection on the second frequency subset FS2, traversing k training sets and test set The partitioning method generates a set of k candidate frequency subsets in represents the i-th candidate frequency subset; (7) Count each feature in the second frequency subset FS2 in all candidate frequency subset sets The cumulative number of times selected C(F j ), and then the cumulative selection times of each feature C(F j ) divided by the number of cross-validation k to obtain the cumulative selection probability P(F j ); (8) Using the threshold analysis method, select the cumulative selection probability P(F j )≥P0 features, forming the optimal frequency subset FS best As the result of feature optimization; where P0 is the threshold.
2. The two-stage feature optimization method for microwave frequency sweep data based on hybrid ant colony algorithm according to claim 1, characterized in that: The swept frequency microwave data set FS obtained in step (1) is expressed as: FS={(f t ,y t )|t=1,2,…,m} Among them, f t ={f t1 ,f t2 ,…,f tn } represents the feature vector of the tth sample, y t represents the moisture content label of the t-th sample, n represents the number of initial features, and each initial feature is numbered. The initial feature number set is recorded as L0 = {1, 2, ..., n}; m represents the number of samples, f tn represents the nth eigenvalue of the tth sample, where the eigenvalue is a microwave attenuation value or a microwave phase shift value.
3. The two-stage feature optimization method for microwave sweep frequency data based on hybrid ant colony algorithm according to claim 1, characterized in that: The step (2) is specifically as follows: (2.1) Calculate the single eigenvector F in the swept frequency microwave dataset FS based on the maximum information coefficient theory j The maximum information coefficient A between the moisture content label of the sample j , the specific calculation formula is: A j =MIC(F j ;Y),j∈L0 Among them, F j ={f 1j ,f 2j ,…,f mj } represents the jth eigenvector, f mj represents the jth eigenvalue of the mth sample, Y={y1,y2,…,y m } represents the sample label set, y m represents the label of the mth sample, L0 represents the initial feature sequence number set; (2.2) Set the number of screening to N1, and sort the numbers corresponding to all eigenvectors in the swept frequency microwave data set FS in reverse order according to the maximum information coefficient calculated in step (2.1), retain the N1 eigenvectors with the highest number, and generate the first frequency subset L1 represents a set of feature sequence numbers in the first frequency subset FS1.
4. The two-stage feature optimization method for microwave frequency sweep data based on hybrid ant colony algorithm according to claim 1, characterized in that: The step (3) is specifically as follows: (3.1) The ridge regression algorithm is used to train the sample moisture content prediction model based on the first frequency subset FS1 to obtain the weight ω corresponding to each feature j , according to ω j Arrange all the feature vectors in the first frequency subset FS1 in reverse order, remove the feature with the lowest weight, and update the first frequency subset FS1; (3.2) Set the number of screening to N2, repeat step (3.1) until the number of features in the first frequency subset FS1 reaches the preset number of features N2, retain the remaining features in the first frequency subset FS1, and generate the second frequency subset L2 represents a set of feature sequence numbers in the second frequency subset FS2.
5. The two-stage feature optimization method for microwave frequency sweep data based on hybrid ant colony algorithm according to claim 1, characterized in that: The step (5) is specifically as follows: (5.1) The training set obtained by dividing the second frequency subset FS2 in step (4) For the target dataset, map the target dataset into an undirected fully connected graph G, where each node represents a feature. The specific form is: G=(F,E) in, represents the set of all feature vectors in the target data set, N2 represents the number of features in the target data set, m1 represents the number of samples in the target data set, E={(F i ,F j )|F i ,F j ∈F,i≠j} represents the path connecting any two nodes, F i ,F j denote the i-th eigenvector and the j-th eigenvector respectively; (5.2) Initialization of algorithm parameters, including the number of selected features N f , the number of ants in the ant colony N a , the maximum number of ant colony iterations I max , initial pheromone concentration τ0, pheromone weight α, pheromone release coefficient e, pheromone evaporation coefficient ρ, heuristic factor weight β; (5.3) Based on the Pearson correlation coefficient theory, the similarity between feature vectors is calculated, and the inverse of the similarity is used as the inspiration factor η of the ant colony. The specific calculation formula is: Among them, i,j∈L2 and i≠j, represents the mean of the i-th feature of all samples in the target dataset, f ti represents the i-th eigenvalue of the t-th sample in the target data set, ∑ t It means to traverse all samples in the target data set and sum them up. Sim(.,.) means the similarity between two feature vectors in the target data set. (5.4) Calculate the probability P of each feature being selected by the kth ant based on the state probability transition rule k , the specific formula is: in, Indicates the current selected feature F i The candidate feature set of the kth ant in the ant colony, F u Represents a set of candidate features Any candidate feature in τ j Represents feature F j , α and β represent the weights of pheromone and heuristic factors respectively; (5.5) Each candidate feature F calculated according to step (5.4) j The transition probability value P k , the roulette rule is used to determine the next feature selected by the kth ant; (5.6) Repeat steps (5.4)-(5.5) until the number of features visited by the kth ant reaches the preset number of features N. f ; (5.7) Repeat steps (5.4)-(5.6) until all ants in the ant colony have visited N f features, generate N a Candidate feature subsets L3 represents the feature sequence number set in the candidate feature subset S′; (5.8) Based on the elite ant colony system theory, the pheromone value τ of each node is updated. The specific formula is: t i (t+1)=(1-ρ)τ i (t)+eΔτ i (t) Where: e and ρ represent the release and evaporation coefficients of pheromone, respectively, τ i (t) represents the characteristic F of the tth generation ant colony i The pheromone concentration, Δτ i (t) represents the tth generation of ant colony in the feature F i The pheromone value released on the associated path, I b represents the feature subset visited by the elite ant with the highest fitness in the t-th generation ant colony, and fitness represents the fitness function; (5.9) Repeat steps (5.4)-(5.8) until the number of population iterations reaches the maximum number of iterations I max , retain the feature subset with the highest fitness and generate the optimal frequency subset FS HACO : Among them, FS HACO Represents the frequency subset obtained by feature selection using the HACO algorithm, recorded as the training subset L4 represents the optimal frequency subset FS HACO The set of feature numbers in ; (5.10) In the test set Screening and training subsets Features with the same feature number get the test subset For the training subset and the test subset Take the union and generate the candidate frequency subset FS3.
6. The two-stage feature optimization method for microwave frequency sweep data based on hybrid ant colony algorithm according to claim 1, characterized in that: The cumulative number of times C(F j ) and the cumulative selection probability P(F j ) is calculated as: Among them, k represents the number of cross-validation folds, h i (F j ) is a binary label, if the feature F in the frequency subset FS2 j The i-th candidate frequency subset Select, h i (F j ) is 1, otherwise it is 0.
Citation Information
Patent Citations
Apparatus and method for determining a value of a property of a material using microwave
CN105247353A
Moisture meter
JP2000097879A