Method for analyzing nuclear radiation level of frozen food
By integrating data from frozen food and refrigeration equipment, and using machine learning models to analyze the nuclear radiation level of frozen food, the problem of untimely detection in the existing technology is solved, and rapid and accurate nuclear radiation detection and analysis is achieved.
Patent Information
- Application Number
- CN202411596789.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-04-25
AI Technical Summary
There is a lack of methods in the prior art that can quickly and accurately detect the nuclear radiation level of frozen food at the cold chain terminal, making it difficult for freezer managers or stockholders to detect and deal with nuclear pollution in a timely manner.
A method for analyzing nuclear radiation level of frozen food is provided. By acquiring and integrating nuclear radiation data, food data and equipment data of refrigeration equipment of frozen food, pre-processing, feature extraction and machine learning model prediction, and visual results are generated to analyze nuclear radiation levels.
It has achieved rapid and accurate analysis of the nuclear radiation levels of frozen foods in multiple refrigeration equipment, and can promptly detect and deal with nuclear radiation exceeding the standard, ensuring the safety of frozen foods purchased by consumers.
Smart Images

Figure CN119884991A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data analysis methods, and in particular relates to a method for analyzing nuclear radiation levels of frozen foods. Background Art
[0003] The prior art still lacks equipment and methods that can effectively detect nuclear contamination of frozen food at cold chain terminals such as freezers. Although there is a method for detecting nuclear radiation of food in the prior art, this method requires the frozen food to be thawed and incinerated, and then subjected to spectrum analysis of radioactive nuclides after cooling to determine the nuclear radiation level of the food. For scenarios where a large amount of frozen food is transported through the cold chain and then loaded into multiple freezers and other terminals every day, it is unrealistic to use such a nuclear radiation detection method. It can only be used for sampling and testing a small part of the food, and the test results are also quite delayed. When a batch of frozen food in the freezer is nuclear contaminated, the freezer manager or loader will not be able to discover and deal with the situation in time. Summary of the invention
[0004] The present invention is made to solve the above problems, and aims to provide a method for quickly and accurately analyzing the nuclear radiation level of a large amount of frozen food stored in multiple refrigeration equipment. The present invention adopts the following technical solutions:
[0005] The present invention provides a method for analyzing the nuclear radiation level of frozen food, which is used to analyze the nuclear radiation level of frozen food stored in refrigeration equipment. The method has the following technical features, which include the following steps: Step S1, obtaining nuclear radiation data and food data of frozen food, and integrating them into original data to be analyzed; Step S2, preprocessing the original data to obtain preprocessed data; Step S3, extracting features from the preprocessed data to obtain multiple features, wherein the multiple features at least include classification features corresponding to food types; Step S4, inputting the multiple features into a trained machine learning model, which outputs prediction results of the nuclear radiation levels of each of the food types; and Step S5, generating visualization results based on the prediction results of the nuclear radiation levels of each of the food types.
[0006] The method for analyzing nuclear radiation levels of frozen foods provided by the present invention may also have such a technical feature, wherein, in step S1, the equipment data of the refrigeration equipment is also obtained, and the nuclear radiation data, the food data and the equipment data are integrated into the original data, and the original data at least includes: the nuclear radiation measurement value in the refrigeration equipment, the collection time of the nuclear radiation measurement value, the equipment location of the refrigeration equipment, the food type, and the food weight.
[0007] The method for analyzing nuclear radiation levels of frozen foods provided by the present invention may also have such technical features, wherein step S2 includes the following sub-steps: step S2-1, using the interquartile range method to remove outliers in the original data; step S2-2, for the original data after removing outliers, using linear interpolation or mean filling method to fill missing values therein; and step S2-3, standardizing the original data after filling the missing values to obtain the preprocessed data.
[0008] The method for analyzing nuclear radiation levels of frozen foods provided by the present invention may also have such a technical feature, wherein, in step S2-1, for the multiple nuclear radiation measurement values, their first quartile Q1 and third quartile Q3 are calculated, and a normal value range is obtained based thereon, and data points exceeding the normal value range are removed, wherein the upper limit value of the normal value range is Q1-1.5*IQR, and the lower limit value is Q3+1.5*IQR, and in step S2-3, the Z-score standardization method is used to normalize the multiple nuclear radiation measurement values.
[0009] The method for analyzing nuclear radiation levels of frozen foods provided by the present invention may also have such technical features, wherein in step S3, the classification feature is a binary vector obtained by encoding the food type using one-hot encoding, and the extracted features also include time features, food weight features, and nuclear radiation measurement value features.
[0010] The method for analyzing the nuclear radiation level of frozen food provided by the present invention may also have such technical features, wherein the machine learning model is a gradient boosting decision tree model, and in step S4, the machine learning model outputs a predicted value of the nuclear radiation level of each of the food types based on the input multiple features, and compares the predicted value of the nuclear radiation level of each of the food types with a predetermined corresponding nuclear radiation level safety threshold, so as to determine whether the nuclear radiation level of each of the food types exceeds the standard; or in step S4, the machine learning model outputs a classification result of whether the nuclear radiation level of each of the food types exceeds the standard based on the input multiple features.
[0011] The method for analyzing nuclear radiation levels of frozen foods provided by the present invention may also have such technical features, wherein the process of training the machine learning model includes the following steps: step SA1, obtaining the nuclear radiation data and the food data of the frozen food, and obtaining the equipment data of the refrigeration equipment of the frozen food, integrating the nuclear radiation data, the food data and the equipment data into data for model training, and dividing the data into a training set and a test set according to a predetermined ratio; step SA2, preprocessing the data of the training set to obtain preprocessed training data; step SA3, performing feature extraction on the preprocessed training data to obtain a plurality of training features, at least including classification features corresponding to the food type; step SA4, inputting the plurality of training features into the machine learning model, training the machine learning model with minimization of the loss function as the training goal, and optimizing the model parameters; step SA5, judging whether a predetermined iteration stop condition is reached; step SA6, when step SA5 judges as yes, stopping iteration to obtain the trained machine learning model.
[0012] The method for analyzing nuclear radiation levels of frozen foods provided by the present invention may also have such a technical feature, wherein in step SA4, the loss function is a square error loss function:
[0013]
[0014] Where F(x) is the predicted value output by the machine learning model, and y is the corresponding actual value. In each training round, the negative gradient of the gradient boosting decision tree model is calculated as the pseudo residual:
[0015]
[0016] And fit a new decision tree to predict the pseudo residual, and add the new decision tree to the gradient boosting decision tree model to update the model:
[0017] F m (x) = F m-1 (x)+αh m (x)
[0018] In the formula, F m (x) is the model after adding the mth decision tree, α is the learning rate, h m (x) is the mth tree.
[0019] The method for analyzing nuclear radiation levels of frozen foods provided by the present invention may also have such a technical feature, wherein, in step SA5, the iteration stopping condition is that one or more evaluation indicators of the machine learning model reach a predetermined value, and the evaluation indicators include any one or more of accuracy and mean square error.
[0020] The method for analyzing the nuclear radiation level of frozen food provided by the present invention may also have such a technical feature, wherein in step S5, the generated visualization result includes: a time series graph, one axis of which is time and the other axis is the corresponding nuclear radiation measurement value, and each broken line or curve corresponds to one of the refrigeration devices; a heat map, the background of which is a regional map of the area where one or more refrigeration devices are located, and the foreground is a graphic marked with different colors / different depths, the position of the graphic in the regional map corresponds to the device position of the refrigeration device, and the color / depth corresponds to the nuclear radiation measurement value; and / or a bar graph, one axis of which is one or more food types, and the other axis is the mean of the nuclear radiation prediction values corresponding to each of the food types, and each bar in the graph represents the mean of the nuclear radiation prediction values of one of the food types.
[0021] Function and Effect of the Invention
[0022] The method for analyzing the nuclear radiation level of frozen food according to the present invention comprises the steps of obtaining raw data, preprocessing the raw data, extracting features from the preprocessed data, inputting the extracted features into a machine learning model to predict the nuclear radiation level, and generating a visualization result based on the prediction result, wherein, since the raw data includes the measured nuclear radiation data and the food data of the stored frozen food, and the extracted features include classification features corresponding to multiple food types, the machine learning model can output the prediction results of the nuclear radiation level of each food type. The present invention fills the gap in the prior art where there is no relevant analysis method, can quickly and accurately obtain the nuclear radiation level detection results of a large number of foods stored in multiple refrigeration equipment, and even when multiple types of food are mixed in the refrigeration equipment, the nuclear radiation level of each type of food can be analyzed, so that the administrator and the loaders can timely discover and deal with the situation where the nuclear radiation of frozen food exceeds the standard, thereby ensuring that consumers can purchase safe frozen food. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a flow chart of a method for analyzing nuclear radiation levels of frozen foods in an embodiment of the present invention;
[0024] Figure 2 is a side view of a freezer in an embodiment of the present invention;
[0025] Figure 3 is a top view of a partial structure of a freezer in an embodiment of the present invention;
[0026] Figure 4 is a cross-sectional view of a freezer in an embodiment of the present invention;
[0027] Figure 5is a logic block diagram of a nuclear radiation detection device in an embodiment of the present invention;
[0028] Figure 6 is a flow chart of step S2 in an embodiment of the present invention;
[0029] Figure 7 is a flow chart of training a machine learning model in an embodiment of the present invention;
[0030] Figure 8 is a schematic diagram of a time series graph in an embodiment of the present invention;
[0031] Fig. 9 is a schematic diagram of a thermal map in an embodiment of the present invention;
[0032] Fig.10 Schematic diagram of a bar graph in an embodiment of the present invention.
[0033] Reference numerals:
[0034] Refrigerator 10; cabinet 11; refrigeration system 12; temperature control device 13; nuclear radiation detection device 14; main control unit 141; power conversion unit 142; nuclear radiation detection unit 143; detection probe 1431; serial communication unit 144; wireless communication unit 145. DETAILED DESCRIPTION
[0035] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the method for analyzing the nuclear radiation level of frozen food of the present invention is specifically described below in conjunction with embodiments and drawings.
[0036] <Example 1>
[0037] This embodiment provides a method for analyzing nuclear radiation levels of frozen foods, which is used to analyze nuclear radiation data collected from a closed or semi-closed space where one or more frozen foods are stored, so as to obtain analysis results of the nuclear radiation levels of the one or more frozen foods. The space is usually the inner cavity of a food refrigeration device.
[0038] In this embodiment, the above space is the space in the freezing chamber of a large horizontal freezer used in shopping malls, large supermarkets, etc., and multiple portions of food can be placed in the freezing chamber. The multiple portions of food are the same type of food (for example, all seafood) or multiple different types of food (for example, meat, seafood, vegetables, etc. are mixed). For the convenience of the following description, a freezer with a nuclear radiation detection function will be shown below.
[0039] Figure 2 is a side view of the freezer in this embodiment, Figure 3 is a top view of the partial structure of the refrigerator in this embodiment (the refrigerator cover is not shown in the figure), Figure 4It is a cross-sectional view of the freezer in this embodiment.
[0040] like Figures 2 to 4 As shown, the refrigerator 10 includes a cabinet body 11, a refrigeration system 12, a temperature control device 13, a nuclear radiation detection device 14, and an equipment information storage device (not shown in the figure).
[0041] The cabinet 11 is in a rectangular shape, with an open top and an upper cover. Two substantially rectangular cavities separated from each other are formed in the cabinet 11, wherein the upper one is a freezing chamber 111 for storing frozen food, and the lower one is an equipment accommodating chamber 112 for installing equipment.
[0042] The refrigeration system 12 includes cooling pipes and circuits disposed in the equipment accommodating chamber 112, etc., for refrigerating the freezing chamber 111. The temperature control device 13 is used to detect the temperature in the freezing chamber 111 and control the refrigeration system 12 based on the detected temperature, so that the temperature of the freezing chamber 111 is maintained within a predetermined temperature range.
[0043] Figure 5 It is a logic block diagram of the nuclear radiation detection device in this embodiment.
[0044] like Figure 5 As shown, the nuclear radiation detection device 14 includes a main control unit 141 and a power conversion unit 142 , a nuclear radiation detection unit 143 , a serial communication unit 144 , and a wireless communication unit 145 , which are electrically connected to the main control unit 141 , respectively.
[0045] The power conversion unit 142 is used to provide other units with stable DC power required for their operation.
[0046] The nuclear radiation detection unit 143 includes a nuclear radiation detection sensor, which has a detection probe 1431. In this embodiment, the detection probe 1431 is arranged beside one side of the freezing chamber 111 and faces the inside of the freezing chamber 111, and the installation height of the detection probe 1431 is close to the top of the cabinet 11. The nuclear radiation detection sensor can collect the nuclear radiation amount (analog amount) in the freezing chamber 111.
[0047] The nuclear radiation detection sensor transmits the measured nuclear radiation amount to the main control unit 141 through the serial communication unit 144. In this embodiment, the nuclear radiation detection module 145 is a nuclear radiation detection module, whose model is MR-10-J. The types of rays it measures include gamma rays and X-rays, and it has an RS485 output interface, and the data can be directly read through the RS485 digital communication protocol. It has a nuclear radiation detector, which is a glass Geiger counter tube, and the above-mentioned probe is a part of the detector. Correspondingly, the serial communication unit 144 is an RS485 communication unit. In an alternative solution, other types of nuclear radiation detection modules can also be used, such as a module that can detect hard beta rays, gamma rays and X-rays.
[0048] The main control unit 141 includes a microprocessor (MCU), which may be an MCU with a built-in signal processor and an analog-to-digital converter. After receiving the nuclear radiation amount measured by the nuclear radiation detection sensor, the MCU performs certain signal processing on it and converts it into a corresponding nuclear radiation measurement value (digital quantity). In this embodiment, the model of the MCU is STM32WBA52CG.
[0049] The wireless communication unit 145 communicates with an external device, such as a computing and analysis device, by wireless communication, and sends corresponding data to the device according to a request from the device. In this embodiment, the wireless communication unit 145 is a 4G communication unit or a 5G communication unit.
[0050] In an alternative solution, the temperature control device 13 and the nuclear radiation detection device 14 may also be integrated into one, and the two may share a main control unit 141 and a power conversion unit 142, etc., which can reduce equipment costs and make it more convenient to assemble the freezer 10.
[0051] The device information storage device is used to store the device information of the refrigerator 10, including at least the device unique identification number (device ID). According to the device ID, the device location (such as the coordinates of the refrigeration device) can be found in the corresponding device management system.
[0052] In an alternative solution, the refrigerator 10 may further include a positioning device, such as a GPS positioning device, and use its GPS coordinates as the device location.
[0053] Generally speaking, the cold chain system has a corresponding frozen food management system. When the loader loads the freezer 10, the food information of the corresponding frozen food will be entered into the frozen food management system, and the food management system will store the food information of the frozen food in correspondence with the equipment information of the freezer 10 where the frozen food is stored. In this embodiment, the computing and analyzing device is also connected to the equipment in the frozen food management system in communication, so that the food information of the frozen food in the corresponding freezer 10 can be queried from the food management system according to the unique identification number of the equipment.
[0054] In an alternative solution, the computing and analyzing device may also be a part of the frozen food management system.
[0055] Figure 1 1 is a flow chart of the method for analyzing nuclear radiation levels of frozen foods in this embodiment.
[0056] like Figure 1 As shown, based on the above-mentioned freezer 10, computing and analyzing device, and frozen food management system, the method specifically includes the following steps:
[0057] Step S1, obtaining nuclear radiation data and food data of frozen food, and obtaining equipment data of a refrigeration device storing the frozen food, and integrating the nuclear radiation data, food data and equipment data into raw data to be analyzed.
[0058] Step S2, preprocessing the original data to obtain preprocessed data.
[0059] Step S3, extracting features from the preprocessed data to obtain a variety of features, wherein the extracted features at least include classification features corresponding to food types.
[0060] Step S4, multiple features are input into the trained machine learning model, and the model outputs the nuclear radiation level detection results of each food type.
[0061] Step S5, generating visualization results based on the detection results of the nuclear radiation levels of various food types.
[0062] The above steps will be described in detail below.
[0063] Step S1, obtaining nuclear radiation data and food data of frozen food, and obtaining equipment data of a refrigeration device storing the frozen food, and integrating the nuclear radiation data, food data and equipment data into raw data to be analyzed.
[0064] In this embodiment, the measured nuclear radiation data is obtained from the nuclear radiation detection device 14 of the freezer 10, the equipment data (including the unique equipment identification code and the equipment location) is obtained from the equipment information storage device thereof, and the food data of one or more frozen foods stored in the freezer 10 is queried from the frozen food management system according to the unique equipment identification code. After the data is integrated, the obtained raw data includes at least: nuclear radiation measurement value, acquisition time, equipment location, food type, and food weight. Among them, the unit of the nuclear radiation measurement value is becquerel (Bq). The acquisition time is the timestamp of the acquisition of the corresponding nuclear radiation measurement value. The food type is the type name of the food, such as meat, seafood, vegetables, etc. The unit of food weight is kilogram (kg).
[0065] In this embodiment, the above data is collected once every hour.
[0066] Step S2, preprocessing the original data to obtain preprocessed data.
[0067] Figure 6 is a flow chart of step S2 in this embodiment.
[0068] like Figure 6 As shown, step S2 specifically includes the following sub-steps:
[0069] Step S2-1: For the original data, use the interquartile range method to remove outliers.
[0070] Among them, for multiple nuclear radiation measurement values, the first quartile (denoted as Q1) and the third quartile (Q3) are calculated, and the upper limit and lower limit of the normal value range are set based on Q1 and Q3 respectively:
[0071] Upper limit = Q1-1.5*IQR
[0072] Lower limit = Q3 + 1.5 * IQR
[0073] Then, data points in the nuclear radiation data that exceed the normal value range formed by the upper limit value and the lower limit value are removed, thereby obtaining the nuclear radiation data after the abnormal values are removed.
[0074] Step S2-2: For the original data after removing outliers, the missing values are filled in by using linear interpolation or mean filling method.
[0075] Among them, the linear interpolation method uses the mean of the two nuclear radiation measurement values before and after the missing value (before and after sorted by timestamp) to fill the missing value. The mean filling method uses the mean of the column where the missing value is located (that is, the mean of nuclear radiation measurement values of multiple other timestamps) to fill the missing value.
[0076] Step S2-3, standardize the original data after filling the missing values.
[0077] Among them, the Z-score standardization method is used to normalize multiple nuclear radiation measurement values, and the nuclear radiation measurement values are converted into a standard normal distribution, and its expression is:
[0078]
[0079] Where X is the nuclear radiation measurement value (original data) before standardization, μ is the mean of multiple nuclear radiation measurement values, and σ is the data standard deviation of multiple nuclear radiation measurement values.
[0080] Step S3, extracting features from the preprocessed data to obtain a variety of features, including at least classification features corresponding to food types.
[0081] Among them, feature extraction is performed on the preprocessed data, including extracting time features based on time series analysis, extracting classification features based on food types, and extracting food weight features, nuclear radiation measurement value features, etc. Among them, time features include daily average values and weekly average values of nuclear radiation measurement values. Classification features are binary vectors obtained by encoding and converting food types using One-Hot Encoding.
[0082] Step S4, multiple features are input into a trained machine learning model, and the model outputs the nuclear radiation level detection results of each food type.
[0083] Among them, the machine learning model is a gradient boosting decision tree (GBDT) model. The gradient boosting decision tree model is gradually optimized on the basis of multiple decision trees, and has strong generalization ability and good prediction accuracy. In this embodiment, the above multiple features are used as the input of the model, and the model outputs the predicted value of the nuclear radiation level of each food type, that is, the machine learning task is a regression task.
[0084] Optionally, step S4 also includes comparing the predicted value of the nuclear radiation level of each food type with a predetermined safety threshold of the nuclear radiation level of each food type, and determining whether the nuclear radiation level of each food type exceeds the standard.
[0085] For example, a freezer 10 contains 1 kg of meat and 1 kg of seafood, and the measured nuclear radiation value of the freezer 10 is 1200 becquerels. After preprocessing and feature extraction of the corresponding raw data, the corresponding features are input into the machine learning model, and the model outputs the predicted nuclear radiation values of the two food types, for example, the predicted nuclear radiation value of seafood is 550 becquerels / kg. Then, the predicted nuclear radiation value of seafood, 550 becquerels / kg, is compared with the predetermined safety threshold of 500 becquerels / kg for the food type, and it can be determined that the nuclear radiation level of the seafood in the freezer 10 exceeds the standard.
[0086] Figure 7 It is a flowchart for training the machine learning model in this embodiment.
[0087] like Figure 7 As shown, the process of training the above machine learning model (gradient boosting decision tree model) specifically includes the following steps:
[0088] Step SA1, obtain the nuclear radiation data and food data of the frozen food, and obtain the equipment data of the refrigeration equipment storing the frozen food, integrate the nuclear radiation data, food data and equipment data into the original data for model training, and divide the original data into a training set and a test set in proportion.
[0089] Among them, it is preferred to obtain data from refrigeration equipment of the same model (using the same above-mentioned nuclear radiation detection device 14), and the data of multiple refrigeration equipment installed in different positions during actual operation can be obtained, or multiple operating conditions can be simulated and corresponding data can be obtained.
[0090] When simulating multiple situations to obtain training data, data can be collected including the following situations and their combinations: placing the same type of food in the refrigeration equipment, placing multiple types of food mixed together, placing food with the same production date, placing multiple foods with different production dates, placing food that is less than a certain proportion (for example, 1 / 4) of the maximum storage capacity, placing food that is more than a certain proportion (for example, 3 / 4) of the maximum storage capacity, placing food that is approximately half of the maximum storage capacity and placed close to the detection probe, placing food that is approximately half of the maximum storage capacity and placed away from the detection probe, and so on.
[0091] After obtaining the raw data containing a large amount of data, it is divided into a training set and a test set in a ratio of 80%:20%, which are used to train the model and test the model performance respectively.
[0092] Step SA2: preprocess the training set data to obtain preprocessed training data.
[0093] Step SA3, performing feature extraction on the preprocessed training data to obtain a plurality of training features, wherein the extracted training features at least include classification features corresponding to food types.
[0094] The specific operations of step SA2 and step SA3 are substantially the same as those of the above-mentioned step S2 and step S3, and are not described in detail herein.
[0095] Step SA4: Input multiple training features into the machine learning model, train the model with the loss function minimization as the training goal, and optimize the model parameters.
[0096] Among them, the machine learning model is subjected to multiple rounds of iterative training, and the training set data is divided into multiple batches. In each training round, one batch of the training set data is input into the model for training after preprocessing and feature extraction.
[0097] In this embodiment, the machine learning model is a gradient boosting decision tree model. During the training process, based on the training data, the model optimizes the model by gradually adding decision trees, and each step reduces the residual error of the current model. The corresponding expression is:
[0098] F m (x) = F m-1 (x)+αh m (x)
[0099] In the formula, F m (x) is the model after adding the mth decision tree, α is the learning rate, h m (x) is the mth tree.
[0100] The loss function adopts the square error loss function, which is expressed as:
[0101]
[0102] Where F(x) is the predicted value output by the model and y is the corresponding actual value.
[0103] In this embodiment, at each step (each training round), the negative gradient of the model is calculated as the pseudo residual, and the expression is:
[0104]
[0105] Then, a new decision tree is fitted to predict these pseudo residuals, and the fitted new decision tree is added to the model to update the model.
[0106] Step SA5, determining whether a predetermined iteration stop condition is reached.
[0107] The iteration stopping condition may be reaching a predetermined number of training rounds, or the model prediction accuracy reaching a predetermined standard, etc.
[0108] In this embodiment, after a round of training is completed, multiple evaluation indicators of the model are calculated, including at least accuracy (Accuray) and mean square error (MSE), and the iteration is stopped when all evaluation indicators reach predetermined values.
[0109] When the judgment is no, the process returns to step SA2, and after preprocessing and feature extraction of the next batch of training set data, it is input into the model for the next round of training.
[0110] Step SA6: when the judgment in step SA5 is yes, stop iteration and obtain the trained machine learning model.
[0111] Through the above steps, historical data or simulation data can be used to train the machine learning model, so that the model can establish the relationship between the nuclear radiation level and the food type characteristics and food weight characteristics, thereby obtaining a model that can predict the nuclear radiation level of each frozen food.
[0112] Step S5, generating visualization results based on the detection results of the nuclear radiation levels of various food types.
[0113] In this embodiment, a time series graph, a heat map, and a bar graph are generated based on the integrated data.
[0114] Figure 8 Schematic diagram of the time series diagram in this embodiment.
[0115] like Figure 8 As shown in the figure, according to the device ID of each refrigeration device, multiple nuclear radiation measurement values of the device and the corresponding timestamp, a time series diagram of the nuclear radiation measurement values of each refrigeration device is generated, in which the horizontal axis is time in hours; the vertical axis is the nuclear radiation measurement value in becquerels, and multiple broken lines correspond to multiple refrigeration devices. This can intuitively show the nuclear radiation level in each freezer at different time points and the change of the nuclear radiation level in each freezer over time.
[0116] In this embodiment, the time series graph is drawn using the chart library Chart.js.
[0117] Fig. 9 Schematic diagram of the heat map in this embodiment.
[0118] like Fig. 9 As shown, a heat map of the nuclear radiation measurement values of each refrigeration device is generated based on the device ID, device location, nuclear radiation measurement value and corresponding timestamp of each refrigeration device. The background in the figure is a regional map of the area where multiple refrigeration devices are located, and the foreground is multiple refrigeration devices (square boxes in the figure), and their nuclear radiation measurement values are marked with different colors, so as to intuitively display the distribution of nuclear radiation levels at different device locations in an area.
[0119] In this embodiment, the heat map is drawn using Mapbox, a tool of Geographic Information System (GIS).
[0120] Fig.10 Schematic diagram of the bar graph in this embodiment.
[0121] like Fig.10 As shown, a bar chart is generated based on each food type and its corresponding nuclear radiation prediction value. The horizontal axis in the chart is the food type, and the vertical axis is the mean of the nuclear radiation prediction value corresponding to the food type. Each bar in the chart represents the mean of the nuclear radiation prediction value of a food type.
[0122] Based on the above visualization results, administrators or loaders can better manage multiple refrigeration equipment and the frozen foods stored in them, and prevent consumers from purchasing frozen foods with excessive nuclear radiation levels from refrigeration equipment. For example, through the heat map, refrigeration equipment with high nuclear radiation levels can be intuitively and quickly found, and its equipment location can be clearly known, so that it can be quickly arranged for processing, and the processing priority can be arranged according to the nuclear radiation levels of multiple refrigeration equipment. When dealing with frozen foods with high / exceeding nuclear radiation levels, referring to the bar chart can intuitively and quickly know the type of food that is most likely to exceed the nuclear radiation level. Further combined with the time series chart, a batch of this type of food that was delivered at a specific time can be quickly and preliminarily located.
[0123] Functions and Effects of Embodiment 1
[0124] According to the method for analyzing the nuclear radiation level of frozen food provided by the present embodiment, the method comprises the steps of obtaining raw data, preprocessing the raw data, extracting features from the preprocessed data, inputting the extracted features into a machine learning model to predict the nuclear radiation level, and generating a visualization result based on the prediction result, wherein, since the raw data comprises the measured nuclear radiation data and the food data of the stored frozen food, and the extracted features comprise classification features corresponding to a plurality of food types, the machine learning model can output the prediction results of the nuclear radiation level of each food type. The present invention fills the gap in the prior art where there is no relevant analysis method, can quickly and accurately obtain the nuclear radiation level detection results of a large number of foods stored in a plurality of refrigeration equipment, and even when a plurality of types of food are mixed and placed in the refrigeration equipment, the nuclear radiation level of each type of food can be analyzed, so that the administrator and the loaders can timely discover and deal with the situation where the nuclear radiation of frozen food exceeds the standard, thereby ensuring that consumers can purchase safe frozen food.
[0125] In an embodiment, the machine learning model is a gradient boosting decision tree model, which optimizes the model by gradually adding decision trees, and each step reduces the residual of the current model, so the prediction performance of the model can be stably improved based on the training data.
[0126] Furthermore, the original data includes the measured nuclear radiation values, food types, food weights, and equipment locations in the refrigeration equipment. The data used for training also contains this information, so the model can learn the relationship between food types, food weights, and nuclear radiation levels, and output more accurate prediction results. In addition, the training data can use the actual operating data of multiple refrigeration equipment. Since such refrigeration equipment exists in large quantities in shopping malls, large supermarkets, etc., a large amount of valuable training data can be easily collected, and the model can be continuously trained as needed to improve its prediction accuracy.
[0127] Furthermore, the square error loss function is used in model training, and the negative gradient of the model is calculated as a pseudo residual in each training round. A new decision tree is fitted based on the pseudo residual, which can make the model converge quickly, improve the training efficiency of the model and the prediction accuracy of the final model.
[0128] Furthermore, the original data was preprocessed, including removing outliers, filling missing values, and standardizing the data. Since the original nuclear radiation measurement data is sparse and noisy, and is multi-source heterogeneous data, the fusion processing is relatively complicated. Therefore, the direct prediction effect using the original data is not ideal. After the above preprocessing, the data quality and analysis accuracy can be improved.
[0129] Furthermore, a variety of visualization results are generated based on the original data / preprocessed data, the prediction results of the model output, and information such as the equipment location, including time series graphs, heat maps, and bar graphs. These can provide administrators and loaders with intuitive and comprehensive information on the nuclear radiation levels of frozen foods, making it easier for administrators and loaders to better manage frozen foods stored in multiple refrigeration equipment, and to promptly detect and deal with nuclear contamination in the event of contamination, thereby ensuring that consumers can purchase safe frozen foods.
[0130] Furthermore, in the embodiment, raw data is collected once an hour and corresponding calculation and analysis is performed. Under the premise of ensuring that nuclear contamination can be discovered in a timely manner, the amount of data can be relatively reduced, thereby reducing the requirements for the capacity and computing power of the corresponding calculation and analysis devices.
[0131] Furthermore, in the embodiment, a nuclear radiation detection device for collecting nuclear radiation data is installed in a refrigeration device (freezer), and its detection probe faces the freezing chamber of the freezer, and the detection probe is set at a position close to the top opening of the freezer, so that food can be placed arbitrarily in the freezing chamber without affecting the work of the detection probe. In addition, after the nuclear radiation detection device measures the nuclear radiation data, the microprocessor performs preliminary signal processing and analog-to-digital conversion on it, and then sends it to the corresponding calculation and analysis device through wireless communication, that is, the nuclear radiation data is processed in a relatively distributed manner, which can reduce the burden of the calculation and analysis device; and the use of wireless communication to send nuclear radiation data does not require additional wiring for freezers set in scenes such as shopping malls, and the above-mentioned solution can be easily deployed using existing freezers, making the solution have good practical application value.
[0132] <Example 2>
[0133] This embodiment provides a method for analyzing nuclear radiation levels of frozen foods. In this embodiment, the same symbols are given to the same components as in the first embodiment and the corresponding descriptions are omitted.
[0134] Compared with the first embodiment, the difference lies in that, in the method of this embodiment, step S4 is different. Multiple features are input into the trained machine learning model, and the model outputs the classification result of whether the nuclear radiation level of each food type exceeds the standard, that is, the machine learning task is a classification task.
[0135] In this embodiment, other structures and methods are the same as those in the first embodiment, and thus will not be described again.
[0136] In addition, the method of this embodiment can also be used in combination with the method of embodiment 1, that is, the predicted value of the nuclear radiation level of each food type and the classification result of whether it exceeds the standard are obtained through two models respectively.
[0137] The above embodiments are only used to illustrate the specific implementation of the present invention, and the present invention is not limited to the description scope of the above embodiments. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only to illustrate the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for analyzing the nuclear radiation level of frozen food, used for analyzing the nuclear radiation level of frozen food stored in a refrigeration device, characterized in that: The following steps are involved: Step S1, obtaining nuclear radiation data and food data of frozen food, and integrating them into raw data to be analyzed; Step S2, preprocessing the original data to obtain preprocessed data; Step S3, extracting features from the preprocessed data to obtain a plurality of features, wherein the plurality of features at least include classification features corresponding to food types; Step S4, inputting the plurality of features into a trained machine learning model, and the model outputting a prediction result of the nuclear radiation level of each of the food types; and Step S5, generating a visualization result based on the nuclear radiation level prediction result of each of the food types.
2. The method for analyzing nuclear radiation levels of frozen foods according to claim 1, characterized in that: in, In step S1, the equipment data of the refrigeration equipment is also obtained, and the nuclear radiation data, the food data and the equipment data are integrated into the original data. The original data includes at least: the nuclear radiation measurement value in the refrigeration equipment, the acquisition time of the nuclear radiation measurement value, the equipment location of the refrigeration equipment, the food type, and the food weight.
3. The method for analyzing nuclear radiation levels of frozen foods according to claim 2, Features: Wherein, step S2 includes the following sub-steps: Step S2-1, using the interquartile range method to remove outliers in the original data; Step S2-2, for the original data after removing the outliers, fill the missing values therein by using a linear interpolation method or a mean filling method; and Step S2-3, standardizing the original data after filling the missing values to obtain the preprocessed data.
4. The method for analyzing nuclear radiation levels of frozen foods according to claim 3, characterized in that: in, In step S2-1, for the plurality of nuclear radiation measurement values, the first quartile Q1 and the third quartile Q3 are calculated, and a normal value range is obtained based thereon, and data points exceeding the normal value range are removed, wherein the upper limit of the normal value range is Q1-1.5*IQR, and the lower limit is Q3+1.5*IQR. In step S2-3, the Z-score standardization method is used to normalize the multiple nuclear radiation measurement values.
5. The method for analyzing nuclear radiation levels of frozen foods according to claim 2, characterized in that: in, In step S3, the classification feature is a binary vector obtained by encoding the food type using one-hot encoding. The extracted features also include time features, food weight features and nuclear radiation measurement value features.
6. The method for analyzing nuclear radiation level of frozen food according to claim 5, Features: Wherein, the machine learning model is a gradient boosting decision tree model, In step S4, the machine learning model outputs a predicted value of the nuclear radiation level of each of the food types according to the input multiple features, and compares the predicted value of the nuclear radiation level of each of the food types with a predetermined corresponding nuclear radiation level safety threshold, so as to determine whether the nuclear radiation level of each of the food types exceeds the standard; or In step S4, the machine learning model outputs a classification result of whether the nuclear radiation level of each type of food exceeds the standard based on the input multiple features.
7. The method for analyzing nuclear radiation levels of frozen foods according to claim 6, Features: The process of training the machine learning model includes the following steps: Step SA1, obtaining the nuclear radiation data and the food data of the frozen food, and obtaining the equipment data of the refrigeration equipment of the frozen food, integrating the nuclear radiation data, the food data and the equipment data into data for model training, and dividing the data into a training set and a test set according to a predetermined ratio; Step SA2, preprocessing the data of the training set to obtain preprocessed training data; Step SA3, performing feature extraction on the preprocessed training data to obtain a plurality of training features, including at least classification features corresponding to the food type; Step SA4, inputting the plurality of training features into the machine learning model, training the machine learning model with minimization of the loss function as the training objective, and optimizing the model parameters; Step SA5, determining whether a predetermined iteration stop condition is reached; Step SA6: when the judgment in step SA5 is yes, stop iteration and obtain the trained machine learning model.
8. The method for analyzing nuclear radiation levels of frozen foods according to claim 7, characterized in that: in, In step SA4, the loss function is a square error loss function: Where F(x) is the predicted value output by the machine learning model, and y is the corresponding actual value. In each training round, the negative gradient of the gradient boosting decision tree model is calculated as the pseudo residual: And fit a new decision tree to predict the pseudo residual, and add the new decision tree to the gradient boosting decision tree model to update the model: F m (x)=F m-1 (x)+αh m (x) In the formula, F m (x) is the model after adding the mth decision tree, α is the learning rate, h m (x) is the mth tree.
9. The method for analyzing nuclear radiation levels of frozen foods according to claim 7, characterized in that: in, In step SA5, the iteration stopping condition is that one or more evaluation indicators of the machine learning model reach a predetermined value. The evaluation index includes any one or more of accuracy and mean square error.
10. The method for analyzing nuclear radiation level of frozen food according to claim 1, Features: Wherein, in step S5, the generated visualization result includes: A time series graph, one axis of which is time and the other axis is the corresponding nuclear radiation measurement value, and each broken line or curve corresponds to one of the refrigeration devices; a heat map, the background of which is a regional map of the area where one or more of the refrigeration equipment is located, and the foreground is a graphic marked with different colors / different depths, the position of the graphic in the regional map corresponds to the device location of the refrigeration equipment, and the color / depth corresponds to the nuclear radiation measurement value; and / or A bar chart, one axis of which is one or more food types, and the other axis is the mean of the predicted nuclear radiation values corresponding to each of the food types, and each bar in the chart represents the mean of the predicted nuclear radiation values of one of the food types.