A method and system for food component analysis based on near-infrared spectroscopy

By combining intelligent sampling and attention-enhanced convolutional neural networks with spectral feature selection technology, the problems of local sample differences and complexity of traditional methods in near-infrared spectroscopy are solved, enabling efficient and accurate food composition analysis and human metabolic impact assessment, and generating easy-to-understand reports.

CN120009222BActive Publication Date: 2026-03-13CSSC HAISHEN MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing near-infrared spectroscopy techniques are easily affected by local differences in samples in food composition analysis, leading to reduced data consistency and reliability. Traditional machine learning methods are complex and time-consuming in feature selection and model parameter tuning when processing high-dimensional spectral data, making it difficult to automatically focus on key areas, and the analysis results are complex and difficult to understand.

Method used

High-quality near-infrared spectral signals are generated using intelligent sampling methods. Convolutional neural networks enhanced with attention mechanisms automatically focus on key regions. Representative features are selected using spectral feature selection technology. Finally, the effects of food on human metabolism are evaluated using gradient boosting decision tree algorithms, generating an easy-to-understand analysis report.

Benefits of technology

It improves the accuracy and efficiency of food composition analysis, provides a comprehensive analysis of the effects of human metabolism, generates easy-to-understand analysis reports, and is suitable for large-scale sample analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120009222B_ABST
    Figure CN120009222B_ABST
Patent Text Reader

Abstract

This application provides a method and system for food component analysis based on near-infrared spectroscopy. The method involves acquiring near-infrared spectral signals from food samples using an intelligent sampling method to generate sample near-infrared spectral signals. Based on these signals, an attention-enhanced convolutional neural network is used to automatically focus on key regions. Combined with spectral feature selection technology, spectral features are screened to generate sample component and content information. Based on this information, a gradient boosting decision tree algorithm is used to assess the degree of impact on human metabolism. Combined with bioinformatics analysis techniques, the biological mechanisms are analyzed to generate a sample impact assessment report. Based on this report, natural language processing is used to generate a food component analysis report. The technical solution provided in this application achieves high-precision, automated food component analysis, improving analytical accuracy and efficiency, and providing in-depth analysis of the mechanisms by which food components affect human metabolism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of food component analysis technology, and in particular to a food component analysis method and system based on near-infrared spectroscopy. Background Technology

[0002] With the rapid development of the food industry and the increasing demands of consumers for food safety and quality, food composition analysis technology is playing an increasingly important role in ensuring food quality and safety. In order to meet the needs of these application scenarios, food composition analysis technology needs to have high precision, high efficiency, automated processing capabilities, and the ability to deeply analyze the mechanisms by which food components affect human metabolism.

[0003] Among existing methods for food composition analysis, near-infrared spectroscopy is widely used due to its non-destructive and rapid nature. This technique, by acquiring near-infrared spectral signals from samples and combining them with chemometric methods, enables quantitative analysis of food components. Some studies employ traditional machine learning methods (such as support vector machines and random forests) to model near-infrared spectral data to predict the content of food components. These methods typically rely on feature selection and model training, but often require extensive manual parameter tuning and feature engineering. When assessing the impact of food components on human metabolism, researchers often combine bioinformatics analysis techniques, utilizing gene expression data, metabolic pathways, and other information to delve into the biological mechanisms.

[0004] Existing near-infrared spectroscopy acquisition methods may be affected by local differences in samples, leading to reduced data consistency and reliability. Traditional machine learning methods are complex and time-consuming in feature selection and model parameter tuning when processing high-dimensional spectral data, making it difficult to automatically focus on key regions and select the most representative spectral features. Existing analytical methods often only provide information on component content, lacking analysis of the impact on human metabolism, and cannot comprehensively assess the safety and health of food. The generated analytical reports usually contain a large number of technical terms and complex data, which are difficult for non-professionals to understand and use, limiting their practical application value. Summary of the Invention

[0005] This application provides a food component analysis method and system based on near-infrared spectroscopy to address the lack of analysis of the effects of human metabolism in the prior art.

[0006] In a first aspect, embodiments of this application provide a food component analysis method based on near-infrared spectroscopy, comprising:

[0007] Near-infrared spectral signals are collected from food samples, and intelligent sampling methods are used to avoid local differences in the samples to generate near-infrared spectral signals.

[0008] Based on the near-infrared spectral signal of the sample, an attention-enhanced convolutional neural network is used to automatically focus on key regions of the near-infrared spectral signal of the sample. Combined with spectral feature selection technology, the most representative spectral features are selected to generate sample composition and content information.

[0009] Based on the sample composition and content information, the gradient boosting decision tree algorithm is used to assess the degree of impact of the food sample on human metabolism. Combined with bioinformatics analysis technology, the biological mechanism is analyzed in depth, and a sample impact assessment report is generated.

[0010] Based on the sample impact assessment report, natural language processing is used to convert it into easily understandable language to generate a food composition analysis report.

[0011] Optionally, based on the near-infrared spectral signal of the sample, an attention-enhanced convolutional neural network is used to automatically focus on key regions of the near-infrared spectral signal of the sample, and combined with spectral feature selection technology, the most representative spectral features are screened to generate sample composition and content information, including:

[0012] Based on the near-infrared spectral signal of the sample, noise and interference are removed by intelligent preprocessing method to generate a high-quality near-infrared spectral signal;

[0013] Based on the high-quality near-infrared spectral signal, an attention-enhanced convolutional neural network is used to automatically identify and focus on key regions of the spectral signal, extract deep features, and generate deep features of key regions.

[0014] Based on the deep features of the key regions, combined with spectral feature selection technology and the representativeness of sample component information, representative spectral features are generated.

[0015] Based on the representative spectral features, a spectral-component mapping model is pre-constructed to predict the composition and content ratio of components, thereby generating sample component and content information.

[0016] Optionally, the step of automatically identifying and focusing on key regions of the spectral signal based on the high-quality near-infrared spectral signal, extracting deep features, and generating deep features of key regions using an attention-enhanced convolutional neural network includes:

[0017] Based on the high-quality near-infrared spectral signal, key regions of the spectral signal are automatically identified and generated through pre-training.

[0018] Based on the key region identifiers, a convolutional neural network with an enhanced attention mechanism is used to extract features from the key regions of the spectral signal, generating deep features of the spectral signal.

[0019] Based on the deep features of the spectral signal, features at different levels are fused using feature integration technology to enhance feature representation capabilities and generate a comprehensive feature representation.

[0020] Based on the comprehensive feature representation, and combined with the key region identifier, optimization processing is performed to generate deep features of the key region.

[0021] Optionally, based on the key region identifiers, an attention-enhanced convolutional neural network is used to extract features from the key regions of the spectral signal, generating deep features of the spectral signal, including:

[0022] Based on the key region identifiers, wavelet transform is performed on the input features to decompose the signal into different frequency bands;

[0023] Singular value decomposition is performed to extract important singular values, and the feature dimension is compressed to generate a primary feature representation;

[0024] The primary feature representation is calculated using the following formula:

[0025]

[0026] Where, F1(x) i ) represents the primary feature representation of the i-th input feature in the key region of the spectral signal; x i The i-th input feature of the key region of the spectral signal; w i W represents the weight of the i-th input feature; i is the index of the input feature, from 1 to N; N is the number of input features; a b is the weight matrix for the attention mechanism; a Here, c is the bias vector for the attention mechanism; tanh is the hyperbolic tangent activation function, used to introduce nonlinearity; a σ is the center vector of the attention mechanism; a The standard deviation of the attention mechanism;

[0027] Based on the primary feature representation, it is input to multiple different attention modules and transformed and enhanced through different weight matrices and bias vectors. Gaussian kernel function and periodic change term are introduced to generate deep feature representation.

[0028] The deep feature representation is calculated using the following formula:

[0029]

[0030] Among them, F2(h i F1(x) represents the deep feature representation of the i-th high-level feature in the key region of the spectral signal; i ) represents the primary feature representation of the i-th input feature in the key region of the spectral signal; h iLet w be the i-th high-level feature in the key region of the spectral signal; i is the index of the high-level feature, from 1 to N; N is the number of high-level features; ik Let be the weight matrix for the i-th high-level feature at the k-th attention; k is the index of the attention module, from 1 to K; K is the number of attention modules; b ak W is the bias vector for the k-th attention module; ReLU is the modified linear unit activation function, used to introduce nonlinearity; ak c is the weight matrix of the k-th attention module; k σ is the center vector of the k-th attention module; k α is the standard deviation of the k-th attention module; α is the amplitude coefficient; β is the frequency coefficient;

[0031] Based on the deep feature representation, features generated by different attention modules are integrated through feature fusion to enhance the overall expressive power of the features. Regularization is used for smoothing, and combined with the key regions of the spectral signal, deep features of the spectral signal are generated.

[0032] Optionally, the step of generating representative spectral features based on the deep features of the key region, combined with spectral feature selection technology and the representativeness of sample component information, includes:

[0033] Based on the deep features of the key regions, combined with spectral feature selection technology, preliminary screening is performed to remove redundant and irrelevant features and generate a preliminary screening feature set.

[0034] Based on the preliminary feature set, the correlation between each feature and the sample component information is evaluated using statistical analysis methods to generate a feature importance score;

[0035] Based on the feature importance scores, select the highest-scoring features to ensure that they represent the sample composition information to the greatest extent possible, and generate a representative feature set.

[0036] Based on the representative feature set, dimensionality reduction is performed using principal component analysis to extract the main components and generate representative spectral features.

[0037] Optionally, based on the sample composition and content information, a gradient boosting decision tree algorithm is used to assess the degree of impact of the food sample on human metabolism. Combined with bioinformatics analysis techniques, the biological mechanisms are analyzed in depth to generate a sample impact assessment report, including:

[0038] Based on the sample composition and content information, a human metabolic impact assessment dataset is set up, and standardized processing is performed to generate standardized input data.

[0039] Based on the standardized input data, the gradient boosting decision tree algorithm is used to predict the correlation between food components and human metabolism, and a correlation prediction model is generated.

[0040] Based on the aforementioned correlation prediction model, the extent to which food samples affect human metabolism is assessed, and preliminary impact assessment results are generated.

[0041] Based on the preliminary impact assessment results, and combined with bioinformatics analysis techniques, we will conduct an in-depth analysis of the specific biological mechanisms by which food components affect human metabolism, and generate a sample impact assessment report.

[0042] Optionally, the step of using a gradient boosting decision tree algorithm to predict the correlation between food components and their effects on human metabolism, based on the standardized input data, and generating a correlation prediction model, includes:

[0043] Based on the standardized input data, data preprocessing and outlier detection are performed to generate a preprocessed input dataset.

[0044] Based on the preprocessed input dataset, the gradient boosting decision tree algorithm is used to predict the correlation between food components and human metabolism, and an initial prediction model is generated.

[0045] Based on the initial prediction model, cross-validation is used for training and validation to improve the prediction accuracy and generalization ability of the initial prediction model and generate an optimized prediction model.

[0046] Based on the optimized prediction model, the model parameters are further optimized, and the learning rate and the number of decision trees are adjusted to improve stability and prediction performance. Through multiple iterations and verifications, a correlation prediction model is generated.

[0047] Optionally, based on the preprocessed input dataset, a gradient boosting decision tree algorithm is used to predict the correlation between food components and their effects on human metabolism, generating an initial prediction model, including:

[0048] Based on the preprocessed input dataset, recursive feature elimination is used to select the feature that contributes the most to the prediction, thereby reducing the influence of noisy features and generating sample residuals.

[0049] The sample residuals are calculated using the following formula:

[0050]

[0051] in, y is the sample residual of the i-th sample in the t-th iteration; i α represents the actual observed value of the i-th sample; j h represents the weight of the j-th decision tree; j (x i) represents the prediction value of the j-th decision tree for the i-th sample; β k W represents the weight of the k-th nonlinear transformation. k b is the weight matrix for the k-th nonlinear transformation; k σ is the bias vector for the k-th nonlinear transformation; σ is the sigmoid activation function used to introduce nonlinearity; j is the index of the decision tree, from 1 to t-1; k is the index of the nonlinear transformation, from 1 to t-1; t is the iteration number; x i Let be the feature vector of the i-th sample;

[0052] Based on the sample residuals, the parts that the model did not predict correctly are identified, and statistical methods are used to further confirm the abnormal residuals. By minimizing the sum of squared residuals, the decision tree structure and parameters are optimized to generate sample prediction values.

[0053] The predicted value of the sample is calculated using the following formula:

[0054]

[0055] Among them, h t (x i Let be the sample prediction value of the t-th decision tree for the i-th sample; λ is the sample residual of the i-th sample in the t-th iteration; λ is the nonlinear adjustment parameter used to control the nonlinearity of the loss function; λ1 is the regularization parameter of the leaf node output of the decision tree; J is the number of leaf nodes in the decision tree; θ j c is the output value of the j-th leaf node; j σ is the center vector of the j-th Gaussian kernel function; j λj is the standard deviation of the j-th Gaussian kernel function; λ2 is the regularization parameter for the weights of the internal nodes of the decision tree; K is the number of internal nodes of the decision tree; ωj k Let v be the weight of the k-th internal node; μ is the nonlinear adjustment parameter of the internal node; v k Let be the weight vector of the k-th internal node; i is the index of the sample, from 1 to N; N is the total number of samples; j is the index of the leaf node, from 1 to J; k is the index of the internal node, from 1 to K; h is the decision tree model; x i h(x) is the feature vector of the i-th sample; i ) is a decision tree for the i-th sample x i The predicted value of the sample;

[0056] Based on the sample predictions, the predictions from multiple decision trees are integrated by weighted averaging. The generated predictions are evaluated using cross-validation to further optimize the model hyperparameters, improve model stability and prediction performance, and generate an initial prediction model.

[0057] Optionally, based on the sample impact assessment report, the process of converting it into easily understandable language using natural language processing to generate a food composition analysis report includes:

[0058] Based on the sample impact assessment report, key assessment results are extracted, and combined with biological mechanism analysis information to generate structured data;

[0059] Based on the structured data, natural language processing is used to generate text, converting technical terms into easily understandable language descriptions to generate a preliminary text report.

[0060] Based on the preliminary text report, combined with visualization processing, charts and images are generated to help illustrate the impact of food components, thus generating a visual text report;

[0061] Based on the aforementioned visual text report, further editing and formatting adjustments are made to generate a food composition analysis report.

[0062] Secondly, embodiments of this application provide a food component analysis system based on near-infrared spectroscopy, comprising:

[0063] The acquisition module is used to acquire near-infrared spectral signals from food samples. It uses an intelligent sampling method to avoid local differences in the sample and generates the sample's near-infrared spectral signal.

[0064] The screening module is used to automatically focus on key regions of the near-infrared spectral signal of the sample based on the near-infrared spectral signal of the sample using an attention-enhanced convolutional neural network, and combined with spectral feature selection technology to screen the most representative spectral features and generate sample composition and content information.

[0065] The generation module is used to evaluate the impact of the food sample on human metabolism based on the sample composition and content information, using a gradient boosting decision tree algorithm, and combining bioinformatics analysis technology to deeply analyze the biological mechanisms and generate a sample impact assessment report.

[0066] The conversion module is used to convert the sample impact assessment report into an easy-to-understand language description using natural language processing, and generate a food composition analysis report.

[0067] In this embodiment, near-infrared spectral signals are collected from food samples. An intelligent sampling method is used to avoid local differences in the samples, generating near-infrared spectral signals. Based on these signals, an attention-enhanced convolutional neural network is used to automatically focus on key regions of the near-infrared spectral signals. Combined with spectral feature selection technology, the most representative spectral features are selected to generate sample composition and content information. Based on this information, a gradient boosting decision tree algorithm is used to assess the impact of the food sample on human metabolism. Combined with bioinformatics analysis techniques, the biological mechanisms are analyzed in depth, generating a sample impact assessment report. Based on this report, natural language processing is used to convert the data into easily understandable language, generating a food composition analysis report. By acquiring near-infrared spectral signals through intelligent sampling methods, local differences in samples can be effectively avoided, ensuring data consistency and reliability. Attention-enhanced convolutional neural networks automatically focus on key regions, and combined with spectral feature selection technology, the most representative spectral features are selected, thereby improving the precision and accuracy of component analysis. Employing attention-enhanced convolutional neural networks and gradient boosting decision tree algorithms, the entire analysis process is highly automated, reducing the need for manual intervention and improving analysis efficiency. Through efficient feature extraction and model training, large amounts of data can be processed in a short time, making it suitable for large-scale sample analysis. Combined with bioinformatics analysis techniques, the mechanisms by which food components affect human metabolism can be deeply analyzed, providing a more comprehensive and in-depth biological understanding and offering important reference for scientific research and product development. Natural language processing technology is used to convert complex analysis results into easily understandable language descriptions, facilitating comprehension and use by non-professionals and improving the practicality and readability of the report. By comprehensively utilizing multiple advanced technologies, the analysis can more comprehensively reflect food components and their impact on human metabolism, providing strong support for food safety and health research.

[0068] Furthermore, intelligent preprocessing methods are used to remove noise and interference, generating high-quality near-infrared spectral signals to ensure the accuracy and reliability of subsequent analyses. Attention-enhanced convolutional neural networks can automatically identify and focus on key regions of the spectral signal, extracting deep features and thus improving the accuracy and efficiency of feature extraction. Combined with spectral feature selection technology, the most representative spectral features are generated based on the representativeness of sample component information, reducing redundant information and improving the model's generalization ability. The pre-built spectral-component mapping model can accurately predict component composition and content ratios, generating high-precision sample component and content information, providing a reliable foundation for subsequent analyses.

[0069] Furthermore, by standardizing the sample composition and content information, standardized input data is generated to ensure data consistency and comparability, thereby improving the stability and predictive accuracy of the model. Using the gradient boosting decision tree algorithm, the correlation between food components and their effects on human metabolism can be efficiently predicted, generating a correlation prediction model that provides a scientific basis for assessing the impact of food on the human body. Based on this correlation prediction model, the degree of impact of food samples on human metabolism can be comprehensively assessed, generating preliminary impact assessment results and providing important references for food safety and health research. Combined with bioinformatics analysis techniques, the specific biological mechanisms by which food components affect human metabolism are analyzed in depth, generating a detailed sample impact assessment report that provides a more comprehensive and in-depth biological understanding. The generated sample impact assessment report not only includes composition and content information but also provides detailed analyses of biological mechanisms, making it easier for researchers and non-professionals to understand and use, thus improving the report's practicality and readability.

[0070] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description

[0071] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0072] Figure 1 A flowchart illustrating a food component analysis method based on near-infrared spectroscopy, provided for embodiments of this application;

[0073] Figure 2 A schematic diagram of the structure of a food component analysis system based on near-infrared spectroscopy provided in an embodiment of this application;

[0074] Figure 3 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation

[0075] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0076] In some of the processes described in the specification, claims, and accompanying drawings of this application, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not themselves represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.

[0077] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0078] Figure 1 A flowchart of a food component analysis method based on near-infrared spectroscopy is provided as an embodiment of this application, such as... Figure 1 As shown, the method includes:

[0079] 101. Near-infrared spectral signals are collected from food samples, and intelligent sampling methods are used to avoid local differences in the samples, thereby generating near-infrared spectral signals of the samples;

[0080] Near-infrared spectroscopy is a non-destructive testing technique that obtains information about the chemical composition of a sample by measuring its absorption or reflection spectra in the near-infrared region (700-2500 nm). This technique is widely used in food, pharmaceuticals, agriculture, and other fields.

[0081] Intelligent sampling methods utilize advanced sensor technology and data analysis algorithms to automatically select optimal sampling points, thereby avoiding the influence of local differences in the sample on the analysis results. This method can improve the consistency and reliability of the data.

[0082] The near-infrared spectral signal of a sample is the absorption or reflection spectral data of a food sample in the near-infrared region (700-2500 nm) acquired by near-infrared spectroscopy. It contains information about various chemical components in the sample and is the basis for subsequent analysis.

[0083] In this embodiment, a high-precision near-infrared spectrometer is first used to scan the food sample to obtain preliminary spectral data. Secondly, these preliminary data are analyzed using an intelligent sampling algorithm to identify possible local differences and select multiple representative sampling points. Thirdly, the selected sampling points are scanned repeatedly to ensure the stability and consistency of the data. Finally, these high-quality spectral data are integrated and processed to generate the final near-infrared spectral signal of the sample.

[0084] Suppose we have a batch of apples and we need to analyze their moisture content;

[0085] First, a preliminary scan of the entire apple is performed using a near-infrared spectrometer to obtain preliminary spectral data. This step provides an overall spectral overview but may include local variations. Second, this preliminary spectral data is analyzed using an intelligent sampling algorithm to identify local differences between different parts (peel, flesh, and core). For example, the moisture content of the peel may differ from that of the flesh and core. The intelligent sampling algorithm automatically selects multiple representative sampling points to ensure data consistency and reliability. In this example, three different parts of the apple—the top, middle, and bottom—are selected as sampling points. Third, each selected sampling point (top, middle, and bottom) is scanned three times. Spectral data is recorded for each scan to ensure data stability and consistency. Multiple scans reduce random errors and improve data reliability. Finally, the spectral data from these three parts are integrated and processed. Specifically, an averaging or weighted averaging method can be used to merge the data from multiple scans to generate the final near-infrared spectral signal of the sample.

[0086] Through the above steps, a high-quality near-infrared spectral signal representing the overall moisture content of the apple is obtained, providing a reliable basis for subsequent component analysis.

[0087] 102. Based on the near-infrared spectral signal of the sample, an attention-enhanced convolutional neural network is used to automatically focus on the key regions of the near-infrared spectral signal of the sample. Combined with spectral feature selection technology, the most representative spectral features are selected to generate sample composition and content information.

[0088] Attention-enhanced convolutional neural networks are deep learning models that automatically identify and focus on key regions in input data by introducing an attention mechanism, helping the model pay more attention to important features when processing complex data.

[0089] Spectral feature selection is a data preprocessing method used to select the most representative features from high-dimensional spectral data to improve model performance and generalization ability.

[0090] Sample composition and content information refers to the extraction and identification of the types and relative contents of various chemical components in a food sample by analyzing near-infrared spectral signals. This is crucial for assessing the quality, safety, and nutritional value of food.

[0091] In this step, firstly, high-quality near-infrared spectral signals are input into a convolutional neural network enhanced with an attention mechanism; secondly, the network automatically identifies and focuses on key regions of the spectral signal through the attention mechanism, extracting deep features from these regions; thirdly, spectral feature selection technology is used to filter the extracted features, removing redundant features and retaining the most representative spectral features; finally, based on the most representative spectral features, a spectral-composition mapping model is constructed to predict the composition and content ratio of the sample, generating sample composition and content information.

[0092] Optionally, step 102, which involves using an attention-enhanced convolutional neural network to automatically focus on key regions of the near-infrared spectral signal of the sample, and combining this with spectral feature selection technology to screen the most representative spectral features and generate sample composition and content information, includes: removing noise and interference from the near-infrared spectral signal of the sample using an intelligent preprocessing method to generate a high-quality near-infrared spectral signal; automatically identifying and focusing on key regions of the spectral signal using an attention-enhanced convolutional neural network based on the high-quality near-infrared spectral signal, extracting deep features, and generating deep features of key regions; screening representative spectral features based on the deep features of key regions and combining spectral feature selection technology with the representativeness of sample composition information; and pre-constructing a spectral-composition mapping model based on the representative spectral features to predict the composition and content ratio of components, thereby generating sample composition and content information.

[0093] The step of automatically identifying and focusing on key regions of the spectral signal based on the high-quality near-infrared spectral signal, extracting deep features, and generating deep features of the key regions using an attention-enhanced convolutional neural network includes: automatically identifying and locating key regions of the spectral signal based on the high-quality near-infrared spectral signal through pre-training, and generating key region identifiers; extracting features from the key regions of the spectral signal using an attention-enhanced convolutional neural network based on the key region identifiers, and generating deep features of the spectral signal; fusing features at different levels based on the deep features of the spectral signal through feature integration technology to enhance feature expression capabilities and generate a comprehensive feature representation; and optimizing the comprehensive feature representation in conjunction with the key region identifiers to generate deep features of the key regions.

[0094] High-quality near-infrared spectral signals are generated by removing noise and interference through intelligent preprocessing methods. They have higher signal-to-noise ratio and consistency, and can more accurately reflect the chemical composition information of the sample.

[0095] Attention-enhanced convolutional neural networks (CNNs) are deep learning models that automatically identify and focus on key regions in input data by introducing an attention mechanism, thereby improving the accuracy and efficiency of feature extraction. The attention mechanism dynamically allocates weights, allowing the model to focus more on important features.

[0096] The deep features of key regions are deep feature representations of key regions extracted from high-quality near-infrared spectral signals by a convolutional neural network enhanced by an attention mechanism, which are used for subsequent component analysis and content prediction.

[0097] Spectral feature selection is a technique used to select the most representative features from high-dimensional spectral data, reducing redundant information and improving the model's generalization ability and computational efficiency.

[0098] The spectral-component mapping model is a model built based on representative spectral features, used to predict the component composition and content ratio of food samples.

[0099] In this embodiment, firstly, based on high-quality near-infrared spectral signals, key regions of the spectral signals are automatically identified and located using a pre-trained model, generating key region identifiers; secondly, a convolutional neural network enhanced with an attention mechanism is used to extract features from these key regions, generating deep features of the spectral signals; thirdly, features at different levels are fused using feature integration technology to enhance feature representation capabilities and generate comprehensive feature representations; finally, the key region identifiers are combined with optimization processing to generate deep features of the key regions.

[0100] Suppose we have a batch of wheat flour and we need to analyze its protein content;

[0101] First, a high-precision near-infrared spectrometer is used to acquire near-infrared spectral signals of wheat flour. Noise and interference are removed using intelligent preprocessing methods (such as wavelet transform and smoothing filtering) to generate high-quality near-infrared spectral signals. Second, the high-quality near-infrared spectral signals are input into a pre-trained model. This model uses automatic identification algorithms (such as autoencoders or clustering algorithms) to locate key regions of the spectral signals and generate key region identifiers. Next, a convolutional neural network with attention-enhanced mechanisms is used to extract features from these key regions, generating deep features of the spectral signals. Then, feature integration techniques (such as multi-scale feature fusion or feature pyramid networks) are used to fuse features at different levels, enhancing feature representation capabilities and generating a comprehensive feature representation. Third, optimization processing is performed in conjunction with the key region identifiers to generate deep features of the key regions. Finally, based on these deep features of the key regions and combined with spectral feature selection techniques, the most representative spectral features are selected. Using a pre-built spectral-composition mapping model, the protein content in wheat flour is predicted, generating sample composition and content information.

[0102] By following the steps above, the protein content in wheat flour can be analyzed efficiently and accurately, providing a scientific basis for quality control and food safety.

[0103] This application takes into account that in a convolutional neural network enhanced by attention mechanism, features are extracted from key regions of spectral signals through wavelet transform and singular value decomposition to generate primary feature representations. Then, the feature representations are further enhanced by multiple different attention modules, and a Gaussian kernel function and periodic variation term are introduced to generate deep feature representations. Finally, deep features of the spectral signal are generated through feature fusion and smoothing.

[0104] Optionally, based on the key region identifiers, an attention-enhanced convolutional neural network is used to extract features from the key regions of the spectral signal, generating deep features of the spectral signal, including:

[0105] Based on the key region identifiers, wavelet transform is performed on the input features to decompose the signal into different frequency bands;

[0106] Singular value decomposition is performed to extract important singular values, and the feature dimension is compressed to generate a primary feature representation;

[0107] The primary feature representation is calculated using the following formula:

[0108]

[0109] Where, F1(x) i ) represents the primary feature representation of the i-th input feature in the key region of the spectral signal; x i The i-th input feature of the key region of the spectral signal; w iW represents the weight of the i-th input feature; i is the index of the input feature, from 1 to N; N is the number of input features; a b is the weight matrix for the attention mechanism; a Here, c is the bias vector for the attention mechanism; tanh is the hyperbolic tangent activation function, used to introduce nonlinearity; a σ is the center vector of the attention mechanism; a The standard deviation of the attention mechanism;

[0110] Based on the primary feature representation, it is input to multiple different attention modules and transformed and enhanced through different weight matrices and bias vectors. Gaussian kernel function and periodic change term are introduced to generate deep feature representation.

[0111] The following formula can be used to calculate:

[0112]

[0113] Among them, F2(h i F1(x) represents the deep feature representation of the i-th high-level feature in the key region of the spectral signal; i ) represents the primary feature representation of the i-th input feature in the key region of the spectral signal; h i Let w be the i-th high-level feature in the key region of the spectral signal; i is the index of the high-level feature, from 1 to N; N is the number of high-level features; ik Let be the weight matrix for the i-th high-level feature at the k-th attention; k is the index of the attention module, from 1 to K; K is the number of attention modules; b ak W is the bias vector for the k-th attention module; ReLU is the modified linear unit activation function, used to introduce nonlinearity; ak c is the weight matrix of the k-th attention module; k σ is the center vector of the k-th attention module; k α is the standard deviation of the k-th attention module; α is the amplitude coefficient; β is the frequency coefficient;

[0114] Based on the deep feature representation, features generated by different attention modules are integrated through feature fusion to enhance the overall expressive power of the features. Regularization is used for smoothing, and combined with the key regions of the spectral signal, deep features of the spectral signal are generated.

[0115] This method aims to

[0116] In the primary feature representation, the attention weight part w i : Assign weights to each input feature to highlight important features; hyperbolic tangent activation function part tanh(W a ·x i +b a): Introducing nonlinearity to enhance the model's expressive power; Gaussian kernel function part Local correlation is introduced by using a Gaussian kernel function to enhance feature representation;

[0117] Where, x i Input features extracted from key regions of the spectral signal; w i Obtained through iterative optimization during the training process; W a ,b a : Obtained through iterative optimization during the training process; c a ,σ a Obtained through iterative optimization during the training process;

[0118] In deep feature representation, the attention weight part w ik : Assign weights to each high-level feature in different attention modules to highlight important features; ReLU activation function part ReLU(W ak ·F1(x i )+b ak ): Introducing nonlinearity to enhance the model's expressive power; Gaussian kernel function part. Local correlation is introduced through a Gaussian kernel function to enhance feature representation; the periodic variation term (1+α·sin(β·F1(x)) is used. i ))): Introducing periodic changes enhances the diversity of feature representations;

[0119] Where, F1(x) i The value is calculated using the primary feature representation of the i-th input feature in the key region of the spectral signal; h i High-level features extracted from key regions of the spectral signal; w ik W ak ,b ak Obtained through iterative optimization during the training process; c k ,σ k The parameters are obtained through iterative optimization during the training process; α and β are hyperparameters, obtained through cross-validation.

[0120] Suppose we need to analyze the oil content in a batch of coffee beans;

[0121] Given a dataset containing 100 samples, each sample has 10 features; suppose that for the key region identifier of the first sample, its input features are x1, x2, ..., x 10 Weight matrix W a =[0.1,0.2,…,0.9], bias vector b a =0.5, center vector c a = [0.5, 0.6, ..., 1.4], standard deviation σ a=0.1, weights w1=0.8, w2=0.7,…,w 10 =0.1;

[0122]

[0123] Assuming a threshold of 0.7 is set, since the deep feature representation of 0.8 is greater than the set threshold of 0.7, it indicates that the feature representation enhanced by the attention mechanism is more significant and can better capture the key features of the spectral signal. Through the above steps, the key features of the spectral signal can be effectively extracted and enhanced, the feature representation capability of the model can be enhanced, and the prediction accuracy of the oil content in coffee beans can be improved.

[0124] Optionally, the step of generating representative spectral features based on the deep features of the key region, combined with spectral feature selection technology and the representativeness of sample component information, includes: performing preliminary screening based on the deep features of the key region, combined with spectral feature selection technology, removing redundant and irrelevant features, and generating a preliminary screened feature set; evaluating the correlation between each feature and sample component information using statistical analysis methods based on the preliminary screened feature set, and generating a feature importance score; selecting the highest-scoring features based on the feature importance score to ensure maximum representation of sample component information, and generating a representative feature set; and performing dimensionality reduction using principal component analysis to extract the main components based on the representative feature set, and generating representative spectral features.

[0125] The deep features of key regions are deep feature representations of key regions extracted from high-quality near-infrared spectral signals by a convolutional neural network enhanced by an attention mechanism, which are used for subsequent component analysis and content prediction.

[0126] Spectral feature selection is a technique used to select the most representative features from high-dimensional spectral data, reducing redundant information and improving the model's generalization ability and computational efficiency.

[0127] The initial feature set is a set of features selected through spectral feature selection technology, which removes redundant and irrelevant features.

[0128] Feature importance scoring is a score generated by evaluating the correlation between each feature and sample component information through statistical analysis methods, and is used to measure the importance of the feature.

[0129] The representative feature set consists of the highest-scoring features selected based on feature importance scores, which best represent the sample composition information.

[0130] The representative spectral features are the main components extracted after dimensionality reduction of the representative feature set by principal component analysis, which are used for subsequent component analysis and content prediction.

[0131] In this embodiment, firstly, based on the deep features of key regions, a preliminary screening is performed using spectral feature selection technology to remove redundant and irrelevant features, generating a preliminary screening feature set. Secondly, based on the preliminary screening feature set, the correlation between each feature and the sample component information is evaluated using statistical analysis methods to generate a feature importance score. Thirdly, based on the feature importance score, several features with the highest scores are selected to ensure that they represent the sample component information to the greatest extent, generating a representative feature set. Finally, based on the representative feature set, dimensionality reduction is performed using principal component analysis to extract the main components and generate representative spectral features.

[0132] Suppose we need to analyze the sugar content in a batch of wheat flour;

[0133] First, based on the deep features of key regions, combined with spectral feature selection techniques (such as recursive feature elimination (RFE) or model-based feature selection methods), preliminary screening is performed to remove redundant and irrelevant features, generating a preliminary feature set. Second, based on the preliminary feature set, statistical analysis methods (such as Pearson correlation coefficient or mutual information method) are used to evaluate the correlation between each feature and the protein content of the sample, generating a feature importance score. Third, based on the feature importance score, the top 10 features with the highest scores are selected to ensure that these features represent the protein content information of the sample to the greatest extent, generating a representative feature set. Finally, based on the representative feature set, principal component analysis is used to perform dimensionality reduction, extract the main components, and generate representative spectral features.

[0134] By following the steps above, the most representative spectral features can be effectively selected, providing a reliable basis for subsequent prediction of the sugar content of wheat flour.

[0135] 103. Based on the sample composition and content information, the gradient boosting decision tree algorithm is used to assess the degree of impact of the food sample on human metabolism. Combined with bioinformatics analysis technology, the biological mechanism is analyzed in depth, and a sample impact assessment report is generated.

[0136] Gradient boosting decision tree algorithm is an ensemble learning method that iteratively trains multiple weak classifiers (usually decision trees) to gradually reduce residuals and eventually form a strong classifier. This algorithm can effectively handle nonlinear relationships and high-dimensional data.

[0137] Bioinformatics analysis techniques are a class of technologies used to analyze biological data, including genomics, proteomics, and metabolomics. These techniques allow for a deeper understanding of the specific mechanisms by which food components affect human metabolism.

[0138] The sample impact assessment report is based on food composition and content information. It uses machine learning and bioinformatics analysis techniques to assess the specific impact of food samples on human metabolism. The report includes the degree of impact of food components on human health, possible biological mechanisms, and relevant scientific evidence, providing a detailed reference for food safety and health research.

[0139] In this step, firstly, a dataset containing this information is constructed based on the sample composition and content information, and then standardized to generate standardized input data. Secondly, a gradient boosting decision tree algorithm is used to train the standardized input data to predict the correlation between food components and their effects on human metabolism, generating a correlation prediction model. Thirdly, based on the correlation prediction model, the degree of influence of food samples on human metabolism is assessed, generating preliminary impact assessment results. Finally, combined with bioinformatics analysis techniques, the specific biological mechanisms by which food components affect human metabolism are analyzed in depth, generating a detailed sample impact assessment report.

[0140] Optionally, step 103, which involves assessing the impact of the food sample on human metabolism using a gradient boosting decision tree algorithm based on the sample composition and content information, and combining this with bioinformatics analysis techniques to deeply analyze the biological mechanisms and generate a sample impact assessment report, includes: setting up a human metabolic impact assessment dataset based on the sample composition and content information, performing standardization processing to generate standardized input data; using the gradient boosting decision tree algorithm based on the standardized input data to predict the correlation between food components and human metabolic impact, generating a correlation prediction model; assessing the degree of impact of the food sample on human metabolism based on the correlation prediction model, generating preliminary impact assessment results; and combining the preliminary impact assessment results with bioinformatics analysis techniques to deeply analyze the specific biological mechanisms by which food components affect human metabolism, generating a sample impact assessment report.

[0141] The step of predicting the correlation between food components and their effects on human metabolism using a gradient boosting decision tree algorithm based on the standardized input data, and generating a correlation prediction model, includes: preprocessing the standardized input data, detecting outliers, and generating a preprocessed input dataset; using the gradient boosting decision tree algorithm to predict the correlation between food components and their effects on human metabolism, generating an initial prediction model; training and validating the initial prediction model using cross-validation to improve its prediction accuracy and generalization ability, generating an optimized prediction model; and further optimizing the model parameters, adjusting the learning rate and the number of decision trees to improve stability and prediction performance, and generating a correlation prediction model through multiple iterations.

[0142] The sample composition and content information consists of the types and relative contents of each chemical component in the food sample obtained through near-infrared spectroscopy analysis, which is used for subsequent assessment of its impact on human metabolism.

[0143] Gradient Boosting Decision Tree (GBDT) is an ensemble learning method that iteratively trains multiple weak classifiers (usually decision trees) to gradually improve the model's predictive ability. GBDT can handle complex nonlinear relationships and has good generalization ability.

[0144] Standardizing input data involves processing the raw data using methods such as Z-score standardization to ensure that the data has zero mean and unit variance, thereby improving the stability and convergence speed of model training.

[0145] The correlation prediction model is a model generated using the gradient boosting decision tree algorithm based on standardized input data, used to predict the correlation between food components and their effects on human metabolism.

[0146] Bioinformatics analysis techniques, including genomics, proteomics, and metabolomics, are used to deeply analyze the specific biological mechanisms by which food components affect human metabolism.

[0147] In this embodiment, firstly, a human metabolic impact assessment dataset is set up based on sample composition and content information, and standardized to generate standardized input data. Secondly, based on the standardized input data, data preprocessing and outlier detection are performed to generate a preprocessed input dataset. Thirdly, a gradient boosting decision tree algorithm is used to predict the correlation between food components and human metabolic impact, generating an initial prediction model. Cross-validation is then used for training and validation to improve the prediction accuracy and generalization ability of the initial prediction model, generating an optimized prediction model. Next, the model parameters are further optimized, and the learning rate and number of decision trees are adjusted to improve stability and prediction performance. Through multiple iterations, a correlation prediction model is generated. Finally, based on the preliminary impact assessment results, combined with bioinformatics analysis techniques, the specific biological mechanisms by which food components affect human metabolism are analyzed in depth, generating a sample impact assessment report.

[0148] Suppose we have a batch of milk samples and we need to assess the impact of their fat content on human metabolism.

[0149] First, based on sample composition and content information, a dataset for assessing the impact on human metabolism was established and Z-score normalization was performed to generate standardized input data. Second, the standardized input data underwent data preprocessing, including outlier detection and missing value imputation, to generate a preprocessed input dataset. Next, a gradient boosting decision tree algorithm was used to predict the correlation between milk fat content and its impact on human metabolism, generating an initial prediction model. Third, a 5-fold cross-validation method was used for training and validation to improve the prediction accuracy and generalization ability of the initial prediction model, generating an optimized prediction model. The model parameters were further optimized, and the learning rate and the number of decision trees were adjusted. Through multiple iterations, the final correlation prediction model was generated. Finally, based on the preliminary impact assessment results and combined with bioinformatics analysis techniques, the specific biological mechanisms by which milk fat content affects human metabolism were analyzed in depth, generating a detailed sample impact assessment report.

[0150] By following the steps above, we can accurately assess the impact of fat content in milk samples on human metabolism and provide scientific evidence to support food safety and health research.

[0151] This application takes into account that in the gradient boosting decision tree model, the model prediction performance is optimized by recursive feature elimination and nonlinear transformation. First, the sample residuals are calculated, then a new decision tree is constructed based on the residuals, and the prediction results of multiple decision trees are integrated by weighted averaging to generate an initial prediction model.

[0152] Optionally, based on the preprocessed input dataset, a gradient boosting decision tree algorithm is used to predict the correlation between food components and their effects on human metabolism, generating an initial prediction model, including:

[0153] Based on the preprocessed input dataset, recursive feature elimination is used to select the feature that contributes the most to the prediction, thereby reducing the influence of noisy features and generating sample residuals.

[0154] The sample residuals are calculated using the following formula:

[0155]

[0156] in, y is the sample residual of the i-th sample in the t-th iteration; i α represents the actual observed value of the i-th sample; j h represents the weight of the j-th decision tree; j (x i ) represents the prediction value of the j-th decision tree for the i-th sample; β k W represents the weight of the k-th nonlinear transformation. k b is the weight matrix for the k-th nonlinear transformation; kσ is the bias vector for the k-th nonlinear transformation; σ is the sigmoid activation function used to introduce nonlinearity; j is the index of the decision tree, from 1 to t-1; k is the index of the nonlinear transformation, from 1 to t-1; t is the iteration number; x i Let be the feature vector of the i-th sample;

[0157] Based on the sample residuals, the parts that the model did not predict correctly are identified, and statistical methods are used to further confirm the abnormal residuals. By minimizing the sum of squared residuals, the decision tree structure and parameters are optimized to generate sample prediction values.

[0158] The predicted value of the sample is calculated using the following formula:

[0159]

[0160] Among them, h t (x i Let be the sample prediction value of the t-th decision tree for the i-th sample; λ is the sample residual of the i-th sample in the t-th iteration; λ is the nonlinear adjustment parameter used to control the nonlinearity of the loss function; λ1 is the regularization parameter of the leaf node output of the decision tree; J is the number of leaf nodes in the decision tree; θ j c is the output value of the j-th leaf node; j σ is the center vector of the j-th Gaussian kernel function; j λj is the standard deviation of the j-th Gaussian kernel function; λ2 is the regularization parameter for the weights of the internal nodes of the decision tree; K is the number of internal nodes of the decision tree; ωj k Let v be the weight of the k-th internal node; μ is the nonlinear adjustment parameter of the internal node; v k Let be the weight vector of the k-th internal node; i is the index of the sample, from 1 to N; N is the total number of samples; j is the index of the leaf node, from 1 to J; k is the index of the internal node, from 1 to K; h is the decision tree model; x i h(x) is the feature vector of the i-th sample; i ) is a decision tree for the i-th sample x i The predicted value of the sample;

[0161] Based on the sample predictions, the predictions from multiple decision trees are integrated by weighted averaging. The generated predictions are evaluated using cross-validation to further optimize the model hyperparameters, improve model stability and prediction performance, and generate an initial prediction model.

[0162] This method aims to calculate residuals to guide the training direction of the model, use a sigmoid function to adjust the nonlinearity of the loss function to focus on larger errors, and reduce model complexity and enhance generalization ability through regularization of leaf nodes and internal nodes.

[0163] In the sample residuals, the actual observed value portion y i : Represents the actual observed value of the i-th sample, used for comparison with the model's predicted value; the cumulative part of the decision tree prediction. Let α represent the weighted sum of the predictions from all decision trees in the first t-1 iterations, where α j The weight of the policy tree, h j (x i ) represents the prediction of the i-th sample by the i-th decision tree; this part is used to accumulate the predictions of all trained decision trees; the nonlinear transformation accumulation part Let β represent the weighted sum of the predicted values ​​of all nonlinear transformations in the first t-1 iterations, where β k The weights are the weights of the nonlinear transformation, σ is the sigmoid activation function, and W... k It is the weight matrix, b k It is the bias vector, which is used to introduce nonlinearity and improve the expressive power of the model.

[0164] Among them, y i These are actual observations, obtained directly from the dataset; α j ,h j (x i β is obtained through iterative optimization during the training process, and is updated once in each iteration; k W k ,b k σ is obtained through iterative optimization during the training process, and is updated once in each iteration.

[0165] In the sample predicted values, the main part of the loss function A sigmoid function is used to adjust the nonlinearity of the loss function, making the model more attentive to larger residuals; leaf node regularization... Regularization of the leaf node output values ​​reduces model complexity and prevents overfitting; regularization of internal nodes... By regularizing the weights of internal nodes, the model complexity is further controlled and the model's generalization ability is enhanced.

[0166] in, h(x) is obtained by calculation using Formula 1. i The result is obtained by minimizing the loss function; λ, λ1, λ2, μ are hyperparameters, obtained by optimization using cross-validation; θ j ,c j ,σ j Obtained through iterative optimization during the training process; ω k ,v k Obtained through iterative optimization during the training process;

[0167] Suppose we need to analyze the caffeine content in a batch of tea leaves;

[0168] Suppose a dataset contains 100 samples, each with 10 features. In the 5th iteration, for the 1st sample, the actual observed value y1 = 3.5 (unit: mg / g). The weights of the decision tree and nonlinear transformation in the first 4 iterations are α1 = 0.3, α2 = 0.4, α3 = 0.2, α4 = 0.1, β1 = 0.5, β2 = 0.3, β3 = 0.2, β4 = 0.1, respectively. The corresponding predicted values ​​are h1(x1) = 3.2, h2(x1) = 3.4, h3(x1) = 3.3, h4(x1) = 3.35. The output values ​​of the nonlinear transformation are σ(W1·x1+b1) = 0.7, σ(W2·x1+t2) = 0.8, σ(W3·x1+b3) = 0.6, σ(W4·x1+b4) = 0.9; residuals...

[0169]

[0170] Assuming a threshold of 0.2 is set, since the residual of 0.185 is less than the set threshold, it indicates that the current model's prediction of the first sample is already quite accurate. Furthermore, the error is further reduced by the new predicted value of 3.685, thus improving the model's prediction accuracy. Through the above steps, the model's prediction accuracy can be effectively improved, and the model can be ensured to have high accuracy and stability when predicting the caffeine content in tea.

[0171] 104. Based on the sample impact assessment report, natural language processing is used to convert it into easily understandable language description to generate a food composition analysis report.

[0172] Natural Language Processing (NLP) is an artificial intelligence technology used to process and understand human language. NLP can transform complex data and information into natural language text that is easy to understand and use.

[0173] The food composition analysis report is the final report generated, which includes information on food composition and content, assessment results of its impact on human metabolism, and analysis of biological mechanisms, presented to users in a concise and clear language.

[0174] In this step, firstly, the generated sample impact assessment report is obtained, which includes information on food composition and content, assessment results of human metabolic impact, and analysis of biological mechanisms; secondly, natural language processing technology is used to convert the technical terms and complex data in the report into easily understandable natural language descriptions; thirdly, the converted text is structured to ensure that the report content is clear, logical, and rigorous; finally, all processed texts are integrated to generate the final food composition analysis report, which is easy for users to read and understand.

[0175] Optionally, step 104, which involves using natural language processing to convert the sample impact assessment report into easily understandable language to generate a food component analysis report, includes: extracting key assessment results from the sample impact assessment report, combining this with biological mechanism analysis information to generate structured data; using natural language processing to generate text based on the structured data, converting technical terms into easily understandable language to generate a preliminary text report; using visualization processing to generate charts and images to aid in explaining the impact of food components, generating a visualized text report; and further editing and formatting the visualized text report to generate a final food component analysis report.

[0176] The sample impact assessment report is a report generated based on food composition and content information, using gradient boosting decision tree algorithm and bioinformatics analysis technology. It includes the degree of impact of food components on human metabolism and its biological mechanisms.

[0177] Structured data extracts and organizes key findings and biological mechanism analysis information from the assessment report into a structured format, facilitating subsequent processing and analysis.

[0178] Natural Language Processing (NLP) is an artificial intelligence technology used to process and understand human language. NLP can transform complex data and information into natural language text that is easy to understand and use.

[0179] The preliminary text report is a preliminary report generated using natural language processing technology and containing easily understandable language descriptions.

[0180] Visualized text reports combine charts and images to aid explanation, making the report content more intuitive and easier to understand.

[0181] The food composition analysis report is the final report generated, which includes information on food composition and content, assessment results of its impact on human metabolism, and analysis of biological mechanisms, presented to users in a concise and clear language.

[0182] In this embodiment, firstly, based on the sample impact assessment report, key assessment results and biological mechanism analysis information are extracted to generate structured data; secondly, natural language processing technology is used to generate text, converting technical terms into easily understandable language descriptions to generate a preliminary text report; thirdly, combined with visualization processing, charts and images are generated to help explain the impact of food components, generating a visualized text report; finally, further editing and formatting are performed to generate the final food component analysis report.

[0183] Suppose we need to generate a food composition analysis report on the impact of protein content in wheat flour on human metabolism;

[0184] First, based on the sample impact assessment report, key assessment results are extracted, such as the impact of protein content on blood glucose levels, amino acid composition, and related biological mechanism analysis information, generating structured data. Second, natural language processing technology is used to generate text, converting technical terms (such as "insulin resistance" and "amino acid profile") into easily understandable language descriptions (such as "weakened body response to insulin" and "proportion of different amino acids"), generating a preliminary text report. Third, combined with visualization processing, line graphs are generated to show the trend of blood glucose level changes under different protein contents, and pie charts are generated to show the proportion of amino acid composition. These charts are embedded into the text report to generate a visualized text report. Finally, further editing and formatting are performed to ensure that the report is clear, logical, and rigorous, generating the final food composition analysis report.

[0185] By following the steps above, a scientific and easy-to-understand food composition analysis report can be generated, helping non-professionals to better understand and use the analysis results.

[0186] Figure 2 This application provides a schematic diagram of the structure of a food component analysis system based on near-infrared spectroscopy, as shown in the embodiment. Figure 2 As shown, the device includes:

[0187] Acquisition module 21 is used to acquire near-infrared spectral signals from food samples, and uses an intelligent sampling method to avoid local differences in the sample to generate near-infrared spectral signals of the sample;

[0188] The screening module 22 is used to automatically focus on the key regions of the near-infrared spectral signal of the sample based on the near-infrared spectral signal of the sample using an attention mechanism-enhanced convolutional neural network, and combined with spectral feature selection technology to screen the most representative spectral features and generate sample composition and content information.

[0189] The generation module 23 is used to evaluate the impact of the food sample on human metabolism based on the sample composition and content information, using a gradient boosting decision tree algorithm, and combining bioinformatics analysis technology to deeply analyze the biological mechanism and generate a sample impact assessment report.

[0190] The conversion module 24 is used to convert the sample impact assessment report into an easy-to-understand language description using natural language processing to generate a food composition analysis report.

[0191] Figure 2 The aforementioned food composition analysis system based on near-infrared spectroscopy can perform... Figure 1The implementation principle and technical effects of the near-infrared spectroscopy-based food component analysis method described in the illustrated embodiment will not be repeated here. The specific operation methods of each module and unit in the near-infrared spectroscopy-based food component analysis system described in the above embodiments have been detailed in the embodiments related to this method, and will not be elaborated upon here.

[0192] In one possible design, Figure 2 The food composition analysis system based on near-infrared spectroscopy shown in the embodiment can be implemented as a computing device, such as... Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;

[0193] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are invoked and executed by the processing component 32.

[0194] The processing component 32 is used for: acquiring near-infrared spectral signals from food samples, using intelligent sampling methods to avoid local differences in the samples, and generating near-infrared spectral signals of the samples; based on the near-infrared spectral signals of the samples, using an attention-enhanced convolutional neural network to automatically focus on key regions of the near-infrared spectral signals of the samples, and combining spectral feature selection technology to screen the most representative spectral features, generating sample composition and content information; based on the sample composition and content information, using a gradient boosting decision tree algorithm to assess the degree of impact of the food samples on human metabolism, and combining bioinformatics analysis technology to deeply analyze the biological mechanisms, generating a sample impact assessment report; based on the sample impact assessment report, using natural language processing to convert it into easily understandable language descriptions, generating a food composition analysis report.

[0195] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above-described method. Alternatively, the processing component may be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method.

[0196] Storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0197] Of course, computing devices may also include other components, such as input / output interfaces, display components, communication components, etc.

[0198] Input / output interfaces provide interfaces between processing components and peripheral interface modules, which can be output devices, input devices, etc.

[0199] The communication components are configured to facilitate wired or wireless communication between computing devices and other devices.

[0200] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the aforementioned processing components, storage components, etc., can be basic server resources rented or purchased from the cloud computing platform.

[0201] This application also provides a computer storage medium storing a computer program, which, when executed by a computer, can perform the above-described functions. Figure 1 The illustrated embodiment presents a food component analysis method based on near-infrared spectroscopy.

[0202] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0203] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0204] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0205] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for food component analysis based on near-infrared spectroscopy, characterized in that, include: Near-infrared spectral signals are collected from food samples, and intelligent sampling methods are used to avoid local differences in the samples to generate near-infrared spectral signals. Based on the near-infrared spectral signal of the sample, an attention-enhanced convolutional neural network is used to automatically focus on key regions of the near-infrared spectral signal of the sample. Combined with spectral feature selection technology, representative spectral features are screened to generate sample composition and content information. Based on the sample composition and content information, the gradient boosting decision tree algorithm is used to assess the degree of impact of the food sample on human metabolism. Combined with bioinformatics analysis technology, the biological mechanism is analyzed in depth, and a sample impact assessment report is generated. Based on the sample impact assessment report, natural language processing is used to convert it into easily understandable language to generate a food composition analysis report. Specifically, based on the near-infrared spectral signal of the sample, an attention-enhanced convolutional neural network is used to automatically focus on key regions of the sample's near-infrared spectral signal. Combined with spectral feature selection technology, representative spectral features are screened to generate sample composition and content information, including: Based on the near-infrared spectral signal of the sample, noise and interference are removed using an intelligent preprocessing method to generate a high-quality near-infrared spectral signal. Based on this high-quality near-infrared spectral signal, key regions of the spectral signal are automatically identified and located through pre-training, generating key region identifiers. Based on these key region identifiers, wavelet transform is performed on the input features to decompose the signal into different frequency bands. Singular value decomposition is performed to extract important singular values, compressing the feature dimension to generate a primary feature representation. Based on this primary feature representation, it is input to multiple different attention modules, and transformed and enhanced using different weight matrices and bias vectors, introducing a Gaussian kernel function and periodic variation terms to generate a deep feature representation. Based on this deep feature representation, feature fusion is performed to integrate the signals generated by the different attention modules. The system comprehensively processes the features to enhance their overall expressive power. Regularization is used for smoothing, and deep features of the spectral signal are generated by combining key regions of the spectral signal. Based on these deep features, feature integration technology is used to fuse features at different levels, enhancing their expressive power and generating a comprehensive feature representation. Based on this comprehensive feature representation, optimization processing is performed using the key region identifiers to generate deep features of the key regions. Based on these deep features of the key regions, spectral feature selection technology is used, combined with the representativeness of sample component information, to generate representative spectral features. Based on these representative spectral features, a spectral-component mapping model is pre-constructed to predict component composition and content ratios, generating sample component and content information.

2. The method according to claim 1, characterized in that, Based on the key region identifiers, a convolutional neural network with an enhanced attention mechanism is used to extract features from the key regions of the spectral signal, generating deep features of the spectral signal, including: Based on the key region identifiers, wavelet transform is performed on the input features to decompose the signal into different frequency bands; Singular value decomposition is performed to extract important singular values, and the feature dimension is compressed to generate a primary feature representation; The primary feature representation is calculated using the following formula: ; in, The first key region of the spectral signal Primary feature representation of each input feature; The first key region of the spectral signal One input feature; For the first The weights of each input feature; The index of the input feature, from 1 to ; The number of input features; This is the weight matrix for the attention mechanism; is the bias vector for the attention mechanism; tanh is the hyperbolic tangent activation function, used to introduce nonlinearity; The center vector of the attention mechanism; The standard deviation of the attention mechanism; Based on the primary feature representation, it is input to multiple different attention modules and transformed and enhanced through different weight matrices and bias vectors. Gaussian kernel function and periodic change term are introduced to generate deep feature representation. The deep feature representation is calculated using the following formula: ; in, The first key region of the spectral signal Deep feature representation of high-level features; The first key region of the spectral signal Primary feature representation of each input feature; The first key region of the spectral signal A high-level characteristic; Indexes for high-level features, from 1 to ; For the number of high-level features; For the first The weight matrix of each high-level feature in the k-th attention module; The index for the attention module, from 1 to ; The number of attention modules; For the first The bias vector of each attention module; To modify the activation function of the linear unit, and to introduce nonlinearity; For the first The weight matrix of each attention module; For the first The center vector of each attention module; For the first The standard deviation of each attention module; It is the amplitude coefficient; For frequency coefficients; Based on the deep feature representation, features generated by different attention modules are integrated through feature fusion to enhance the overall expressive power of the features. Regularization is used for smoothing, and combined with the key regions of the spectral signal, deep features of the spectral signal are generated.

3. The method according to claim 1, characterized in that, The process of generating representative spectral features based on the deep features of the key region, combined with spectral feature selection technology and the representativeness of sample component information, includes: Based on the deep features of the key regions, combined with spectral feature selection technology, preliminary screening is performed to remove redundant and irrelevant features and generate a preliminary screening feature set. Based on the preliminary feature set, the correlation between each feature and the sample component information is evaluated using statistical analysis methods to generate a feature importance score; Based on the feature importance scores, select the highest-scoring features to ensure that they represent the sample composition information to the greatest extent possible, and generate a representative feature set. Based on the representative feature set, dimensionality reduction is performed using principal component analysis to extract the main components and generate representative spectral features.

4. The method according to claim 1, characterized in that, Based on the sample composition and content information, a gradient boosting decision tree algorithm is used to assess the degree of impact of the food sample on human metabolism. Combined with bioinformatics analysis techniques, the biological mechanisms are analyzed in depth to generate a sample impact assessment report, including: Based on the sample composition and content information, a human metabolic impact assessment dataset is set up, and standardized processing is performed to generate standardized input data. Based on the standardized input data, the gradient boosting decision tree algorithm is used to predict the correlation between food components and human metabolism, and a correlation prediction model is generated. Based on the aforementioned correlation prediction model, the extent to which food samples affect human metabolism is assessed, and preliminary impact assessment results are generated. Based on the preliminary impact assessment results, and combined with bioinformatics analysis techniques, we will conduct an in-depth analysis of the specific biological mechanisms by which food components affect human metabolism, and generate a sample impact assessment report.

5. The method according to claim 4, characterized in that, Based on the standardized input data, the gradient boosting decision tree algorithm is used to predict the correlation between food components and their effects on human metabolism, generating a correlation prediction model, including: Based on the standardized input data, data preprocessing and outlier detection are performed to generate a preprocessed input dataset. Based on the preprocessed input dataset, the gradient boosting decision tree algorithm is used to predict the correlation between food components and human metabolism, and an initial prediction model is generated. Based on the initial prediction model, cross-validation is used for training and validation to improve the prediction accuracy and generalization ability of the initial prediction model and generate an optimized prediction model. Based on the optimized prediction model, the model parameters are further optimized, and the learning rate and the number of decision trees are adjusted to improve stability and prediction performance. Through multiple iterations and verifications, a correlation prediction model is generated.

6. The method according to claim 5, characterized in that, Based on the preprocessed input dataset, the gradient boosting decision tree algorithm is used to predict the correlation between food components and their effects on human metabolism, generating an initial prediction model, including: Based on the preprocessed input dataset, recursive feature elimination is used to select the feature that contributes the most to the prediction, thereby reducing the influence of noisy features and generating sample residuals. The sample residuals are calculated using the following formula: ; in, For the first During the first iteration The sample residuals of each sample; For the first The actual observed values ​​of each sample; For the first The weights of each decision tree; For the first decision trees for the first Predicted values ​​for each sample; For the first Weights of a nonlinear transformation; For the first The weight matrix of a nonlinear transformation; For the first Bias vectors of nonlinear transformations; It is a sigmoid activation function used to introduce nonlinearity; The index for the decision tree, from 1 to... ; The index for the nonlinear transformation, from 1 to... ; This represents the number of iterations. For the first Feature vectors of each sample; Based on the sample residuals, the parts that the model did not predict correctly are identified, and statistical methods are used to further confirm the abnormal residuals. By minimizing the sum of squared residuals, the decision tree structure and parameters are optimized to generate sample prediction values. The predicted value of the sample is calculated using the following formula: ; in, For the first decision trees for the first Sample The sample predicted value; For the first During the first iteration The sample residuals of each sample; This is a nonlinear adjustment parameter used to control the degree of nonlinearity of the loss function; The regularization parameter for the output of the decision tree leaf nodes; The number of leaf nodes in the decision tree; For the first The output values ​​of the leaf nodes; For the first The center vector of a Gaussian kernel function; For the first The standard deviation of a Gaussian kernel function; The regularization parameter for the weights of nodes within the decision tree; The number of nodes inside the decision tree; For the first The weight of each internal node; For internal node nonlinear adjustment parameters; For the first The weight vector of each internal node; The index of the sample, from 1 to Total number of samples The index of the leaf node, from 1 to... ; For the index of the internal node, from 1 to ; For decision tree models; For the first Feature vectors of each sample; For decision trees to the first Sample The predicted value of the sample; Based on the sample predictions, the predictions from multiple decision trees are integrated by weighted averaging. The generated predictions are evaluated using cross-validation to further optimize the model hyperparameters, improve model stability and prediction performance, and generate an initial prediction model.

7. The method according to claim 1, characterized in that, The aforementioned sample impact assessment report is converted into easily understandable language using natural language processing to generate a food composition analysis report, including: Based on the sample impact assessment report, key assessment results are extracted, and combined with biological mechanism analysis information to generate structured data; Based on the structured data, natural language processing is used to generate text, converting technical terms into easily understandable language descriptions to generate a preliminary text report. Based on the preliminary text report, combined with visualization processing, charts and images are generated to help illustrate the impact of food components, thus generating a visual text report; Based on the aforementioned visual text report, further editing and formatting adjustments are made to generate a food composition analysis report.

8. A food component analysis system based on near-infrared spectroscopy, used to perform the food component analysis method based on near-infrared spectroscopy as described in any one of claims 1 to 6, characterized in that, include: The acquisition module is used to acquire near-infrared spectral signals from food samples. It uses an intelligent sampling method to avoid local differences in the sample and generates the sample's near-infrared spectral signal. The screening module is used to automatically focus on key regions of the near-infrared spectral signal of the sample based on the near-infrared spectral signal of the sample using an attention-enhanced convolutional neural network, and combined with spectral feature selection technology to screen representative spectral features and generate sample composition and content information. The generation module is used to evaluate the impact of the food sample on human metabolism based on the sample composition and content information, using a gradient boosting decision tree algorithm, and combining bioinformatics analysis technology to deeply analyze the biological mechanisms and generate a sample impact assessment report. The conversion module is used to convert the sample impact assessment report into an easy-to-understand language description using natural language processing, and generate a food composition analysis report.

Citation Information

Patent Citations

  • Intelligent data early warning decision tree analysis method and system

    CN117349782A

  • Petroleum fractionating tower product analysis method and system based on near infrared technology

    CN119125071A