Spectrum prediction analysis model autonomous construction method and system
Through autonomous selection of modeling variables and pruning strategies, and combining genetic programming to establish a tree network model, the performance degradation of existing spectral analysis models under small sample high-dimensional feature data is solved, and higher prediction accuracy and model diversity is achieved sex.
Patent Information
- Application Number
- CN202411208043.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
AI Technical Summary
Existing spectral analysis models are difficult to establish reliable models when processing small sample high-dimensional feature data, and the curing of the model structure leads to performance degradation.
Administrative selection of modeling variables is used to explore different model structures and eliminate redundant model branches through pruning strategies, and establish a tree network model in combination with genetic programming, and adaptively adjust the maximum tree depth to improve model generalization performance.
It effectively improves the prediction accuracy and diversity of the spectral prediction analysis model, avoids redundant structure, and improves the generalization performance of the model.
Smart Images

Figure CN119089932A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spectral modeling and analysis, and in particular to a method and system for autonomously constructing a spectral prediction and analysis model. Background Art
[0002] Spectral analysis technology based on the spectral characterization of substances has been widely used in the fields of petrochemicals, medicine, agriculture, forestry, and food, and plays an important role in raw material property detection, production process indicator monitoring, prohibited items and food quality analysis. By collecting and analyzing the spectral data and property data of substances, and combining chemometric methods to establish qualitative or quantitative prediction models, rapid and accurate analysis of corresponding indicators can be achieved. In the process of spectral analysis, with the widespread application of high-resolution spectroscopic instruments and the limitations of sampling conditions in actual production processes, the collected spectral data usually have small sample high-dimensional characteristics, which makes it difficult for existing methods to establish reliable spectral prediction and analysis models. In addition, the ubiquitous problem of model structure solidification further reduces the performance of the model. Summary of the invention
[0003] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or critical elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.
[0004] The purpose of the present invention is to solve the above-mentioned problems and provide a method and system for autonomously constructing a spectral prediction and analysis model. By autonomously selecting modeling variables and exploring different model structures, a pruning strategy is adopted to remove redundant model branches, thereby effectively improving the generalization performance of the model.
[0005] The technical solution of the present invention is: the present invention discloses a method for autonomously constructing a spectral prediction and analysis model, the method comprising:
[0006] Step S1, construct an analysis data set and randomly divide it into a training set and a test set;
[0007] Step S2: using the training set data to establish a partial least squares model, selecting initial variables according to the importance of regression coefficients, and adaptively adjusting the maximum tree depth according to the number of initial variables;
[0008] Step S3, randomly generating an initial population according to the function set and the terminal set of the tree network;
[0009] Step S4, calculating the error reduction rate of the tree network subtree and pruning it, and calculating the fitness of the tree individuals after pruning;
[0010] Step S5: select, crossover and mutate individuals according to the individual fitness of the population and preset parameters, re-evaluate the individual fitness and update the optimal individual;
[0011] Step S6: Apply the optimal individual composition spectrum prediction analysis model obtained in step S5 and make predictions on the test set samples.
[0012] According to one embodiment of the method for autonomously constructing a spectral prediction and analysis model of the present invention, in step S1, the analysis data set consists of spectral data and physicochemical property attribute data of the sample, wherein the sample spectral data can be derived from any one of the following: ultraviolet-visible spectrum, near-infrared spectrum, mid-infrared spectrum, Raman spectrum and fluorescence spectrum.
[0013] According to an embodiment of the method for autonomously constructing a spectral prediction and analysis model of the present invention, in step S2, a partial least squares model is established using training set data, initial variables are selected according to the importance of regression coefficients, and the maximum tree depth is adaptively adjusted according to the number of initial variables, further comprising the following steps:
[0014] Step S21, constructing a partial least squares model with the spectral data of the training set as input and the physicochemical property data as output;
[0015] Step S22, sorting the spectral wavelengths according to the absolute values of the regression coefficients of the partial least squares model and selecting a specified number of wavelengths as initial variables of the tree network;
[0016] Step S23: adaptively adjust the maximum tree depth according to the number of initial variables.
[0017] According to an embodiment of the method for autonomously constructing a spectral prediction and analysis model of the present invention, in step S3, the function set of the tree network is the linear terms and nonlinear terms of the linear parameter polynomial model, and the terminal set is the initial variable set.
[0018] According to an embodiment of the method for autonomously constructing a spectral prediction analysis model of the present invention, in step S4, the spectral prediction analysis error reduction rate of the tree network subtree is calculated and pruned, and the fitness of the tree individuals after pruning is calculated, further comprising the following steps:
[0019] Step S41, decomposing the tree network into subtrees;
[0020] Step S42, calculating the spectrum prediction analysis error reduction rate of each subtree, and removing the subtree whose spectrum prediction analysis error reduction rate is greater than the pruning threshold according to a preset pruning threshold;
[0021] Step S43: Calculate the fitness of the tree individuals after pruning.
[0022] According to an embodiment of the method for autonomously constructing a spectral prediction analysis model of the present invention, in step S5, individuals are selected, crossovered and mutated according to the fitness of individuals in the spectral prediction analysis and preset parameters, and the individual fitness is re-evaluated based on the performance of the spectral prediction analysis model composed of new individuals and the optimal individual is updated, further comprising the following steps:
[0023] Step S51, selecting excellent individuals from the initial population to form an elite individual set based on fitness and generation interval;
[0024] Step S52: combining the fitness and crossover and mutation probabilities of the spectral prediction analysis model, selecting parent individuals from the initial population to form a set;
[0025] Step S53, performing crossover and mutation operations on the parent generation individual set to generate a child generation population;
[0026] Step S54, evaluating the fitness of the offspring population based on the spectral prediction analysis model, and merging it with the elite set to form a new initial population;
[0027] Step S55: within the maximum number of iterations, loop through S51-S54 and determine the final spectrum prediction and analysis model.
[0028] According to an embodiment of the method for autonomously constructing a spectral prediction analysis model of the present invention, in step S6, applying the optimal individual obtained in step S5 to form a spectral prediction analysis model and predicting the test set samples further includes the following steps:
[0029] Step S61, determining the final spectrum prediction analysis model according to the best individual and tree network obtained in step S5;
[0030] Step S62: Use the final spectral prediction analysis model to perform prediction analysis on the test set samples.
[0031] The present invention also discloses a spectrum prediction and analysis model autonomous construction system, the system comprising:
[0032] Dataset partitioning module, which constructs the analysis dataset and randomly divides it into training and test sets;
[0033] The model building module uses the training set data to build a partial least squares model, selects initial variables based on the importance of regression coefficients, and adaptively adjusts the maximum tree depth based on the number of initial variables;
[0034] The population generation module randomly generates the initial population according to the function set and terminal set of the tree network;
[0035] The pruning calculation module calculates the spectral prediction analysis error reduction rate of the tree network subtree and performs pruning, and calculates the fitness of the tree individuals after pruning;
[0036] The individual operation module selects, crosses and mutates individuals according to their fitness and preset parameters in the spectral prediction analysis, re-evaluates individual fitness based on the performance of the spectral prediction analysis model composed of new individuals, and updates the optimal individual.
[0037] The prediction module applies the optimal individual composition spectrum prediction analysis model obtained by the individual operation module and predicts the test set samples.
[0038] The present invention also discloses a computer-readable storage medium storing program instructions executable by a processor to implement the steps of the above-mentioned method for autonomously constructing a spectral prediction and analysis model.
[0039] The present invention also discloses a computer device, which includes a memory, a processor, and program instructions stored in the memory and executable by the processor, wherein the processor executes the program instructions to implement the steps of the autonomous construction method of the spectral prediction and analysis model as described above.
[0040] Compared with the prior art, the present invention has the following beneficial effects: the present invention establishes a tree network model based on genetic programming, and introduces nonlinear subtrees on the basis of constructing linear subtrees, thereby effectively improving the diversity of the model structure. In addition, the present invention explores different model structures by adaptively adjusting the maximum tree depth, and combines pruning strategies to avoid redundant structures, thereby effectively improving the generalization performance of the model. Compared with the existing spectral prediction and analysis model with fixed parameters, the present invention establishes a more flexible model structure through variable screening, genetic programming and pruning operations, effectively improving the prediction accuracy and model diversity of the spectral analysis model. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above features and advantages of the present invention can be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily drawn to scale, and components with similar related properties or features may have the same or similar reference numerals.
[0042] Figure 1 A flow chart of an embodiment of the method for autonomously constructing a spectral prediction and analysis model of the present invention is shown.
[0043] Figure 2 A schematic diagram showing an embodiment of the spectral prediction and analysis model autonomous construction system of the present invention.
[0044] Figure 3 A schematic diagram showing the measured diesel spectrum data within the wavelength range of 750 to 1550 nm.
[0045] Figure 4Schematic diagram showing the spectral data after standard first-order derivative preprocessing.
[0046] Figure 5 A schematic diagram showing the regression coefficients of the constructed partial least squares model.
[0047] Figure 6 A schematic diagram showing the fitness curve of the tree network model as the number of iterations changes.
[0048] Figure 7 A schematic diagram showing the prediction results of the constructed density content regression model. DETAILED DESCRIPTION
[0049] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the aspects described below in conjunction with the accompanying drawings and specific embodiments are only exemplary and should not be construed as limiting the scope of protection of the present invention in any way.
[0050] Figure 1 The process of an embodiment of the method for autonomously constructing a spectrum prediction and analysis model of the present invention is shown. Figure 1 , the implementation steps of the method of this embodiment are described in detail as follows.
[0051] Step S1: Construct the analysis data set {X, y} and randomly divide it into training sets {X train ,y train} and the test set {X test ,y test The training set is used to build the model, and the test set is used to verify the prediction performance of the final model.
[0052] In step S1, the analysis data set consists of the sample's spectral data X and physicochemical property attribute data y. The sample spectral data X can come from any of the following: ultraviolet-visible spectrum, near infrared spectrum, mid-infrared spectrum, Raman spectrum and fluorescence spectrum.
[0053] Step S2: Using the training set data {X train ,y train}A partial least squares (PLS) model was established, initial variables were selected based on the importance of regression coefficients, and the maximum tree depth was adaptively adjusted according to the number of initial variables.
[0054] In step S2, a partial least squares (PLS) model is established using the training set data, initial variables are selected according to the importance of regression coefficients, and the maximum tree depth is adaptively adjusted according to the number of initial variables, specifically including the following steps:
[0055] Step S21: Using the spectral data X of the training set train Input, physical and chemical property data y trainA partial least squares (PLS) model is constructed for the output, which can be expressed as y train =X train α+b, where α=[α1,…,α n ] is the model regression coefficient, b is the bias coefficient;
[0056] Step S22, sorting the spectral wavelengths according to the absolute value |α| of the regression coefficient of the partial least squares (PLS) model and selecting a specified number (for example, the first k) of wavelengths as initial variables of the tree network;
[0057] Step S23: adaptively adjust the maximum tree depth n according to the initial number of variables k d The specific calculation can be done by the following formula:
[0058]
[0059] Step S3: randomly generate an initial population according to the function set and terminal set of the tree network.
[0060] In step S3, the function set of the tree network is the linear terms and nonlinear terms of the linear parameter polynomial model, and the terminal set is the initial variable set determined in step S2.
[0061] The tree network constructed using the initial variables can be expressed as:
[0062] y=Fβ+e
[0063] In the formula, β=[β1,…,β n ] T represents the parameter vector, e=[e1,e2,…,e m ] represents the error vector, and F is the regression matrix composed of the initial variables, which is specifically expressed as:
[0064]
[0065] Step S4, calculating the spectrum prediction analysis error reduction rate of the tree network subtree and performing pruning, and calculating the fitness of the tree individuals after pruning.
[0066] In step S4, the spectrum prediction analysis error reduction rate of the tree network subtree is calculated and pruned, and the fitness of the tree individuals after pruning is calculated, which specifically includes the following steps:
[0067] Step S41, decomposing the tree network into subtrees, that is, the minimum spanning tree composed of each terminal set and the function set;
[0068] Step S42, calculating the spectrum prediction analysis error reduction rate ed of each subtree, and removing the subtree whose spectrum prediction analysis error reduction rate is greater than the pruning threshold according to a preset pruning threshold thr;
[0069] The regression matrix is decomposed as follows:
[0070] F=WA
[0071] In the formula,
[0072]
[0073] is an n×n upper triangular matrix, W=[w1,w2,…,w n ] to satisfy W T W = D, an m×m matrix, where D is a positive diagonal matrix. Let g = D -1 W T y, then w i The spectral prediction analysis error reduction rate of the corresponding branch can be obtained by w i The explained variance is expressed as:
[0074]
[0075] In the above formula, the spectral prediction analysis error reduction rate calculation index ed i It can be used to quantify the variance contribution of the subtree and the error reduction rate of spectral prediction analysis. i The smaller it is, the lower the contribution of the corresponding subtree to the spectral prediction analysis model. i If the value is lower than the set pruning threshold thr, the corresponding subtree will be removed. This operation can maximize the prediction capability of the spectral analysis model while simplifying the structure of the spectral prediction analysis model.
[0076] Step S43: Calculate the fitness of the tree individuals after pruning.
[0077] Individual fitness measures the output of an individual The difference between the true y value of the attribute is expressed in the root mean square error (RMSE) and the coefficient of determination (R 2 ), where RMSE can be expressed as:
[0078]
[0079] In the formula, y=[y1,y2,…,y p ] is the true value of the attribute of p samples, is the predicted value. 2 It can be expressed as:
[0080]
[0081] Where Cov(·) represents covariance and Var(·) represents variance.
[0082] Finally, calculate the fitness of the tree individuals after pruning S0 , which can be expressed as:
[0083]
[0084] Step S5: According to the individual fitness of the population F it S0 And preset parameters (including preset crossover probability pc, mutation probability pm, generation interval pg) are used to select, crossover and mutate individuals, re-evaluate individual fitness and update the optimal individual.
[0085] In step S5, individuals are selected, crossed and mutated according to the fitness of individuals in the population in the spectral prediction analysis and preset parameters, and the individual fitness is re-evaluated based on the performance of the spectral prediction analysis model composed of new individuals and the optimal individual is updated, which specifically includes the following steps:
[0086] Step S51: Combine fitness Fit S0 and generation interval pg to select excellent individuals from the initial population to form an elite individual set I;
[0087] Step S52: Fit the spectral prediction analysis model S0 With the crossover probability pc and the mutation probability pm, the parent individuals are selected from the initial population to form a set U;
[0088] Step S53, performing crossover and mutation operations on the parent generation individual set to generate a child generation population O;
[0089] Step S54, evaluating the fitness of the offspring population based on the spectral prediction analysis model, and merging it with the elite set to form a new initial population;
[0090] Step S55, within the maximum iteration number range G, loop steps S51-S54 and determine the final spectrum prediction analysis model.
[0091] Step S6: Apply the optimal individual composition spectrum prediction analysis model obtained in step S5 and make predictions on the test set samples.
[0092] In step S6, the optimal individual composition spectrum prediction analysis model obtained in step S5 is applied to the test set sample {X test ,y test} Make predictions:
[0093] Step S61, determining the final spectrum prediction analysis model according to the best individual and tree network obtained in S5;
[0094] Step S62: Use the final spectral prediction analysis model to perform prediction analysis on the test set samples.
[0095] Figure 2 The principle of an embodiment of the spectrum prediction analysis model autonomous construction system of the present invention is shown. Figure 2 The system of this embodiment includes: a data set partitioning module, a model building module, a population generation module, a pruning calculation module, an individual operation module, and a prediction module.
[0096] The data set partitioning module constructs an analysis data set and randomly divides it into a training set and a test set; the analysis data set consists of the spectral data and physicochemical property attribute data of the sample, where the sample spectral data can come from any of the following: UV-visible spectrum, near-infrared spectrum, mid-infrared spectrum, Raman spectrum and fluorescence spectrum.
[0097] The model building module uses the training set data to build a partial least squares model, selects initial variables based on the importance of regression coefficients, and adaptively adjusts the maximum tree depth based on the number of initial variables.
[0098] The model building module uses the training set data to build a partial least squares model, selects initial variables according to the importance of regression coefficients, and adaptively adjusts the maximum tree depth according to the number of initial variables, further including the following steps:
[0099] A partial least squares model was constructed with the spectral data of the training set as input and the physicochemical property data as output;
[0100] The spectral wavelengths are sorted according to the absolute value of the regression coefficient of the partial least squares model and a specified number of wavelengths are selected as the initial variables of the tree network;
[0101] The maximum tree depth is adaptively adjusted according to the initial number of variables.
[0102] The population generation module randomly generates an initial population according to the function set and terminal set of the tree network; the function set of the tree network is the linear terms and nonlinear terms of the linear parameter polynomial model, and the terminal set is the initial variable set.
[0103] The pruning calculation module calculates the spectral prediction analysis error reduction rate of the tree network subtree and prunes it, and calculates the fitness of the tree individuals after pruning.
[0104] The pruning calculation module calculates the spectral prediction analysis error reduction rate of the tree network subtree and performs pruning, and calculates the fitness of the tree individuals after pruning, further comprising the following steps:
[0105] Decompose the tree network into subtrees;
[0106] Calculate the spectral prediction analysis error reduction rate of each subtree, and remove the subtrees whose error reduction rate is greater than the pruning threshold according to the preset pruning threshold;
[0107] Calculate the fitness of tree individuals after pruning.
[0108] The individual operation module selects, crosses and mutates individuals according to their fitness and preset parameters in the spectral prediction analysis, re-evaluates the individual fitness based on the performance of the spectral prediction analysis model composed of new individuals, and updates the optimal individual.
[0109] The individual operation module selects, crosses and mutates individuals according to the individual fitness of the population and preset parameters, re-evaluates the individual fitness and updates the optimal individual, further comprising the following steps:
[0110] Combine fitness and generation interval to select excellent individuals from the initial population to form an elite individual set;
[0111] Combined with the fitness, crossover and mutation probabilities of the spectral prediction analysis model, parent individuals are selected from the initial population to form a set;
[0112] Perform crossover and mutation operations on the parent generation individual set to generate the offspring population;
[0113] The offspring population is evaluated for fitness based on the spectral prediction analysis model and merged with the elite set to form a new initial population;
[0114] Within the maximum number of iterations, the above processing steps are cycled and the final spectrum prediction analysis model is determined.
[0115] The prediction module applies the optimal individual composition spectrum prediction analysis model obtained by the individual operation module and predicts the test set samples.
[0116] The prediction module applies the optimal individual composition spectrum prediction analysis model obtained by the individual operation module and predicts the test set samples, further comprising the following steps:
[0117] According to the individual operation module, the best individual and tree network are obtained to determine the final spectrum prediction analysis model;
[0118] The final spectral prediction analysis model is used to perform prediction analysis on the test set samples.
[0119] The present invention is described below with an example of diesel density content prediction, and the specific steps include:
[0120] Step 1: Collect 263 diesel samples and measure the sample spectra and density data. Use a near-infrared spectrometer to collect spectral data of the collected samples. Measure the near-infrared spectrum of the diesel samples by inserting the probe into each sample bottle. Measure and analyze the density of the diesel samples in accordance with national or industry standards, with a density range of 834.94-858.83 kg / m 3 . Figure 3This is the measured diesel spectrum data within the wavelength range of 750 to 1550nm. It can be seen from the figure that the measured spectrum data has no obvious abnormal spectrum and no obvious noise. Figure 4 is the spectral data after standard first-order derivative preprocessing.
[0121] Step 2: Establish the partial least squares (PLS) model of diesel samples, and select the first 60 wavelengths as the initial wavelength variables according to the absolute value of the regression coefficient. Figure 5 is the regression coefficient of the constructed partial least squares model.
[0122] Step 3: Randomly generate an initial population for the selected initial wavelength variable.
[0123] Step 4: Calculate the error reduction rate of the tree network subtree and prune it, and calculate the fitness of the tree individuals after pruning;
[0124] Step 5: Select, crossover and mutation operations based on fitness and preset parameters, where the generation interval pg, crossover probability pc and mutation probability pm are set to 0.8, 0.2 and 0.8 respectively, the maximum number of iterations is 1000, and the pruning threshold is 0.01. The fitness curve of the tree network model that changes with the number of iterations is shown in the figure below: Figure 6 shown.
[0125] Step 6: Use the model built in step 5 to predict and analyze the spectrum to be measured. The prediction results of the density content regression model are as follows: Figure 7 As shown, the training set determination coefficient is 0.9928, the root mean square error RMSEC is 1.1257, and the prediction set determination coefficient It is 0.9828, and the root mean square error RMSEP is 1.3029.
[0126] Although the above methods are illustrated and described as a series of actions for simplicity of explanation, it should be understood and appreciated that these methods are not limited by the order of the actions, because according to one or more embodiments, some actions may occur in a different order and / or concurrently with other actions from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art.
[0127] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or a combination of the two. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. The technician may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present invention.
[0128] The various illustrative logic blocks, modules, and circuits described in conjunction with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in cooperation with a DSP core, or any other such configuration.
[0129] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software module may reside in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read and write information from / to the storage medium. In an alternative, a storage medium may be integrated into a processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.
[0130] In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented as a computer program product in software, each function may be stored on or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include both computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one place to another. Storage media may be any available medium that can be accessed by a computer. As an example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer. Any connection is also properly referred to as a computer-readable medium. For example, if the software is transmitted from a website, a server, or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein disk often reproduces data magnetically, while disc reproduces data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0131] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but should be granted the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for autonomously constructing a spectral prediction and analysis model, characterized in that: Methods include: Step S1, construct an analysis data set and randomly divide it into a training set and a test set; Step S2: using the training set data to establish a partial least squares model, selecting initial variables according to the importance of regression coefficients, and adaptively adjusting the maximum tree depth according to the number of initial variables; Step S3, randomly generating an initial population according to the function set and the terminal set of the tree network; Step S4, calculating the error reduction rate of the tree network subtree and pruning it, and calculating the fitness of the tree individuals after pruning; Step S5: select, crossover and mutate individuals according to the individual fitness of the population and preset parameters, re-evaluate the individual fitness and update the optimal individual; Step S6: Apply the optimal individual composition spectrum prediction analysis model obtained in step S5 and make predictions on the test set samples.
2. The method for autonomously constructing a spectral prediction and analysis model according to claim 1, characterized in that: In step S1, the analysis data set consists of spectral data and physicochemical property attribute data of the sample, wherein the sample spectral data can come from any of the following: ultraviolet-visible spectrum, near-infrared spectrum, mid-infrared spectrum, Raman spectrum and fluorescence spectrum.
3. The method for autonomously constructing a spectral prediction and analysis model according to claim 1, characterized in that: In step S2, a partial least squares model is established using the training set data, initial variables are selected according to the importance of the regression coefficients, and the maximum tree depth is adaptively adjusted according to the number of initial variables, further comprising the following steps: Step S21, constructing a partial least squares model with the spectral data of the training set as input and the physicochemical property data as output; Step S22, sorting the spectral wavelengths according to the absolute values of the regression coefficients of the partial least squares model and selecting a specified number of wavelengths as initial variables of the tree network; Step S23: adaptively adjust the maximum tree depth according to the number of initial variables.
4. The method for autonomously constructing a spectral prediction and analysis model according to claim 1, characterized in that: In step S3, the function set of the tree network is the linear terms and nonlinear terms of the linear parameter polynomial model, and the terminal set is the initial variable set.
5. The method for autonomously constructing a spectral prediction and analysis model according to claim 1, characterized in that: In step S4, the spectrum prediction analysis error reduction rate of the tree network subtree is calculated and pruned, and the fitness of the tree individuals after pruning is calculated, which further includes the following steps: Step S41, decomposing the tree network into subtrees; Step S42, calculating the spectrum prediction analysis error reduction rate of each subtree, and removing the subtree whose spectrum prediction analysis error reduction rate is greater than the pruning threshold according to a preset pruning threshold; Step S43: Calculate the fitness of the tree individuals after pruning.
6. The method for autonomously constructing a spectral prediction and analysis model according to claim 1, characterized in that: In step S5, individuals are selected, crossed and mutated according to the fitness of individuals in the population in the spectral prediction analysis and preset parameters, and the individual fitness is re-evaluated based on the performance of the spectral prediction analysis model composed of new individuals and the optimal individual is updated, further comprising the following steps: Step S51, selecting excellent individuals from the initial population to form an elite individual set based on fitness and generation interval; Step S52: combining the fitness and crossover and mutation probabilities of the spectral prediction analysis model, selecting parent individuals from the initial population to form a set; Step S53, performing crossover and mutation operations on the parent generation individual set to generate a child generation population; Step S54, evaluating the fitness of the offspring population based on the spectral prediction analysis model, and merging it with the elite set to form a new initial population; Step S55: within the maximum number of iterations, loop through S51-S54 and determine the final spectrum prediction and analysis model.
7. The method for autonomously constructing a spectral prediction and analysis model according to claim 1, characterized in that: In step S6, the optimal individual composition spectrum prediction analysis model obtained in step S5 is applied to predict the test set samples, further comprising the following steps: Step S61, determining the final spectrum prediction analysis model according to the best individual and tree network obtained in step S5; Step S62: Use the final spectral prediction analysis model to perform prediction analysis on the test set samples.
8. A spectrum prediction and analysis model autonomous construction system, characterized in that: The system includes: Dataset partitioning module, which constructs the analysis dataset and randomly divides it into training and test sets; The model building module uses the training set data to build a partial least squares model, selects initial variables based on the importance of regression coefficients, and adaptively adjusts the maximum tree depth based on the number of initial variables; The population generation module randomly generates the initial population according to the function set and terminal set of the tree network; The pruning calculation module calculates the spectral prediction analysis error reduction rate of the tree network subtree and performs pruning, and calculates the fitness of the tree individuals after pruning; The individual operation module selects, crosses and mutates individuals according to their fitness and preset parameters in the spectral prediction analysis, re-evaluates individual fitness based on the performance of the spectral prediction analysis model composed of new individuals, and updates the optimal individual. The prediction module applies the optimal individual composition spectrum prediction analysis model obtained by the individual operation module and predicts the test set samples.
9. A computer-readable storage medium storing program instructions executable by a processor to implement the steps of the method for autonomously constructing a spectral prediction and analysis model as described in any one of claims 1 to 7.
10. A computer device comprising a memory, a processor, and program instructions stored in the memory and executable by the processor, wherein the processor executes the program instructions to implement the steps of the method for autonomously constructing a spectral prediction and analysis model as described in any one of claims 1 to 7.
Citation Information
Cited By
Pruning method, device and equipment of spectrum prediction model for film thickness measurement
CN121683917A
