Training method and training device of prediction model, prediction method, equipment, medium and product
By constructing a cost-sensitive loss function and using weighted sampling techniques to train a prediction model, the accuracy problem of predicting TPM exceedances in oils and fats was solved, ensuring food safety and reducing waste, and achieving efficient prediction of TPM exceedance probability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- M (CHINA) CO LTD
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-12
AI Technical Summary
Current technologies cannot effectively predict the total polar matter (TPM) content in oils and fats, leading to food safety risks and economic waste.
By constructing a cost-sensitive loss function and weighted sampling techniques, a prediction model is trained using historical TPM values of oils, time-series data of fried foods, equipment operation data, and environmental monitoring data, thereby improving the accuracy of predicting the probability of TPM exceeding the standard.
This approach, while prioritizing food safety, reduces the risk of underreporting of TPM (Total Productive Maintenance) exceedances, decreases oil waste, and improves the accuracy and economic efficiency of the prediction model.
Smart Images

Figure CN122024924A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a training method, training device, prediction method, equipment, medium, and product for a prediction model. Background Technology
[0002] In the catering industry, cooking oil is an important cooking medium, widely used in various high-temperature processing methods such as frying, deep-frying, and stir-frying. However, during repeated high-temperature heating, oils undergo a series of complex chemical reactions, including oxidation, hydrolysis, and polymerization, generating various polar substances, including aldehydes, ketones, acids, and high molecular weight polymers. The total amount of these polar substances is usually characterized by the total polar materials (TPM) content. Studies have shown that when the TPM content exceeds a certain threshold (e.g., in Chinese national standards, TPM must not exceed 27%), the nutritional value of the oil not only decreases significantly but may also produce substances harmful to health, posing health risks with long-term consumption.
[0003] Currently, restaurants primarily monitor the quality of frying oil through experience-based judgment or by using TPM (Total Particulate Matter) analyzers to determine the total particulate matter (TPM) content. However, experience-based judgment suffers from high subjectivity and inaccuracy; TPM analyzers are characterized by long testing cycles, high costs, and complex operation. Furthermore, both methods exhibit a time lag, potentially detecting TPM only after it has already exceeded the threshold.
[0004] In addition to food safety issues caused by TPM exceeding the limit, there are also economic problems caused by waste due to changing oil products when the TPM threshold is far from being reached.
[0005] Therefore, there is an urgent need for a method that can predict the TPM content in oils in advance, so as to ensure that the TPM content does not exceed the healthy threshold while reducing oil waste. Summary of the Invention
[0006] To address the problem of the inability to predict the probability of TPM exceeding the standard in oils and fats, this application proposes a training method for a prediction model to predict the probability of TPM exceeding the standard in oils and fats.
[0007] The training method includes: acquiring training data, which includes historical TPM values of the oil, time-series data of fried food, equipment operation data, and environmental monitoring data. The time-series data of fried food is used to represent frying time and number of frying operations. The equipment operation data includes equipment operating temperature and equipment operating time. The environmental monitoring data includes ambient humidity. Constructing a cost-sensitive loss function, which includes asymmetric penalty weights. Inputting the historical TPM values, the time-series data of fried food, the equipment operation data, and the environmental monitoring data into an initial model, and using the loss function for iterative training to obtain the prediction model.
[0008] Optionally, the loss function is the weighted cross-entropy loss function L. wce Its expression is as follows:
[0009]
[0010] Where i represents the i-th sample in each generation of samples obtained by the prediction model during the iteration process; y i p represents the true value of the i-th sample. A true value of 1 indicates that the TPM exceeds the standard, and a true value of 0 indicates that the TPM is normal. i The probability of TPM exceeding the standard for the i-th sample predicted by the prediction model is N, where N is the total number of samples and α is the excess penalty weight. The excess penalty weight is for cases where the TPM excess probability is less than the oil change threshold when the true value is 1.
[0011] Optionally, the penalty weight includes the over-limit penalty weight and the unit penalty weight, wherein the unit penalty weight is for the case where the TPM over-limit probability is greater than the oil change threshold when the true value is 0.
[0012] Optionally, the over-limit penalty weight is K times the unit penalty weight, where K≥5.
[0013] Optionally, the samples are obtained through weighted sampling during the iteration process to increase the proportion of samples with a true value of 1 in the samples.
[0014] Optionally, the robustness of the prediction model can be improved through adversarial training.
[0015] Optionally, the initial model includes one of a weighted logistic regression model, a cost-sensitive support vector machine model, and an imbalanced data processing neural network model with attention mechanism.
[0016] This application also proposes a method for predicting the probability of total polar matter (TPM) exceeding the standard in oils and fats, comprising: collecting data of the oil to be tested, wherein the data of the oil to be tested includes the current TPM value, the time series data of the fried food, the equipment operation data and the environmental monitoring data; inputting the current TPM value, the time series data of the fried food, the equipment operation data and the environmental monitoring data into the prediction model obtained according to the training method described in any of the preceding claims, so as to obtain the probability of TPM exceeding the standard.
[0017] This application also proposes a training device for a predictive model used to predict the probability of total polar matter (TPM) exceeding the standard in oils and fats, comprising: a data acquisition unit for acquiring training data, the training data including historical TPM values of the oils and fats, frying time-series data, equipment operation data, and environmental monitoring data, the frying time-series data representing frying time and number of fryings, the equipment operation data including equipment operating temperature and equipment operating time, and the environmental monitoring data including ambient humidity; a loss function unit for constructing a cost-sensitive loss function, the loss function including asymmetric penalty weights; and a model training unit for inputting the historical TPM values, the frying time-series data, the equipment operation data, and the environmental monitoring data into an initial model, and using the loss function for iterative training to obtain the predictive model.
[0018] This application also proposes an electronic device comprising a memory storing computer-executable instructions and a processor; when the instructions are executed by the processor, the device causes the device to implement the training method or the prediction method according to any one of the foregoing.
[0019] This application also proposes a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the training method or the prediction method described in any of the preceding claims.
[0020] This application also proposes a computer program product, including a computer program that, when executed by a processor, implements the training method or the prediction method as described in any of the preceding claims.
[0021] This application trains a predictive model using historical TPM values of oils, time-series data of fried foods, equipment operation data, and environmental monitoring data. This model is then used to predict the probability of future TPM exceedances in oils. Furthermore, considering the severe imbalance in sample proportions, with the actual proportion of samples exceeding TPM limits being relatively small, a cost-sensitive loss function and weighted sampling are proposed to increase the model's focus on actual TPM exceedance samples. This allows the model to more accurately predict future TPM exceedance probabilities, ultimately achieving a comprehensive goal of ensuring food safety while also considering economic benefits. Attached Figure Description
[0022] Figure 1 This is a flowchart of a training method for a prediction model used to predict the probability of total polar substances (TPM) exceeding the standard in oils and fats, according to an embodiment of this application.
[0023] Figure 2 This is a flowchart of a method for predicting the probability of total polar substances (TPM) exceeding the standard in oils and fats, according to an embodiment of this application.
[0024] Figure 3 This is a schematic diagram of a training device for a prediction model used to predict the probability of total polar matter (TPM) exceeding the standard in oils and fats, according to an embodiment of this application.
[0025] Figure 4 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0026] The method proposed in this application will now be described with reference to the accompanying drawings.
[0027] Figure 1 This is a flowchart of the training method for a predictive model used to predict the probability of total polar matter (TPM) exceeding the standard in oils and fats.
[0028] In step 11, training data is acquired. There are six main categories of indicators affecting oils: air, high temperature, salt, carbides (e.g., the amount of breading used for frying), water, and detergents. Among these, water, carbides, salt, and high temperature have a significant impact on the total particulate matter (TPM) in oils. Therefore, in one embodiment, the training data may include historical TPM values of oils, frying time-series data, equipment operation data, and environmental monitoring data.
[0029] The training dataset consists of multiple sets of samples, each corresponding to measurement data at a specific time point. For example, if the TPM data is measured once a day, each set of samples includes: the daily TPM value, time-series data of explosives, equipment operation data, and environmental monitoring data.
[0030] Historical TPM values are the core indicator, directly reflecting whether the TPM of oils exceeds the standard. They can be obtained by measuring TPM at fixed times every day using a TPM analyzer.
[0031] Fried food time-series data comprises sales time-series data for various stock keeping units (SKUs) of fried foods, such as sales quantity and sales time distribution. Because there are significant differences in frying time and oil consumption rates among different SKUs (e.g., French fries fry for about 3 minutes, selling 1000 servings, while chicken nuggets fry for 5 minutes, selling 500 servings, and the water content and carbide content of French fries and chicken nuggets differ), frying time-series data can indirectly infer frying time and number of frying operations, thus reflecting the rate and extent of oil consumption. Equipment operation data includes equipment operating temperature and equipment operating time.
[0032] The equipment operating temperature refers to the frying temperature when frying different foods, and the equipment operating time can include the frying time itself and the equipment's service life. Environmental monitoring data includes ambient humidity to reflect the water content in the indicators.
[0033] In step 12, a cost-sensitive loss function is constructed, which includes asymmetric penalty weights. First, the following table illustrates various scenarios regarding TPM in grease, including whether TPM exceeds the limit and whether the grease needs to be replaced. The TPM exceeding the limit shown in the table represents the actual TPM situation, not the predicted result.
[0034] TPM exceeded the standard. TPM not exceeded standard B oil change a Aa Ba No oil change Ab Bb
[0035] Situations Aa and Bb are normal, while situations Ab and Ba are abnormal. Situation Ab indicates that TPM levels actually exceed the standard, but due to failure to detect or misprediction, the current oil is considered to have TPM levels below the standard, leading to a missed report (referred to as "excessive underreporting"). Situation Ba indicates that TPM levels actually do not exceed the standard, but due to erroneous detection or misprediction, the current oil is considered to have TPM levels above the standard, leading to a premature oil change (referred to as "early oil change"). In this application, samples with normal TPM levels are called negative samples, and samples with excessive TPM levels are called positive samples. Therefore, excessive underreporting samples are false negative samples (FN), and early oil change samples are false positive samples (FP).
[0036] Based on the principle that food safety takes precedence over economic benefits, the risk cost of situation Ab is significantly higher than that of situation Ba. Therefore, in abnormal situations, preventing situation Ab should be prioritized far more than preventing situation Ba. Thus, preventing abnormal situations, especially situation Ab, is crucial to minimizing overall risk costs. Meanwhile, the proportion of samples exceeding TPM limits (considered positive samples in this application) is extremely small (typically less than 1%). Therefore, considering the above reasons, to improve sensitivity to underreporting of TPM exceeding limits, a unit penalty weight (i.e., weight of 1) is set for premature oil changes, and an exceeding penalty weight α is set for underreporting of TPM exceeding limits, ensuring that α is much greater than 1 (i.e., the exceeding penalty weight and the unit penalty weight are asymmetrical), for example, making the exceeding penalty weight α K times the unit penalty weight, where K ≥ 5.
[0037] The overall loss function of the model can be simply expressed as L = α × L FN +1×L FP L FN L represents the loss from underreported samples exceeding the standard. FP This represents the loss from changing the oil prematurely. Therefore, when training the model, we can focus on the smaller number of samples that exceed the standard but are not reported, greatly improving the impact of TPM exceeding the standard and not reporting on the loss function, while also taking into account the impact of changing the oil prematurely, thus meeting the constraints of prioritizing food safety while also considering economic benefits.
[0038] In step 13, historical TPM values, explosive time series data, equipment operation data, and environmental monitoring data are input into the initial model, and the loss function is used for iterative training to obtain the prediction model.
[0039] In one example, the training data consists of TPM values for N consecutive (or non-consecutive) days (i.e., historical TPM values), along with daily explosives time-series data, equipment operation data, and environmental monitoring data. In each iteration, the TPM value for day i+1 (or i+any value) is predicted using the actual TPM value for day i and other data, and then combined with the true labels of the samples from day i+1 and the loss function to train the next generation.
[0040] In a binary classification problem where TPM exceeds or does not exceed the limit, the above loss function L can be further adopted using the following weighted cross-entropy loss function:
[0041]
[0042] Among them, y i This represents the true value of the i-th sample (e.g., the sample from day i mentioned above). A value of 1 indicates that the TPM exceeds the standard, while a value of 0 indicates that it is normal. iLet N be the probability of TPM exceeding the limit for the i-th sample predicted by the model, and N be the total number of samples (e.g., samples from N days as mentioned above). In this formula, the excess penalty weight α is for the case where the TPM excess probability is less than the oil change threshold when the true value is 1; the unit penalty weight is for the case where the TPM excess probability is greater than the oil change threshold when the true value is 0. The oil change threshold can be set according to specific circumstances.
[0043] This loss function allows the training process to focus on a small number of positive samples. Furthermore, to further improve the predictive model's ability to handle over-reporting and under-reporting, factors beyond the loss function, such as data sampling and the initial model, can be considered.
[0044] First, weighted sampling can be used during data collection to increase the proportion of positive samples (i.e., samples with a true value of 1) in the sample. Weighted sampling includes undersampling and / or synthetic minority sample or pooled sampling methods. Due to the emphasis on food safety and corresponding testing procedures (e.g., daily testing), even if TPM exceeds the standard, the exceeding samples usually do not suddenly have a particularly large exceeding range, but are located in the boundary range close to 27%. Therefore, for example, for exceeding samples with TPM greater than 27%, the Adaptive Synthetic Sampling (ADASYN) algorithm can be used to generate more exceeding samples in sparse regions with very few samples and low density. The ADASYN algorithm can adaptively synthesize samples according to the sample density, thereby generating more samples at the decision boundary.
[0045] In addition to samples that exceed the standard, attention can also be paid to samples that are close to exceeding the standard to further improve food safety. For example, for samples with a TPM greater than 24% but less than 27% that do not exceed the standard but are close to exceeding the standard, the Synthetic Minority Over-sampling Technique (SMOTE) algorithm can be used to generate synthetic samples and remove overlapping samples between the samples that exceed the standard and the samples with a TPM less than 24%, focusing on samples with a high risk of exceeding the standard and those that are close to exceeding the standard.
[0046] In addition to increasing the number of samples requiring attention, one can also reduce the number of samples that do not require attention to increase the proportion of samples requiring attention. For example, for samples that do not exceed the standard and whose TPM is less than 24%, undersampling can be used to reduce the number of such samples.
[0047] In addition, adversarial training can be used to increase the robustness of the model, enabling it to make stable predictions even when faced with noisy data.
[0048] The aforementioned training framework can be termed a cost-sensitive robust learning framework, which is a technical system that explicitly embeds misclassification cost factors throughout the entire machine learning process. This includes: Training phase: Through a weighted loss function and adversarial example generation, the model learns the business logic that "the risk of over-reporting and underreporting is more costly than early oil change"; Inference phase: Using Bayesian decision theory, the prediction result with the minimum expected cost is selected. Therefore, this cost-sensitive robust learning framework is particularly suitable for the application scenario described in this application, where positive samples are <1% and the cost differences between different error types are significant (α is much greater than 1).
[0049] To further address the imbalanced sample problem and increase the proportion of samples exceeding the TPM standard, imbalanced ensemble learning algorithms, anomaly detection algorithms, or special network structures can be used as the initial model. For example, the initial model can include one of the following: a weighted logistic regression model, a cost-sensitive support vector machine model, or an imbalanced data processing neural network model with an attention mechanism.
[0050] Once a well-trained prediction model is obtained, the probability of total polar matter (TPM) exceeding the standard in oils and fats can be predicted. Figure 2 This is a flowchart of a method for predicting the probability of total polar substances (TPM) exceeding the standard in oils and fats.
[0051] In step 21, data on the oil to be tested is collected. This data includes the current TPM value, frying time sequence data, equipment operation data, and environmental monitoring data. The data collected in this step is real-time data for the current day, used to predict the probability of TPM exceeding the standard on the next day or other future days.
[0052] In step 22, the current TPM value, explosive time series data, equipment operation data and environmental monitoring data are input into the training model obtained according to the training method in the aforementioned steps to obtain the probability of TPM exceeding the standard.
[0053] After obtaining the TPM exceedance probability, in order to make decisions based on this exceedance probability, an adjustable oil change risk threshold θ∈(0,1) can be set. This oil change risk threshold θ can be the same as or different from the aforementioned oil change threshold.
[0054] An oil change instruction will only be generated when the probability of TPM exceeding the standard is greater than θ. The oil change risk threshold θ can be determined using a cost optimization algorithm to find the optimal solution for the oil change time while ensuring compliance with the GB2716-2018 food safety standard. After obtaining the probability of exceeding the standard (e.g., the probability of exceeding the standard the next day) and the oil change risk threshold θ, an executable instruction can be generated through a decision model. The executable instruction includes an immediate oil change instruction (including the oil type) and a continued use instruction (including a countdown to the next test), which are transmitted to authorized terminals (e.g., terminals in each store) through an encrypted channel to instruct the store to change the oil or continue use.
[0055] This application also proposes a training device for a predictive model used to predict the probability of total polar matter (TPM) exceeding the standard in oils and fats. For example... Figure 3 As shown, the training device 300 includes:
[0056] The data acquisition unit 31 is used to acquire training data, which includes historical TPM values of oil, time-series data of fried food, equipment operation data, and environmental monitoring data. The time-series data of fried food is used to represent the frying time and number of frying times of fried food. The equipment operation data includes the equipment operating temperature and the equipment operating time. The environmental monitoring data includes the ambient humidity.
[0057] Loss function unit 32 is used to construct a cost-sensitive loss function, which includes asymmetric penalty weights.
[0058] Model training unit 33 is used to input historical TPM values, explosive time series data and auxiliary monitoring data into the initial model, and use the loss function to perform iterative training to obtain the prediction model.
[0059] It is understood that the training device 300 can run on various computers and servers, and can be trained to obtain a prediction model using the training method corresponding to the prediction model of this application.
[0060] The training method and device for the prediction model used to predict the probability of total polar matter (TPM) exceeding the standard in oils, as described above, along with the prediction method and oil change decision method using this prediction model, creatively achieve the following advantages:
[0061] Under the practical constraints of strictly limiting manual inspections to once per day, this method infers grease loss by fusing multi-source feature data (such as SKU sales time-series data). This approach overcomes the bottlenecks of data volume and frequency by extracting weak signals (i.e., data that is easily overlooked but contains important information).
[0062] The model simultaneously considers food safety and operating costs as optimization objectives, with food safety taking priority. This cost-sensitive design enables the model to learn the business logic that "the risk of underreporting exceeding standards is more costly than changing the oil prematurely."
[0063] This establishes a complete methodology chain encompassing "detection, prediction, decision-making, and execution." Through a distributed decision engine and command execution system, it ensures that prediction results can be translated into actual control over oil quality (TPM content). This not only significantly reduces the risk of TPM exceeding limits but also lowers oil change costs, achieving a balance between food safety and economic efficiency.
[0064] Now for reference Figure 4The diagram shown is a block diagram of an electronic device 400 according to an embodiment of the present application. The electronic device 400 may include one or more processors 402, system control logic 408 connected to at least one of the processors 402, system memory 404 connected to the system control logic 408, non-volatile memory (NVM) 406 connected to the system control logic 408, and network interface 410 connected to the system control logic 408.
[0065] Processor 402 may include one or more single-core or multi-core processors. Processor 402 may include any combination of general-purpose processors and special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In embodiments herein, processor 402 may be configured to perform one or more embodiments of various embodiments of a training method for a predictive model for predicting the probability of exceeding the total polar substance TPM in oils and fats according to the present application, or a predictive method for predicting the probability of exceeding the total polar substance TPM in oils and fats.
[0066] In some embodiments, system control logic 408 may include any suitable interface controller to provide any suitable interface to at least one of the processors 402 and / or any suitable device or component communicating with system control logic 408.
[0067] In some embodiments, system control logic 408 may include one or more memory controllers to provide an interface to system memory 404. System memory 404 may be used to load and store data and / or instructions. In some embodiments, system memory 404 of electronic device 400 may include any suitable volatile memory, such as suitable dynamic random access memory (DRAM).
[0068] The non-volatile memory 406 may include one or more tangible, non-transitory computer-readable storage media for storing data and / or instructions. In some embodiments, the non-volatile memory 406 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of HDD (Hard Disk Drive), CD (Compact Disc) drive, and DVD (Digital Versatile Disc) drive.
[0069] Non-volatile memory 406 may include a portion of storage resources installed on a device of electronic device 400, or it may be accessible by the device but is not necessarily part of the device. For example, non-volatile memory 406 may be accessed over a network via network interface 410.
[0070] Specifically, system memory 404 and non-volatile memory 406 may each include a temporary copy and a permanent copy of instructions 420. Instructions 420 may include instructions that, when executed by at least one of processors 402, cause electronic device 400 to implement the methods provided in this application. In some embodiments, instructions 420, hardware, firmware, and / or their software components may additionally / alternatively reside in system control logic 408, network interface 410, and / or processor 402.
[0071] In some embodiments, network interface 410 may be integrated into other components of electronic device 400. For example, network interface 410 may be integrated into at least one of processor 402, system memory 404, non-volatile memory 406, and firmware device (not shown) having instructions that, when at least one of processor 402 executes the instructions, electronic device 400 implements one or more embodiments of various embodiments of the training method for a predictive model for predicting the probability of exceeding the total polar substance TPM in oils, or the predictive method for predicting the probability of exceeding the total polar substance TPM in oils, as described herein. Network interface 410 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface.
[0072] In one embodiment, at least one of the processors 402 may be packaged together with the logic of one or more controllers for system control logic 408 to form a system package (SiP). In another embodiment, at least one of the processors 402 may be integrated on the same die with the logic of one or more controllers for system control logic 408 to form a system on chip (SoC).
[0073] Electronic device 400 may further include: input / output (I / O) device 412. Input / output (I / O) device 412 may include a user interface that enables a user to interact with electronic device 400; the design of peripheral component interfaces enables peripheral components to also interact with electronic device 400.
[0074] In some embodiments, the user interface may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., a light-emitting diode flash), and a keyboard.
[0075] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0076] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 400. In other embodiments of this application, the electronic device 400 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0077] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.
[0078] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this paper are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0079] One or more aspects of at least one embodiment can be implemented by representational instructions stored on a computer-readable storage medium, the instructions representing various logics in a processor, which, when read by a machine, cause the machine to create logic for performing the techniques described herein. These representations, referred to as “IP cores,” can be stored on a tangible computer-readable storage medium and provided to multiple customers or production facilities for loading into manufacturing machines that actually manufacture the logic or processor.
[0080] One embodiment of this application discloses a computer-readable storage medium storing one or more programs executable by one or more processors to implement the training method of the prediction model for predicting the probability of exceeding the total polar matter (TPM) standard in oils and fats, or the prediction method for predicting the probability of exceeding the total polar matter (TPM) standard in oils and fats.
[0081] One embodiment of this application discloses a computer program product, including a computer program that, when executed by a processor, implements the training method of the prediction model for predicting the probability of total polar substances (TPM) exceeding the standard in oils and fats, or the prediction method for predicting the probability of total polar substances (TPM) exceeding the standard in oils and fats.
[0082] The specific embodiments described above illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Although the description of this application is presented in conjunction with preferred embodiments, this does not mean that the features of this invention are limited to these embodiments. Furthermore, to avoid confusion or obscuring the focus of this application, some specific details will be omitted in the description. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0083] Furthermore, the various operations will be described as multiple discrete operations in a manner most conducive to understanding the illustrative embodiments; however, the order of description should not be construed as implying that these operations must depend on the order. In particular, these operations do not need to be performed in the order presented.
[0084] Unless the context otherwise specifies, the terms “contains,” “has,” and “includes” are synonyms. The phrase “A / B” means “A or B.” The phrase “A and / or B” means “(A and B) or (A or B).”
[0085] As used herein, the terms “module” or “unit” may refer to, be, or include: application-specific integrated circuits (ASICs), electronic circuits, (shared, dedicated, or group) processors and / or memories that execute one or more software or firmware programs, combinational logic circuits, and / or other suitable components that provide the described functionality.
[0086] In the accompanying drawings, certain structural or methodological features are shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. In some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0087] It should be understood that although terms such as "first," "second," etc., may be used herein to describe various units or data, these units or data should not be limited by these terms. These terms are used merely to distinguish one feature from another. For example, without departing from the scope of the exemplary embodiments, a first feature may be referred to as a second feature, and similarly, a second feature may be referred to as a first feature.
[0088] It should be noted that in this specification, similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0089] Although the invention has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art will understand that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.
Claims
1. A training method for a predictive model used to predict the probability of total polar substances (TPM) exceeding the standard in oils and fats, characterized in that, include: Acquire training data, which includes the historical TPM value of the oil, frying time series data, equipment operation data, and environmental monitoring data. The frying time series data is used to represent frying time and number of frying times. The equipment operation data includes equipment operating temperature and equipment operating time. The environmental monitoring data includes ambient humidity. Construct a cost-sensitive loss function, which includes asymmetric penalty weights; The historical TPM value, the time series data of the explosives, the equipment operation data, and the environmental detection data are input into the initial model, and the prediction model is obtained by iterative training using the loss function.
2. The training method according to claim 1, characterized in that, The loss function is the weighted cross-entropy loss function L. wce Its expression is as follows: , Where i represents the i-th sample in each generation of samples obtained by the prediction model during the iteration process; y i p represents the true value of the i-th sample. A true value of 1 indicates that the TPM exceeds the standard, and a true value of 0 indicates that the TPM is normal. i The probability of TPM exceeding the standard for the i-th sample predicted by the prediction model is N, where N is the total number of samples and α is the excess penalty weight. The excess penalty weight is for cases where the TPM excess probability is less than the oil change threshold when the true value is 1.
3. The training method according to claim 2, characterized in that, The penalty weight includes the over-limit penalty weight and the unit penalty weight. The unit penalty weight is for cases where the TPM over-limit probability is greater than the oil change threshold when the true value is 0.
4. The training method according to claim 3, characterized in that, The weight of the penalty for exceeding the limit is K times the weight of the unit penalty, where K ≥ 5.
5. The training method according to claim 4, characterized in that, The samples are obtained through weighted sampling during the iteration process to increase the proportion of samples with a true value of 1.
6. The training method according to claim 5, characterized in that, The robustness of the prediction model is improved through adversarial training.
7. The training method according to claim 1, characterized in that, The initial model includes one of the following: a weighted logistic regression model, a cost-sensitive support vector machine model, and an imbalanced data processing neural network model with attention mechanism.
8. A method for predicting the probability of total polar substances (TPM) exceeding the standard in oils and fats, characterized in that, include: Data on the oil to be tested is collected, including the current TPM value, frying time sequence data, equipment operation data, and environmental monitoring data. The current TPM value, the time series data of the explosives, the equipment operation data, and the environmental detection data are input into the prediction model obtained by the training method according to any one of claims 1-7 to obtain the probability of TPM exceeding the standard.
9. A training device for a predictive model used to predict the probability of total polar substances (TPM) exceeding the standard in oils and fats, characterized in that, include: The data acquisition unit is used to acquire training data, which includes the historical TPM value of the oil, frying time series data, equipment operation data and environmental monitoring data. The frying time series data is used to represent the frying time and the number of frying times. The equipment operation data includes the equipment operating temperature and the equipment operating time. The environmental monitoring data includes the ambient humidity. The loss function unit is used to construct a cost-sensitive loss function, which includes asymmetric penalty weights. The model training unit is used to input the historical TPM value, the time series data of the explosives, the equipment operation data and the environmental detection data into the initial model, and use the loss function to perform iterative training to obtain the prediction model.
10. An electronic device, characterized in that, The device includes a memory storing computer-executable instructions and a processor; when the instructions are executed by the processor, the device causes the device to perform the training method according to any one of claims 1 to 7 or the prediction method according to claim 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the training method of any one of claims 1 to 7 or the prediction method of claim 8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the training method as described in any one of claims 1 to 7 or the prediction method as described in claim 8.