Spectral wavelength variable selection method and device, computer equipment and storage medium
By iterating the spectral information randomly rearranged and structure-effect relationship model, the problem of insufficient selection of wavelength variables caused by strong feature correlation in the prior art is solved, and the stability and efficiency of the model are improved.
Patent Information
- Application Number
- CN202510052612.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When faced with scenarios with strong feature correlation, existing wavelength variable selection methods are easy to select one of the features and ignore other related features, resulting in excessive removal of the spectral signal, affecting the stability and efficiency of the model.
By randomly rearranged the spectral information of the target sample, the initial spectral matrix is obtained; the target spectral matrix is determined from the initial spectral matrix based on the number of preset wavelength variables; the structure-effect relationship model between the research target and the target spectral matrix of the target sample is determined. ; Iterate the structure-effect relationship model based on the preset prediction index to obtain the wavelength variable selection sequence.
It reduces the possibility that the spectral signal is over-eliminated when selecting wavelength variables, retains effective information, improves the stability and efficiency of the model, and at the same time reduces the spectral dimension and improves the efficiency of operations and iterations.
Smart Images

Figure CN119474792A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a spectrum wavelength variable selection method, device, computer equipment and storage medium. Background Art
[0002] Among the existing wavelength variable selection methods, the Least Absolute Shrinkage and Selection Operator (Lasso) is a variant of linear regression. It constrains parameters during model fitting and adds an L1 regularization term, which makes it susceptible to feature correlation. When there is a strong correlation between features, Lasso regression tends to select one of the features and ignore other related features. Summary of the invention
[0003] In view of this, the purpose of the present invention is to overcome the shortcomings of the prior art and to provide a spectral wavelength variable selection method, device, computer equipment and storage medium, which extract effective wavelength variables in the spectrum based on consideration of the combination and matching relationship between variables, and are suitable for spectral pre-processing algorithms for qualitative and quantitative analysis of spectra.
[0004] The present invention provides the following technical solutions: In a first aspect, the present invention provides a spectral wavelength variable selection method, comprising: Randomly rearrange the spectral information of the target sample to obtain an initial spectral matrix; Determining a target spectral matrix from the initial spectral matrix according to a preset number of wavelength variables; Determining a structure-activity relationship model between a research target of the target sample and the target spectral matrix; The structure-activity relationship model is iterated according to preset prediction indicators and the target spectrum matrix to obtain a wavelength variable selection sequence.
[0005] In one embodiment, the randomly rearranging the spectral information of the target sample to obtain an initial spectral matrix includes: Acquire a spectrum matrix to be processed according to the spectrum information; The spectral matrix to be processed is randomly rearranged based on a random shuffle algorithm to obtain the initial spectral matrix.
[0006] In one embodiment, determining the target spectral matrix from the initial spectral matrix according to the preset number of wavelength variables includes: Determining the number of preset wavelength variables according to the chemical principle of the research target; Based on a matrix slicing algorithm, feature extraction is performed on the initial spectrum matrix according to the preset number of wavelength variables to obtain the target spectrum matrix.
[0007] In one embodiment, determining a structure-activity relationship model between a research target of the target sample and the target spectral matrix comprises: defining an attribute combination, the attribute combination comprising a plurality of spectral variables; The prediction function of the structure-activity relationship model is determined according to the attribute combination.
[0008] In one embodiment, the structure-activity relationship model is iterated according to the preset prediction index and the target spectrum matrix to obtain the wavelength variable selection sequence, including: Perform prediction based on the target spectrum matrix using the structure-activity relationship model to obtain a prediction result; Obtaining prediction parameters of the structure-activity relationship model according to the prediction results; The wavelength variable selection sequence is determined according to the prediction parameters and preset prediction indicators.
[0009] In one embodiment, determining the wavelength variable selection sequence according to the prediction parameters and the preset prediction index includes: Determining whether the prediction parameter reaches the preset prediction index; If the prediction parameter reaches the preset prediction index, the attribute combination data sequence corresponding to the prediction parameter is used as the wavelength variable selection sequence.
[0010] In one embodiment, after determining whether the prediction parameter reaches the preset prediction index, the method further includes: If the prediction parameter does not reach the preset prediction index, the step of predicting according to the target spectral matrix by using the structure-activity relationship model is re-executed.
[0011] In a second aspect, the present invention provides a spectrum wavelength variable selection device, comprising: An acquisition module is used to randomly rearrange the spectral information of the target sample to obtain an initial spectral matrix; A determination module, used for determining a target spectrum matrix from the initial spectrum matrix according to a preset number of wavelength variables; A modeling module, used to determine a structure-activity relationship model between the research target of the target sample and the target spectral matrix; The selection module is used to iterate the structure-activity relationship model according to the preset prediction index and the target spectrum matrix to obtain a wavelength variable selection sequence.
[0012] In a third aspect, the present invention proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the spectral wavelength variable selection method as described in the first aspect is implemented.
[0013] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the spectral wavelength variable selection method as described in the first aspect.
[0014] The spectral wavelength variable selection method, device, computer equipment and storage medium disclosed in the present invention randomly rearrange the spectral information of the target sample to obtain an initial spectral matrix; determine the target spectral matrix from the initial spectral matrix according to a preset number of wavelength variables; determine the structure-activity relationship model between the research target of the target sample and the target spectral matrix; iterate the structure-activity relationship model according to preset prediction indicators and the target spectral matrix to obtain a wavelength variable selection sequence. In this way, by randomly rearranging the spectral information, when selecting wavelength variables, the variables that have been taken into consideration are not used as a priori conditions for whether the current variable is selected, reducing the possibility of excessive elimination of spectral signals when selecting wavelength variables, ensuring the retention of effective information as much as possible, and improving the stability of the model; at the same time, based on the preset number of wavelength variables, target spectral matrix data is selected for the establishment of a structure-activity relationship model, reducing the spectral dimension and improving the efficiency of calculation and iteration. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.
[0016] Figure 1 A schematic diagram of a process of selecting a spectrum wavelength variable proposed in this embodiment is shown; Figure 2 A schematic diagram of spectrum matrix conversion proposed in this embodiment is shown; Figure 3 A schematic diagram of the target spectrum matrix proposed in this embodiment is shown; Figure 4 Another schematic diagram of the process of selecting a spectrum wavelength variable according to the present embodiment is shown; Figure 5 A schematic diagram showing a comparison between the Cu experimental value proposed in this embodiment and the quantitative analysis value of the Cu-PLS model; Figure 6A schematic diagram showing a comparison between the Cu experimental value proposed in this embodiment and the quantitative analysis value of the Cu-wavelength variable selection-PLS model; Figure 7 A schematic diagram comparing the Cu-PLS model error and the Cu-wavelength variable selection-PLS model error proposed in this embodiment is shown; Figure 8 A schematic diagram of the structure of the spectrum wavelength variable selection device proposed in this embodiment is shown.
[0017] Description of the accompanying drawings: 800 - spectral wavelength variable selection device; 801 - acquisition module; 802 - determination module; 803 - modeling module; 804 - selection module. DETAILED DESCRIPTION
[0018] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0019] The components of the embodiments of the present invention generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0020] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0021] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0022] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present invention belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present invention.
[0023] Example 1 In the method of combining spectroscopy with multivariate correction, the traditional view is that multivariate correction methods (such as PLS) have strong anti-interference ability and can participate in the establishment of multivariate correction models with all wavelengths. With the in-depth study and application of methods such as PLS, it is possible to obtain better quantitative correction models by screening characteristic wavelengths or wavelength ranges by specific methods. On the one hand, wavelength selection can simplify the model, improve the operating efficiency of the model and improve the interpretability of the model. More importantly, due to the elimination of irrelevant or nonlinear variables, a correction model with strong predictive ability and good robustness can be obtained. Therefore, the selection of wavelength variables has become one of the key steps in the process of establishing the correction model, and has also become a research hotspot in the field of chemometrics and spectral analysis.
[0024] The disclosed embodiment provides a spectral wavelength variable selection method, which extracts effective wavelength variables in the spectrum based on the combination and matching relationship between variables, and is suitable for a spectral pre-processing algorithm for qualitative and quantitative analysis of the spectrum.
[0025] See also Figure 1 , a spectral wavelength variable selection method, including steps S101~S104, each step is described in detail below.
[0026] Step S101, randomly rearrange the spectral information of the target sample to obtain an initial spectral matrix.
[0027] In this embodiment, the spectrum information of all target samples is obtained and randomly re-shot to obtain an initial spectrum matrix. Each row in the spectrum matrix is a full spectrum of characteristic spectrum of a target sample, and each column is the intensity value of different target samples at the same wavelength.
[0028] All spectral variables are randomly rearranged. Whether a variable is taken into consideration has nothing to do with other variables. No variable will be deleted because two features are highly similar. All valid information is retained to a greater extent, which is conducive to improving the stability and long-term applicability of the model.
[0029] In a specific embodiment, step S101 includes: obtaining a spectrum matrix to be processed according to the spectrum information; and randomly rearranging the spectrum matrix to be processed based on a random shuffle algorithm to obtain the initial spectrum matrix.
[0030] In this example, see Figure 2 , the spectral information of all target samples is arranged into a spectral matrix to be processed, and the spectral matrix to be processed is randomly rearranged based on a random shuffle algorithm to obtain an initial spectral matrix.
[0031] Each spectral data in the spectral matrix is a wavelength variable of a single pixel, which can achieve more thorough elimination of redundant information and retention of effective information. All spectral data are randomly rearranged instead of being cut into equal-width sub-intervals in sequence. When selecting wavelength variables, the variables that have been taken into consideration are not used as a priori conditions for whether the current variable is selected, which reduces the possibility of excessive elimination of spectral signals when selecting wavelength variables and increases the space and wavelength combination methods for model optimization.
[0032] Step S102, determining a target spectrum matrix from the initial spectrum matrix according to a preset number of wavelength variables.
[0033] In this example, see Figure 3 , the target spectral matrix is determined from the initial spectral matrix according to the preset number of wavelength variables N, that is, the first N columns of spectral data in the initial spectral matrix are selected as the target spectral matrix.
[0034] The data dimension of many spectra is very high, much larger than the number of samples, and this kind of data is called high-dimensional data. High-dimensional data is very sparse in space, and the sample size is small compared to the dimension of the space. The biggest problem encountered in the analysis of high-dimensional data is the expansion of the dimension, which is commonly known as the "curse of dimensionality" problem. As the dimension increases, the number of spatial samples required for analysis will increase exponentially. This embodiment reduces the spectral dimension by intercepting the first N spectral variables for subsequent model establishment, and significantly improves the efficiency of calculation and iteration.
[0035] In a specific embodiment, step S102 includes: determining the number of preset wavelength variables according to the chemical principle of the research target; based on a matrix slicing algorithm, performing feature extraction on the initial spectral matrix according to the preset number of wavelength variables to obtain the target spectral matrix.
[0036] In this embodiment, the preset number of wavelength variables N is determined according to the chemical principle of the research target, and the matrix slicing algorithm is further used to extract the target spectrum matrix from the initial spectrum matrix according to the preset number of wavelength variables N. The research targets include element content, color, moisture, etc.
[0037] Exemplarily, when the research target is the element content, the preset number N of wavelength variables should be consistent or nearly consistent with the number of characteristic wavelengths of the element within the wavelength band covered by the spectrum.
[0038] According to the principle of chemometrics, it conforms to the chemical characteristics of the spectrum itself. The spectrum is like the "DNA" that reflects the information of each element and structure in the sample. For example, when the spectrum of 200~400nm is collected for processing, there are many characteristic peaks of Fe. The number of preset wavelength variables N (for example, N=1000) can be appropriately increased to retain the most effective information to a greater extent; the number of characteristic peaks of the S element in this band is relatively small, and the parameter can be adjusted to N=50 to avoid including too much information unrelated to S. Of course, the determination of N also needs to be determined based on experience, parameter adjustment and other considerations.
[0039] Step S103, determining a structure-activity relationship model between the research target of the target sample and the target spectral matrix.
[0040] In this embodiment, a structure-activity relationship model, i.e., a qualitative or quantitative algorithm, is established for the research target based on the target spectrum matrix. According to the actual application requirements, statistical regression, multivariate calibration, pattern recognition and other methods can be used to find the relationship between the spectrum and the research targets such as element content, color, and moisture.
[0041] In a specific embodiment, step S103 includes: defining an attribute combination, wherein the attribute combination includes a plurality of spectral variables; and determining a prediction function of the structure-activity relationship model according to the attribute combination.
[0042] In this embodiment, taking the linear model as an example, given The attribute combination described by the spectral variable ,in ( 1 ≤ i ≤ d )yes x In the i The value of an attribute (spectral variable).
[0043] The structure-activity relationship model is a function that is predicted by a linear combination of attributes. The function expression is: . This function expression can be converted to: Among them, the spectral variables in one attribute combination are randomly selected from the N spectral variables of the same target sample.
[0044] Step S104, iterating the structure-activity relationship model according to the preset prediction index and the target spectrum matrix to obtain a wavelength variable selection sequence.
[0045] In this embodiment, the structure-activity relationship model is trained using the target spectrum matrix, and the training of the structure-activity relationship model is evaluated in combination with the preset prediction index, that is, the selection effect of the wavelength variable is tested. When the training degree of the structure-activity relationship model meets the preset prediction index, the attribute combination data sequence currently used to train the structure-activity relationship model can be used as the wavelength variable selection sequence. Among them, the training status of the structure-activity relationship model can be reflected by parameters such as the correlation coefficient (R) between the predicted value and the actual value of the structure-activity relationship model, RMSECV or RMSEP.
[0046] The existing filtering method evaluates the variables independently when selecting variables, without considering the dependency or synergy between the variables. However, this embodiment does not use a single variable for evaluation, but uses the modeling RSMEP or correlation coefficient of N randomly selected spectral variables as the effect index of modeling under the combination relationship of these N variables, thereby considering the combination relationship between multiple spectral variables.
[0047] See also Figure 4 In a specific embodiment, step S104 includes steps S1041 to S1043, and each step is described in detail below.
[0048] Step S1041, predicting based on the target spectrum matrix using the structure-activity relationship model to obtain a prediction result.
[0049] In this embodiment, the function of the structure-activity relationship model is and Unknown, how to determine and The key is to measure the research target prediction value of the structure-activity relationship model Corresponding to the true value of the research target The mean square error is the most commonly used performance metric in regression tasks, so try to minimize the mean square error.
[0050]
[0051]
[0052] The mean square error has a very good geometric meaning, which corresponds to the Euclidean distance. Solving the model based on the minimization of the mean square error is to try to find a straight line that minimizes the sum of the Euclidean distances of all samples to the straight line.
[0053] Solution and The process of minimizing is also called parameter estimation. and Take the derivatives separately, and then set the two partial derivatives to 0, and we can get and Closed-form solution to the optimal solution: , .
[0054] Specifically, the target spectrum matrix needs to be divided into training data and prediction data. and The optimal solution is solved; each set of attribute combination data A in the training data corresponds to a and The optimal solution; each and After the optimal solution, the and The optimal solution is substituted into the function of the structure-activity relationship model, and a set of attribute combination data B is determined from the predicted data to obtain the attribute combination data B in the and Prediction results under the optimal solution.
[0055] Step S1042, obtaining prediction parameters of the structure-activity relationship model according to the prediction results.
[0056] In this embodiment, the true value of the research target corresponding to the above attribute combination data B is obtained, and the current and The prediction parameters of the structure-activity relationship model under the optimal solution. The prediction parameters can be prediction error or prediction accuracy, etc.
[0057] Step S1043: determining the wavelength variable selection sequence according to the prediction parameters and preset prediction indicators.
[0058] In this embodiment, the prediction parameters and the preset prediction indicators are used to calculate the current and Whether the attribute combination data sequence A of the optimal solution can be used as the wavelength variable selection sequence.
[0059] In a specific embodiment, step S1043 includes: determining whether the prediction parameter reaches the preset prediction index; if the prediction parameter reaches the preset prediction index, taking the attribute combination data sequence corresponding to the prediction parameter as the wavelength variable selection sequence.
[0060] In this embodiment, if the current prediction parameters reach the preset prediction index, it can be known that the current attribute combination data sequence A is valid spectral information. At this time, the training of the structure-activity relationship model is stopped, and the current attribute combination data sequence A is used as the wavelength variable selection sequence.
[0061] In a specific embodiment, if the prediction parameter does not reach the preset prediction index, the step of predicting according to the target spectral matrix by using the structure-activity relationship model is re-executed.
[0062] In this embodiment, if the prediction parameters do not reach the preset prediction indicators, it can be known that the current attribute combination data sequence A does not reach the indicators, and it is necessary to continue to train the structure-activity relationship model using the training data in the target spectral matrix until the corresponding prediction parameters meet the preset prediction indicators.
[0063] Exemplarily, referring to Table 1, the Cu experimental value is used as a control to compare the quantitative analysis value and error of the Cu-PLS model using the conventional partial least squares method (PLS) with the quantitative analysis value and error of the Cu-wavelength variable selection-PLS model using the spectral wavelength variable selection method proposed in this embodiment. It can be seen that the quantitative analysis value of the Cu-wavelength variable selection-PLS model is closer to the Cu experimental value than the quantitative analysis value of the Cu-PLS model, and the error of the Cu-wavelength variable selection-PLS model is smaller than the error of the Cu-PLS model.
[0064] Table 1:
[0065] See also Figure 5 and Figure 6 , respectively comparing the Cu experimental value and the quantitative analysis value of the Cu-PLS model, as well as the Cu experimental value and the Cu-wavelength variable selection-PLS model. It can be seen that the prediction trend of the Cu-wavelength variable selection-PLS model is closer to the Cu experimental value; see Figure 7 ,Comparing the error of Cu-PLS model and Cu-wavelength variable selection-PLS model, ,it can be seen that the error of Cu-wavelength variable selection-PLS model is smaller.
[0066] The above data comparison results can prove that the spectral wavelength variable selection method proposed in this embodiment can effectively reduce the analysis error of the quantitative correction model, thereby improving the analysis accuracy of the quantitative correction model.
[0067] The spectral wavelength variable selection method proposed in this embodiment randomly rearranges the spectral information of the target sample to obtain an initial spectral matrix; determines the target spectral matrix from the initial spectral matrix according to a preset number of wavelength variables; determines the structure-activity relationship model between the research target of the target sample and the target spectral matrix; iterates the structure-activity relationship model according to preset prediction indicators and the target spectral matrix to obtain a wavelength variable selection sequence. In this way, by randomly rearranging the spectral information, when selecting wavelength variables, the variables that have been taken into consideration are not used as a priori conditions for whether the current variable is selected, reducing the possibility of excessive elimination of spectral signals when selecting wavelength variables, ensuring the retention of effective information as much as possible, and improving the stability of the model; at the same time, the target spectral matrix data is selected based on the preset number of wavelength variables for the establishment of the structure-activity relationship model, reducing the spectral dimension and improving the efficiency of calculation and iteration.
[0068] Example 2 In addition, the present disclosure provides a spectrum wavelength variable selection device 800, see Figure 8 , the device comprises: An acquisition module 801 is used to randomly rearrange the spectral information of the target sample to obtain an initial spectral matrix; A determination module 802 is used to determine a target spectrum matrix from the initial spectrum matrix according to a preset number of wavelength variables; A modeling module 803 is used to determine a structure-activity relationship model between the research target of the target sample and the target spectral matrix; The selection module 804 is used to iterate the structure-activity relationship model according to the preset prediction index and the target spectrum matrix to obtain a wavelength variable selection sequence.
[0069] Optionally, the acquisition module 801 is used to acquire a spectrum matrix to be processed according to the spectrum information; and randomly rearrange the spectrum matrix to be processed based on a random shuffle algorithm to obtain the initial spectrum matrix.
[0070] Optionally, the determination module 802 is used to determine the number of preset wavelength variables according to the chemical principle of the research target; based on the matrix slicing algorithm, feature extraction is performed on the initial spectral matrix according to the preset number of wavelength variables to obtain the target spectral matrix.
[0071] Optionally, the modeling module 803 is used to define an attribute combination, wherein the attribute combination includes multiple spectral variables; and determine a prediction function of the structure-activity relationship model according to the attribute combination.
[0072] Optionally, a selection module 804 is used to perform prediction based on the target spectral matrix through the structure-activity relationship model to obtain a prediction result; obtain prediction parameters of the structure-activity relationship model according to the prediction result; and determine the wavelength variable selection sequence according to the prediction parameters and preset prediction indicators.
[0073] Optionally, the selection module 804 is used to determine whether the prediction parameter reaches the preset prediction index; if the prediction parameter reaches the preset prediction index, the attribute combination data sequence corresponding to the prediction parameter is used as the wavelength variable selection sequence.
[0074] Optionally, a selection module 804 is used to re-execute the step of predicting according to the target spectral matrix using the structure-activity relationship model if the prediction parameter does not reach the preset prediction index.
[0075] The device provided in the embodiment of the present disclosure can execute the steps of the spectral wavelength variable selection method provided in Example 1, which will not be described again to avoid repetition.
[0076] The spectral wavelength variable selection device proposed in this embodiment randomly rearranges the spectral information of the target sample to obtain an initial spectral matrix; determines the target spectral matrix from the initial spectral matrix according to a preset number of wavelength variables; determines the structure-activity relationship model between the research target of the target sample and the target spectral matrix; iterates the structure-activity relationship model according to preset prediction indicators and the target spectral matrix to obtain a wavelength variable selection sequence. In this way, by randomly rearranging the spectral information, when selecting wavelength variables, the variables that have been taken into consideration are not used as a priori conditions for whether the current variable is selected, reducing the possibility of excessive elimination of spectral signals when selecting wavelength variables, ensuring the retention of effective information as much as possible, and improving the stability of the model; at the same time, the target spectral matrix data is selected based on the preset number of wavelength variables for the establishment of the structure-activity relationship model, reducing the spectral dimension and improving the efficiency of calculation and iteration.
[0077] Example 3 In addition, an embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the spectral wavelength variable selection method described in Example 1 is implemented.
[0078] The device provided in the embodiment of the present disclosure can execute the steps of the spectral wavelength variable selection method provided in Example 1, which will not be described again to avoid repetition.
[0079] Example 4 The embodiment of the present disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the spectral wavelength variable selection method described in Embodiment 1 is implemented.
[0080] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0081] The computer-readable storage medium provided in this embodiment can implement the spectral wavelength variable selection method provided in Example 1, and will not be described again here to avoid repetition.
[0082] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.
[0083] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0084] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A spectrum wavelength variable selection method, characterized in that: include: Randomly rearrange the spectral information of the target sample to obtain an initial spectral matrix; Determining a target spectral matrix from the initial spectral matrix according to a preset number of wavelength variables; Determining a structure-activity relationship model between a research target of the target sample and the target spectral matrix; The structure-activity relationship model is iterated according to preset prediction indicators and the target spectrum matrix to obtain a wavelength variable selection sequence.
2. The spectrum wavelength variable selection method according to claim 1, characterized in that: The step of randomly rearranging the spectral information of the target sample to obtain an initial spectral matrix includes: Acquire a spectrum matrix to be processed according to the spectrum information; The spectral matrix to be processed is randomly rearranged based on a random shuffle algorithm to obtain the initial spectral matrix.
3. The spectrum wavelength variable selection method according to claim 1, characterized in that: The step of determining a target spectrum matrix from the initial spectrum matrix according to a preset number of wavelength variables includes: Determining the number of preset wavelength variables according to the chemical principle of the research target; Based on a matrix slicing algorithm, feature extraction is performed on the initial spectrum matrix according to the preset number of wavelength variables to obtain the target spectrum matrix.
4. The spectrum wavelength variable selection method according to claim 1, characterized in that: Determining a structure-activity relationship model between a research target of the target sample and the target spectral matrix includes: defining an attribute combination, the attribute combination comprising a plurality of spectral variables; The prediction function of the structure-activity relationship model is determined according to the attribute combination.
5. The spectrum wavelength variable selection method according to claim 4, characterized in that: The step of iterating the structure-activity relationship model according to the preset prediction index and the target spectrum matrix to obtain a wavelength variable selection sequence includes: Perform prediction based on the target spectrum matrix using the structure-activity relationship model to obtain a prediction result; Obtaining prediction parameters of the structure-activity relationship model according to the prediction results; The wavelength variable selection sequence is determined according to the prediction parameters and preset prediction indicators.
6. The spectrum wavelength variable selection method according to claim 5, characterized in that: The step of determining the wavelength variable selection sequence according to the prediction parameters and the preset prediction index comprises: Determining whether the prediction parameter reaches the preset prediction index; If the prediction parameter reaches the preset prediction index, the attribute combination data sequence corresponding to the prediction parameter is used as the wavelength variable selection sequence.
7. The spectrum wavelength variable selection method according to claim 6, characterized in that: After determining whether the prediction parameter reaches the preset prediction index, the method further includes: If the prediction parameter does not reach the preset prediction index, the step of predicting according to the target spectral matrix by using the structure-activity relationship model is re-executed.
8. A spectrum wavelength variable selection device, characterized in that: include: An acquisition module is used to randomly rearrange the spectral information of the target sample to obtain an initial spectral matrix; A determination module, used for determining a target spectrum matrix from the initial spectrum matrix according to a preset number of wavelength variables; A modeling module, used to determine a structure-activity relationship model between the research target of the target sample and the target spectral matrix; The selection module is used to iterate the structure-activity relationship model according to the preset prediction index and the target spectrum matrix to obtain a wavelength variable selection sequence.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for selecting a spectral wavelength variable according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the spectrum wavelength variable selection method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Near infrared spectrum variable selection method and device, electronic equipment and storage medium
CN116628463A
Soil heavy metal spectral feature extraction method based on ICO-BOSS algorithm
CN117874480A
Method and system for extracting net signals of near infrared spectrum
US20230204504A1