KAN convolution-based near infrared spectrum corn oil quantitative prediction method and system
By adopting KAN convolution-based prediction method in near-infrared spectral analysis technology, combining autoencoder and mobile window band selection technology, the problems of accuracy, generalization ability and overfitting in the existing technology are solved, and efficient and lightweight quantitative prediction of corn grease is achieved.
Patent Information
- Application Number
- CN202510184747.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-27
AI Technical Summary
Existing near-infrared spectral analysis techniques have challenges in accuracy, generalization capabilities and computational efficiency, especially in signal noise, spectral overlap, overfitting and data generalization capabilities.
A near-infrared spectral corn grease quantitative prediction method based on KAN convolution is adopted, combined with autoencoder and mobile window band selection technology, an efficient lightweight prediction algorithm is established to improve prediction accuracy and generalization ability, and reduce the risk of overfitting.
It improves the accuracy and generalization ability of quantitative prediction of corn oil, reduces the risk of overfitting, and achieves efficient prediction performance in portable spectrometer application scenarios.
Smart Images

Figure CN120216890A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of corn detection, and particularly to a quantitative prediction method and system for corn oil in near-infrared spectroscopy based on KAN convolution. Background Art
[0002] The statements in this part merely provide background technical information related to the present invention and do not necessarily constitute prior art.
[0003] In recent years, deep learning technology has been increasingly widely applied in near-infrared (NIR) spectroscopy analysis. With the growth of market demand, near-infrared (NIR) technology, relying on the advantages of rapid and non-destructive detection, has gradually developed into an indispensable core tool in agricultural production. With the continuous progress of manufacturing technology, especially the development of chip integration and sensor technology, a large number of portable spectrometers have emerged, promoting the transformation of near-infrared spectroscopy detection technology from the laboratory to a wider range of application scenarios and realizing the transformation to the general public. The potential of NIR technology in terms of accuracy, automation, and diverse application scenarios has been continuously explored. Driven by market demand, especially in the fields of food safety, environmental protection, and intelligent manufacturing, NIR spectroscopy analysis is gradually becoming one of the core technologies in industrial production processes.
[0004] However, despite the significant progress made by NIR technology, current algorithms and systems still face many challenges, especially in terms of accuracy, generalization ability, and computational efficiency. First, the accuracy is limited by signal noise and spectral overlap, resulting in instability of the analysis results; second, the generalization ability of the algorithm is insufficient, and it performs poorly when dealing with data from different sources and different environments; third, the overfitting problem is serious, especially when the amount of data is limited, it is difficult for the model to balance complexity and practical application effects, and the overfitting problem remains a major problem in deep learning algorithms. Summary of the Invention
[0005] To solve the above problems, the present invention proposes a quantitative prediction method and system for corn oil in near-infrared spectroscopy based on KAN convolution. A KAN convolution network is constructed based on the Kolmogorov-Arnold network, combined with an autoencoder and a moving window band selection technique to establish an efficient and lightweight prediction algorithm, which improves the prediction accuracy and generalization ability, and at the same time reduces the risk of overfitting.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a quantitative prediction method for corn oil in near-infrared spectroscopy based on KAN convolution, including the following steps:
[0008] Obtain the near-infrared spectral data of corn and preprocess the near-infrared spectral data of corn;
[0009] Divide the preprocessed spectral data into multiple windows, calculate the contribution degree of each window to the prediction target, select windows according to the contribution degree, extract features from the spectral data within the selected windows to obtain a low-dimensional latent representation, and reconstruct the low-dimensional latent representation to obtain a reconstructed latent representation;
[0010] Use the improved KAN convolutional network to extract features from the reconstructed latent representation to obtain comprehensive features, and perform quantitative prediction of corn oil based on the comprehensive features;
[0011] Define a loss function, optimize the model parameters, and obtain a trained quantitative prediction model for corn oil.
[0012] As an alternative implementation, preprocess the near-infrared spectral data of corn, specifically:
[0013] Adopt a method combining smoothing, standard normal transformation, and first derivative to remove noise and high-frequency components in the spectral data, eliminate baseline drift and intensity differences between different spectra, and amplify weak feature changes.
[0014] As an alternative implementation, the improved KAN convolutional network includes a KANLinear layer, a KANConvolution layer, and a KANConvolutional_Layer layer.
[0015] As an alternative implementation, the KANLinear layer calculates the B-spline basis function according to the input data by introducing the B-spline basis function and an adaptive grid, and dynamically adjusts the grid position of the B-spline basis function.
[0016] As an alternative implementation, the KANConvolution layer performs non-linear convolution based on the KANLinear layer. Through a custom convolution function, the input features are convolved with the KANLinear layer, and finally the output results of multiple KAN convolution kernels are integrated.
[0017] As an alternative implementation, the KANConvolutional_Layer layer selects an appropriate convolution method according to the dimension of the input data, encapsulates multiple KANConvolution instances, and implements multi-channel convolution operations.
[0018] In a second aspect, the present invention provides a quantitative prediction system for near-infrared spectral corn oil based on KAN convolution, including:
[0019] A data acquisition and preprocessing module, configured to: acquire near-infrared spectral data of corn and preprocess the near-infrared spectral data of corn;
[0020] A feature extraction module, configured to: divide the preprocessed spectral data into multiple windows, calculate the contribution degree of each window to the prediction target, select windows according to the contribution degree, extract features from the spectral data within the selected windows to obtain a low-dimensional latent representation, and reconstruct the low-dimensional latent representation to obtain a reconstructed latent representation;
[0021] A KAN convolution module, configured to: extract features from the reconstructed latent representation by using an improved KAN convolution network to obtain comprehensive features, and perform quantitative prediction on corn oil based on the comprehensive features;
[0022] A model training module, configured to: define a loss function, optimize model parameters, and obtain a trained quantitative prediction model for corn oil.
[0023] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the method described in the first aspect is completed.
[0024] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the method described in the first aspect is completed.
[0025] In a fifth aspect, the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the method described in the first aspect is implemented.
[0026] Compared with the prior art, the beneficial effects of the present invention are:
[0027] The present disclosure proposes a quantitative prediction method and system for near-infrared spectral corn oil based on KAN convolution. The present invention verifies the feasibility of the KAN convolution network in the field of near-infrared spectral detection, innovates the model architecture according to spectral characteristics, ensures the prediction accuracy and generalization ability of the model, and also establishes an integrated lightweight model for the application scenario of portable spectrometers and the characteristics of the KAN network, further solving the overfitting problem, providing an innovative idea for the application of the KAN convolution network in the near-infrared field.
[0028] The present disclosure proposes a quantitative prediction method and system for near-infrared spectral corn oil based on KAN convolution, and proposes a new feature extraction model MW-AE, which further improves the quality of features by combining supervised and unsupervised learning. Specifically, it is manifested in the following aspects: 1. Improve data processing efficiency: By means of a sliding window, local selection is carried out in different band intervals, which can effectively reduce the dimension of the input data, thereby accelerating the subsequent calculation process and reducing the consumption of computing resources. 2. Remove redundant bands: Through the selection of bands within the window, the model can focus on the bands that are most sensitive to the target, remove redundant and noisy bands, reduce the noise impact on the data, and improve the signal-to-noise ratio of the spectral signal. 3. Nonlinear mapping: The autoencoder can capture complex feature patterns in the spectral data through a nonlinear mapping relationship, while linear methods are difficult to effectively process these nonlinear relationships, especially when facing complex and variable spectral data. 4. Data reconstruction ability: Through the decoding process of the autoencoder, the model can obtain the reconstruction error of the input data, so as to better understand the important patterns and details in the data.
[0029] Advantages of additional aspects of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings forming a part of this specification are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention.
[0031] Figure 1 is a flowchart of the quantitative prediction method for near-infrared spectral corn oil based on KAN convolution of the present invention;
[0032] Figure 2 is a data processing flowchart of the feature extraction model of the present invention;
[0033] Figure 3 is a graph of the moving window threshold selection result of the present invention;
[0034] Figure 4 is a data processing flowchart of the autoencoder of the present invention;
[0035] Figure 5 is a graph of the reconstruction error distribution of the present invention;
[0036] Figure 6 is a network structure diagram of the KAN convolution provided by the present invention;
[0037] Figure 7 is a training fitting graph of the present invention;
[0038] Figure 8This is the loss curve graph of the implementation of the present invention. Detailed implementation manners
[0039] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0040] It should be noted that the following detailed descriptions are all exemplary and are intended to provide further descriptions of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0041] It should be noted that the terms used herein are only for describing specific implementation manners and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular forms are also intended to include the plural forms. In addition, it should be understood that the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or devices.
[0042] In the case of no conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0043] Embodiment 1
[0044] As Figure 1 shown, this embodiment provides a quantitative prediction method for near-infrared spectral corn oil based on KAN convolution, including the following steps:
[0045] S1. Obtain the near-infrared spectral data of corn and preprocess the near-infrared spectral data of corn;
[0046] S2. Divide the preprocessed spectral data into multiple windows, calculate the contribution degree of each window to the prediction target, select windows according to the contribution degree, extract features from the spectral data within the selected windows to obtain a low-dimensional latent representation, and reconstruct the low-dimensional latent representation to obtain a reconstructed latent representation;
[0047] S3. Use the improved KAN convolution network to extract features from the reconstructed latent representation to obtain comprehensive features, and perform quantitative prediction on corn oil based on the comprehensive features;
[0048] S4. Define a loss function, optimize the model parameters, and obtain a trained quantitative prediction model for corn oil.
[0049] Feasibility of using near-infrared spectroscopy to detect corn oil:
[0050] The essence of near-infrared spectroscopy is the overtone and combination frequency absorption characteristics of molecular chemical bond vibrations. The vibration modes of organic groups such as ester bonds (C=O) and fatty acid chains (-CH2, -CH3) in corn oil will form characteristic absorption peaks in the 1100 - 2500 nm band. The positions, intensities, and combined forms of these absorption peaks directly correspond to the concentration information of specific functional groups in the oil, which is the physical and chemical basis for quantitative prediction.
[0051] The main component of corn oil is triglyceride, and the chemical bonds (C=O, C-O, C-H) in its molecules have characteristic vibration modes in the near-infrared band:
[0052] Characteristic absorption of ester bond: The first overtone of the C=O stretching vibration is located at 1720 - 1760 nm.
[0053] Characteristics of fatty acid chains: The combination frequency of CH2 symmetric / asymmetric stretching vibrations is located at 1200 - 1400 nm, and the overtone of the CH3 bending vibration is located at 1600 - 1700 nm. The intensities of these absorption peaks have a linear-nonlinear mixed relationship defined by the Beer-Lambert law with the number of corresponding chemical bonds (i.e., the oil concentration), which constitutes the physical and chemical basis for quantitative prediction.
[0054] Preprocess the near-infrared spectral data of corn, specifically:
[0055] Adopt a method combining smoothing, standard normal variate transformation, and first derivative to remove noise and high-frequency components in the spectral data, eliminate baseline drift and intensity differences between different spectra, and amplify weak characteristic changes.
[0056] The present invention proposes a new feature extraction model, moving window band selection combined with autoencoder (MW-AE). For the moving window band selection in MW-AE, the entire spectral data is divided into multiple overlapping or non-overlapping windows. The threshold for moving window band selection is set to a minimum of 0.05 and a maximum of 0.20, that is, at least select the bands with a model interpretation ability exceeding 20%, and at most select the bands with an interpretation ability exceeding 5%, aiming to avoid over-screening. Adopt a small sliding window (5 bands) to more finely capture the local features of the spectral data.
[0057] Apply partial least squares regression (PLS) to the bands within each window, maximize the covariance between the input features and the target variables by extracting latent variables, calculate the contribution of each window to the prediction target, and select the bands within the windows that meet a certain threshold or rank among the top according to the contribution index of each window as the final features, as Figure 2 shown.
[0058] Mathematical description of moving window: For each sliding window W i, perform PLS regression and calculate its contribution degree Score to the prediction target y i .
[0059] Score i = PLS Score (W i , y)
[0060] Select the window W that satisfies Score i > τ, where τ is a preset threshold, as i shown Figure 3 .
[0061] Take the output feature set of the moving window band selection (MW) as the input features again and perform unsupervised learning of the autoencoder. Compress the pre-selected high-dimensional input data to a low-dimensional latent space through the encoder, and then reconstruct it back to the original dimension through the decoder. The goal is to minimize the reconstruction error, thereby extracting the main features of the data. First, determine the appropriate latent feature dimension (latent size) for the experimental dataset, then adjust the size and number of hidden layers to determine the complexity of the encoder and decoder, and finally adjust the learning rate to determine the number of training epochs as Figure 4 shown, use a histogram to represent the number of samples within the error range, and construct a distribution map of the reconstruction error, as Figure 5 shown
[0062] When facing the overfitting problem caused during the training process of the autoencoder, choose to add L2 regularization to the optimizer to constrain the model parameters by adding a weight penalty term to the optimizer, rather than directly using a sparse autoencoder. The main reason is that L1 regularization tends to set some feature activations to zero, resulting in an overly sparse feature space, while spectral data often requires a relatively continuous and smooth feature representation. L2 regularization encourages the network to learn more smoothly by penalizing large weights, effectively limiting the size of the network weights, improving the generalization performance and robustness of the model. This design helps to suppress the influence of noise on the model in spectral data analysis and ensures that the model extracts a smoother and more stable feature representation
[0063] The encoder compresses the high-dimensional input data X into a low-dimensional latent representation Z:
[0064] Z = f encoder (X) = σ(W e X + b e )
[0065] The decoder converts the latent representation Z back to the high-dimensional reconstructed data
[0066]
[0067] The reconstruction error formula is as follows:
[0068]
[0069] Where: is the reconstruction output of the autoencoder, and X i is the original input data.
[0070] After band selection, the data input to the autoencoder has been simplified and optimized, which enables the autoencoder to focus more on extracting key information from the data. The autoencoder performs feature compression on the data after band selection, further reducing redundant information while extracting the most discriminative features, which are particularly important for subsequent convolutional processing.
[0071] Based on the Kolmogorov-Arnold representation theorem, it aims to efficiently approximate and represent complex multivariate non-linear functions. The KAN network, by introducing B-spline basis functions (B-spline basis functions) and adaptive grids, no longer builds a neural network model using a fixed activation function like the MLP, but parameterizes the activation function into a spline function, emphasizing the learnability of the activation function and being able to better capture non-linear features in the data, especially suitable for quantitative analysis of high-dimensional spectral data.
[0072] The main modules of this part are:
[0073] (1) KANLinear layer, a tensor of shape (batch_size, in_features), calculates the B-spline basis function through the input data for non-linear mapping. Dynamically adjusts the grid position of the B-spline basis function to adapt to the data distribution. Then controls the model complexity through L1 and entropy regularization to prevent overfitting.
[0074] The B-spline basis function is a set of piecewise polynomial functions defined on the interval 4, used to construct smooth curves. For the B-spline basis function of order k Its recursive definition is as follows:
[0075]
[0076] where t i , is the knot vector, which determines the position and shape of the basis function.
[0077] The calculation of the uniform step size grid is as follows:
[0078]
[0079] Grid -niform = {x min -margin + i×Δi = 0, 1, …, grid - ize}
[0080] Adaptive grid update:
[0081] Grid = grid - eps×Grid - Uniform + (1 - grid - eps)×Grid - Adaptive
[0082] Among them, Grid_Adaptive is selected according to the sorting of input data, and grid_eps controls the weights of the uniform grid and the adaptive grid.
[0083] (2) KAN Convolution layer, a tensor with the shape of (batch_size, channels, length), which implements a single KAN convolution operation and performs non - linear convolution based on KANLinear. Through a custom convolution function, the input features are convolved with the KANLinear layer, and finally the output results of multiple KAN convolution kernels are integrated.
[0084] Unfold the input tensor x into a convolution window matrix X unfolded :
[0085] X unfolded = Unfold(x)
[0086] Apply the KANLinear layer to each convolution window for non - linear transformation:
[0087] y k = KANLinear(x k )
[0088] Among them, x k is the data of the k - th convolution window, and y k is the convolution output.
[0089] Integrate the outputs y k of all convolution windows into the final output tensor:
[0090] Y = Concat(y1, y2, …, y k )
[0091] (3) KAN Convolutional_Layer layer, a tensor of shape (batch_size, channels, length), supporting multiple convolutional kernels to extract features in parallel. According to the dimensions of the input data, an appropriate convolution method is selected, encapsulating multiple KAN Convolution instances to implement multi-channel convolution operations:
[0092] Y = Concat(KANConvolution1(X), KANConvolution2(X), …, KANConvolution N (X))
[0093] Y = Concat(Y1, Y2, …, Y N )
[0094] (4) Finally, build the main model, combining the KAN convolutional layer, pooling layer, and fully connected layer (KANLinear layer) to output the result.
[0095]
[0096] Among them, H in is the input length, K is the convolutional kernel size, S is the stride, P is the padding, and D is the dilation. The forward propagation process of the entire network can be expressed as:
[0097] X′ = Conv1(X)
[0098] X″ = Pool1(X′)
[0099] X″′ = Conv2(X″)
[0100] X″″ = Pool2(X″′)
[0101] X flat = Flatten(X″″)
[0102] X fcl = KANLinear1(X flat )
[0103] y = KANLinear2(X fc1 )
[0104] Conv1 and Conv2 are the first and second KAN convolutions, Pool1 and Pool2 are pooling layers, Flatten is the flattening layer, and KANLinear and KANLinear2 are fully connected layers.
[0105] The regularization part of the convolutional module abandons the traditional Dropout layer and instead focuses on the network architecture design itself. Specifically, the present invention adopts entropy regularization (Regularization Loss Entropy) and activation regularization (Regularization Loss Activation), and separately designs the convolutional layer and the flatten connection layer. Different from the Dropout layer that reduces overfitting by randomly discarding neurons, entropy regularization enhances the generalization ability of the model by optimizing the entropy value of the output to ensure that the model does not overly concentrate on local features during training; while activation regularization improves the stability and efficiency of model training by controlling the distribution of activation values to prevent excessive activation or vanishing gradients. The independent regularization design of the convolutional layer and the flatten connection layer further enhances the network's adaptability to features at different levels, ensuring precise learning of local and global features. The overall structure is as Figure 6 shown.
[0106] The advantage of using the KAN convolutional network is that instead of using the method of "linear combination + activation", it directly activates the input and then sums, providing a method to represent any multivariate continuous function as a combination of univariate functions and addition. This feature gives KAN a natural advantage in approximating complex non-linear functions. Further, it also optimizes the number of model parameters. Fewer network layers can still provide high accuracy, while also reducing the risk of overfitting.
[0107] The control experiment proves that, on the premise of maintaining approximate accuracy, both the convolutional kernel size and the number of convolutional layers of the KAN convolutional network are much less than those of the traditional convolutional network. Moreover, for the training model of the oil components of corn seeds, the number of neurons after the flatten layer is optimized from 608 to 189, a reduction of about 69%. The prediction error (RMSEP) is reduced by 29.5%, and the prediction determination coefficient is increased by 4.5%, and the residual prediction deviation ratio (RPD) is increased by about 33.1%. These indicators show that the optimized model is more reliable in processing unknown data, and its prediction performance is significantly better than that of the traditional model.
[0108] To verify the ability of the model to suppress overfitting and its advantages in terms of accuracy and parameter utilization, an 80x701 near-infrared spectroscopy dataset of the oil components of medium and small-sized corn is selected for the experiment. The reason is that due to the relatively small number of features in medium and small-sized datasets, the overfitting phenomenon is more serious in traditional convolutional models, and the experimental parameters are more intuitive.
[0109] The experiment is based on a deep learning framework built on a self-owned desktop computer, Python 3.10, and Pytorch 2.1.0. The hardware configuration and model parameters related to the experiment are shown in Table 1.
[0110] Table 1 Hardware configuration and model parameters
[0111]
[0112] The module design of MW-AE proposed in this invention is combined with KAN convolutional network, and the combination of unsupervised learning and supervised learning is realized in feature engineering, and the model is built with a new deep learning network. For the MW-AE module, the results are better when the encoder layer and decoder layer of the autoencoder are two layers respectively. As shown in Table 2, when the band threshold is 0.20, it can not only reduce the number of parameters, but also effectively retain the key parameters. Avoid the overfitting problem caused by over-learning,
[0113] Table 2 Evaluation results of threshold values of different bands of MW-AE
[0114]
[0115] The experimental results are shown in Table 3. Although Conv has a training set determination coefficient under the two-layer structure It can reach above 0.99, but the overfitting is serious, and the best is achieved in the case of a 4-layer convolution structure. MW-AE-KANConv achieves the best in the case of a two-layer convolution structure, and the training set determination coefficient is =0.9401, and the calibration error is RMSEC=0.0438, which is slightly lower than the traditional model, but still at a high fitting level. Its test set determination coefficient is Compared with the coefficient of determination of the training set, it is only 0.0073 lower (the gap is about 0.73%), and this gap has been greatly narrowed (the traditional model is 6.98%). The prediction error RMSEP is 0.0372, which is significantly lower than the 0.0527 of the traditional model, and the error is reduced by about 29.5%. At the same time, the RPD value is 4.3623, which is greatly improved (about 33.1% higher than the traditional model), reaching the standard of an excellent prediction model (RPD>4). This shows that the prediction ability of the optimized model on unknown data is significantly better than that of the traditional model, and it also shows that the training and prediction performance of the optimized model are more balanced, which greatly reduces the risk of overfitting and reflects a stronger generalization ability.
[0116] Table 3 Model comparison results
[0117]
[0118]
[0119] like Figure 7 andFigure 8 As shown, the invention not only continuously reduces the loss on the training set, but also the loss on its test set is consistent with the training set loss and always remains at a low level. Especially during the long iterative process after training, the loss on the test set hardly increases, showing stronger generalization ability. At the same time, the root mean square error, coefficient of determination, and residual prediction deviation ratio all reach better results, indicating that this method can avoid overfitting and still maintain efficient prediction performance on unknown data.
[0120] Example 2
[0121] This embodiment provides a quantitative prediction system for near-infrared spectral corn oil based on KAN convolution, including:
[0122] A data acquisition and preprocessing module, configured to: acquire the near-infrared spectral data of corn and preprocess the near-infrared spectral data of corn;
[0123] A feature extraction module, configured to: divide the preprocessed spectral data into multiple windows, calculate the contribution degree of each window to the prediction target, select windows according to the contribution degree, extract features from the spectral data within the selected windows to obtain a low-dimensional latent representation, and reconstruct the low-dimensional latent representation to obtain a reconstructed latent representation;
[0124] A KAN convolution module, configured to: use an improved KAN convolution network to extract features from the reconstructed latent representation to obtain comprehensive features, and perform quantitative prediction on corn oil based on the comprehensive features;
[0125] A model training module, configured to: define a loss function, optimize model parameters, and obtain a trained quantitative prediction model for corn oil.
[0126] It should be noted here that the above modules correspond to the steps described in Example 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above Example 1. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.
[0127] In more embodiments, there is also provided:
[0128] An electronic device, including a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the method described in Example 1 is completed. For the sake of brevity, it will not be elaborated here.
[0129] It should be understood that in this embodiment, the processor may be a central processing unit (CPU), or the processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0130] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0131] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by the processor, the method described in Embodiment 1 is completed.
[0132] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor. The software module may be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0133] A computer program product includes a computer program. When the computer program is executed by the processor, the method described in Embodiment 1 is implemented.
[0134] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer-executable instructions, such as instructions included in program modules, which are executed in a device on a target real or virtual processor to perform the process / method as described above. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules may be combined or divided as needed. The machine-executable instructions for program modules may be executed locally or within a distributed device. In a distributed device, program modules may be located in local and remote storage media.
[0135] The computer program code for implementing the method of the present invention can be written in one or more programming languages. This computer program code can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program code is executed by the computer or other programmable data processing devices, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the computer, partially on the computer, as an independent software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.
[0136] In the context of the present invention, the computer program code or related data can be carried by any suitable carrier so that the device, apparatus, or processor can execute the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like. Examples of signals can include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, etc.
[0137] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with this embodiment can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0138] Although the specific implementation manners of the present invention have been described above in conjunction with the accompanying drawings, this is not a limitation on the protection scope of the present invention. Those skilled in the art should understand that, based on the technical solution of the present invention, various modifications or deformations that can be made by those skilled in the art without creative efforts are still within the protection scope of the present invention.
Claims
1. A quantitative prediction method for corn oil based on near infrared spectroscopy with KAN convolution, characterized in that: The following steps are involved: Acquire near infrared spectrum data of corn, and preprocess the near infrared spectrum data of corn; The preprocessed spectral data is divided into multiple windows, the contribution of each window to the prediction target is calculated, a window is selected according to the contribution, features are extracted from the spectral data in the selected window to obtain a low-dimensional potential representation, and the low-dimensional potential representation is reconstructed to obtain a reconstructed potential representation; The improved KAN convolutional network is used to extract features from the reconstructed latent representation to obtain comprehensive features, and then the corn oil is quantitatively predicted based on the comprehensive features. Define the loss function, optimize the model parameters, and obtain the trained corn oil quantitative prediction model.
2. The quantitative prediction method of corn oil based on near infrared spectrum of KAN convolution as claimed in claim 1, characterized in that: The near infrared spectrum data of corn is preprocessed as follows: A method combining smoothing, standard normal transformation and first-order derivative is used to remove noise and high-frequency components in spectral data, eliminate baseline drift and intensity differences between different spectra, and amplify weak feature changes.
3. The quantitative prediction method of corn oil based on near infrared spectrum of KAN convolution as claimed in claim 1, characterized in that: The improved KAN convolutional network includes a KANLinear layer, a KANConvolution layer and a KANConvolutional_Layer layer.
4. The quantitative prediction method of corn oil based on near infrared spectrum of KAN convolution as claimed in claim 3, characterized in that: The KANLinear layer introduces B-spline basis functions and adaptive grids, calculates B-spline basis functions according to input data, and dynamically adjusts the grid positions of the B-spline basis functions.
5. The quantitative prediction method of corn oil based on near infrared spectrum of KAN convolution as claimed in claim 3, characterized in that: The KANConvolution layer performs nonlinear convolution based on the KANLinear layer, and convolves the input features with the KANLinear layer through a custom convolution function, and finally integrates the output results of multiple KAN convolution kernels.
6. The quantitative prediction method of corn oil based on near infrared spectrum of KAN convolution as claimed in claim 3, characterized in that: The KANConvolutional_Layer layer selects an appropriate convolution method according to the dimension of the input data, encapsulates multiple KANConvolution instances, and implements multi-channel convolution operations.
7. A quantitative prediction system for corn oil based on near infrared spectroscopy with KAN convolution, characterized in that: include: The data acquisition and preprocessing module is configured to: acquire near-infrared spectrum data of corn and preprocess the near-infrared spectrum data of corn; The feature extraction module is configured to: divide the preprocessed spectral data into a plurality of windows, calculate the contribution of each window to the prediction target, select a window according to the contribution, extract features from the spectral data in the selected window to obtain a low-dimensional potential representation, reconstruct the low-dimensional potential representation to obtain a reconstructed potential representation; The KAN convolution module is configured to: extract features from the reconstructed latent representation using the improved KAN convolution network to obtain comprehensive features, and quantitatively predict corn oil based on the comprehensive features; The model training module is configured to: define the loss function, optimize the model parameters, and obtain the trained corn oil quantitative prediction model.
8. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 6 is completed.
9. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Cited By
Near infrared spectrum-based leaf moisture content and chlorophyll detection method
CN120992551A