Cheese raw milk weighing and quality grade correlation judgment method based on machine learning

By combining machine learning and blockchain technology with multi-dimensional data, dynamic quality assessment and closed-loop management of raw milk for cheese have been achieved, solving the problem of static lag in traditional methods and improving the accuracy and traceability of quality assessment.

CN121563304APending Publication Date: 2026-02-24DR CHEESE (ANHUI) FOOD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511728360.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

In current cheese production, the methods for judging the quality of raw milk are static and outdated, unable to predict potential risks in dynamic processes, have weak data traceability, and lack a closed-loop feedback mechanism, resulting in insufficient precision and foresight in quality control.

Method used

By employing a machine learning-based approach, an attention-driven feature engineering model is constructed by acquiring multi-dimensional data (weighing baseline data, routine quality inspection data, cold chain dynamic data, and dairy source visual data) to achieve real-time quality prediction and closed-loop control. Blockchain technology is also introduced for end-to-end traceability.

Benefits of technology

A deep correlation was established between the weighing process and the final quality grade, enabling early warning of potential quality risks and multi-entity collaborative intervention, enhancing the fidelity and credibility of end-to-end traceability, and ensuring the self-optimization and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121563304A_ABST
    Figure CN121563304A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of quality evaluation and judgment, and particularly discloses a cheese raw milk weighing and quality grade correlation judgment method based on machine learning, and the method comprises the following steps: obtaining multi-dimensional data of cheese raw milk to be judged, the multi-dimensional data at least comprises weighing basic data, conventional quality detection data, cold chain dynamic data and milk source visual data. According to the method, weighing basic data, dynamic cold chain data, conventional detection data and milk source visual data are deeply fused, so that a conventional isolated and static quality detection link is successfully converted into a dynamic learnable closed-loop intelligent management and control system; according to the scheme, a deep correlation model between the weighing process and the final quality grade is established, more importantly, early warning and multi-subject collaborative intervention of potential quality risks can be achieved based on real-time data in the cold chain process, and passive quality inspection is changed into active risk prevention and control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quality assessment and determination technology, specifically to a machine learning-based method for determining the correlation between the weighing of raw milk for cheese and its quality grade. Background Technology

[0002] In cheese production, the quality of raw milk is the fundamental factor determining the flavor, texture, and yield of the final product. Traditional raw milk quality control processes rely primarily on two independent stages: weighing upon milk collection and laboratory sampling and testing before warehousing. The weighing stage focuses on basic information such as the quantity, origin, and supplier of the raw milk to facilitate trade settlement; while laboratory testing assesses the hygiene and composition of the raw milk by analyzing physicochemical indicators such as fat, protein, and total bacterial count. While this model ensures basic production requirements to a certain extent, it has significant limitations in terms of refined and intelligent management.

[0003] However, existing technologies have failed to effectively establish a deep correlation between basic data from the weighing process and the final quality grade of raw milk. First, traditional quality assessment methods are static, lagging endpoint tests, unable to predict or proactively intervene in potential quality risks during dynamic processes such as transportation and storage. Second, data traceability is weak; the link between traditional identifiers like batch numbers and physical samples is not robust, posing a risk of information mismatch or tampering. More importantly, existing quality management systems generally lack a closed-loop feedback mechanism capable of self-learning and iteratively optimizing from historical data. This leads to rigid risk assessment models that cannot adapt to complex changes in the real-world environment, significantly reducing the accuracy and foresight of quality control. Summary of the Invention

[0004] This invention aims to at least partially address one of the technical problems in related technologies. Therefore, the objective of this invention is to propose a machine learning-based method for determining the correlation between the weighing and quality grade of raw milk for cheese production, thereby improving the accuracy of cheese quality assessment.

[0005] To achieve the above objectives, a first aspect of the present invention proposes a method for determining the correlation between the weighing and quality grade of raw milk for cheese production based on machine learning, comprising the following steps:

[0006] S1. Obtain multi-dimensional data of the raw milk for cheese to be judged, wherein the multi-dimensional data includes at least weighing basic data, routine quality inspection data, cold chain dynamic data, and visual data of the milk source;

[0007] S2. Preprocess the multi-dimensional data to generate feature data to be used;

[0008] S3. Based on the feature data to be used, construct attention-driven feature engineering to generate model input features including at least weighing correlation features, dynamic quality comprehensive index and spatiotemporal fusion features.

[0009] S4. Input the model input features into a preset machine learning ensemble model for training to obtain a target quality prediction model;

[0010] S5. Based on the target quality prediction model, determine the quality grade of the raw milk for cheese to be judged, and execute a closed-loop control and traceability process, which includes:

[0011] Based on the cold chain dynamic data, a real-time milk risk value R is calculated. When R is not less than a first preset risk threshold, multi-entity collaborative regulation is triggered.

[0012] Based on the aforementioned milk source visual data, a milk source visual feature code VC is generated, and the VC is bound to the process data through an association key K for end-to-end traceability.

[0013] S6. Collect the control effect data of the multi-entity collaborative regulation and the traceability result data of the full-link traceability, and perform feedback optimization on the target quality prediction model.

[0014] To achieve the above objectives, a second aspect of the present invention proposes a machine learning-based system for determining the correlation between the weighing and quality grade of raw milk for cheese production, comprising:

[0015] The data acquisition module is configured to comprehensively acquire multi-dimensional data related to the batch of raw milk for cheese to be judged, wherein the multi-dimensional data includes at least:

[0016] The data preprocessing module is configured to perform deep preprocessing on the multi-dimensional data. The preprocessing includes at least: processing missing values ​​using the median imputation method of the same supplier's nearly N batches or the historical data similarity matrix method; and performing image enhancement operations on the breast source visual data, such as green channel extraction, contrast-limited adaptive histogram equalization, and gamma correction.

[0017] The feature engineering module is configured to construct deep derived features based on the preprocessed data through an attention-driven mechanism. The deep derived features include at least: weighing correlation features reflecting the stability of the supply weight, dynamic quality comprehensive index generated by the parallel information focusing module, and spatiotemporal fusion features generated by the Transformer encoder model.

[0018] The quality assessment module is configured to use a machine learning ensemble model trained on historical data to determine the predicted quality level of the batch of raw milk to be assessed based on the deep derived features.

[0019] The closed-loop control and optimization module further includes:

[0020] Risk assessment and coordinated control submodule: configured to calculate milk risk value in real time based on the cold chain dynamic data;

[0021] The authenticity traceability submodule is configured to continuously collect a set of time-series breast cancer visual data within a stable period, calculate its time stability coefficient by analyzing the variance of each visual feature value in the time-series data, and perform weighted fusion of the visual feature values ​​based on the TSC to generate a robust breast cancer visual feature code that can resist the interference of instantaneous physical state.

[0022] Attribution optimization submodule: configured to calculate the adjustment difference value between the final actual quality result of the batch of raw milk and the predicted quality level after obtaining the final actual quality result.

[0023] To achieve the above objectives, a third aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the above-described method for determining the correlation between the weighing and quality grade of raw cheese milk based on machine learning.

[0024] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0025] The machine learning-based method for determining the correlation between weighing and quality grade of raw milk for cheese, as described in this invention, successfully transforms the traditionally isolated and static quality inspection process into a dynamic and learnable closed-loop intelligent management and control system by deeply integrating basic weighing data, dynamic cold chain data, routine testing data, and visual data of the milk source. This solution not only establishes a deep correlation model between the weighing process and the final quality grade, but more importantly, it can achieve early warning of potential quality risks and multi-subject collaborative intervention based on real-time data in the cold chain process, transforming passive quality inspection into proactive risk prevention and control.

[0026] By introducing stable visual feature codes based on time-series analysis and combining them with blockchain technology, a highly reliable and tamper-proof digital twin is created for each batch of raw milk, fundamentally enhancing the fidelity and credibility of end-to-end traceability. Crucially, the adaptive feedback optimization mechanism designed in this invention, from contribution analysis to proportional attribution and ultimately independent updates, enables the risk model to accurately attribute and self-evolve from each control event, ensuring that model parameters continuously converge towards optimization. This maintains the accuracy, robustness, and efficiency of quality judgment and control strategies in complex and ever-changing real-world production environments. Attached Figure Description

[0027] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. In the drawings, the same reference numerals are used to refer to the same parts. Wherein:

[0028] Figure 1 This is a flowchart illustrating the machine learning-based method for determining the correlation between weighing and quality grade of raw milk for cheese, provided by the present invention.

[0029] Figure 2 This is a schematic diagram comparing the preprocessing effects of visual data of milk source in the machine learning-based method for determining the correlation between milk weighing and quality grade of cheese raw materials provided by this invention.

[0030] Figure 3 This is a schematic diagram of the three-dimensional response surface of the risk value in the machine learning-based method for determining the correlation between weighing and quality grade of raw milk for cheese provided by the present invention.

[0031] Figure 4 This is a schematic diagram of the dynamic evolution of visual features based on time-series image analysis in the machine learning-based method for determining the correlation between weighing and quality grade of raw milk for cheese provided by the present invention.

[0032] Figure 5 This is a schematic diagram comparing the effects of risk weight adjustment under different feedback optimization strategies in the machine learning-based method for determining the correlation between weighing and quality grade of raw milk for cheese provided by this invention.

[0033] Figure 6 This is a schematic diagram of the structure of the machine learning-based cheese raw milk weighing and quality grade correlation determination system provided by the present invention;

[0034] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0035] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0036] The following describes, with reference to the accompanying drawings, a machine learning-based method, system, and electronic device for determining the correlation between weighing and quality grade of raw milk for cheese production according to embodiments of the present invention.

[0037] Example 1:

[0038] Figure 1This is a flowchart illustrating a machine learning-based method for determining the correlation between raw milk weighing and quality grade in cheese production, according to an embodiment of the present invention. This method aims to construct a complete technical system encompassing data acquisition, intelligent prediction, closed-loop traceability, and optimization to overcome problems such as static detection, data silos, and lack of feedback in traditional raw milk quality control. The execution entity in this embodiment is typically a server system deployed in the cheese processing plant's data center, which interacts with various front-end devices via the Industrial Internet of Things (IIoT).

[0039] The complete process of this embodiment revolves around a core machine learning ensemble model, specifically comprising six interrelated core steps, namely steps S1 to S6. These six steps will be described in detail below:

[0040] Step S1: Comprehensive acquisition of multi-dimensional data.

[0041] The core task of this step is to comprehensively and accurately collect multi-dimensional, heterogeneous data streams related to the batch of raw milk for cheese to be judged. These data collectively form the basis for a comprehensive, multi-perspective profile of this batch of raw milk. In this embodiment, the multi-dimensional data is strictly defined as a data set including at least four key categories: basic weighing data, routine quality inspection data, cold chain dynamic data, and visual data of the milk source.

[0042] First, regarding the acquisition of basic weighing data: The data collection process is triggered when the milk tanker transporting raw milk arrives at the factory's receiving platform and stops on the electronic weighbridge. The weighbridge system automatically reads and records the gross weight of the batch of raw milk, and weighs the tare weight again after unloading. The difference between the two yields the precise weight of each batch, defined as W. Simultaneously, RFID readers or barcode scanners deployed at the receiving port automatically scan the electronic tags attached to the milk tanker or the barcodes on the documents provided by the supplier, resolving the source information of the batch of raw milk. This includes at least the milk source identifier, defined as S, and the supplier identifier, defined as V.

[0043] The above data is linked to the unique batch number of the raw milk in the factory through the factory's Manufacturing Execution System (MES) to form a structured weighing data record, which is then stored in the central database in real time.

[0044] Secondly, regarding the acquisition of routine quality testing data: During the unloading of raw milk, an automatic sampling device collects representative samples according to a preset procedure and sends them to the factory's quality control laboratory. In the laboratory, testing personnel use professional analytical instruments to analyze the samples.

[0045] For example, the fat content of a sample is determined using a milk composition analyzer and defined as F, and the protein content is defined as P; the total bacterial count is determined using colony counting or rapid microbial detection equipment and defined as B. These test results are then entered into the Laboratory Information Management System (LIMS) and linked to the previously generated batch number via a system interface, ensuring a precise correspondence between chemical indicators and physical batches.

[0046] Secondly, regarding the acquisition of dynamic data for the cold chain. To achieve dynamic monitoring of the transportation process, integrated IoT sensor terminals are pre-installed on all milk tankers transporting raw milk. These terminals incorporate high-precision temperature sensors and triaxial accelerometers. The temperature sensor monitors the temperature of the raw milk inside the tank in real time, with the data stream defined as T. The accelerometer monitors the bumps and vibrations of the vehicle during operation; the system pays particular attention to and records vibration peaks, with the data stream defined as... These dynamic data are uploaded to the cloud data platform in real time via the vehicle's wireless communication module, such as a 4G or 5G network, at a preset time frequency, such as once every five minutes. They are also bound to the raw milk batch number corresponding to the transportation task, thus forming a complete, timestamped cold chain dynamic data chain.

[0047] Finally, regarding the acquisition of visual data from the milk source. This is a key data source in this invention, designed to capture the physical appearance characteristics of raw milk.

[0048] To achieve this, two key visual inspection points were installed on the raw milk delivery pipeline. The first point is located after the initial filtration of the raw milk and before it enters the plate heat exchanger;

[0049] The second node is located before the raw milk is cooled and enters the temporary storage tank. Each node is equipped with an industrial-grade high-resolution camera and a shadowless ring light source to ensure image quality.

[0050] When the flow sensor inside the pipeline detects the flow of raw milk, it triggers the camera to capture a high-definition image. These two sets of image data together constitute the source visual data for this batch of raw milk, which can visually reflect the color, uniformity, and presence of small lumps or impurities. This image data is also associated with the batch number and stored in a dedicated image server.

[0051] Step S2: Deep preprocessing of multi-dimensional data.

[0052] Because the raw, multi-dimensional data collected comes from a wide range of sources, has diverse formats, and may be subject to various interferences during collection and transmission, it cannot be directly used for training machine learning models. The core task of this step is to perform a series of cleaning, transformation, and enhancement operations on this raw data to generate usable feature data with a uniform format and reliable quality.

[0053] The primary task of data preprocessing is handling missing values. In actual operation, momentary sensor malfunctions or network fluctuations can lead to the loss of some data points, especially dynamic data in the cold chain. This embodiment employs an advanced phased imputation strategy. In the initial stage of system operation, due to the lack of sufficient historical data accumulation, if data loss occurs, the system will use a relatively conservative imputation method based on the median of the past N batches from the same supplier. Specifically:

[0054] The system queries the supplier's most recent N batches, for example, the most recent 20 batches, for the non-missing values ​​on the same data item, and then uses the median of these values ​​to fill in the current missing value. This method can effectively avoid the interference of extreme values ​​on the imputation results.

[0055] Once the system has been running stably for a period of time and has accumulated a large amount of data, it will enter the second stage. At this point, the system will construct a multi-dimensional historical data similarity matrix based on the historical data of all suppliers. This matrix can measure the similarity of different batches of data in terms of overall pattern. When missing values ​​are encountered again, the system will use this matrix to find the K most similar historical complete data points to the current data, and perform a weighted average based on similarity, thereby achieving more accurate and intelligent data imputation.

[0056] The second key task in data preprocessing is image enhancement for visual data of raw milk. Original images may fail to fully highlight subtle features of the raw milk due to uneven lighting, non-linear camera response curves, and other issues. Therefore, this embodiment employs an image enhancement workflow comprising three sub-steps:

[0057] The first sub-step is green channel extraction. Research shows that in the RGB color space, the green channel is most sensitive to reflecting minute impurities and color changes in milky white liquids, and has the highest signal-to-noise ratio. Therefore, when the system first converts the original color image to grayscale, it does not use the traditional weighted average method, but directly extracts the pixel value matrix of its green channel as the basis for subsequent processing.

[0058] The second sub-step involves applying contrast-limited adaptive histogram equalization, a technique known as CLAHE. Unlike global histogram equalization, the CLAHE algorithm divides the image into several small regions and performs histogram equalization independently on each region. This method can significantly enhance the local contrast of the image, making subtle lumps, fat globules, or whey separation in the raw milk more clearly visible, while effectively avoiding excessive amplification of noise through contrast limitation.

[0059] The third sub-step is gamma correction. This step aims to correct the non-linear brightness distortion caused by the image sensor and display device. By performing a power-law transformation on the pixel values ​​of the image, the brightness response of the processed image is made more consistent with the perceptual characteristics of the human eye, laying the foundation for subsequent accurate feature extraction.

[0060] like Figure 2 The presentation shows a comparison of the effects of preprocessing visual data from milk sources. Six sub-images systematically demonstrate the technical effectiveness of the preprocessing workflow. Figure (a) shows the original visual image of the milk source, simulating a raw milk image collected in an actual industrial environment. The image size is 300*300 pixels. Dark areas in the milky white background, such as the area near coordinates [180, 80], represent whey separation. Bright circular areas, such as the circle at coordinates [75, 75], simulate bubble interference generated during transportation. Scattered bright spots correspond to impurity particle characteristics. These three types of features are the key visual indicators emphasized in step S2 above. Figure (b) shows the green channel extraction results, verifying the technical claim that the green channel is most sensitive to reflecting minute impurities and color changes in milky white liquids. The figure shows that the impurity contrast increased from the original value of 42 to 58, and the signal-to-noise ratio improved by approximately 35%.

[0061] Figure (c) shows the CLAHE-enhanced image, visually demonstrating the effect of contrast-limited adaptive histogram equalization through four key feature regions marked with red borders: a 2.3-fold increase in local contrast, corresponding to the technical effect mentioned above that makes the fine lumps, fat globules, or whey separation that may exist in the raw milk more clearly visible. The four marked regions correspond to: region 1 (whey separation) contrast increased from 0.32 to 0.76, region 2 (impurity aggregation) signal-to-noise ratio increased from 18.2 to 25.4, region 3 (bubble interference) feature stability increased from 0.45 to 0.82, and region 4 (density unevenness) discernibility increased from 0.38 to 0.79. These specific numerical values ​​quantitatively verify the enhancement effect of CLAHE processing on various visual features. Figure (d) shows the result after a power-law transformation with γ=0.6, which corrects the nonlinear brightness distortion caused by the image sensor and display device, laying the foundation for subsequent accurate feature extraction.

[0062] Figure (e) further enhances the credibility of the technical effect: the feature extraction effect comparison in Figure (e) shows that after preprocessing, the uniformity of turbidity improved from 0.65 to 0.89, the impurity contrast improved from 0.42 to 0.78, and the whey separation recognition rate improved significantly from 0.38 to 0.82. The significant improvement of these three key indicators directly proves the effectiveness of the preprocessing process in supporting subsequent feature engineering. The image quality index comparison in Figure (f) systematically verifies the comprehensive performance advantages of the preprocessing method through the comprehensive improvement of four dimensions: global contrast (0.45→0.82), local variance (28.3→65.7), signal-to-noise ratio (15.2→22.8), and feature discriminability (0.48→0.85).

[0063] Step S3: Attention-driven innovation feature engineering.

[0064] Feature engineering is a crucial step in determining the performance ceiling of machine learning models. Compared to simply inputting preprocessed data directly into the model, this step aims to extract more informative and discriminative deep-derived features from the data by constructing an attention-driven feature engineering mechanism. These features are designed to include at least weighing correlation features, dynamic quality comprehensive indicators, and spatiotemporal fusion features.

[0065] First, we construct weighing correlation features. This embodiment argues that the stability of the supply weight from the same milk source or supplier is itself a potential quality signal. A well-managed milk source with stable production should have relatively small fluctuations in the supply weight of each batch.

[0066] Therefore, the system will calculate the standard deviation of the weight W of all batches over a period of time, such as the past three months, for each milk source identifier S from the basic weighing data, and record it as . This standard deviation This is thus used as an important feature related to the weighing process and is input into the model. A persistently high... The value may be learned by the model as a signal associated with certain quality hazards.

[0067] Secondly, a dynamic comprehensive quality index is generated, denoted as... Traditional indicators such as fat, protein, and total bacterial count are isolated and cannot reflect the interactions and dynamic importance between them. This embodiment introduces a neural network component called Parallel Information Focusing Module (PFAM). This module can dynamically assign attention weights to different quality inspection indicators, just like a human expert.

[0068] For example, when making certain cheeses that require extremely high protein thermal stability, the PFAM module learns and automatically increases the weight of protein content (P) and its related derivative indicators; while when making high-fat cream cheese, it pays more attention to fat content (F). By processing channel attention and spatial attention in parallel, it can capture complex patterns under different combinations of indicators, ultimately outputting a single, highly condensed, dynamic comprehensive quality indicator. This indicator is more predictive than any single raw indicator.

[0069] Secondly, spatiotemporal fusion features are extracted. Cold chain dynamic data is essentially a type of time series data, and its value lies not only in the numerical value at a single point in time, but also in its pattern of change over time. This embodiment innovatively employs the advanced Transformer encoder model from the field of natural language processing to process this type of data. Compared with traditional time series models such as recurrent neural networks, the Transformer's self-attention mechanism can capture the long-term dependencies between any two points in the time series.

[0070] For example, the Transformer's self-attention mechanism can learn a complex pattern where the temperature rises steadily over two hours and then suddenly experiences a violent fluctuation. This pattern has a far greater impact on the final milk quality than continuous slight vibrations. Through the Transformer encoder, the raw cold chain dynamic data is transformed into a fixed-length vector. This vector is a spatiotemporal fusion feature containing rich temporal information, which profoundly characterizes the cumulative impact on the quality of raw milk during transportation.

[0071] Step S4: Training the machine learning ensemble model.

[0072] The core task of this step is to use historical data to train a target quality prediction model that can accurately predict the quality grade of raw milk. To ensure the stability and generalization ability of the model, this embodiment uses a machine learning ensemble model.

[0073] The idea behind ensemble models is to combine multiple weak learners of different types or with different parameters to form a powerful strong learner. In this embodiment, the ensemble model can be composed of a gradient boosting decision tree (XGBoost), a lightweight gradient boosting machine (LightGBM), and a small multilayer perceptron (MLP) neural network model. These models are chosen because they are each adept at handling different types of data and relationships: decision tree models are good at handling tabular data and discovering non-linear relationships, while neural networks are good at capturing deeper, abstract features in the data.

[0074] The training process is as follows: First, a large amount of historical data accumulated in the factory is collected. Each data point contains the model input features, weighing correlation features, dynamic quality comprehensive indicators, spatiotemporal fusion features, etc. generated in the previous steps, as well as the actual quality grade of the batch of raw milk after manual evaluation, such as excellent, first grade, qualified, unqualified, etc.

[0075] Then, these labeled datasets are divided into training, validation, and test sets. The training set is used to independently train base learners such as XGBoost, LightGBM, and MLP. After training, a stacking ensemble strategy is employed, using the predictions from these base learners as new features. A simple logistic regression or linear regression model is then trained as a meta-learner, which performs the final weighted combination of the base learner results to output the final quality level prediction.

[0076] The target quality prediction model built in this way usually has significantly better prediction accuracy and robustness than any single model.

[0077] Step S5: Execution of quality level determination and closed-loop control traceability.

[0078] Once data for a new batch of raw milk to be judged is collected and processed, this step will use the target quality prediction model trained in the previous step to determine the quality level in real time and initiate the subsequent closed-loop control and traceability process.

[0079] First, a quality grade is determined. The model input features generated in step S3 are input into the target quality prediction model. The model outputs a predicted quality grade, such as Grade 1, and may include a confidence score. This prediction result is immediately sent to the quality management and production planning departments, providing crucial data support for their decisions on whether to accept the batch of raw milk and how to schedule production.

[0080] Next, the closed-loop control and traceability process is executed in parallel. This process includes two key sub-processes.

[0081] The first sub-process is proactive control based on real-time milk quality risk values. The system continuously analyzes the cold chain dynamic data of the batch of raw milk during transit or temporary storage at the factory, and calculates its milk quality risk value, defined as R, in real time according to a preset risk assessment formula. In this embodiment, the formula is explicitly defined as:

[0082] in: This is the variance of temperature fluctuation within a preset time period, such as the variance of cold chain temperature T fluctuation over the past hour. The larger this value, the more unstable the temperature control. The peak value of transportation vibration within a preset time period reflects the most severe turbulence that may be encountered during transportation. This is the ratio of the duration of the temperature anomaly to the preset standard duration. For example, if the standard requires the temperature anomaly to be repaired within 15 minutes, but it actually lasted for 30 minutes, then this value is 2. Temperature weighting, For vibration weights, As the duration weight, these three variables are calculated in real time from the original dynamic data. They are hyperparameters of the model, representing the importance of different risk factors. Their initial values ​​are set by experts and will be dynamically adjusted in subsequent optimization steps. , , These are preset formula weighting coefficients used to balance the dimensions of different risk components.

[0083] The system will preset a first risk threshold, such as 60 points. Once the calculated real-time milk quality risk value R is not less than this threshold, the system will determine that the batch of raw milk is at risk of quality deterioration and automatically trigger a multi-stakeholder collaborative control mechanism to send warnings and control instructions to relevant responsible persons, such as cold chain drivers or warehouse managers.

[0084] For example, here we simulate a real-world scenario and compare the risk value calculation results under two scenarios: normal transportation and abnormal transportation.

[0085] To make the calculations practically meaningful, the fixed parameters and judgment thresholds in the formula are first set in accordance with industry practices.

[0086] Model weights, determined by initial expert settings or model iterations, include:

[0087] Temperature weighting Since temperature is the most critical factor affecting microbial activity, it is given the highest weight.

[0088] Vibration weight Because violent vibrations can damage the structure of fat globules, their importance is secondary;

[0089] Duration weight The duration of the abnormal state is directly related to the cumulative damage, so it has a high weight.

[0090] Formula weighting coefficients: ; ; Here we assume that all variables have been normalized and have a coefficient of 1.

[0091] Risk assessment threshold: The first preset risk threshold is 60.0. When the risk value R exceeds 60, the system must trigger an early warning and control command.

[0092] 1. Scenario 1: Normal and ideal cold chain transportation.

[0093] A batch of raw milk was transported from farm A to factory B. The road conditions were good and the refrigeration system of the refrigerated truck was working stably.

[0094] Dynamic data collection over the past hour:

[0095] Temperature fluctuations: The temperature inside the tank remains stable at [temperature value missing]. Between. Calculate its temperature fluctuation variance. To obtain a very small value, for example ;

[0096] Transportation vibration: The vehicle travels on a flat highway, and the vibration is very slight. The maximum vibration peak recorded by the accelerometer is... It's also very low, for example (Unit: m / s²)

[0097] Duration of temperature anomalies: The temperature never exceeded [a certain value] throughout the entire transportation process. The temperature anomaly falls within the standard range, therefore the duration of the anomaly is 0 minutes. Its ratio to the standard duration is... .

[0098] Risk value R calculation: Substitute the above values ​​into the formula:

[0099]

[0100]

[0101]

[0102] Calculated risk value This value is far below our set risk threshold of 60.0. This indicates that the system accurately determined that the risk of this batch of raw milk during transportation was extremely low and the quality was stable. Therefore, the system will not trigger any alarms, and the production process will proceed normally. This confirms the solution's silent operation capability under normal circumstances, avoiding interference with production from invalid alarms and demonstrating its operational stability.

[0103] Scenario 2: Abnormal transportation due to sudden malfunctions

[0104] Another batch of raw milk experienced intermittent refrigeration compressor failures during transport, and the vehicle also chose a rural road with poor road conditions to avoid traffic congestion on the main road.

[0105] Dynamic data collection over the past hour:

[0106] Temperature fluctuations: Due to frequent compressor start-stop cycles, the temperature inside the tank fluctuates. arrive The temperature fluctuates drastically between these values. Calculate the variance of this temperature fluctuation. This results in a significantly increased value, for example... ;

[0107] Transportation vibration: Driving on bumpy roads resulted in continuous and intense vibrations in the vehicle. The maximum recorded vibration peak value... Significantly increased, for example (Unit: m / s²)

[0108] Duration of temperature anomaly: Within this hour, the temperature exceeded [a certain value] for a cumulative total of 20 minutes. The upper limit. Assuming the standard requires an anomaly repair time of 10 minutes, then the ratio of the anomaly duration to the standard duration is... .

[0109] Risk value R calculation: Substitute all the above abnormal data into the same formula:

[0110]

[0111]

[0112]

[0113] Calculated risk value Although this value is already very high and has attracted the system's attention, it has not yet reached the threshold of 60.0 that triggers mandatory regulation. This may be because although all indicators have deteriorated, they have not yet reached the critical point.

[0114] Let's push the scenario to a more extreme level: suppose the compressor completely shuts down for 10 minutes, causing the temperature to rise rapidly, while the vehicle goes over a severe speed bump.

[0115] at this time, It may surge to ; It may reach instantaneous m / s²; Keep as ;

[0116] At this point, the risk value R is recalculated:

[0117]

[0118]

[0119]

[0120] The final risk value calculated at this time This value significantly exceeds our set risk threshold of 60.0. At this point, the system will immediately and automatically trigger a multi-entity collaborative control process. The cold chain driver's onboard terminal will receive a serious warning: "Breast temperature continues to exceed the standard; please check the refrigeration system immediately."

[0121] Furthermore, the factory's dispatch center screen will display an alert, notifying the dispatcher that batch XXX-milk tanker YYY has a high risk of milk quality deterioration, and to contact the driver and prepare an emergency plan.

[0122] Given this risk level of 85.5, even if the driver subsequently repairs the malfunction, the factory will take different measures than usual when receiving this batch of raw milk. For example, the quality department will prioritize it for inspection, and the production department may decide not to use it for producing top-grade cheese, which has the highest requirements for raw milk quality, but instead downgrade its use or reject it outright. This avoids putting raw materials with significant quality risks into high-value production lines and directly mitigates potential economic losses.

[0123] Since such a high risk value will inevitably lead to a huge difference between the quality inspection results and the normal value, this will trigger the feedback optimization mechanism in step F, allowing the model to learn the strong correlation between such extreme cases and the final quality results, thereby making more accurate judgments in the future.

[0124] Through the clear comparison of the numerical examples above, it can be seen that the formula for calculating the milk quality risk value is not an abstract theoretical model, but a quantitative assessment tool that can be closely integrated with real industrial scenarios and is highly sensitive to changes in key risk factors. It can effectively distinguish between normal and abnormal states and, when the risk accumulates to a critical point, promptly and accurately trigger subsequent automated control processes. This fully demonstrates that the technical solution of this invention has strong feasibility, high implementation value, and enormous potential in refined production management.

[0125] The second sub-process is end-to-end traceability based on milk source visual feature codes. To create an unalterable digital identity for each batch of physical raw milk, the system performs in-depth processing on the milk source visual data collected in step S1. Specifically:

[0126] It can quantitatively extract milk turbidity features, whey separation features, and impurity particle features from preprocessed images using algorithms such as image segmentation and morphological analysis.

[0127] Then, the system converts these three core visual feature values ​​into a unique string according to preset encoding rules. This string is defined as the milk source visual feature code for this batch of raw milk, denoted as VC. To ensure the secure binding of this identification code with subsequent process data, the system will then perform a hash operation on VC, for example, using the SHA-256 algorithm, to generate a fixed-length hash value. This hash value is defined as the association key, denoted as K.

[0128] Finally, the system packages the VC itself, the associated key K, and all process data generated during the subsequent production of this batch of raw milk, such as the pasteurization temperature curve and the batch number of the added starter culture, into a structured data block. This data block is then written as a new transaction into the factory's pre-set private blockchain network. Due to the decentralized and immutable nature of blockchain technology, once the data block is on the chain, it ensures that every step of this batch of raw milk, from its source visual characteristics to the final product, can be accurately and reliably traced.

[0129] Step S6: Model self-optimization based on result feedback.

[0130] This step is crucial for achieving intelligent closed-loop and continuous evolution of the system. Its core idea is to enable the model to learn from past successes and failures and continuously improve its prediction and evaluation capabilities.

[0131] This step is triggered when a batch of raw milk reaches the end of its entire lifecycle, after which the final actual quality test data is generated, such as the final results obtained by more sophisticated instruments or human tasting evaluation. The system collects these final actual results and compares them with the predicted data given by the model before regulation; the difference between the two is quantified as a regulation difference value.

[0132] The system internally sets an optimization trigger threshold. The optimization process is only activated when the absolute value of the adjustment difference exceeds this threshold. This is done to avoid unnecessary and frequent adjustments to the model due to normal, random, and minor fluctuations, thus ensuring the stability of the optimization process.

[0133] Once the optimization process is activated, the system will adjust the weighting parameters in the risk calculation formula based on the sign of the control difference value. Specifically:

[0134] If the final actual quality is worse than the model's prediction, it indicates that the model's initial risk assessment was overly optimistic, and the adjustment difference value should be negative. In this case, the system will automatically and accordingly increase the temperature weight in the formula. Vibration weight and duration weight Conversely, if the actual quality is better than predicted, it indicates that the model is overly pessimistic, and the system will adjust these three weights accordingly. Through this simple, feedback-based iterative adjustment mechanism, the risk assessment model acquires preliminary adaptive learning capabilities, enabling it to continuously improve its risk assessments to better reflect reality over long-term operation.

[0135] In summary, this embodiment, through the organic combination of the above six steps, fully realizes a closed-loop intelligent management method covering the entire process, from multi-dimensional data perception, feature extraction, and accurate quality prediction to proactive risk control, reliable link traceability, and model self-optimization. It elevates the quality control level of cheese raw milk from the traditional manual, static, and lagging model to a new level of automatic, dynamic, and forward-looking management.

[0136] Example 2:

[0137] In pursuit of the highest level of precision management and intelligence in industrial production, this embodiment introduces three independent yet synergistic deep optimization modules for three key aspects of Embodiment 1: the effectiveness of risk control, the inherent stability of visual traceability, and the attribution accuracy of model optimization. The addition of these modules significantly enhances the overall system's intelligence, operational robustness, and commercial value.

[0138] The following will describe in detail the specific improvements and enhancements made to this preferred embodiment compared to Embodiment 1:

[0139] I. From single threshold early warning to multi-level priority closed-loop coordinated regulation.

[0140] Example 1 discloses that when the real-time milk quality risk value R is not less than a first preset risk threshold, the system triggers a multi-entity collaborative control mechanism. This solves the problem of determining the presence or absence of risk in practice, but lacks quantitative grading of risk severity, resulting in relatively singular control instructions and an inability to differentiate resource allocation and responsibility assignment based on the urgency of the situation. This preferred embodiment addresses this limitation by deeply optimizing the module and introducing a priority management system based on multi-level risk thresholds. Specifically:

[0141] In addition to the first preset risk threshold set in Embodiment 1, this embodiment further adds a second preset risk threshold, such as R=80.0, and a third preset risk threshold, such as R=120.0. These two newly added thresholds divide the risk space into three progressive response levels: general risk, higher risk, and severe risk, and pre-configure different collaborative control strategy matrices involving different responsible parties for each level.

[0142] 1. Triggering general risk control strategies when 60.0 ≤ R < 80.0

[0143] When the real-time milk quality risk value R calculated by the system first enters this range, it indicates that the quality of the raw milk has deviated from the ideal trajectory, but the situation is not yet urgent and belongs to a controllable early warning stage. At this time, the control strategy triggered by the system is intended to provide reminders and monitoring.

[0144] Responsible Party 1: Cold Chain Transport Driver. The driver's in-vehicle smart terminal or mobile app will receive a low-priority notification in the format: "Current risk value [R] for batch XXX raw milk: Slightly high. Please maintain a constant speed and monitor the refrigeration system's operating status." This instruction aims to increase the driver's alertness without causing excessive stress or interfering with their normal driving.

[0145] Entity Two: Factory Dispatch Center. On the dispatch center's monitoring screen, the icon for this batch of transport vehicles will change from the usual green to yellow, and the current risk value will be displayed in the information bar. The system will not issue an audible alarm, but the dispatcher on duty can clearly identify the target requiring attention through the visual change. The purpose of this strategy is to enable back-end management personnel to focus on monitoring potentially risky vehicles so that they can intervene immediately if the situation escalates.

[0146] 2. A higher-risk control strategy is triggered when 80.0 ≤ R < 120.0

[0147] When the risk value R rises further and enters this range, it indicates that one or more key risk factors have deteriorated significantly, the probability of quality degradation has increased substantially, and immediate human intervention is required. At this point, the system-triggered control strategy aims to intervene and confirm the situation.

[0148] Responsible Party 1: Cold Chain Transport Driver. The system will send a high-priority alert with audible and vibration prompts to the driver's terminal. The alert will be formatted as follows: "Current risk value [R] for batch XXX raw milk has reached a high level! Main risk source: [e.g., drastic temperature fluctuations]." Please check the vehicle's refrigeration equipment as soon as possible, ensuring it is safe to do so. If any abnormalities are found, please report them immediately. This instruction is clear and specific, requiring the driver to take action.

[0149] Entity Two: Factory Dispatch Center. The vehicle icon on the monitoring screen will turn orange and begin flashing. Simultaneously, the system will issue an audible alarm, requiring the dispatcher to manually confirm before it can be deactivated. At the same time, the system will automatically generate a report including the current risk level, analysis of key risk factors, and the driver's contact information. A pop-up window will then prompt the dispatcher to immediately contact driver XXX to verify the vehicle's status and provide remote support.

[0150] Third responsible party: Supplier's quality management department. The system will automatically send a quality risk warning letter to the quality management manager of the supplier for that batch of raw milk via enterprise collaborative office software or email, informing them that the batch they supplied faces a high quality risk, allowing them to be aware of the situation in advance.

[0151] 3. Triggering a severe risk control strategy when R ≥ 120.0

[0152] When the risk value R exceeds the third preset risk threshold, it usually indicates a serious equipment failure or extremely poor transportation conditions. The raw milk is highly likely to experience irreversible quality degradation, and the entire batch may even need to be scrapped. In this situation, the system-triggered dispatch order is intended for emergency response and decision support.

[0153] Responsible Party 1: Cold chain transport driver. The terminal will receive a highest-priority red alert, continuously emitting an alarm tone. The content format is: "Batch XXX raw milk current risk value [R] has reached a critical level! Quality may decline rapidly in a short period of time. Please immediately implement the emergency plan and contact the dispatch center for further instructions!"

[0154] Second responsible party: Factory dispatch center and production supervisor. The system will not only issue the highest-level alert to the dispatcher, but will also simultaneously push the alert information and a detailed "Risk Analysis and Handling Recommendation Report" to the production department supervisor. Based on historical data analysis, this report will provide specific decision-making options such as recommending rejection, recommending downgrading for use in XX product category, immediately coordinating nearby transfer or disposal.

[0155] Third responsible party: the supplier's quality management and business department. The system will automatically generate a formal "Potential Quality Incident Notification" and send it to multiple relevant departments of the supplier, providing timely and objective data records for possible subsequent business claims or quality issue arbitration.

[0156] like Figure 3 The three-dimensional response surface of the risk value intuitively presents the variance of the risk value R as a function of temperature. and peak transport vibration The changing nonlinear response relationship, with the surface color gradually changing from blue (low risk) to red (high risk), perfectly reflects the technical characteristic that the real-time milk risk value R calculation formula can be highly sensitive to changes in key risk factors.

[0157] Figure 3The three semi-transparent planes correspond to the multi-level risk thresholds set above: the yellow plane (R=60) represents the first preset risk threshold, triggering general risk control; the orange plane (R=80) corresponds to the second preset risk threshold, initiating higher-risk intervention; and the red plane (R=120) marks the severe risk threshold, triggering emergency response. The setting of these three threshold planes verifies the technological innovation of closed-loop coordinated control from single-threshold early warning to multi-level priority control.

[0158] Three example points clearly marked on the surface: green dots ( r=0.04, =1.2, R=3.2) represents a normal transportation scenario, and its extremely low risk value verifies the system's ability to accurately assess the extremely low risk of this batch of raw milk during transportation; yellow dots ( r=4.5, =8.0, R=50.5) corresponds to an abnormal transportation scenario, demonstrating the coupled impact of temperature fluctuations and increased vibration on the risk value; the red dot ( =8.0, =15.0, R=85.5) marks extreme transportation scenarios, and their positional relationship, which significantly exceeds the severity threshold, proves the accurate early warning capability of the risk model under critical conditions.

[0159] The nonlinear gradient change of the surface clearly demonstrates the risk accumulation effect: when the temperature fluctuation variance exceeds 5.0 and the vibration peak exceeds 10.0 m / s², the risk surface rapidly rises, entering a high-risk region. This is entirely consistent with the technical argument above that the complex pattern of a sudden, violent vibration after a steady temperature rise over 2 hours has a far greater impact on the final milk quality than continuous slight vibration. The steep region of the surface is concentrated in the lower right corner, indicating that the risk increases sharply when high temperature fluctuations and high vibrations occur simultaneously, providing a precise mathematical basis for a multi-agent collaborative control mechanism.

[0160] Figure 3 This powerfully demonstrates the scientific validity and practicality of the risk warning model: it can not only accurately quantify the impact of a single risk factor, but also precisely capture the coupling effect of multiple factors, providing a reliable decision support tool for quality risk management of cheese raw milk in complex cold chain environments. Furthermore, through a sophisticated multi-level closed-loop collaborative control mechanism with three progressive response levels, this embodiment transforms risk management from a simple binary judgment question—risk or no risk—into a sophisticated and intelligent emergency command system, offering greater feasibility and guidance value for actual production.

[0161] II. From Instantaneous Visual Snapshots to Temporally Stable Visual Fingerprints

[0162] Example 1 discloses a technique for generating a visual feature code (VC) for milk source by extracting visual features from raw milk and then uploading it to the blockchain for traceability. The innovation of this method lies in assigning a visual identifier to a physical fluid. However, it relies on a single frame or a few frames of instantaneous snapshots. In real industrial environments, the instantaneous physical state of raw milk, such as bubbles generated during flow, surface foam, and stratification during settling, poses a significant challenge to the stability and reproducibility of image features. Even a single accidental bubble can lead to a significant difference in the VC code, thereby undermining the credibility of the entire traceability system. This example is designed to overcome this core technical challenge.

[0163] This embodiment introduces a stable visual feature code generation method based on time-series image sequence analysis. The core idea is that within a short time window, true, intrinsic visual features are stable, while visual artifacts caused by physical perturbations are transient. By identifying and amplifying this stability difference through algorithms, a visual fingerprint that truly represents the genetic makeup of that batch of raw milk can be extracted. The specific implementation process is as follows:

[0164] 1. High-frequency acquisition of time-series image data

[0165] When the raw milk for cheese to be identified flows through the visual detection node, the system no longer triggers a single shot, but instead takes a preset, stable period. Within a given 15-second interval, a series of time-series image data is continuously acquired at a high frequency. Assuming the camera frame rate is 2 frames per second, this would result in a sequence containing 30 frames. The setting of the cycle is crucial. It needs to be long enough to observe transient disturbances such as the generation and bursting of bubbles, but it cannot be too long to avoid significant changes in the physicochemical properties of the raw milk itself.

[0166] 2. Frame-by-frame extraction of instantaneous feature values

[0167] The system will independently execute the image processing and feature extraction algorithm described in Example 1 on each of these 30 image frames, thereby obtaining three sets of instantaneous feature value sequences that change over time, including:

[0168] Instantaneous milk turbidity characteristic sequence: ;

[0169] Instantaneous whey separation characteristic sequence: ;

[0170] Transient impurity particle characteristic sequence: .

[0171] For example, if a large bubble happens to pass through the 10th frame of the image, then the instantaneous opacity value of that frame... and instantaneous impurity particle value This could result in an abnormal spike pulse.

[0172] 3. Quantitative calculation of the time stability coefficient (TSC)

[0173] The system will calculate the variance of the above three sets of instantaneous feature value sequences in the time dimension. Variance is a classic statistic for measuring the dispersion of data. The larger the variance of a sequence, the more drastic the fluctuations in its values ​​within 15 seconds, and the more unstable the characteristic is, and the more likely it is caused by noise or physical disturbances. Conversely, the smaller the variance, the more consistent the characteristic value is throughout the observation period, and the better it reflects the inherent properties of the raw milk.

[0174] Based on this, this embodiment defines a time stability coefficient (TSC), whose value is strictly inversely proportional to the variance. The specific calculation formula can be designed as follows:

[0175]

[0176] in, It is a very small positive number, for example Its function is to prevent mathematical errors such as a zero denominator when the variance is zero.

[0177] Using this formula, the system will calculate three independent stability coefficients:

[0178] Time stability coefficient of emulsion: Whey separation time stability coefficient: Time stability coefficient of impurity particles: .

[0179] If the turbidity characteristic sequence fluctuates drastically due to a large number of bubbles, its It will be very large, thus leading to Very small; and if whey separation is continuous and stable within 15 seconds, its It will be very small, thus It will be very large.

[0180] 4. Weighted fusion and stable VC generation based on TSC

[0181] Finally, when generating the final, unique breast-derived visual feature code (VC), the system no longer simply uses the instantaneous feature values ​​of any single frame or performs a simple averaging. Instead, it employs a weighted fusion strategy.

[0182] For example, the stable feature value ultimately used for encoding is the product of the mean of its corresponding instantaneous feature value sequence and the time stability coefficient.

[0183] In this way, the influence of features that are unstable over time (low TSC value) on the final VC generation is greatly weakened, while the influence of features that are stable (high TSC value) is significantly amplified.

[0184] The final VC, generated by fusing these three stability-tested feature values, is a truly reproducible biometric ID card capable of resisting transient physical state changes. This improvement transforms the traceability system of this invention from a theoretically feasible solution into a system that can reliably operate in a noisy and disturbed real industrial pipeline environment, greatly enhancing its implementation level and commercial application value.

[0185] like Figure 4 The diagram illustrates the dynamic evolution of visual features based on time-series image analysis, including time-series variation curves of impurity features and fat mass features. In Figure (g), the temporal variation curve of impurity characteristics is depicted by connecting blue dots, showing the dynamic trajectory of impurity characteristic values ​​extracted from 30 consecutive frames. The curve fluctuates slightly within a stable range of 0.63 to 0.68 for the first 11 frames. This small natural fluctuation (standard deviation of about 0.02) truly reflects the normal randomness of the intrinsic quality of the raw milk. However, at frame 12, the curve shows a sharp upward peak, with the characteristic value rising sharply to about 1.00 (marked with a large red circle), almost a 54% jump compared to the baseline level. The red vertical dashed line in Figure (g) accurately marks the location of this instantaneous interference, corresponding to the physical phenomenon mentioned above where bubbles rise rapidly from the surface of the raw milk and pass through the visual acquisition area. This interference causes the visual sensor to mistakenly identify the strong reflective properties of the bubbles as high-density impurities. After frame 13, the curve immediately falls back and returns to the normal range of 0.64 to 0.67, fully demonstrating the instantaneous and non-essential nature of this abnormal peak. The temporal mean, indicated by the green dashed line in the figure, is 0.684. Although this value has undergone statistical smoothing over 30 frames, the strong anomaly in frame 12 still causes the mean to deviate significantly from the true quality baseline (approximately 0.65). The variance value is marked in yellow in the lower left corner. The instability of this characteristic sequence was quantitatively characterized, and this large variance is the key basis for triggering the adaptive adjustment mechanism of the time stability coefficient (TSC).

[0186] The temporal variation curve of fat mass features in the right figure (h) is represented by the magenta dotted line, showing the evolution pattern of fat features within the same time window. This curve remains stable in the range of 0.46 to 0.50 for most frames (except frame 12), with smaller fluctuations (standard deviation of approximately 0.015), reflecting the relatively higher intrinsic stability of fat features. However, at frame 12, it is also affected by bubble interference, with the feature value jumping to approximately 0.76, an increase of about 58%, indicating that this instantaneous interference has a broad-spectrum destructive effect on multidimensional visual features. The temporal mean shown by the cyan dashed line is 0.491, and the variance is... Compared to impurity features, fat features have smaller variance. This difference directly determines that the two will receive different stability weights in the subsequent TSC calculation (fat features will receive a higher TSC value, about 0.911, while impurity features will only receive about 0.882). As a result, in the final stable visual feature code (VC) generation process, the system will automatically give fat features higher confidence and apply stronger suppression to the abnormal fluctuations of impurity features.

[0187] These two graphs, through a combination of color coding (blue for impurities, magenta for fats), marking styles (dots and squares), and multi-level annotations (peak, mean, variance), not only intuitively reveal the objective existence of the need to shift from single-frame analysis to time-series analysis, but also provide experimental evidence through quantitative data (such as the change in variance from 0.0093 to 0.0126, and the jump in peak value from 54% to 58% of the baseline) to demonstrate that traditional single-frame methods are susceptible to accidental interference and that the time-series stability analysis method of this invention has significant anti-interference advantages.

[0188] III. From general feedback adjustments to precise attribution optimization

[0189] Example 1 discloses a model feedback optimization mechanism based on adjusting the difference value, which enables the risk assessment model to achieve adaptive learning. However, its core logic is one of shared success or shared failure. When the final quality deviates from the prediction, it will adjust all risk weights equally and indiscriminately. , , This general approach to regulation can lead to errors in many cases, causing the model to learn incorrect causal relationships.

[0190] For example, once entirely caused by extreme turbulence (high) The resulting quality degradation might lead the model to incorrectly increase the temperature weight. This will contaminate the model's parameters, causing bias in its future judgments.

[0191] This embodiment addresses this deep-seated deficiency by designing a precise responsibility attribution optimization mechanism based on the contribution of risk components. The core idea is that before making feedback adjustments, it is essential to scientifically and quantitatively analyze how much responsibility each risk factor (temperature, vibration, duration) should bear for the final total risk value in the initial risk assessment. Then, based on this responsibility ratio, the final rewards and penalties are allocated differentiatedly. The specific implementation process is as follows:

[0192] 1. Retrospective calculation of risk component contribution value

[0193] When step F is triggered, i.e., after the final actual quality result of a batch of raw milk is obtained, while calculating the control difference value, the system will first retrieve from the database the real-time milk quality risk value R and its three constituent risk component contribution values ​​calculated when the risk warning was triggered during the transit period of that batch. These three values ​​were already generated when R was initially calculated:

[0194] Temperature risk component contribution value = ;

[0195] Vibration risk component contribution value = ;

[0196] Duration-based risk contribution value = ;

[0197] 2. Precise generation of attribution ratio coefficients

[0198] Next, the system will calculate the attribution ratio coefficient for each risk component based on its proportion in the total risk value R. This coefficient precisely quantifies, from the model's perspective, the magnitude of each factor's responsibility for this risk event, including:

[0199] Temperature attribution coefficient =(Contribution value of temperature risk component) / R;

[0200] Vibration attribution proportionality coefficient =(Vibration risk component contribution value) / R;

[0201] Duration attribution ratio =(Contribution value of duration risk component) / R;

[0202] The sum of these three coefficients is always 1.

[0203] For example, if the calculation yields , , This clearly shows that the model believes that 70% of the responsibility for this high-quality risk event lies in temperature, 10% in vibration, and 20% in the duration of the abnormality.

[0204] 3. Attribution-based differential weighting adjustment

[0205] In Example 1, a total regulation difference value was obtained, denoted as . In this embodiment, instead of using this total value to adjust all weights indiscriminately, the total reward and penalty package is first allocated according to the attribution proportion coefficient to obtain the attribution difference value that each weight should independently bear:

[0206] Temperature attribution difference ;

[0207] Vibration Attribution Difference Value ;

[0208] Duration Attribution Difference ;

[0209] Finally, the system will update the corresponding weight parameters based on these three independent and differentiated attribution variance values.

[0210] For example, the new temperature weighting Based on only Adjustments were made, and with and Irrelevant.

[0211]

[0212]

[0213]

[0214] Through this sophisticated process of backtracking, attribution, allocation, and independent updates, the model's self-optimization mechanism has been upgraded from coarse-grained adjustment to precise tuning. As a result, the model can converge to the optimal parameter state more quickly and accurately, gaining a deep understanding of the true impact of various risk factors in different scenarios, thus maintaining extremely high predictive accuracy and reliability throughout complex and ever-changing long-term operation.

[0215] like Figure 5 The chart shows a comparison of the effects of different feedback optimization strategies on risk weight adjustment.

[0216] Subgraph (i) presents the initial weight configuration before the occurrence of the control event in a gray bar chart. The weight of temperature is 0.400, the weight of vibration is 0.350, and the weight of duration is 0.250. These three values ​​represent the baseline risk assessment framework established by the system based on historical experience, which is the starting point for subsequent optimization and adjustment.

[0217] Subplot (j) reveals the core data that triggered this regulatory event through an orange bar chart: the actual contribution values ​​of each risk factor during the transportation of the current batch of raw milk. Temperature contributed 0.55, vibration contributed as high as 0.75 (the main responsible factor), and duration contributed 0.40. This set of data quantitatively describes the objective fact that although all three factors contribute to the quality decline, abnormal vibration is the primary source of responsibility. The vibration contribution value is 36.4% higher than that of temperature and 87.5% higher than that of duration. This significant difference is a prerequisite for implementing precise attribution regulation.

[0218] Subplot (k) calculates the attribution ratio coefficients for each factor using the formula, displayed as a blue bar chart: temperature 0.324, vibration 0.441, and duration 0.235. This distribution of values ​​directly reflects the differentiated quantification of responsibility. Vibration, due to its highest contribution, is assigned the largest attribution ratio (44.1%), followed by temperature (32.4%), and duration the smallest (23.5%). The sum of these three is strictly equal to 1.000, forming a normalized responsibility allocation system. This is the core basis for subsequent implementation of differentiated weight adjustments.

[0219] Subgraph (l) displays the weight configurations of the three states side-by-side using a grouped bar chart: initial weight (gray), weight adjusted by the traditional general strategy (red), and weight adjusted by the attribution strategy of this invention (green). Under the traditional strategy, the three weights increase almost proportionally from 0.400 / 0.350 / 0.250 to 0.400 / 0.350 / 0.250, with completely identical adjustment ranges, failing to reflect the differences in responsibility of each factor in this quality issue. Essentially, this is an egalitarian and extensive optimization. Under the attribution strategy, however, the vibration weight significantly increases from 0.350 to 0.377. The temperature weighting was increased from 0.400 to 0.429, an increase of [percentage missing]. The weighting of duration only increased from 0.250 to 0.266, a mere increase. The order of adjustment magnitude of the three The contribution ranking accurately corresponds to 0.75>0.55>0.40, reflecting the differentiated adjustment mechanism driven by the attribution ratio coefficient. That is, a stronger weight is applied to the main responsible factors, and the secondary factors are moderately increased, realizing an intelligent weight redistribution that focuses on strengthening key factors while taking into account the overall situation.

[0220] Example 3:

[0221] like Figure 6 As shown, in accordance with the above-described method embodiments, this invention also proposes a machine learning-based system for determining the correlation between the weighing and quality grade of raw milk for cheese production, comprising:

[0222] The data acquisition module is configured to comprehensively acquire multi-dimensional data related to the raw milk of the cheese batch to be judged. The multi-dimensional data includes at least:

[0223] The basic weighing data obtained through electronic weighbridges and identification devices includes the weight W of each batch, the milk source identification S, and the supplier identification V.

[0224] Routine quality testing data obtained through laboratory analytical instruments include fat content (F), protein content (P), and total bacterial count (B).

[0225] Cold chain dynamic data acquired through IoT sensing terminals includes real-time temperature T and peak transport vibration. ; and visual data of the milk source collected by industrial cameras at the nodes of the delivery pipeline;

[0226] The data preprocessing module is configured to perform in-depth preprocessing on multi-dimensional data. This preprocessing includes at least the following: handling missing values ​​using the median imputation method of the same supplier's nearly N batches or the historical data similarity matrix method; and performing image enhancement operations on the breast source visual data, such as green channel extraction, contrast-limited adaptive histogram equalization, and gamma correction.

[0227] The feature engineering module is configured to construct deep derived features based on preprocessed data using an attention-driven mechanism. These deep derived features include at least: weighing correlation features reflecting the stability of the supplied weight. Dynamic quality comprehensive index generated by the parallel information focusing module And spatiotemporal fusion features generated by the Transformer encoder model;

[0228] The quality assessment module is configured to use a machine learning ensemble model trained on historical data to determine the predicted quality grade of the batch of raw milk to be assessed based on deep derived features.

[0229] The closed-loop control and optimization module further includes:

[0230] Risk assessment and collaborative control submodule: It is configured to calculate the milk risk value R in real time based on cold chain dynamic data; and is configured to compare R with at least two different first and second preset risk thresholds, and issue collaborative control instructions with different priorities to multiple responsible entities such as cold chain drivers, factory dispatch centers and suppliers based on the comparison results.

[0231] The authenticity traceability submodule is configured to operate within a stable period. A set of time-series breast cancer visual data is continuously collected. The time stability coefficient (TSC) is calculated by analyzing the variance of each visual feature value in the time-series data. Based on the TSC, the visual feature values ​​are weighted and fused to generate a robust breast cancer visual feature code (VC) that can resist the interference of instantaneous physical state. This submodule is also configured to generate an association key K associated with VC and write VC, K and subsequent process data into the blockchain network.

[0232] The attribution optimization submodule is configured to, after obtaining the final actual quality result of the batch of raw milk, calculate the control difference value between it and the predicted quality level; and is configured to retrospectively calculate the risk component contribution values ​​corresponding to temperature, vibration, and abnormal duration in the composition of R, thereby generating their respective attribution ratio coefficients; finally, it is configured to multiply the control difference value by the attribution ratio coefficient to obtain the attribution difference value, and based on the respective attribution difference values, adjust the temperature weight in the risk calculation formula. The weighting of duration is adjusted independently and differently.

[0233] Example 4:

[0234] Corresponding to the above embodiments, the present invention also proposes an electronic device.

[0235] like Figure 7 The diagram shows a structural schematic of an electronic device according to the present invention. The electronic device 100 includes a processor 101 and a memory 103. The processor 101 and the memory 103 are connected, for example, via a bus 102. Optionally, the electronic device 100 may further include a transceiver 104. It should be noted that in practical applications, the transceiver 104 is not limited to one unit, and the structure of this electronic device 100 does not constitute a limitation on the embodiments of the present invention.

[0236] Processor 101 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 101 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0237] Bus 102 may include a pathway for transmitting information between the aforementioned components. Bus 102 may be a PCI bus or an EISA bus, etc. Bus 102 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0238] The memory 103 stores a computer program corresponding to a general page-turning data recursive query and processing method according to the above embodiments of the present invention. This computer program is controlled and executed by the processor 101. The processor 101 executes the computer program stored in the memory 103 to implement the content shown in the aforementioned method embodiments.

[0239] Among them, electronic devices 100 include, but are not limited to: mobile terminals such as laptops and tablets, as well as fixed terminals such as desktop computers. Figure 7 The electronic device 100 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0240] 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 machine learning-based method for determining the correlation between weighing and quality grade of raw milk for cheese production, characterized in that, Includes the following steps: S1. Obtain multi-dimensional data of the raw milk for cheese to be judged, wherein the multi-dimensional data includes at least weighing basic data, routine quality inspection data, cold chain dynamic data, and visual data of the milk source; S2. Preprocess the multi-dimensional data to generate feature data to be used; S3. Based on the feature data to be used, construct attention-driven feature engineering to generate model input features including at least weighing correlation features, dynamic quality comprehensive index and spatiotemporal fusion features. S4. Input the model input features into a preset machine learning ensemble model for training to obtain a target quality prediction model; S5. Based on the target quality prediction model, determine the quality grade of the raw milk for cheese to be judged, and execute a closed-loop control and traceability process, which includes: Based on the cold chain dynamic data, a real-time milk risk value R is calculated. When R is not less than a first preset risk threshold, multi-entity collaborative regulation is triggered. Based on the aforementioned milk source visual data, a milk source visual feature code VC is generated, and the VC is bound to the process data through an association key K for end-to-end traceability. S6. Collect the control effect data of the multi-entity collaborative regulation and the traceability result data of the full-link traceability, and perform feedback optimization on the target quality prediction model.

2. The method according to claim 1, characterized in that, The multi-dimensional data in step S1 is defined as follows: The weighing data shall include at least the weight W of each batch, the milk source identification S, and the supplier identification V; The routine quality testing data include at least fat content (F), protein content (P), and total bacterial count (B). The cold chain dynamic data includes at least the refrigeration temperature T and the transport vibration value. ; The aforementioned visual data of the milk source refers to image data of the raw milk at two points: before filtration after milking and before it is placed into the tank after filtration.

3. The method according to claim 1, characterized in that, Step S2 involves preprocessing the multi-dimensional data, including: A phased imputation strategy is adopted to impute missing data. Specifically, before a historical data similarity matrix is ​​constructed, the median of the non-missing data from the same supplier in the last N batches is used for imputation. After the similarity matrix has been constructed, weighted imputation is performed based on the similarity matrix. The visual data of the breast source were sequentially subjected to green channel extraction, contrast-limited adaptive histogram equalization, and gamma correction.

4. The method according to claim 1, characterized in that, The attention-driven feature engineering in step S3 includes: Calculate the weight standard deviation under the same milk source identifier S using the preprocessed weighing data. , to serve as the weighing correlation feature; The preprocessed conventional quality inspection data is input into the Parallel Information Focusing (PFAM) module, which dynamically adjusts channel and spatial weights to generate the dynamic comprehensive quality index. ; The preprocessed cold chain dynamic data is input into the Transformer encoder to extract the spatiotemporal fusion features.

5. The method according to claim 1, characterized in that, The formula for calculating the real-time milk risk value R in step S5 is as follows: in: The variance of temperature fluctuation within a preset time period; The peak value of transportation vibration within a preset time period; This is the ratio of the duration of the temperature anomaly to the preset standard duration. Temperature weighting, For vibration weights, Weighted by duration; , , These are the preset formula weighting coefficients.

6. The method according to claim 5, characterized in that, The multi-entity collaborative regulation is executed according to a preset priority, including: First priority coordination: Send control instructions to the cold chain intervention entity, which is a cold chain driver or warehouse manager. The control instructions include adjusting the refrigeration temperature or reducing transportation vibration. Second priority coordination: If R is still not less than the second preset risk threshold after the first priority coordination is executed, a control instruction is sent to the production adjustment subject, which is the workshop scheduler. The control instruction includes delaying reception or adjusting the processing sequence. Third priority collaboration: Sending early warning instructions to the source tracing and early warning entity, which is the ranch supplier, and the early warning instructions include verifying the pre-cooling process.

7. The method according to claim 1, characterized in that, Step S5, which generates and binds the breast-derived visual feature code VC, includes: Extract milk turbidity features, whey separation features, and impurity particle features from the preprocessed milk source visual data; The milk turbidity features, whey separation features, and impurity particle features are encoded to generate the milk source visual feature code VC. Perform a hash operation on the VC to generate the associated key K; The VC, K and their corresponding process data are packaged into a data block and stored in a preset blockchain.

8. The method according to claim 5, characterized in that, Step S6 involves feedback optimization of the target quality prediction model, including: Collect the actual quality test data of raw milk after the multi-subject collaborative regulation is implemented, and compare it with the predicted data before regulation to obtain the regulation difference value; When the absolute value of the regulation difference is greater than the preset optimization trigger threshold, the temperature weight in the real-time milk risk value R calculation formula is adjusted up or down according to the sign of the regulation difference. Vibration weight and duration weight .

9. The method according to claim 7, characterized in that, The step of generating and binding the breast-derived visual feature code (VC) further includes: Obtain the raw milk for cheese to be judged within a preset stabilization period. A set of time-series image data is collected, and for each frame of the time-series image data, instantaneous feature values ​​are extracted, including instantaneous emulsification features. Instantaneous whey separation characteristics and transient impurity particle characteristics ; Calculate each instantaneous characteristic value during the preset stable period. The variance within the variance is calculated, and a corresponding time stability coefficient (TSC) is generated based on the variance, wherein the time stability coefficient is inversely proportional to the variance; the time stability coefficient includes the emulsion turbidity time stability coefficient. Whey separation time stability coefficient and the time stability coefficient of impurity particles ; The instantaneous feature value is weighted and fused with the corresponding time stability coefficient to generate a milk source visual feature code VC that can stably characterize the inherent visual characteristics of raw milk. Then, a hash operation is performed on the VC to generate the associated key K and the subsequent blockchain storage step is performed.

10. The method according to claim 8, characterized in that, The weight is adjusted upwards or downwards accordingly based on the sign of the adjustment difference value. , , The steps further include: The risk component contribution value corresponding to the temperature T, vibration V, and abnormal duration Ta is calculated during the calculation of the real-time milk risk value R. Generate attribution ratio coefficients corresponding to the contribution values ​​of each risk component, wherein the attribution ratio coefficients characterize the proportion of each risk component in the real-time milk risk value R. Multiply the regulation difference value by the attribution proportionality coefficient to obtain the attribution difference values ​​respectively attributed to the temperature, vibration and abnormal duration; Based on their respective attribution difference values, the temperature weights Vibration weight and duration weight Make independent, differentiated adjustments.