A feature pattern generation and collaborative optimization method for near infrared spectroscopy modeling

Through the preprocessing of near-infrared spectral data and the use of generative adversarial networks, combined with the cross-adaptive attention mechanism and discrete particle swarm optimization technology, the optimal minimum feature mode set is constructed and a collaborative optimization model is built, solving the problem of dimensional disasters and nonlinear relationships in the processing of near-infrared spectral data in the existing technology, and significantly improving the accuracy of material component content analysis.

CN119415934BActive Publication Date: 2025-03-18ANHUI AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510028071.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-03-18
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

The prior art faces dimensional disaster problems and difficulty in capturing nonlinear relationships in near-infrared spectral data processing and analysis, and lacks flexibility and integrated optimization of feature extraction and model construction, which limits the improvement of model accuracy.

Method used

By acquiring the near-infrared spectral data of the sample, preprocessing and converting it into two-dimensional structural data, using the generative adversarial network to generate more data, combining the cross-adaptive attention mechanism and discrete particle swarm optimization technology, the best and minimum feature mode set is built, and a collaborative optimization model is built.

Benefits of technology

It significantly improves the accuracy of near-infrared spectral modeling in the analysis of material composition content, enhances the visualization and interpretability of data, and reduces the impact on the model due to the small sample size.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415934B_ABST
    Figure CN119415934B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of near-infrared spectral modeling and analysis, and provides a method for generating and co-optimizing feature patterns of near-infrared spectral modeling, including: obtaining sample near-infrared spectral data and performing preprocessing operations, using a conversion method to convert one-dimensional near-infrared spectral data into two-dimensional structural data; on the basis of the existing two-dimensional structural data, using a generation technology to generate more two-dimensional structural data; for different feature patterns, using different neural networks to extract deep features, and using a cross-adaptive attention mechanism and a feature co-construction method to construct an optimal minimum feature pattern set; building a model based on the optimal minimum feature pattern set, and using a co-optimization loss function to optimize the model, and finally achieving efficient modeling and accurate analysis of near-infrared spectral data. The present invention significantly improves the accuracy of near-infrared spectral modeling in material component content analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of near-infrared spectral modeling and analysis, and in particular relates to a feature pattern generation and collaborative optimization method for near-infrared spectral modeling. Background Art

[0002] In the field of chemometrics, near-infrared spectroscopy has been widely studied and applied due to its unique advantages.

[0003] Near-infrared spectroscopy is based on the selective absorption of light in the near-infrared region by a substance, and can obtain information about the composition and structure of a substance. Near-infrared spectroscopy has been widely used in the food, agriculture, and pharmaceutical industries due to its advantages such as rapidity and non-destructive testing. Near-infrared spectroscopy can provide rich chemical and physical information and is an important tool for analyzing the composition of a substance.

[0004] However, in the existing technology, the processing and analysis of near-infrared spectral data usually relies on statistical methods or traditional machine learning algorithms, which may face the dimensionality curse problem when processing high-dimensional data and have difficulty capturing nonlinear relationships in the data. In addition, the existing technology lacks sufficient flexibility and integrated optimization in feature extraction and model construction, which limits the improvement of model accuracy. Summary of the invention

[0005] The purpose of an embodiment of the present invention is to provide a feature pattern generation and collaborative optimization method for near-infrared spectral modeling. This method obtains near-infrared spectral data of a sample and obtains more feature patterns through data processing, which to a certain extent solves the problem of small sample size. The method further utilizes collaborative optimization technology to construct an optimal minimum feature pattern set, build a collaborative optimization model, and achieve accurate analysis of the content of material components.

[0006] To achieve the above object, the present invention provides the following technical solutions.

[0007] The embodiment of the present invention provides a method for generating and co-optimizing a characteristic pattern of near infrared spectroscopy modeling, comprising the following steps:

[0008] Preprocessing the acquired sample near-infrared spectrum data, and converting the preprocessed one-dimensional near-infrared spectrum data into two-dimensional structure data;

[0009] Based on the existing two-dimensional structure data, more two-dimensional structure data is generated using a generation algorithm based on a generative adversarial network;

[0010] The deep features of two-dimensional structure data are extracted using a neural network that matches the feature pattern, and a cross-adaptive attention mechanism is used to generate a new feature pattern set;

[0011] Based on the existing different feature pattern sets, the optimal minimum feature pattern set is constructed using the feature collaborative construction method based on discrete particle swarm optimization BPSO;

[0012] A neural network is constructed according to the optimal minimum feature pattern set, and a model is built. The feature pattern set is input into the built model, and the model is optimized using a collaborative optimization loss function to obtain an analysis model for analyzing the composition of the target substance.

[0013] Furthermore, the step of generating more two-dimensional structure data using a generative algorithm based on a generative adversarial network includes:

[0014] The two-dimensional structural data converted from the one-dimensional near-infrared spectral data are expressed as , n random vectors are sampled from the standard normal distribution N (0, 1), and the random vector set is expressed as , these random vectors Z are input to the generator, and the generator outputs a data with the same size as the input ;

[0015] The real data sample and generate samples The input is sent to the discriminator, which outputs a probability value indicating that the generated sample belongs to the real data; if the output is close to 1, the discriminator believes that the generated sample is real; if the output is close to 0, it is considered to be generated;

[0016] As training progresses, the performance of the discriminator and generator will gradually improve until a balance point is reached, at which point the generator generates images that are highly similar to real samples, generating two-dimensional structured data.

[0017] Furthermore, the loss function of the generative model in the generator is expressed as:

[0018] ;

[0019] where z is from the prior distribution A randomly generated noise vector is is the data generated by the generator, It is the judgment of the discriminator on the generated data, and outputs a value between 0 and 1, indicating the probability that the data is real data;

[0020] The loss function for the generative model is used to maximize , which maximizes the probability that the feature pattern generated by the discriminator is judged as a true feature pattern, thereby generating a more realistic feature pattern.

[0021] Furthermore, the loss function of the discriminant model in the discriminator is expressed as:

[0022] ;

[0023] Where x is derived from the real data distribution The real data sampled in It is the discriminator's judgment on the real data, and outputs a value between 0 and 1, indicating the probability that the data is real data. is the characteristic pattern generated by the generator, is the judgment of the discriminator on the generated feature pattern, and E represents the expected value, which is used to average all possible x and z;

[0024] The discriminant model loss function is used to minimize , improving the ability of the discriminant model to distinguish between real feature patterns and generated feature patterns.

[0025] Furthermore, in the cross-adaptive attention mechanism, the query vector Q1 is set to be a one-dimensional near-infrared spectral feature pattern ; The query vector Q2 represents the information expected from the data; the key vector K represents the image feature pattern , reveals the information contained in the data; the value vector V represents the generated image pattern, which represents the expected output result;

[0026] During the calculation process, the similarity between the query vector and each key vector is first calculated; the dot product formula for calculating the similarity between the query vector and each key vector is as follows:

[0027] ;

[0028] Among them, Query represents the vector of information that is expected to be retrieved or matched from the data. is a vector representing the characteristics or attributes of an element in a data set. is the dimension of the key vector, i.e., the key vector The number of elements in ;

[0029] Next, the obtained similarity is converted into a probability distribution through the Softmax function. The calculation formula is as follows:

[0030] ;

[0031] in, Represents the attention weight corresponding to the i-th key vector; represents the similarity between the query vector and the i-th key vector; Lx represents the number of original generated image patterns;

[0032] Then, each value vector is multiplied by its corresponding weight and all the results are added together to obtain the final generated image pattern. , the calculation formula is as follows:

[0033] ;

[0034] Among them, Source represents the original generated image pattern obtained before the self-attention mechanism is executed; is the attention weight corresponding to the original image feature pattern converted by the Softmax function, and the value vector represents each original generated image mode; Lx represents the number of original generated image modes.

[0035] Furthermore, the step of constructing the optimal minimum feature pattern set using the feature collaborative construction method based on discrete particle swarm optimization BPSO includes:

[0036] The different sets of deep feature patterns extracted by the neural network are expressed as:

[0037] ;

[0038] In the initialization stage of the BPSO algorithm, a variety of deep feature pattern sets extracted by the deep neural network are encoded and represented. Represent a potential feature subset in the feature space and calculate its fitness based on the performance of the feature subset on the model task;

[0039] Update the particle's velocity and position. The formula for updating the particle's velocity is as follows:

[0040] ;

[0041] in, is the velocity of particle i at time t, is the position of particle i at time t, w is the inertia weight, which gradually changes from Reduce to , θ is a random number in the interval [0,1],

[0042] is the individual optimal position of particle i, gbest is the global optimal position, and They are individual learning factor and social learning factor;

[0043] The formula for updating the particle position is as follows:

[0044] ;

[0045] in, represents the velocity of particle i at time t+1, represents the position of particle i at time t, represents the position of particle i at time t+1;

[0046] After the position is updated, the particle speed needs to be limited to ensure that it does not exceed the preset maximum speed , to avoid particles from jumping too much in the search space and losing the precision of the search;

[0047] Iterate the search by repeating the above steps until the preset maximum number of iterations T is reached;

[0048] In each iteration, particles dynamically adjust their search strategies based on their own and the group's historical optimal experience, in order to find the best balance between global search and local search;

[0049] After multiple iterations, the algorithm will converge to the optimal solution. At this time, the global optimal position gbest represents the minimum feature pattern set that performs best on the model task.

[0050] Furthermore, in the step of optimizing the model using the collaborative optimization loss function, an objective function is defined to minimize the model error. Considering the effect of feature fusion, the calculation formula of the collaborative optimization loss function is as follows:

[0051] ;

[0052] Among them, Y is the true value, is the model output value, α is the ratio of one-dimensional feature pattern to the best minimum feature pattern set, β is the ratio of original two-dimensional feature pattern to the best minimum feature pattern set, γ is the ratio of generated two-dimensional feature pattern to the best minimum feature pattern set, and λ is the trade-off parameter.

[0053] Compared with the prior art, the characteristic pattern generation and collaborative optimization method of near infrared spectroscopy modeling of the present invention has the following beneficial effects:

[0054] First, the present invention converts the one-dimensional near-infrared feature pattern into a two-dimensional feature pattern, and uses a generative adversarial network to obtain more available data based on the two-dimensional feature pattern, which reduces the impact of the small sample size on the model to a certain extent, enhances the visualization and interpretability of the data, and provides a new perspective for the use of deep learning models to analyze the content of material components;

[0055] Second, the present invention integrates the cross-adaptive attention mechanism and collaborative optimization technology, constructs the optimal minimum feature pattern set, and builds a collaborative optimization model, which significantly improves the accuracy of near-infrared spectroscopy modeling in the analysis of material component content. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention.

[0057] Figure 1 A schematic diagram of the implementation flow of a feature pattern generation and collaborative optimization method for near infrared spectroscopy modeling according to the present invention;

[0058] Figure 2 A logic flow chart of a characteristic pattern generation and collaborative optimization method for near infrared spectroscopy modeling of the present invention;

[0059] Figure 3 The present invention provides a logical structure block diagram of a feature pattern generation and collaborative optimization method for near-infrared spectral modeling. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0061] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.

[0062] Please refer to Figure 1 In an embodiment of the present invention, a method for generating and co-optimizing a feature pattern of near infrared spectroscopy modeling is provided, comprising the following steps:

[0063] S101, preprocessing the acquired sample near-infrared spectrum data, and converting the preprocessed one-dimensional near-infrared spectrum data into two-dimensional structure data;

[0064] Among them, in the operation of preprocessing the near-infrared spectral data of the sample in the present invention, multi-source scattering correction processing is performed on the near-infrared spectral data, the purpose of which is to eliminate the spectral differences between samples caused by different scattering levels and improve the accuracy and consistency of the spectral data; Gram angle field conversion is performed on the one-dimensional near-infrared spectral data, the purpose of which is to improve the analyzability and utilization of the data.

[0065] It should be noted that the preprocessing method selected in the embodiment of the present invention is only one of a variety of optional methods. The preprocessing operation can also select baseline correction, normalization, standard normal transformation and other preprocessing methods, and the one-dimensional near-infrared spectrum conversion method can also select Markov transition field conversion method, recursive graph conversion method, graphic difference field conversion method and other methods. This example should not be regarded as covering all possible preprocessing techniques, but rather provides a specific implementation method.

[0066] S102, based on the existing two-dimensional structure data, using a generation algorithm based on a generative adversarial network to generate more two-dimensional structure data;

[0067] S103, extracting deep features from the two-dimensional structure data using a neural network that matches the feature pattern, and using a cross-adaptive attention mechanism to generate a new feature pattern set;

[0068] S104, based on the existing different feature pattern sets, constructing the optimal minimum feature pattern set by using the feature collaborative construction method based on discrete particle swarm optimization BPSO;

[0069] S105, constructing a neural network according to the optimal minimum feature pattern set, and building a model, inputting the feature pattern set into the built model, optimizing the model using a collaborative optimization loss function, and obtaining an analysis model for target substance component analysis.

[0070] Furthermore, in step S102 of the present invention, the step of generating more two-dimensional structure data using a generation algorithm based on a generative adversarial network includes:

[0071] The two-dimensional structural data converted from the one-dimensional near-infrared spectral data are expressed as , n random vectors are sampled from the standard normal distribution N (0, 1), and the random vector set is expressed as , these random vectors Z are input to the generator, and the generator outputs a data with the same size as the input ;

[0072] The real data sample and generate samples The input is sent to the discriminator, which outputs a probability value indicating that the generated sample belongs to the real data; if the output is close to 1, the discriminator believes that the generated sample is real; if the output is close to 0, it is considered to be generated;

[0073] As training progresses, the performance of the discriminator and generator will gradually improve until a balance point is reached, at which point the generator generates images that are highly similar to real samples, generating two-dimensional structured data.

[0074] The loss function of the generative model in the generator is expressed as:

[0075] ;

[0076] where z is from the prior distribution A randomly generated noise vector is is the data generated by the generator, It is the judgment of the discriminator on the generated data, and outputs a value between 0 and 1, indicating the probability that the data is real data;

[0077] The loss function for the generative model is used to maximize , which maximizes the probability that the feature pattern generated by the discriminator is judged as a true feature pattern, thereby generating a more realistic feature pattern.

[0078] The loss function of the discriminant model in the discriminator is expressed as:

[0079] ;

[0080] Where x is derived from the real data distribution The real data sampled in It is the discriminator's judgment on the real data, and outputs a value between 0 and 1, indicating the probability that the data is real data. is the characteristic pattern generated by the generator, is the judgment of the discriminator on the generated feature pattern, and E represents the expected value, which is used to average all possible x and z;

[0081] The discriminant model loss function is used to minimize , improving the ability of the discriminant model to distinguish between real feature patterns and generated feature patterns.

[0082] In step S103 of the present invention, as an example, Vision Transformer is used to extract two-dimensional feature patterns and generated two-dimensional feature pattern deep features, and CNN-LSTM is used to extract one-dimensional feature pattern deep features. Based on the existing one-dimensional feature pattern deep features and two-dimensional feature pattern deep features, a cross-adaptive attention mechanism is used to transform the generated two-dimensional feature pattern deep features to obtain the final generated two-dimensional feature pattern deep feature set.

[0083] It should be noted that the deep feature extraction models of different feature modes selected in this example are targeted at the characteristics of spectral data, and other models can be replaced according to personal needs.

[0084] Furthermore, in the cross-adaptive attention mechanism, the query vector Q1 is set to be a one-dimensional near-infrared spectral feature pattern ; The query vector Q2 represents the information expected from the data; the key vector K represents the image feature pattern , reveals the information contained in the data; the value vector V represents the generated image pattern, which represents the expected output result;

[0085] During the calculation process, the similarity between the query vector and each key vector is first calculated; the dot product formula for calculating the similarity between the query vector and each key vector is as follows:

[0086] ;

[0087] Among them, Query represents the vector of information that is expected to be retrieved or matched from the data. is a vector representing the characteristics or attributes of an element in a data set. is the dimension of the key vector, i.e., the key vector The number of elements in ;

[0088] Next, the obtained similarity is converted into a probability distribution through the Softmax function. The calculation formula is as follows:

[0089] ;

[0090] in, Represents the attention weight corresponding to the i-th key vector; represents the similarity between the query vector and the i-th key vector; Lx represents the number of original generated image patterns;

[0091] Then, each value vector is multiplied by its corresponding weight and all the results are added together to obtain the final generated image pattern. , the calculation formula is as follows:

[0092] ;

[0093] Among them, Source represents the original generated image pattern obtained before the self-attention mechanism is executed; is the attention weight corresponding to the original image feature pattern converted by the Softmax function, and the value vector represents each original generated image mode; Lx represents the number of original generated image modes.

[0094] The present invention selects discrete particle swarm optimization as a feature collaborative construction method, wherein the step of constructing an optimal minimum feature pattern set using the feature collaborative construction method based on discrete particle swarm optimization BPSO includes:

[0095] The different sets of deep feature patterns extracted by the neural network are expressed as:

[0096] ;

[0097] In the initialization stage of the BPSO algorithm, a variety of deep feature pattern sets extracted by the deep neural network are encoded and represented. Represent a potential feature subset in the feature space, and calculate its fitness based on the performance of the feature subset on the model task; as a specific implementation method, the mean square error is selected as the evaluation indicator of model performance;

[0098] It should be noted that the model evaluation indicator selected in this example is only one of the multiple optional evaluation indicators. Model evaluation indicators can also be selected from mean absolute error, determination coefficient, etc.

[0099] Update the particle's velocity and position. The formula for updating the particle's velocity is as follows:

[0100] ;

[0101] in, is the velocity of particle i at time t, is the position of particle i at time t, w is the inertia weight, which gradually changes from Reduce to , θ is a random number in the interval [0,1],

[0102] is the individual optimal position of particle i, gbest is the global optimal position, and They are individual learning factor and social learning factor;

[0103] As an example, setting the maximum value of the inertia weight Set the minimum value of inertia weight to 0.9 is 0.4;

[0104] The formula for updating the particle position is as follows:

[0105] ;

[0106] in, represents the velocity of particle i at time t+1, represents the position of particle i at time t, represents the position of particle i at time t+1;

[0107] After the position is updated, the particle speed needs to be limited to ensure that it does not exceed the preset maximum speed , to avoid particles from jumping too much in the search space and losing the precision of the search;

[0108] Iterate the search by repeating the above steps until the preset maximum number of iterations T is reached;

[0109] In each iteration, the update formula of the inertia weight is expressed as:

[0110] ;

[0111] Particles dynamically adjust their search strategies based on their own and the group's historical optimal experience, in order to find the best balance between global search and local search;

[0112] After multiple iterations, the algorithm will converge to the optimal solution. At this time, the global optimal position gbest represents the minimum feature pattern set that performs best on the model task.

[0113] In step S105 of the present invention, as an example, a fully connected layer is built according to the existing sample feature pattern set, the Adam optimizer is used, the loss function adopts MSELoss, the number of training rounds is set to 50 rounds, and the learning rate is set to 0.001.

[0114] The feature collaborative construction technology selected in this example can also select methods such as genetic algorithm, hierarchical analysis method, etc. This example should not be regarded as covering all possible feature collaborative construction technologies, but rather provides a specific implementation method.

[0115] Furthermore, in the step of optimizing the model using the collaborative optimization loss function, an objective function is defined to minimize the model error. Considering the effect of feature fusion, the calculation formula of the collaborative optimization loss function is as follows:

[0116] ;

[0117] Among them, Y is the true value, is the model output value, α is the ratio of one-dimensional feature pattern to the best minimum feature pattern set, β is the ratio of original two-dimensional feature pattern to the best minimum feature pattern set, γ is the ratio of generated two-dimensional feature pattern to the best minimum feature pattern set, and λ is the trade-off parameter.

[0118] In summary, the present invention converts a one-dimensional near-infrared feature pattern into a two-dimensional feature pattern, and uses a generative adversarial network based on the two-dimensional feature pattern to obtain more available data, which reduces the impact of the small sample size on the model to a certain extent, enhances the visualization and interpretability of the data, and provides a new perspective for using deep learning models to analyze the content of material components; the present invention integrates the cross-adaptive attention mechanism and collaborative optimization technology, constructs the optimal minimum feature pattern set, and builds a collaborative optimization model, which significantly improves the accuracy of near-infrared spectroscopy modeling in material component content analysis.

[0119] Please refer to Figure 3In the embodiment of the present invention, the multi-source data processing module is used to obtain the near-infrared spectral data of the sample and pre-process the data, including near-infrared spectral data pre-processing and generation of different feature patterns; the feature collaborative construction module is used to use the cross-adaptive attention mechanism and discrete particle swarm algorithm to iteratively construct the best minimum feature pattern set; the collaborative optimization modeling module is used to build a model based on the existing best minimum feature pattern set, continuously improve the model accuracy in the iterative collaborative optimization process, and output the corresponding material component content analysis results.

[0120] Although the embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and the embodiments. It can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily realized. Therefore, without departing from the general concept defined by the claims and equivalent scope, the present invention is not limited to the specific details and the illustrations shown and described here.

Claims

1. A method for generating and co-optimizing feature patterns for near infrared spectroscopy modeling, characterized in that: The following steps are involved: Preprocessing the acquired sample near-infrared spectrum data, and converting the preprocessed one-dimensional near-infrared spectrum data into two-dimensional structure data; Based on the existing two-dimensional structure data, more two-dimensional structure data is generated using a generation algorithm based on a generative adversarial network; The deep features of two-dimensional structure data are extracted using a neural network that matches the feature pattern, and a cross-adaptive attention mechanism is used to generate a new feature pattern set; Based on the existing different feature pattern sets, the optimal minimum feature pattern set is constructed using the feature collaborative construction method based on discrete particle swarm optimization BPSO; Constructing a neural network according to the optimal minimum feature pattern set, building a model, inputting the feature pattern set into the built model, optimizing the model using a collaborative optimization loss function, and obtaining an analysis model for target substance component analysis; In the cross-adaptive attention mechanism, the query vector Q1 is set to be a one-dimensional near-infrared spectral feature pattern ; The query vector Q2 represents the information expected from the data; the key vector K represents the image feature pattern , reveals the information contained in the data; the value vector V represents the generated image pattern, which is the expected output result; During the calculation process, the similarity between the query vector and each key vector is first calculated; the dot product formula for calculating the similarity between the query vector and each key vector is as follows: ; Among them, Query represents the vector of information that is expected to be retrieved or matched from the data. It is a vector representing the characteristics or attributes of an element in the data set; is the dimension of the key vector, i.e., the key vector The number of elements in ; Next, the obtained similarity is converted into a probability distribution through the Softmax function. The calculation formula is as follows: ; in, Represents the attention weight corresponding to the i-th key vector; represents the similarity between the query vector and the i-th key vector; Lx represents the number of original generated image patterns; Then, each value vector is multiplied by its corresponding weight and all the results are added together to obtain the final generated image pattern. , the calculation formula is as follows: ; Among them, Source represents the original generated image pattern obtained before the self-attention mechanism is executed; is the attention weight corresponding to the original image feature pattern converted by the Softmax function, and the value vector represents each original generated image mode; Lx represents the number of original generated image modes.

2. The method for generating characteristic patterns and co-optimizing near infrared spectroscopy modeling according to claim 1, characterized in that: The step of generating more two-dimensional structure data using a generation algorithm based on a generative adversarial network includes: The two-dimensional structural data converted from the one-dimensional near-infrared spectral data are expressed as , n random vectors are sampled from the standard normal distribution N (0, 1), and the random vector set is expressed as , these random vectors Z are input to the generator, and the generator outputs a data with the same size as the input ; The real data sample and generate samples The input is sent to the discriminator, which outputs a probability value indicating that the generated sample belongs to real data; if the output is close to 1, the discriminator believes that the generated sample is real; if the output is close to 0, it is considered to be generated; As the training progresses, the performance of the discriminator and the generator reaches a balance point, at which point the generator generates images that are highly similar to real samples, generating two-dimensional structured data.

3. The method for generating characteristic patterns and co-optimizing near infrared spectroscopy modeling according to claim 2, characterized in that: The loss function of the generative model in the generator is expressed as: ; where z is from the prior distribution A randomly generated noise vector is is the data generated by the generator, It is the judgment of the discriminator on the generated data, and outputs a value between 0 and 1 to indicate the probability that the data is real data; The loss function for the generative model is used to maximize , so as to maximize the probability that the feature pattern generated by the discriminator is judged as the true feature pattern.

4. The method for generating characteristic patterns and co-optimizing near infrared spectroscopy modeling according to claim 3, characterized in that: The loss function of the discriminant model in the discriminator is expressed as: ; Where x is derived from the real data distribution The real data sampled in It is the discriminator's judgment on the real data, and outputs a value between 0 and 1 to indicate the probability that the data is real data. is the characteristic pattern generated by the generator, is the judgment of the discriminator on the generated feature pattern, and E represents the expected value, which is used to average all possible x and z; The discriminant model loss function is used to minimize .

5. The method for generating characteristic patterns and co-optimizing near infrared spectroscopy modeling according to claim 4, characterized in that: The step of constructing the optimal minimum feature pattern set using the feature collaborative construction method based on discrete particle swarm optimization BPSO includes: The different sets of deep feature patterns extracted by the neural network are expressed as: ; In the initialization stage of the BPSO algorithm, a variety of deep feature pattern sets extracted by the deep neural network are encoded and represented. Represent a potential feature subset in the feature space and calculate its fitness based on the performance of the feature subset on the model task; Update the particle's velocity and position. The formula for updating the particle's velocity is as follows: ; in, is the velocity of particle i at time t, is the position of particle i at time t, w is the inertia weight, which gradually changes from Reduce to , θ is a random number in the interval [0,1], is the individual optimal position of particle i, gbest is the global optimal position, and They are individual learning factor and social learning factor; The formula for updating the particle position is as follows: ; in, represents the velocity of particle i at time t+1, represents the position of particle i at time t, represents the position of particle i at time t+1; After the position is updated, the particle speed needs to be limited to ensure that it does not exceed the preset maximum speed ; Iterate the search by repeating the above steps until the preset maximum number of iterations T is reached; In each iteration, particles dynamically adjust their search strategies based on their own and the group's historical optimal experience, in order to find the best balance between global search and local search; After multiple iterations, the algorithm will converge to the optimal solution. At this time, the global optimal position gbest represents the minimum feature pattern set that performs best on the model task.

6. The method for generating characteristic patterns and co-optimizing near infrared spectroscopy modeling according to claim 5, characterized in that: In the step of optimizing the model using the collaborative optimization loss function, an objective function is defined to minimize the model error. Considering the effect of feature fusion, the calculation formula of the collaborative optimization loss function is as follows: ; Among them, Y is the true value, is the model output value, α is the ratio of one-dimensional feature pattern to the best minimum feature pattern set, β is the ratio of original two-dimensional feature pattern to the best minimum feature pattern set, γ is the ratio of generated two-dimensional feature pattern to the best minimum feature pattern set, and λ is the trade-off parameter.

Citation Information

Patent Citations

  • Near-infrared quantitative model construction method and device and storage medium

    CN116434870A

  • Textile component quantitative characterization method based on multilayer one-dimensional CNN (Convolutional Neural Network) deep network

    CN117524340A