A food testing method, equipment, and media based on industrial big data.
By constructing a dual-branch deep autoencoder and association rule mining, a unique dynamic threshold is generated, which solves the problem of high false alarm rate in food testing, realizes real-time anomaly detection and risk source tracing of food quality, achieves closed-loop control, and meets the real-time quality control needs of the food industry.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI GUOKE TESTING & CERTIFICATION CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-03
AI Technical Summary
Existing food testing technologies lack effective big data analysis methods, making it difficult to achieve dynamic and accurate real-time food quality detection. This results in high false alarm rates and delayed responses, failing to meet the needs of the modern food industry for real-time quality control and risk warning.
By constructing a dual-branch deep autoencoder to generate a dedicated dynamic threshold, and combining association rules to mine and trace risk sources, real-time anomaly detection and risk source location in food quality are achieved. Multi-source industrial big data is collected by sensors for preprocessing and feature extraction, and a dynamic reconstruction error threshold is constructed to detect anomalies online.
It reduced the false alarm rate, improved detection sensitivity, and achieved closed-loop real-time quality control from early warning triggering to risk source output. It also enabled adaptive baseline modeling of quality fluctuations under different production conditions and accurate attribution of abnormal features.
Smart Images

Figure CN122333280A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of food quality and safety testing technology, specifically a food testing method, equipment, and medium based on industrial big data. Background Technology
[0002] Current food testing primarily relies on manual sampling combined with laboratory physicochemical analysis. Meanwhile, some companies have introduced automated online testing equipment to determine quality based on threshold comparisons of single or multiple parameters. With the development of the Industrial Internet of Things (IIoT), food production lines can collect massive amounts of industrial data, including temperature, humidity, equipment operating parameters, raw material batch information, and historical test results, providing a data foundation for more comprehensive quality analysis.
[0003] However, current technologies still lack effective big data analytics to integrate the aforementioned multi-source, heterogeneous, and high-speed data, making it difficult to achieve dynamic and accurate real-time food quality monitoring. A few solutions attempt to employ statistical process control, but these fail to address key issues such as data heterogeneity, noise interference, and rapid anomaly tracing, resulting in high false alarm rates and delayed responses, thus failing to meet the practical needs of modern food industries for real-time quality control and risk warning. Summary of the Invention
[0004] This invention provides a food testing method, equipment, and medium based on industrial big data. By constructing a dual-branch deep autoencoder to generate a dedicated dynamic threshold and locate the anomaly contribution rate, and then combining association rules to mine and trace the risk source, it achieves a reduction in false alarm rate and an improvement in detection sensitivity. It achieves closed-loop real-time quality control from early warning triggering to risk source output, thus solving the problems in the background technology.
[0005] To achieve the above objectives, the technical solution of the present invention is as follows: A food testing method based on industrial big data executes the following steps using computer equipment: S1, through sensors and enterprise information systems deployed on the production line, collects and stores multi-source industrial big data in real time, including environmental parameters, equipment operating status, raw material information, and semi-finished and finished product testing indicators; S2 preprocesses the collected multi-source industrial big data, including missing value imputation, outlier removal, time alignment, and feature extraction, to form a structured detection dataset; S3 uses historical normal batch datasets to train a deep autoencoder model and determine the dynamic reconstruction error threshold of food quality features; during online detection, the real-time data stream is input into the deep autoencoder model to calculate the reconstruction error. If the error exceeds the threshold, an early warning is triggered and the feature variable with the highest contribution rate is located. S4 utilizes the feature variables with the highest contribution rate located in S3, combined with association rule mining, to associate the early warning information with raw material batches and production sections, and output suspicious risk sources.
[0006] Preferably, in S1, the sensors include a temperature sensor, a humidity sensor, a pH meter, a near-infrared spectrometer, and a machine vision device; the enterprise information system includes a raw material traceability system, a production execution system, and a laboratory information management system; the data acquisition frequency can be dynamically adjusted according to the production line speed; the acquired data is transmitted to the distributed storage system in real time through a message queue, using timestamps as the primary key.
[0007] Preferably, in S2, missing value imputation is performed using linear interpolation or time series prediction based on historical data; outlier removal is based on the 3σ criterion or local outlier factor; time alignment is performed using nearest neighbor matching based on timestamps; feature extraction includes calculating the mean, standard deviation, slope, and spectral energy within a sliding window, with the window length set according to the detection response time requirements.
[0008] Preferably, the specific steps of S3 are as follows: S31: The structured data output by S2 is associated with the entire production batch, and the full-cycle working condition features are synchronously bound to each quality sample to form paired datasets, which are then divided into training and validation sets in an 8:2 ratio.
[0009] S32: Construct a dual-branch deep autoencoder. The quality branch learns high-dimensional latent features of quality through a fully connected network, while the working condition branch maps working condition parameters into low-dimensional dense latent vectors through an embedding layer. The outputs of the two branches are concatenated and input into the decoder to reconstruct the original quality features. Distributed training is performed with the goal of minimizing the mean square error of reconstruction.
[0010] S33: Use the trained model to infer validation set samples and establish a mapping library between the latent vector of working conditions and the corresponding kernel density distribution of reconstruction error; during online detection, extract the latent vector of working conditions and the latent vector of quality of real-time samples and calculate the overall reconstruction error; then match the most similar working condition interval and generate a dynamic anomaly detection threshold specific to the sample in real time by combining the preset confidence level; finally, compare the reconstruction error with the dynamic threshold, and if it exceeds the threshold, trigger an alarm and calculate the anomaly contribution rate of each dimension feature to locate the feature variable with the highest contribution rate.
[0011] Preferably, in S33, the latent vector of the working condition of the real-time sample is extracted and the overall reconstruction error is calculated as follows: Real-time new samples output by S2 Extract its quality latent vector and operating condition latent vector:
[0012] in, This is the latent quality vector for new samples in real time. This represents the quality feature vector of the new sample in real time. For quality feature encoders, These are the optimal quality encoder parameters obtained through offline training.
[0013] in, This is the latent vector of the working conditions for new samples in real time. This is the feature vector of the working conditions for new samples in real time. For the working condition feature embedding layer, These are the optimal embedding layer parameters obtained through offline training. Real-time overall reconstruction error calculation
[0014] in, Let be the overall reconstruction error of the new sample in real time, and D be the joint feature decoder. This is the result of vertically concatenating the latent vectors of quality and operating conditions. These are the optimal decoder parameters obtained through offline training. for The square of the norm is the square of the Euclidean distance.
[0015] Preferably, the similar working condition matching and dynamic threshold generation in S33 are specifically as follows: Calculate the cosine similarity between the current working condition latent vector and the latent vectors of all working conditions in the offline mapping library:
[0016] in, is the cosine similarity function, with a value range of [-1, 1]. The closer the value is to 1, the more similar the two working conditions are. Let be the latent vector of the i-th sample in the offline mapping library M, where M is the latent vector of the working condition error mapping library, storing the correspondence between the latent vectors of the working conditions of all validation set samples and the overall reconstruction error. This represents the overall reconstruction error of the corresponding sample. Select the K most similar samples to obtain the corresponding reconstruction error set:
[0017] in, Let K be the set of reconstruction errors for the K most similar samples, where K is the preset number of similar samples. Perform Gaussian kernel density estimation and calculate the Silverman optimal bandwidth:
[0018] Where h is the Silverman optimal bandwidth of the Gaussian kernel density estimation, which controls the smoothness of the kernel function; For the error set Standard deviation:
[0019] Where f(e) is the Gaussian kernel density estimation function of the reconstruction error, which is used to fit the error distribution of normal samples under similar working conditions; For the error set The j-th error value in It is a natural exponential function; calculate( Quantiles serve as the specific dynamic threshold for this sample:
[0020] in, This is a dedicated dynamic threshold for new samples in real time; inf represents the infimum, which is the minimum error value that satisfies the condition. The integral of the kernel density estimation function from negative infinity to e represents the probability that the error is less than or equal to e; For the level of significant quality control, , where is the confidence level.
[0021] Preferably, the anomaly detection and feature contribution rate localization in S33 are specifically as follows: Anomaly detection:
[0022] When the overall reconstruction error of a new real-time sample exceeds its specific dynamic threshold, it is judged as an abnormal quality; otherwise, it is judged as normal. If it is judged as abnormal, the abnormal contribution rate of each feature dimension is calculated:
[0023] in, The anomaly contribution rate of the j-th dimension quality feature reflects the degree of influence of this dimension on the overall anomalies; This represents the original value of the j-th dimension feature of the new sample in real time. d represents the reconstructed value of the j-th feature, d represents the total dimension of the quality features, sorted by contribution rate from largest to smallest, and outputs the top N key abnormal feature variables, where N is the preset number of output features.
[0024] Preferably, the specific steps of S4 include: A transaction database is constructed, where each transaction corresponds to one early warning event, containing the following itemsets: early warning ID, timestamp, anomaly feature set, contribution rate ranking, raw material batch number, production section ID, and equipment parameter anomaly flag. The FP-growth algorithm is used to mine frequent itemsets, generating strong association rules. For the current warning, extract the production records within its time window; calculate the credibility of each candidate risk source, where credibility is equal to the support of the preceding and following items occurring simultaneously divided by the support of the preceding item occurring alone; The output rules that meet the confidence threshold and have an elevation greater than 1 are ranked in descending order of confidence and are considered as suspicious risk sources. At the same time, the risk sources are cross-validated with the variables with the highest contribution rate of abnormal features. If they match, they are output as the final risk sources.
[0025] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0026] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0027] As can be seen from the above technical solution compared with the prior art, the present invention has the following beneficial effects: 1. This invention constructs a dual-branch deep autoencoder to jointly learn quality features and latent vectors of operating conditions, and generates a unique dynamic threshold for each sample based on kernel density estimation of similar operating conditions, thereby achieving adaptive modeling of the quality fluctuation baseline under different production conditions and reducing the false alarm rate caused by fixed thresholds.
[0028] 2. This invention locates key abnormal variables by calculating the abnormal contribution rate of features in each dimension online, and combines association rule mining to cross-validate the early warning information with raw material batches and production sections, so as to achieve accurate attribution of abnormal features and rapid tracing of risk sources, and achieve closed-loop real-time quality control from triggering early warning to outputting suspected risk sources. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the method steps of the present invention; Figure 2 This is a schematic diagram of the data change logic in S33 of the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0031] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention, but should not be used to limit the scope of the present invention.
[0032] Example: like Figure 1 As shown in this embodiment, a food factory production line is used as an example. The factory processes hundreds of tons of raw materials every day. The key quality control indicators include physicochemical parameters A, B, and C, as well as key process temperature curves. Traditional testing relies on manual sampling and testing at regular intervals. Quality accidents have occurred where a large number of products were found to be unqualified due to instantaneous fluctuations in process parameters. Therefore, a food testing method based on industrial big data is introduced in this invention.
[0033] Implementation begins: Real-time acquisition and storage of multi-source data Temperature sensors with an accuracy of ±0.1℃, pressure sensors, online pH meters, and near-infrared spectrometers are deployed at raw material receiving tanks, key processing sections, and filling stations. These systems are also integrated with a raw material traceability system (to obtain raw material batch numbers, production execution system data, workstation IDs, equipment operating parameters, and a laboratory information management system (to input offline sampling results)). The data acquisition frequency is set to 1 Hz, with each data point appended with a workstation identifier and timestamp, and transmitted in real-time to a distributed storage system via a message queue.
[0034] Data preprocessing and structuring: A sliding window is formed every 5 seconds, and the original data is sequentially processed by performing missing value imputation, linear interpolation, outlier removal, 3σ criterion, time alignment, nearest neighbor matching, tolerance delay ≤1 second, and feature extraction, including mean, standard deviation, slope, and spectral energy within the window, to form a structured dataset. Each sample contains a quality feature vector and a working condition feature vector.
[0035] Offline training and dynamic threshold modeling Extract batch data that was deemed "qualified" by quality inspection in the past three months, associate them with the entire production batch chain, bind full-cycle operating condition features to each quality sample, form paired datasets, and divide them into training set and validation set in an 8:2 ratio.
[0036] A dual-branch deep autoencoder is constructed on a distributed computing engine: the quality branch learns high-dimensional latent features of quality through a fully connected network, and the working condition branch maps working condition parameters into low-dimensional dense latent vectors through an embedding layer; the outputs of the two branches are concatenated and input into the decoder to reconstruct the original quality features, and training is performed with the goal of minimizing the mean square error of reconstruction.
[0037] By constructing a dual-branch deep autoencoder to jointly learn quality features and latent vectors of operating conditions, and generating a unique dynamic threshold for each sample based on kernel density estimation of similar operating conditions, adaptive modeling of quality fluctuation baselines under different production operating conditions is achieved.
[0038] Using a trained model to infer a validation set, a mapping library between the latent vector of operating conditions and the reconstruction error is established. During online detection, real-time samples are input into the model to extract the latent vectors of quality and operating conditions, and the overall reconstruction error is calculated. The K most similar samples to the current operating condition are matched in the mapping library, and a specific dynamic threshold is generated through Gaussian kernel density estimation. If the reconstruction error exceeds the threshold, an early warning is triggered, and the contribution rate of each dimension of features is calculated to locate key abnormal features.
[0039] The extraction of the latent vector of the working condition from real-time samples and the calculation of the overall reconstruction error are as follows: Real-time new samples output Extract its quality latent vector and operating condition latent vector:
[0040] in, This is the latent quality vector for new samples in real time. This represents the quality feature vector of the new sample in real time. For quality feature encoders, These are the optimal quality encoder parameters obtained through offline training.
[0041] in, This is the latent vector of the working conditions for new samples in real time. This is the feature vector of the working conditions for new samples in real time. For the working condition feature embedding layer, These are the optimal embedding layer parameters obtained through offline training. Real-time overall reconstruction error calculation
[0042] in, Let be the overall reconstruction error of the new sample in real time, and D be the joint feature decoder. This is the result of vertically concatenating the latent vectors of quality and operating conditions. These are the optimal decoder parameters obtained through offline training. for The square of the norm is the square of the Euclidean distance.
[0043] Similar working condition matching and dynamic threshold generation are specifically as follows: Calculate the cosine similarity between the current working condition latent vector and the latent vectors of all working conditions in the offline mapping library:
[0044] in, is the cosine similarity function, with a value range of [-1, 1]. The closer the value is to 1, the more similar the two working conditions are. Let be the latent vector of the i-th sample in the offline mapping library M, where M is the latent vector of the working condition error mapping library, storing the correspondence between the latent vectors of the working conditions of all validation set samples and the overall reconstruction error. This represents the overall reconstruction error of the corresponding sample. Select the K most similar samples to obtain the corresponding reconstruction error set:
[0045] in, Let K be the set of reconstruction errors for the K most similar samples, where K is the preset number of similar samples. Perform Gaussian kernel density estimation and calculate the Silverman optimal bandwidth:
[0046] Where h is the Silverman optimal bandwidth of the Gaussian kernel density estimation, which controls the smoothness of the kernel function; For the error set Standard deviation:
[0047] Where f(e) is the Gaussian kernel density estimation function of the reconstruction error, which is used to fit the error distribution of normal samples under similar working conditions; For the error set The j-th error value in It is a natural exponential function; calculate( Quantiles serve as the specific dynamic threshold for this sample:
[0048] in, This is a dedicated dynamic threshold for new samples in real time; inf represents the infimum, which is the minimum error value that satisfies the condition. The integral of the kernel density estimation function from negative infinity to e represents the probability that the error is less than or equal to e; For the level of significant quality control, , where is the confidence level.
[0049] Anomaly detection and feature contribution rate localization are specifically as follows: Anomaly detection:
[0050] When the overall reconstruction error of a new real-time sample exceeds its specific dynamic threshold, it is judged as an abnormal quality; otherwise, it is judged as normal. If it is judged as abnormal, the abnormal contribution rate of each feature dimension is calculated:
[0051] in, The anomaly contribution rate of the j-th dimension quality feature reflects the degree of influence of this dimension on the overall anomalies; This represents the original value of the j-th dimension feature of the new sample in real time. d represents the reconstructed value of the j-th feature, d represents the total dimension of the quality features, sorted by contribution rate from largest to smallest, and outputs the top N key abnormal feature variables, where N is the preset number of output features.
[0052] Finally, a transaction database is constructed, where each transaction corresponds to one early warning event and includes the following itemsets: early warning ID, timestamp, anomaly feature set, contribution rate ranking, raw material batch number, production section ID, and equipment parameter anomaly flag. The FP-growth algorithm is used to mine frequent itemsets and generate strong association rules. For the current warning, extract the production records within its time window; calculate the credibility of each candidate risk source, where credibility is equal to the support of the preceding and following items occurring simultaneously divided by the support of the preceding item occurring alone; The output rules that meet the confidence threshold and have an elevation greater than 1 are ranked in descending order of confidence and are considered as suspicious risk sources. At the same time, the risk sources are cross-validated with the variables with the highest contribution rate of abnormal features. If they match, they are output as the final risk sources.
[0053] By calculating the anomaly contribution rate of features in each dimension online, key anomaly variables are located. Then, by combining association rule mining, the early warning information is cross-validated with raw material batches and production sections, which enables accurate attribution of anomaly features and rapid tracing of risk sources.
[0054] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0055] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0056] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the food detection methods based on industrial big data in the above embodiments.
[0057] It is understood that the systems, devices, and storage media provided in the embodiments of the present invention correspond to the methods provided in the embodiments of the present invention, and the explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.
[0058] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.
[0059] For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media.
[0060] The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state disks (SSDs)).
[0061] It should be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0062] Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0063] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0064] The embodiments of the present invention are given for the purposes of illustration and description. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A food testing method based on industrial big data, characterized in that, Perform the following steps using a computer device: S1, through sensors and enterprise information systems deployed on the production line, collects and stores multi-source industrial big data in real time, including environmental parameters, equipment operating status, raw material information, and semi-finished and finished product testing indicators; S2 preprocesses the collected multi-source industrial big data, including missing value imputation, outlier removal, time alignment, and feature extraction, to form a structured detection dataset; S3 uses historical normal batch datasets to train a deep autoencoder model and determine the dynamic reconstruction error threshold of food quality features; during online detection, the real-time data stream is input into the deep autoencoder model to calculate the reconstruction error. If the error exceeds the threshold, an early warning is triggered and the feature variable with the highest contribution rate is located. S4 utilizes the feature variables with the highest contribution rate located in S3, combined with association rule mining, to associate the early warning information with raw material batches and production sections, and output suspicious risk sources.
2. The food testing method based on industrial big data as described in claim 1, characterized in that: In S1, the sensors include a temperature sensor, a humidity sensor, a pH meter, a near-infrared spectrometer, and a machine vision device; the enterprise information system includes a raw material traceability system, a production execution system, and a laboratory information management system; the data acquisition frequency can be dynamically adjusted according to the production line speed; the acquired data is transmitted to the distributed storage system in real time through a message queue, using a timestamp as the primary key.
3. The food testing method based on industrial big data as described in claim 1, characterized in that: In S2, missing value imputation is performed using linear interpolation or time series prediction based on historical data; outlier removal is based on the 3σ criterion or local outlier factor; time alignment is performed using nearest neighbor matching based on timestamps; feature extraction includes calculating the mean, standard deviation, slope, and spectral energy within a sliding window, with the window length set according to the detection response time requirements.
4. The food testing method based on industrial big data as described in claim 1, characterized in that: The specific steps of S3 are as follows: S31: The structured data output by S2 is associated with the entire production batch chain, and the full-cycle working condition features are synchronously bound to each quality sample to form paired datasets, which are then divided into training set and validation set in an 8:2 ratio. S32: Construct a dual-branch deep autoencoder. The quality branch learns high-dimensional latent features of quality through a fully connected network, while the working condition branch maps working condition parameters into low-dimensional dense latent vectors through an embedding layer. The outputs of the two branches are concatenated and input into the decoder to reconstruct the original quality features. Distributed training is performed with the goal of minimizing the mean square error of reconstruction. S33: Use the trained model to infer validation set samples and establish a mapping library between the latent vector of working conditions and the corresponding kernel density distribution of reconstruction error; during online detection, extract the latent vector of working conditions and the latent vector of quality of real-time samples and calculate the overall reconstruction error; then match the most similar working condition interval and generate a dynamic anomaly detection threshold specific to the sample in real time by combining the preset confidence level; finally, compare the reconstruction error with the dynamic threshold, and if it exceeds the threshold, trigger an alarm and calculate the anomaly contribution rate of each dimension feature to locate the feature variable with the highest contribution rate.
5. The food testing method based on industrial big data as described in claim 4, characterized in that: The extraction of the latent vector of the real-time sample and the calculation of the overall reconstruction error in S33 are specifically as follows: Real-time new samples output by S2 Extract its quality latent vector and operating condition latent vector: in, This is the latent quality vector for new samples in real time. This represents the quality feature vector of the new sample in real time. For quality feature encoders, These are the optimal quality encoder parameters obtained through offline training. in, This is the latent vector of the working conditions for new samples in real time. This is the feature vector of the working conditions for new samples in real time. For the working condition feature embedding layer, These are the optimal embedding layer parameters obtained through offline training. Real-time overall reconstruction error calculation in, Let be the overall reconstruction error of the new sample in real time, and D be the joint feature decoder. This is the result of vertically concatenating the latent vectors of quality and operating conditions. These are the optimal decoder parameters obtained through offline training. for The square of the norm is the square of the Euclidean distance.
6. The food testing method based on industrial big data as described in claim 5, characterized in that: The similar working condition matching and dynamic threshold generation in S33 are specifically as follows: Calculate the cosine similarity between the current working condition latent vector and the latent vectors of all working conditions in the offline mapping library: in, is the cosine similarity function, with a value range of [-1, 1]. The closer the value is to 1, the more similar the two working conditions are. Let be the latent vector of the i-th sample in the offline mapping library M, where M is the latent vector of the working condition error mapping library, storing the correspondence between the latent vectors of the working conditions of all validation set samples and the overall reconstruction error. This represents the overall reconstruction error of the corresponding sample. Select the K most similar samples to obtain the corresponding reconstruction error set: in, Let K be the set of reconstruction errors for the K most similar samples, where K is the preset number of similar samples. Perform Gaussian kernel density estimation and calculate the Silverman optimal bandwidth: Where h is the Silverman optimal bandwidth of the Gaussian kernel density estimation, which controls the smoothness of the kernel function; For the error set Standard deviation: Where f(e) is the Gaussian kernel density estimation function of the reconstruction error, which is used to fit the error distribution of normal samples under similar working conditions; For the error set The j-th error value in It is a natural exponential function; calculate( Quantiles serve as the specific dynamic threshold for this sample: in, This is a dedicated dynamic threshold for new samples in real time; inf represents the infimum, which is the minimum error value that satisfies the condition. The integral of the kernel density estimation function from negative infinity to e represents the probability that the error is less than or equal to e; For the level of significant quality control, , where is the confidence level.
7. The food testing method based on industrial big data as described in claim 6, characterized in that: The anomaly detection and feature contribution rate localization in S33 are specifically as follows: Anomaly detection: When the overall reconstruction error of a new real-time sample exceeds its specific dynamic threshold, it is judged as an abnormal quality; otherwise, it is judged as normal. If it is judged as abnormal, the abnormal contribution rate of each feature dimension is calculated: in, The anomaly contribution rate of the j-th dimension quality feature reflects the degree of influence of this dimension on the overall anomalies; This represents the original value of the j-th dimension feature of the new sample in real time. d represents the reconstructed value of the j-th feature, d represents the total dimension of the quality features, sorted by contribution rate from largest to smallest, and outputs the top N key abnormal feature variables, where N is the preset number of output features.
8. The food testing method based on industrial big data as described in claim 1, characterized in that: The specific steps of S4 include: Construct a transaction database, where each transaction corresponds to one early warning event, containing the following itemsets: early warning ID, timestamp, abnormal feature set, contribution rate ranking, raw material batch number, production section ID, and equipment parameter abnormality flag. Use the FP-growth algorithm to mine frequent itemsets and generate strong association rules. For the current warning, extract the production records within its time window; calculate the credibility of each candidate risk source, where credibility is equal to the support of the preceding and following items occurring simultaneously divided by the support of the preceding item occurring alone; The output rules that meet the confidence threshold and have an elevation greater than 1 are ranked in descending order of confidence and are considered as suspicious risk sources. At the same time, the risk sources are cross-validated with the variables with the highest contribution rate of abnormal features. If they match, they are output as the final risk sources.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 8.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 8.