A food detergent ingredient detection system and method
Through spectral analysis and multi-layer perceptron neural network models, the problems of complex sample preprocessing and insufficient precision in food detergent ingredient detection were solved, efficient and accurate multi-component detection and risk assessment were achieved, and the comprehensiveness and reliability of the detection technology were improved.
Patent Information
- Application Number
- CN202411362627.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-09-27
AI Technical Summary
Existing food detergent ingredient detection technology requires complex sample pretreatment, which is cumbersome and time-consuming. Spectral analysis has limited accuracy and sensitivity when detecting complex ingredients, lacks the ability to conduct comprehensive multi-component analysis and risk assessment, and does not fully utilize artificial intelligence technology for in-depth mining and predictive analysis.
By combining spectral analysis with a multi-layer perceptron neural network model, accurate detection and risk assessment of food detergent ingredients can be achieved through sample collection, spectral detection, data feature extraction, and ingredient prediction models. Spectral analysis technology is used for non-destructive testing, combined with a multi-layer perceptron neural network model for multi-component analysis and risk assessment.
It improves the detection accuracy and sensitivity, realizes the comprehensive analysis and risk assessment of multiple ingredients, enhances the comprehensiveness and reliability of the detection technology, and ensures the safe use of food detergents.
Smart Images

Figure CN119375180B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of food safety detection, and in particular to a system and method for detecting ingredients of food detergents. Background Art
[0002] Food detergent ingredient detection technology plays an important role in the fields of food safety and public health. As society's attention to food safety continues to increase, food detergent ingredient detection technology is also constantly developing and improving. At present, the main detection methods include gas chromatography, liquid chromatography, mass spectrometry, spectral analysis, etc. Gas chromatography and liquid chromatography can efficiently separate and quantify organic matter in detergents, but their operation is complicated and the cost is high. Mass spectrometry has high sensitivity and high resolution, but requires complex sample pretreatment; spectral analysis is non-destructive, fast and efficient, and has demonstrated high accuracy and efficiency in the detection of food detergents.
[0003] Although the above technologies have achieved certain achievements in the detection of food detergent ingredients, there are still some shortcomings. Traditional chromatography and mass spectrometry analysis methods usually require complex sample pretreatment, which is cumbersome and time-consuming. Although spectral analysis technology has certain rapidity and non-destructiveness, its detection accuracy and sensitivity still need to be improved when facing complex food detergent ingredients. Existing detection methods mostly focus on the detection of a single ingredient and lack the ability to comprehensively analyze and assess risks of multiple ingredients. Existing technologies often use traditional statistical analysis methods and cannot fully utilize big data and artificial intelligence technologies for in-depth mining and predictive analysis, thus limiting the further improvement of detection technology. Summary of the Invention
[0004] In view of the problems existing in the above-mentioned existing food detergent ingredient detection system and method, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is that the existing technology requires complex sample preprocessing, the operation is cumbersome and time-consuming, and it is difficult to meet the needs of rapid detection. The accuracy and sensitivity of spectral analysis technology in detecting complex components are limited. The existing methods are mainly aimed at the detection of single components and lack comprehensive analysis and risk assessment capabilities. Data processing does not fully utilize artificial intelligence technology, which limits the in-depth mining and predictive analysis of detection technology.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: a food detergent component detection system, comprising:
[0007] A sample collection module, used for collecting food detergent and mixing the food detergent with purified water using a solution mixing chamber to form a mixed solution sample;
[0008] A sample detection module is used to obtain detection data using spectral analysis detection technology on mixed solution samples;
[0009] The prediction module is used to extract features from test data, build a food detergent ingredient prediction model, predict ingredient concentrations, and perform risk assessment;
[0010] The storage module is used to encrypt the test data and evaluation results during the test process, collect the test data and evaluation results, and store them.
[0011] As a preferred embodiment of the food detergent component detection system of the present invention, the food detergent collection comprises sampling food detergents from different batches and production lines at a sampling location, uniformly mixing all sampled food detergents, weighing the food detergents using an electronic balance, and recording the mass values;
[0012] The inner wall of the sample tank is coated with an anti-stick coating, and the food detergent is weighed using an electronic balance and poured into the sample tank, and the sample tank cover is closed.
[0013] As a preferred embodiment of the food detergent component detection system described in the present invention, the method comprises: using a solution mixing chamber to mix the food detergent and purified water to form a mixed solution sample, connecting a sample tank to the solution mixing chamber, starting the solenoid valve at the bottom of the sample tank, inputting the required food detergent flow parameters into the solenoid valve controller, opening the water inlet valve to allow the purified water to flow into the solution mixing chamber, mixing the food detergent and purified water in a ratio of 1:10, starting the rotary agitator in the solution mixing chamber, fully mixing the food detergent and purified water by high-speed rotation, recording the stirring time, and obtaining a mixed solution sample.
[0014] As a preferred embodiment of the food detergent component detection system of the present invention, the component detection of the mixed solution sample using spectral analysis technology refers to flowing the mixed solution sample into the detection pool from the liquid outlet, starting the near-infrared spectrometer, and setting the scanning parameters, including the wavelength range and scanning speed;
[0015] Use fiber optic components to connect the light source and detection cell of the near-infrared spectrometer;
[0016] Turn on the light source of the near-infrared spectrometer and record the spectral signal without the mixed solution sample to obtain the background spectral signal I b , then place a standard white plate in the light path, pass the near-infrared light through the standard white plate, and record the reference photoelectric signal intensity I0, place the mixed solution sample to be tested in the light path, pass the near-infrared light through the mixed solution sample, and record the spectral signal I of the mixed solution sample;
[0017] The spectrum detector detects and records the spectrum signal of the transmitted light, converts the spectrum signal into an electrical signal, and the data acquisition card converts the electrical signal into a digital signal and transmits it to the computer through a data line for analysis;
[0018] Background correction was performed on I and I0 respectively, and the obtained correction signals were standardized respectively, and the correction signals were converted into the transmission photoelectric signal intensity I of the mixed solution. s and the reference photoelectric signal intensity I 0,s , calculate the absorbance at each wavelength, the formula is:
[0019]
[0020] Where A is the absorbance, I s is the intensity of the transmitted photoelectric signal of the mixed solution sample, I 0,s is the reference photoelectric signal intensity;
[0021] The absorbance A is used as the Y-axis data and the wavelength is used as the X-axis data to generate a spectrum. The spectrum analysis software plots the absorbance at each wavelength on the spectrum to form a near-infrared spectrum.
[0022] In the spectrum, according to the relative baseline and relative height standards, the wavelength with high absorbance is identified as the absorption peak, and the wavelength point and corresponding absorbance of each absorption peak are recorded as the characteristic peak to construct the spectrum data set;
[0023] The calculated absorbance data were imported into the chemometric analysis software to calculate the covariance matrix of the absorbance data. The covariance matrix was subjected to eigenvalue decomposition to obtain eigenvalues and eigenvectors. The eigenvalues were sorted from large to small, and the eigenvector corresponding to the largest eigenvalue was selected as the principal component. The absorbance data were projected into the principal component space to reduce the dimension and remove noise.
[0024] The characteristic peak position and intensity of each component are identified and recorded in the principal component space, and compared with the existing spectral standard database to determine the composition of each component. The concentration of each component in the mixed solution sample is calculated using the absorbance of the characteristic peak through the Beer-Lambert law.
[0025] As a preferred embodiment of the food detergent ingredient detection system of the present invention, the feature extraction of the detection data comprises calculating the mean and standard deviation of the signal intensity at each wavelength point in the spectral data set, and normalizing the signal intensity at each wavelength point to obtain standardized data.
[0026] Perform wavelet decomposition on the standardized data, remove noise from the high-frequency part of the decomposition, and perform wavelet reconstruction to obtain the denoised data;
[0027] According to the characteristic peak position and intensity of each component, the characteristic vector F is constructed i , each eigenvector is represented by (λ ik , A ik );
[0028] Design the eigenvector function and transform the eigenvector F i Convert to peak feature vector format f(F i ), the formula is:
[0029]
[0030] Among them, λ ik is the position of the characteristic peak of the i-th component of the k-th mixed solution sample, A ik is the intensity of the characteristic peak of the i-th component of the k-th mixed solution sample, a k , b and c are unknown parameters, and nonlinear regression method is used to determine a by minimizing the error between the predicted concentration and the actual concentration. k , b and c are specific values, and m is the number of mixed solution samples;
[0031] By the peak eigenvector f(F i ) generating a spectral analysis data set;
[0032] The converted peak feature vector f(F i ) to form the joint peak eigenvector matrix V:
[0033]
[0034] Among them, f(F i ) k is the peak feature vector of the kth mixed solution sample;
[0035] Calculate the Pearson correlation coefficient r between each eigenvector in the joint peak eigenvector matrix V ij , the formula is:
[0036]
[0037] Among them, r ij is the linear correlation coefficient between the i-th component and the j-th component, λ ik is the characteristic peak position of the i-th component in the k-th mixed solution sample, A jk is the characteristic peak intensity of the jth component in the kth mixed solution sample, is the mean of the characteristic peak position of the i-th component, is the mean characteristic peak intensity of the jth component, and m is the number of mixed solution samples;
[0038] According to the correlation coefficient rij , calculate the adaptive weight factor, the formula is:
[0039]
[0040] Among them, ω i is the adaptive weight factor of the i-th component, and α is the adjustment parameter;
[0041] For each peak eigenvector f(F i ) multiplied by the weight factor ω i , get the weighted peak eigenvector matrix V';
[0042] The peak eigenvector matrix is optimized by using the adaptive weight factor, and the weighted peak eigenvector matrix V' is analyzed. i The size of the threshold T ω , retain the weight factor greater than the threshold T ω The peak feature vector of the weight factor is less than the threshold T. ω The peak eigenvector of .
[0043] As a preferred solution of the food detergent component detection system of the present invention, wherein: the construction of the food detergent component prediction model to predict the component concentration includes:
[0044] A food detergent ingredient evaluation model was constructed using a multi-layer perceptron neural network model, including input layer, hidden layer, and output layer.
[0045] Set the input layer to the peak feature vector f(F i ), the output layer is the predicted concentration value of each component
[0046] The spectral analysis data set is divided into a training set and a test set, the training set data is input into the model, and the model parameters are initialized;
[0047] The defined objective function is used as the loss function for model training. The objective function is designed as the weighted sum of the component concentration prediction error and the detection error. The formula is:
[0048]
[0049] Among them, L is the loss value of the objective function, Q i is the actual concentration value of the i-th component, is the predicted concentration value of the i-th component, λ ik is the characteristic peak position of the i-th component in the k-th mixed solution sample, is the predicted characteristic peak position of the i-th component in the k-th mixed solution sample, β is the weight adjustment parameter, m is the number of mixed solution samples, and n is the number of characteristic peaks;
[0050] Use the Adam optimization algorithm to optimize model parameters, iteratively update model parameters, minimize the loss function, set the learning rate and batch size, and record the loss value of each iteration until the loss function converges;
[0051] Calculate the mean square error and coefficient of determination to evaluate the predictive performance of the model;
[0052] Tune the model's hyperparameters, including learning rate, number of hidden layer neurons, and batch size, and use Bayesian optimization to find the optimal hyperparameter combination;
[0053] Save the trained model;
[0054] Food detergent samples were collected from the sampling site, analyzed and detected using spectral technology and pre-processed to extract the new feature vector f(F i ) Input the food detergent component prediction model to obtain the predicted concentration value of each component in the mixed solution sample
[0055] As a preferred solution of the food detergent component detection system of the present invention, wherein: the risk assessment refers to setting the concentration threshold T of each component according to the safety standard of the food detergent component. i , using adaptive weight factors and predicted concentration values of each component Calculate the comprehensive risk assessment value R:
[0056]
[0057] Among them, R i is the comprehensive risk assessment value of the i-th component of the mixed solution sample, ω i is the adaptive weight factor of the i-th component, T i is the safety threshold of the i-th component, is the predicted concentration value of the i-th component, and p is the number of components in the mixed solution;
[0058] Set the risk threshold R th , compare the comprehensive risk assessment value R i and risk threshold R th Predict risk levels and provide prompts;
[0059] If R i ≤R th , then the risk is within an acceptable range and the system operates normally;
[0060] If R i >Rth , the risk exceeds the acceptable range, triggering an alarm and prompting the user to take action.
[0061] As a preferred solution of the food detergent ingredient detection system described in the present invention, the encryption of the detection data and evaluation results during the test process and the storage and collection of the detection data and evaluation results refer to using the AES algorithm to encrypt the detection data and evaluation results collected during the test process, transmitting the encrypted data to the database through a secure transmission protocol, creating a table structure in the database, recording logs for all encryption and storage processes and backing up them regularly, and setting access permissions.
[0062] Another object of the present invention is a method for detecting ingredients of food detergents, which comprises:
[0063] collecting food detergent and mixing the food detergent with purified water using a solution mixing chamber to form a mixed solution sample;
[0064] Using spectral analysis detection technology on mixed solution samples to obtain detection data;
[0065] Extract features from test data, build a food detergent ingredient prediction model, predict ingredient concentrations, and conduct risk assessments;
[0066] The test data and evaluation results during the test process are encrypted and stored.
[0067] The beneficial effects of the present invention are as follows: the present invention realizes the precise detection and risk assessment of food detergent ingredients through sample collection, spectral analysis, data feature extraction and the construction of ingredient prediction models. Through the multi-layer perceptron neural network model technology, it not only improves the detection accuracy and sensitivity, but also realizes the comprehensive analysis and risk assessment of multiple different ingredients, enhances the comprehensiveness and reliability of the detection technology, and ensures the safe use of food detergents. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0069] Figure 1 The figure is a structural diagram of a food detergent ingredient detection system.
[0070] Figure 2 The figure is a flow chart of a method for detecting ingredients of food detergents. DETAILED DESCRIPTION
[0071] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0072] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0073] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it constitute a separate or selective embodiment that is mutually exclusive with other embodiments.
[0074] Example 1
[0075] Reference Figure 1 , which is the first embodiment of the present invention, provides a food detergent component detection system, a food detergent component detection system comprising:
[0076] S1, a sample collection module, used to collect food detergent and use a solution mixing chamber to mix the food detergent with purified water to form a mixed solution sample;
[0077] Specifically, collecting food detergents means sampling food detergents from different batches and production lines at the sampling site, mixing all sampled food detergents evenly, weighing the food detergents using an electronic balance, and recording the mass values;
[0078] The inner wall of the sample tank is coated with an anti-stick coating, and the food detergent is weighed using an electronic balance and poured into the sample tank, and the sample tank cover is closed.
[0079] By collecting food detergent samples from different batches and production lines at the sampling site and mixing them evenly to ensure the representativeness and uniformity of the samples, an electronic balance is used to accurately weigh the mass of the food detergent to ensure the accuracy of the test data. An anti-stick coating is applied to the inner wall of the sample tank to avoid sample residue, ensure the complete transfer of samples and reduce errors, thereby improving the reliability and repeatability of the test results.
[0080] Furthermore, a solution mixing chamber is used to mix the food detergent and purified water to form a mixed solution sample, which refers to connecting a sample tank to the solution mixing chamber, starting a solenoid valve at the bottom of the sample tank, inputting a desired food detergent flow parameter into the solenoid valve controller, opening a water inlet valve to allow purified water to flow into the solution mixing chamber, mixing the food detergent and purified water in a ratio of 1:10, starting a rotary stirrer in the solution mixing chamber, fully mixing the food detergent and purified water by high-speed rotation, and recording the stirring time to obtain a mixed solution sample;
[0081] Calculate the mass value of the food detergent and the mass value of the mixed solution to obtain the concentration of the food detergent in the mixed solution;
[0082] According to the experimental requirements, the standard value M of the mixing uniformity between food detergent and purified water is set. b , use the following formula to get the actual mixing uniformity M to evaluate the mixing uniformity:
[0083]
[0084] Where M is the actual mixing uniformity, C y is the concentration of the y-th sample, is the average concentration of the samples, n is the number of samples;
[0085] The calculated actual mixing uniformity M is compared with the standard value M b Compare, if M≤M b , then the actual mixing uniformity meets the requirements and the solution is mixed evenly. If M>M b , then the actual mixing uniformity does not meet the requirements and needs to be re-mixed according to the adjustment of mixing parameters, including mixing time and mixer speed.
[0086] Food detergent and purified water are mixed in a ratio of 1:10 through a solution mixing chamber. The flow parameters are controlled by a solenoid valve, and the mixing is performed at high speed using a rotary agitator. The concentration and uniformity of the mixed solution are accurately recorded and calculated to ensure the uniformity and stability of the mixed solution. If the uniformity does not meet the standard, it can be optimized by adjusting the stirring time and the speed of the agitator, which significantly improves the accuracy and reliability of the detection.
[0087] S2, a sample detection module, is used to obtain detection data using spectral analysis detection technology on the mixed solution sample;
[0088] Specifically, using spectral analysis technology to detect the composition of the mixed solution sample refers to flowing the mixed solution sample into the detection cell from the liquid outlet, starting a near-infrared spectrometer, and setting scanning parameters of the instrument for detecting and analyzing the chemical composition and molecular structure of the sample, including wavelength range and scanning speed;
[0089] Use a fiber optic coupler to connect one end of the fiber optic cable to the light source of the near-infrared spectrometer and the other end to the input end of the fiber optic probe;
[0090] Fix the output end of the fiber optic probe to the other end of the detection cell, and adjust the position and distance of the fiber optic probe so that the light from the near-infrared spectrometer passes vertically through the mixed solution;
[0091] Turn on the light source of the near-infrared spectrometer, do not place the mixed solution on the detection path, start the spectrum analysis software, record the spectrum data without the mixed solution, and obtain the background spectrum signal I b Then place the standard white board in the light path, and the optical fiber cable transmits the near-infrared light through the standard white board to the spectrum detector, and records the reference photoelectric signal intensity I 0,s ;
[0092] The mixed solution to be tested is placed in the optical path. The optical fiber cable transmits near-infrared light through the mixed solution. The optical fiber probe receives the transmitted light and transmits it to the spectrum detector through the optical fiber cable to record the spectral signal of the mixed solution. s ;
[0093] The spectrum detector detects and records the spectrum signal of the transmitted light and converts the spectrum signal into an electrical signal;
[0094] Data acquisition card is a hardware device used to collect, convert and transmit analog and digital signals from various sensors, instruments or equipment. The data acquisition card converts electrical signals into digital signals and transmits them to the computer through data lines for analysis;
[0095] Remove the background spectrum signal I for I and I0 respectively b Perform background correction, standardize the obtained correction signals, and convert the correction signals into the mixed solution transmission photoelectric signal intensity I s and the reference photoelectric signal intensity I 0,s , calculate the absorbance at each wavelength, the formula is:
[0096]
[0097] Where A is the absorbance, I s is the intensity of the transmitted photoelectric signal of the mixed solution sample, I 0,s is the reference photoelectric signal intensity;
[0098] Wavelength refers to the distance a wave travels in one cycle and is used to describe light waves, sound waves, and other forms of fluctuations. The relationship between absorbance and wavelength is demonstrated through spectral analysis technology. Spectral analysis software plots the absorbance at each wavelength on the spectrum to form a near-infrared spectrum.
[0099] In the spectrum, according to the relative baseline and relative height standards, the wavelength with high absorbance is identified as the absorption peak, and the wavelength point and corresponding absorbance of each absorption peak are recorded as the characteristic peak to construct the spectrum data set;
[0100] The calculated absorbance data were imported into the chemometric analysis software to calculate the covariance matrix of the absorbance data. The covariance matrix was subjected to eigenvalue decomposition to obtain eigenvalues and eigenvectors. The eigenvalues were sorted from large to small, and the eigenvector corresponding to the largest eigenvalue was selected as the principal component. The absorbance data were projected into the principal component space to reduce the dimension and remove noise.
[0101] The characteristic peak position and intensity of each component are identified and recorded in the principal component space, and compared with the existing spectral standard database to determine the composition of each component. The concentration of each component in the mixed solution sample is calculated using the absorbance of the characteristic peak through the Beer-Lambert law.
[0102] By using spectral analysis technology to detect the components of mixed solution samples, the operating steps of the spectrometer are set up and optimized in detail, from the background spectral signal, the standard white plate reference signal to the actual detection signal of the mixed solution, the accuracy and reliability of the data are ensured. Through the combination of fiber optic coupling technology and near-infrared spectrometer, efficient, non-destructive and precise component detection is achieved, and chemometric analysis software is used for data processing and feature extraction. Finally, the concentration of each component is accurately calculated using the Beer-Lambert law. This method improves the sensitivity and accuracy of detection, while simplifying the detection process, and has the beneficial effects of being fast, accurate and stable.
[0103] S3, prediction module, is used to extract the features of the test data, build a food detergent ingredient prediction model, and predict ingredient concentration and risk assessment;
[0104] Specifically, extracting the features of the detection data means calculating the mean and standard deviation of the signal intensity at each wavelength point in the spectral data set, and normalizing the signal intensity at each wavelength point to obtain standardized data;
[0105] Perform wavelet decomposition on the standardized data, remove noise from the high-frequency part of the decomposition, and perform wavelet reconstruction to obtain the denoised data;
[0106] According to the characteristic peak position and intensity of each component, the characteristic vector F is constructed i , each eigenvector is represented by (λ ik , A ik );
[0107] Design the eigenvector function and transform the eigenvector F i Convert to peak feature vector format f(Fi ), the formula is:
[0108]
[0109] Among them, λ ik is the position of the characteristic peak of the i-th component of the k-th mixed solution sample, A ik is the intensity of the characteristic peak of the i-th component of the k-th mixed solution sample, a k , b and c are unknown parameters, and nonlinear regression method is used to determine a by minimizing the error between the predicted concentration and the actual concentration. k , b and c are specific values, and m is the number of mixed solution samples;
[0110] By the peak eigenvector f(F i ) generating a spectral analysis data set;
[0111] The converted peak feature vector f(F i ) to form the joint peak eigenvector matrix V:
[0112]
[0113] Among them, f(F i ) k is the peak feature vector of the kth mixed solution sample;
[0114] Calculate the Pearson correlation coefficient r between each eigenvector in the joint peak eigenvector matrix V ij , the formula is:
[0115]
[0116] Among them, r ij is the linear correlation coefficient between the i-th component and the j-th component, λ ik is the characteristic peak position of the i-th component in the k-th mixed solution sample, A jk is the characteristic peak intensity of the jth component in the kth mixed solution sample, is the mean of the characteristic peak position of the i-th component, is the mean characteristic peak intensity of the jth component, and m is the number of mixed solution samples;
[0117] According to the correlation coefficient r ij , calculate the adaptive weight factor, the formula is:
[0118]
[0119] Among them, ω i is the adaptive weight factor of the i-th component, and α is the adjustment parameter;
[0120] For each peak eigenvector f(F i ) multiplied by the weight factor ω i , get the weighted peak eigenvector matrix V';
[0121] The peak eigenvector matrix is optimized by using the adaptive weight factor, and the weighted peak eigenvector matrix V' is analyzed. i The size of the threshold T ω , retain the weight factor greater than the threshold T ω The peak feature vector of the weight factor is less than the threshold T. ω The peak eigenvector of .
[0122] By performing detailed feature extraction and processing on the detection data, including calculating the mean and standard deviation of the signal intensity at each wavelength point and performing standardization, the fluctuation of the data under different detection conditions can be effectively eliminated, and standardized data can be obtained. Through wavelet decomposition and denoising, the influence of high-frequency noise can be significantly reduced, thereby obtaining a clearer and more accurate signal, further identifying the characteristic peak position and intensity of each component, constructing a set of feature vectors so that each feature pair can effectively represent the key information of the component, designing a feature vector function, and converting the feature vector into a usable input mode, it is helpful to form a representative joint feature vector matrix, calculating the Pearson correlation coefficient between each eigenvector in the joint eigenvector matrix, and quantitatively analyzing the correlation between each feature, thereby identifying which features have important contributions to model prediction. According to the correlation coefficient, the adaptive weight factor is calculated, and the eigenvector matrix is further optimized. Through this process, important features can be retained, redundant features can be eliminated, and the quality of the data and the prediction accuracy of the model can be improved.
[0123] Furthermore, a food detergent ingredient prediction model is constructed to predict ingredient concentrations including:
[0124] A food detergent ingredient evaluation model was constructed using a multi-layer perceptron neural network model, including input layer, hidden layer, and output layer.
[0125] Set the input layer to the peak feature vector f(F i ), the output layer is the predicted concentration value of each component
[0126] The spectral analysis data set is divided into a training set and a test set, the training set data is input into the model, and the model parameters are initialized;
[0127] The defined objective function is used as the loss function for model training. The objective function is designed as the weighted sum of the component concentration prediction error and the detection error. The formula is:
[0128]
[0129] Among them, L is the loss value of the objective function, Q i is the actual concentration value of the i-th component, is the predicted concentration value of the i-th component, λ ik is the characteristic peak position of the i-th component in the k-th mixed solution sample, is the predicted characteristic peak position of the i-th component in the k-th mixed solution sample, β is the weight adjustment parameter, m is the number of mixed solution samples, and n is the number of characteristic peaks;
[0130] Use the Adam optimization algorithm to optimize model parameters, iteratively update model parameters, minimize the loss function, set the learning rate and batch size, and record the loss value of each iteration until the loss function converges;
[0131] Calculate the mean square error and coefficient of determination to evaluate the predictive performance of the model;
[0132] Tune the model's hyperparameters, including learning rate, number of hidden layer neurons, and batch size, and use Bayesian optimization to find the optimal hyperparameter combination;
[0133] Save the trained model;
[0134] Food detergent samples were collected from the sampling site, analyzed and detected using spectral technology and pre-processed to extract the new feature vector f(F i ) Input the food detergent component prediction model to obtain the predicted concentration value of each component in the mixed solution sample
[0135] A food detergent ingredient evaluation model was constructed using a multilayer perceptron neural network model, enabling high-precision prediction of ingredient concentrations. By setting the input layer to feature vectors and the output layer to predicted concentrations of each ingredient, key features from the spectral analysis data were effectively input into the model. The dataset was divided into training and test sets, and the model parameters were initialized to ensure good generalization during training. The weighted sum of the ingredient concentration prediction error and detection error was used as the loss function, and the Adam optimization algorithm was used for model parameter optimization. The model parameters were iteratively updated to minimize the loss function, thereby improving the model's prediction accuracy. A reasonable learning rate and batch size were set, and the loss value of each iteration was recorded until the loss function converged, ensuring stable model convergence during training. The test set data was input into the model, and the predicted ingredient concentration values were calculated. The model's predictive performance was evaluated using the mean squared error and coefficient of determination to ensure model accuracy and reliability. The model's hyperparameters, including the learning rate, number of hidden layer neurons, and batch size, were tuned. Bayesian optimization was used to find the optimal hyperparameter combination to further improve model performance.
[0136] In addition, risk assessment means setting the concentration threshold T for each ingredient according to the safety standards of food detergent ingredients. i , using adaptive weight factors and predicted concentration values of each component Calculate the comprehensive risk assessment value R:
[0137]
[0138] Among them, R i is the comprehensive risk assessment value of the i-th component of the mixed solution sample, ω i is the adaptive weight factor of the i-th component, T i is the safety threshold of the i-th component, is the predicted concentration value of the i-th component, and p is the number of components in the mixed solution;
[0139] Set the risk threshold R th , compare the comprehensive risk assessment value R i and risk threshold R th Predict risk levels and provide prompts;
[0140] If R i ≤R th , then the risk is within an acceptable range and the system operates normally;
[0141] If R i >R th , the risk exceeds the acceptable range, triggering an alarm and prompting the user to take action.
[0142] By using the food detergent ingredient prediction model, the concentration values of each ingredient in food detergents can be accurately predicted. According to the safety standards of food detergent ingredients, the concentration threshold of each ingredient is set, and the adaptive weight factor and predicted concentration are used to calculate the comprehensive risk assessment value. This not only improves the detection accuracy and efficiency, but also can monitor the safety of food detergents in real time. By setting the risk threshold, the system can compare the comprehensive risk assessment and the risk threshold to predict the risk level and provide prompts. When the comprehensive risk assessment value is less than or equal to the risk threshold, it means that the risk is within an acceptable range and the system operates normally. When the comprehensive risk assessment value is greater than the risk threshold, it means that the risk exceeds the acceptable range. The system will trigger an alarm and prompt the user to take corresponding measures. This risk assessment mechanism not only ensures the safety of food detergents, but also can provide timely warnings to prevent potential hazards.
[0143] S4, a storage module, used to encrypt the test data and evaluation results during the test process, collect the test data and evaluation results, and store them;
[0144] Specifically, the test data and evaluation results during the test process are encrypted. Storing and collecting the test data and evaluation results means using the AES algorithm to encrypt the test data and evaluation results collected during the test process. The AES algorithm is used to protect the security of electronic data. The encrypted data is transmitted to the database through a secure transmission protocol. The secure transmission protocol is used to protect data from being eavesdropped, tampered with, and forged during transmission. A table structure is created in the database, all encryption and storage processes are logged and backed up regularly, and access permissions are set.
[0145] By using the AES algorithm to encrypt the test data and evaluation results collected during the test process, the encrypted data is transmitted to the database through a secure transmission protocol and a table structure is created in the database. This can significantly improve the security and integrity of the data, ensure the confidentiality of the test data and evaluation results during transmission and storage, and prevent the data from being intercepted or tampered with during transmission. By recording logs of all encryption and storage processes and performing regular data backups, the traceability and reliability of the data are guaranteed, preventing data loss. Setting access permissions further ensures that only authorized personnel can access and decrypt the data, thereby effectively protecting the privacy and security of the data.
[0146] Example 2
[0147] Reference Figure 2 , which is the second embodiment of the present invention, is different from the previous embodiment and provides a method for detecting ingredients of food detergents, which includes:
[0148] collecting food detergent and mixing the food detergent with purified water using a solution mixing chamber to form a mixed solution sample;
[0149] Using spectral analysis detection technology on mixed solution samples to obtain detection data;
[0150] Extract features from test data, build a food detergent ingredient prediction model, predict ingredient concentrations, and conduct risk assessments;
[0151] The test data and evaluation results during the test process are encrypted and stored.
[0152] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0153] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0154] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0155] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0156] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A food detergent ingredient detection system, characterized by: include, A sample collection module, used for collecting food detergent and mixing the food detergent with purified water using a solution mixing chamber to form a mixed solution sample; A sample detection module is used to obtain detection data using spectral analysis detection technology on mixed solution samples; The prediction module is used to extract features from test data, build a food detergent ingredient prediction model, predict ingredient concentrations, and perform risk assessment; The storage module is used to encrypt the test data and evaluation results during the test process and store and collect the test data and evaluation results; The method of using spectral analysis technology to detect the components of the mixed solution sample refers to flowing the mixed solution sample into the detection pool from the liquid outlet, starting the near-infrared spectrometer, and setting the scanning parameters, including the wavelength range and the scanning speed; Use fiber optic components to connect the light source and detection cell of the near-infrared spectrometer; Turn on the light source of the near-infrared spectrometer and record the spectral signal without the mixed solution sample to obtain the background spectral signal I b , then place a standard white plate in the light path, pass the near-infrared light through the standard white plate, and record the reference photoelectric signal intensity I0, place the mixed solution sample to be tested in the light path, pass the near-infrared light through the mixed solution sample, and record the spectral signal I of the mixed solution sample; The spectrum detector detects and records the spectrum signal of the transmitted light, converts the spectrum signal into an electrical signal, and the data acquisition card converts the electrical signal into a digital signal and transmits it to the computer through a data line for analysis; Background correction was performed on I and I0 respectively, and the obtained correction signals were standardized respectively, and the correction signals were converted into the transmission photoelectric signal intensity I of the mixed solution. s and the reference photoelectric signal intensity I 0,s , calculate the absorbance at each wavelength, the formula is: Where A is the absorbance, I s is the intensity of the transmitted photoelectric signal of the mixed solution sample, I 0,s is the reference photoelectric signal intensity; The absorbance A is used as the Y-axis data and the wavelength is used as the X-axis data to generate a spectrum. The spectrum analysis software plots the absorbance at each wavelength on the spectrum to form a near-infrared spectrum. In the spectrum, according to the relative baseline and relative height standards, the wavelength with high absorbance is identified as the absorption peak, and the wavelength point and corresponding absorbance of each absorption peak are recorded as the characteristic peak to construct the spectrum data set; The calculated absorbance data were imported into the chemometric analysis software to calculate the covariance matrix of the absorbance data. The covariance matrix was subjected to eigenvalue decomposition to obtain eigenvalues and eigenvectors. The eigenvalues were sorted from large to small, and the eigenvector corresponding to the largest eigenvalue was selected as the principal component. The absorbance data were projected into the principal component space to reduce the dimension and remove noise. Identify and record the characteristic peak position and intensity of each component in the principal component space, and compare it with the existing spectral standard database to determine the composition of each component. Use the Beer-Lambert law to calculate the concentration of each component in the mixed solution sample using the absorbance of the characteristic peak; Extracting the characteristics of the detection data refers to calculating the mean and standard deviation of the signal intensity at each wavelength point in each spectral data set, and normalizing the signal intensity at each wavelength point to obtain standardized data; Perform wavelet decomposition on the standardized data, remove noise from the high-frequency part of the decomposition, and perform wavelet reconstruction to obtain the denoised data; According to the characteristic peak position and intensity of each component, the characteristic vector F is constructed i , each eigenvector is represented by (λ ik , A ik ); Design the eigenvector function and transform the eigenvector F i Convert to peak feature vector format f(F i ), the formula is: Among them, λ ik is the position of the characteristic peak of the i-th component of the k-th mixed solution sample, A ik is the intensity of the characteristic peak of the i-th component of the k-th mixed solution sample, a k , b and c are unknown parameters, and nonlinear regression method is used to determine a by minimizing the error between the predicted concentration and the actual concentration. k , b and c are specific values, and m is the number of mixed solution samples; By the peak eigenvector f(F i ) generating a spectral analysis data set; The converted peak feature vector f(F i ) to form the joint peak eigenvector matrix V: Among them, f(F i ) k is the peak feature vector of the kth mixed solution sample; Calculate the Pearson correlation coefficient r between each eigenvector in the joint peak eigenvector matrix V ij , the formula is: Among them, r ij is the linear correlation coefficient between the i-th component and the j-th component, λ ik is the characteristic peak position of the i-th component in the k-th mixed solution sample, A jk is the characteristic peak intensity of the jth component in the kth mixed solution sample, is the mean of the characteristic peak position of the i-th component, is the mean characteristic peak intensity of the jth component, and m is the number of mixed solution samples; According to the correlation coefficient r ij , calculate the adaptive weight factor, the formula is: Among them, ω i is the adaptive weight factor of the i-th component, and α is the adjustment parameter; For each peak eigenvector f(F i ) multiplied by the weight factor ω i , get the weighted peak eigenvector matrix V'; The peak eigenvector matrix is optimized by using the adaptive weight factor, and the weighted peak eigenvector matrix V' is analyzed. i The size of the threshold T ω , retain the weight factor greater than the threshold T ω The peak feature vector of the weight factor is less than the threshold T. ω The peak eigenvector of .
2. A food detergent component detection system according to claim 1, characterized in that: The collecting of food detergents refers to sampling food detergents from different batches and production lines at the sampling site, mixing all sampled food detergents evenly, weighing the food detergents using an electronic balance, and recording the mass values; The inner wall of the sample tank is coated with an anti-stick coating, and the food detergent is weighed using an electronic balance and poured into the sample tank, and the sample tank cover is closed.
3. A food detergent component detection system as claimed in claim 2, characterized in that: The method of using a solution mixing chamber to mix the food detergent and purified water to form a mixed solution sample refers to connecting a sample tank to the solution mixing chamber, starting the solenoid valve at the bottom of the sample tank, inputting the required food detergent flow parameters into the solenoid valve controller, opening the water inlet valve to allow the purified water to flow into the solution mixing chamber, mixing the food detergent and purified water in a ratio of 1:10, starting the rotary agitator in the solution mixing chamber, fully mixing the food detergent and purified water through high-speed rotation, recording the stirring time, and obtaining a mixed solution sample.
4. A food detergent component detection system as claimed in claim 3, characterized in that: The method of constructing a food detergent ingredient prediction model to predict ingredient concentrations includes: A food detergent ingredient evaluation model was constructed using a multi-layer perceptron neural network model, including input layer, hidden layer, and output layer. Set the input layer to the peak feature vector f(F i ), the output layer is the predicted concentration value of each component The spectral analysis data set is divided into a training set and a test set, the training set data is input into the model, and the model parameters are initialized; The defined objective function is used as the loss function for model training. The objective function is designed as the weighted sum of the component concentration prediction error and the detection error. The formula is: Among them, L is the loss value of the objective function, Q i is the actual concentration value of the i-th component, is the predicted concentration value of the i-th component, λ ik is the characteristic peak position of the i-th component in the k-th mixed solution sample, is the predicted characteristic peak position of the i-th component in the k-th mixed solution sample, β is the weight adjustment parameter, m is the number of mixed solution samples, and n is the number of characteristic peaks; Use the Adam optimization algorithm to optimize model parameters, iteratively update model parameters, minimize the loss function, set the learning rate and batch size, and record the loss value of each iteration until the loss function converges; Calculate the mean square error and coefficient of determination to evaluate the predictive performance of the model; Tune the model's hyperparameters, including learning rate, number of hidden layer neurons, and batch size, and use Bayesian optimization to find the optimal hyperparameter combination; Save the trained model; Food detergent samples were collected from the sampling site, analyzed and detected using spectral technology and pre-processed to extract the new feature vector f(F i ) Input the food detergent component prediction model to obtain the predicted concentration value of each component in the mixed solution sample 5. A food detergent component detection system as claimed in claim 4, characterized in that: The risk assessment refers to setting the concentration threshold T of each ingredient according to the safety standards of food detergent ingredients. i , using adaptive weight factors and predicted concentration values of each component Calculate the comprehensive risk assessment value R: Among them, R i is the comprehensive risk assessment value of the i-th component of the mixed solution sample, ω i is the adaptive weight factor of the i-th component, T i is the safety threshold of the i-th component, is the predicted concentration value of the i-th component, and p is the number of components in the mixed solution; Set the risk threshold R th , compare the comprehensive risk assessment value R i and risk threshold R th Predict risk levels and provide prompts; If R i ≤R th , then the risk is within an acceptable range and the system operates normally; If R i >R th , the risk exceeds the acceptable range, triggering an alarm and prompting the user to take action.
6. A food detergent component detection system as claimed in claim 5, characterized in that: The encryption of the detection data and evaluation results during the test process and the storage of the collected detection data and evaluation results refer to using the AES algorithm to encrypt the detection data and evaluation results collected during the test process, transmitting the encrypted data to the database through a secure transmission protocol, creating a table structure in the database, recording logs for all encryption and storage processes and backing up them regularly, and setting access permissions.
7. A method for detecting ingredients of a food detergent according to any one of claims 1 to 6, characterized in that: include, collecting food detergent and mixing the food detergent with purified water using a solution mixing chamber to form a mixed solution sample; Using spectral analysis detection technology on mixed solution samples to obtain detection data; Extract features from test data, build a food detergent ingredient prediction model, predict ingredient concentrations, and conduct risk assessments; The test data and evaluation results during the test process are encrypted and stored.