A food on-site rapid detection system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SIECAN TECH CO LTD
- Filing Date
- 2024-12-05
- Publication Date
- 2026-06-26
AI Technical Summary
The existing food traceability system is inadequate in terms of authenticity verification and traceability efficiency, and lacks effective supervision of rapid food testing results.
The system uses a handheld PDA terminal to acquire visual and spectral images of food surfaces. Combined with the blockchain technology of the PTS platform, it performs food quality, microbial, and pesticide testing. It utilizes defect image detection models, color unevenness detection models, spectral microbial detection models, and spectral pesticide safety detection models, and achieves accurate judgment and uploading of test results through smart contracts.
It has enabled accurate supervision of food quality, prevented cheating of test results, reduced testing costs, and achieved effective supervision of pesticide residues on food surfaces.
Smart Images

Figure CN119643464B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of food safety testing technology, and in particular to a rapid on-site food testing system. Background Technology
[0002] The existing traceability system still has shortcomings in terms of authenticity verification and traceability efficiency.
[0003] For example, the patent document with application number 202311091008.9 only discloses how to avoid the decline in the accuracy of food rapid test results, without mentioning how to effectively supervise the results of food rapid tests.
[0004] Therefore, how to achieve rapid on-site food testing to reduce food testing costs and strengthen the supervision of food testing through the platform's blockchain technology are technical problems that need to be solved. Summary of the Invention
[0005] To address this, the present invention provides a rapid on-site food testing system that uses a handheld PDA terminal to quickly acquire visual and spectral images of the food surface. The system then uses the blockchain on the PTS platform to perform mandatory testing on the images to determine whether the food meets standards for quality, microorganisms, and pesticides. This avoids cheating of test results due to a lack of personnel supervision and achieves a low-cost rapid food testing and supervision process.
[0006] To achieve the above objectives, the present invention proposes a rapid on-site food testing system, comprising:
[0007] PDA terminals are used for on-site law enforcement rapid inspection of food, including RFID information collectors for obtaining electronic food certificates, spectral imagers for obtaining spectral images of food, and visual sensors for obtaining images of food surfaces.
[0008] The food regulatory information traceability PTS platform communicates with the PDA terminal. The blockchain it carries stores the traceability and testing information of food. It includes a food matching module, a testing model matching module, a pesticide testing model adding module, a testing identification module, and a testing result generation module.
[0009] The food matching module is connected to the detection model matching module and the pesticide detection model addition module, and is used to extract the food traceability detection information corresponding to the food electronic certificate from the traceability detection information through the blockchain smart contract;
[0010] The detection model matching module is used to extract multiple detection models corresponding to the food types included in the electronic food certificate from the traceability detection information through the smart contract of the blockchain.
[0011] The pesticide detection model is augmented with a module to add a spectral pesticide safety detection model to the detection model based on the food traceability risk determined by the food traceability detection information.
[0012] The detection and identification module is connected to the detection model matching module and the pesticide detection model addition module, and is used to identify and detect the food spectral image and the food surface image through the detection model to generate detection parameters;
[0013] The detection result generation module is connected to the detection and identification module. It generates parameter thresholds based on the food traceability detection information, determines the detection result by comparing the detection parameters and parameter thresholds, and uploads the detection result to the blockchain through a smart contract.
[0014] The food includes fruits and vegetables, the food traceability and detection information includes variety, place of origin and pesticides used, the detection model includes a defect image detection model based on convolutional neural network, a color unevenness image detection model based on support vector machine, a spectral microbial detection model and the spectral pesticide safety detection model, and the detection parameters include at least the number of defects and color unevenness.
[0015] Furthermore, the defect image detection model is used to identify the number of defects on the food surface in the food surface image;
[0016] The color unevenness image detection model is used to identify color unevenness within a feature range in the food surface image.
[0017] Furthermore, the color unevenness image detection model calculates the color unevenness by using the difference between the brightness values and the squared difference of the RGB values at multiple sampling points.
[0018] Furthermore, the detection result generation module is used to determine the defect quantity threshold and the color unevenness threshold based on the place of origin and the variety, and to determine whether the food quality is qualified based on the comparison between the defect quantity and the defect quantity threshold, and the comparison between the color unevenness and the color unevenness threshold.
[0019] The above solution enables adjustments to the testing and judgment process based on food origin information from the traceability platform, thus achieving accurate supervision of food quality.
[0020] Furthermore, the spectral microbial detection model includes a characteristic wavelength extraction unit and a microbial detection unit;
[0021] The feature wavelength extraction unit is used to obtain the feature wavelengths of microorganisms in the food spectral image through a spectral projection gradient algorithm.
[0022] The microbial detection unit is a support vector machine model used to generate a predicted total number of colonies based on the characteristic wavelength;
[0023] The detection result generation module is used to determine whether food is contaminated by microorganisms based on the comparison between the predicted total colony count and the total colony count threshold.
[0024] The microorganisms mentioned include Escherichia coli.
[0025] Furthermore, the spectral pesticide safety detection model is a principal component analysis model used to identify the amount of pesticide residues on the food surface in the food spectral image.
[0026] Furthermore, the pesticide detection model is augmented with modules including a pesticide spectral detection model generation unit and a pesticide spectral model verification unit;
[0027] The pesticide spectral detection model generation unit is used to determine whether to add a spectral pesticide safety detection model for the applied pesticide type based on the pesticide metabolism capacity level of the variety and historical data on pesticide residues on the surface of the same variety of food.
[0028] The pesticide spectral model verification unit uploads the verified spectral pesticide safety detection model to the blockchain.
[0029] Furthermore, the pesticide spectral detection model generation unit is used to extract the spectral images of food with qualified pesticide application and food with unqualified pesticide application from the blockchain, compare them, determine the additional pesticide characteristic wavelengths within the pesticide wavelength range, and add the additional pesticide characteristic wavelengths to the spectral pesticide safety detection model.
[0030] The above scheme enables effective detection and supervision of various pesticide residues on food surfaces.
[0031] Furthermore, the PDA terminal is applied to the distribution of food, including production, storage, transportation, and sales.
[0032] The food regulatory information traceability PTS platform also includes a process early warning module;
[0033] The aforementioned early warning module is used to determine if the test results of the same type of food are unqualified in the distribution process, and uploads the distribution process to the blockchain so that regulatory authorities can receive the distribution process through the blockchain.
[0034] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0035] 1. By using a handheld PDA terminal, visual and spectral images of the food surface can be quickly acquired. The PTS platform's blockchain is used to perform mandatory detection on the images to determine whether the food quality, microorganisms, and pesticides meet the standards. This avoids the possibility of cheating on test results due to a lack of personnel supervision, and achieves a low-cost rapid food detection and supervision process.
[0036] 2. It enables the adjustment of the testing and judgment process based on the food origin information of the traceability platform, thus achieving accurate supervision of food quality.
[0037] 3. It enables effective detection and supervision of various pesticide residues on food surfaces. Attached Figure Description
[0038] Figure 1 This is a schematic diagram of the general structure of the on-site rapid food testing system according to an embodiment of the present invention;
[0039] Figure 2 This is a schematic diagram of the detection process of the on-site rapid food detection system according to an embodiment of the present invention;
[0040] Figure 3 This is a schematic diagram of the PTS platform structure of the food on-site rapid testing system according to an embodiment of the present invention;
[0041] Figure 4 This is a schematic diagram of the microbial spectral image of the food rapid on-site detection system according to an embodiment of the present invention.
[0042] Figure 5 This is a schematic diagram of the structure of a rapid on-site food testing system according to an embodiment of the present invention. Detailed Implementation
[0043] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0044] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0045] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.
[0046] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0047] like Figures 1 to 5 As shown, this invention provides a rapid on-site food testing system that uses a handheld PDA terminal to quickly acquire visual and spectral images of the food surface. The system uses the blockchain of the PTS platform to detect and determine whether the food quality, microorganisms, and pesticides meet the standards. This avoids the possibility of cheating in test results due to a lack of personnel supervision and achieves a low-cost rapid food testing and supervision process.
[0048] like Figures 1 to 5 As shown, this embodiment proposes a rapid on-site food inspection system, including: a PDA terminal for conducting rapid on-site law enforcement inspections of food, including an RFID information collector for obtaining electronic food certificates, a spectral imager for obtaining spectral images of food, and a visual sensor for obtaining images of the food surface.
[0049] The Food Supervision Information Traceability (PTS) platform communicates with the PDA terminal. Its blockchain stores food traceability and testing information. The platform includes a food matching module, a testing model matching module, a pesticide testing model adding module, a testing identification module, and a testing result generation module. The food matching module is connected to the testing model matching module and the pesticide testing model adding module, and is used to extract the food traceability and testing information corresponding to the electronic food certificate from the traceability and testing information through the blockchain's smart contract. The testing model matching module is used to extract multiple testing models corresponding to the food types included in the electronic food certificate from the traceability and testing information through the blockchain's smart contract. The pesticide testing model adding module is used to add spectral pesticide safety testing models to the testing models based on the food traceability risks determined by the food traceability and testing information. The detection and identification module is connected to the detection model matching module and the pesticide detection model addition module, and is used to identify and detect the food spectral image and the food surface image through the detection model to generate detection parameters; the detection result generation module is connected to the detection and identification module, generates parameter thresholds based on the food traceability detection information, determines the detection result by comparing the detection parameters and the parameter thresholds, and uploads the detection result to the blockchain through a smart contract; wherein, the food includes fruits and vegetables, the food traceability detection information includes variety, place of origin and pesticides applied, the detection model includes a defect image detection model based on convolutional neural network, a color unevenness image detection model based on support vector machine, a spectral microorganism detection model and the spectral pesticide safety detection model, and the detection parameters include at least the number of defects and color unevenness.
[0050] Specifically, see Figure 5 The PDA terminal has an RFID information collector and wirelessly communicates with the spectral imager and the visual sensor. It uploads food spectral images and food surface images to the Food Supervision Information Traceability Platform (PTS). The PDA terminal and the PTS platform communicate in real-time via a LoRa gateway and NB-IoT. The PDA terminal's microcontroller is a low-power, solar-powered single-chip microcomputer with sleep and communication modes to enable interconnection between the sensing, transmission, and application layers without requiring power or charging.
[0051] Understandably, the Food Safety Information Traceability Platform (PTS) utilizes blockchain technology to ensure the authenticity, immutability, and traceability of traceability information. This brings every step of the food supply chain under regulatory oversight, enabling rapid identification, accurate tracing, and swift action upon detecting any anomalies. Therefore, the PTS platform monitors the online status and testing data of each monitoring point in real time, automatically performs data analysis and statistics, and generates regulatory reports to help regulatory authorities promptly grasp the food safety situation. The platform supports multi-level permission settings, enabling tiered access and management of data to ensure data security.
[0052] Furthermore, the image quality detection model includes a defect image detection model, and the detection parameters include the number of defects; the defect image detection model is an image recognition model based on a convolutional neural network, used to identify the number of defects on the food surface in the surface image.
[0053] Specifically, the convolutional neural network (CNN) of the defect image detection model is implemented based on the YOLOv8 CNN and the WHU-Hi dataset. The WHU-Hi dataset has undergone rigorous preprocessing to ensure data quality and accuracy. YOLOv8 is a next-generation algorithm model developed by Ultralytics after YOLOv5, supporting image classification and object detection tasks. The CNN model includes: a new backbone network, a new Ancher-Free detection head, and a new loss function. Detection based on the YOLOv8 model and the WHU-Hi dataset is achieved using the YOLOv8 CNN model. A detection sub-interface system is built on the Food Safety Supervision and Traceability System (PTS) platform using the Pyside6 library, completing the development of detection interfaces for spectral images and food surface images. By adjusting the detection confidence threshold and IOU threshold of the YOLOv8 model, the detection accuracy is made more suitable.
[0054] The WHU-Hi dataset contains images of various common fruits and vegetables, such as bok choy, potatoes, sweet potato leaves, Chinese cabbage, oat lettuce, lettuce, water spinach, red amaranth, carrots, cauliflower, celery, eggplant, spinach, garlic sprouts, broccoli, peppers, baby bok choy, cucumbers, cherries, apples, and pears. To minimize image distortion without affecting detection accuracy, all images were resized to 640x640 pixels while maintaining their original aspect ratio. Furthermore, to enhance the model's generalization ability and robustness, data augmentation techniques were used, including random rotation, scaling, cropping, and color transformation, to expand the dataset and reduce the risk of overfitting.
[0055] It should be noted that the defects described in this embodiment are downy mildew less than 5 square centimeters, leaf spot less than 5 square centimeters, surface pits / damage, and yellowing / rotting leaves.
[0056] Furthermore, the image quality detection model also includes a color unevenness image detection model, and the detection parameters also include color unevenness; the color unevenness image detection model is an image recognition model based on support vector machines, used to identify color unevenness within a feature range in the surface image.
[0057] It is understandable that Support Vector Machine (SVM) is a supervised learning method for classification based on margin maximization, which can be applied to high-dimensional data. The color unevenness image detection model utilizes the SVC program in sklearn.SVM, selecting RBF as the kernel function, and combining it with a random search method within the range of 0.1-1000 and... The optimal penalty factor and kernel function hyperparameters are determined through an internal search. Then, the feature range in the surface image can be identified based on the feature ranges labeled in the WHU-Hi dataset. The feature range is the middle of the peel for fruits and the middle of the leaves for vegetables.
[0058] Furthermore, the color unevenness image detection model calculates the color unevenness by using the difference between the brightness values and the squared difference of the RGB values at multiple sampling points.
[0059] The color unevenness is calculated using a color difference formula, specifically:
[0060]
[0061] In the formula, △L, △A, and △B are the squared differences of the values of multiple sampling points within the feature range, △L is the brightness difference, △A is the red-green difference of the RGB values, △B is the yellow-blue difference of the RGB values, and the comprehensive color difference △E is the comprehensive color difference, i.e., the color unevenness.
[0062] Furthermore, the detection result generation module is used to determine the defect quantity threshold and the color unevenness threshold based on the place of origin and the variety, and to determine whether the food quality is qualified based on the comparison between the defect quantity and the defect quantity threshold, and the comparison between the color unevenness and the color unevenness threshold.
[0063] Specifically, the detection result generation module is used to determine a defect quantity threshold based on the temperature of the place of origin and the variety; the detection result generation module is used to generate a color unevenness threshold based on the temperature of the place of origin and the duration of light exposure; the detection result adjustment module is used to determine whether the food quality is qualified based on the comparison between the defect quantity and the defect quantity threshold, and the comparison between the color unevenness and the color unevenness threshold.
[0064] Understandably, for example, under high temperatures, the metabolic rate of fruits and vegetables increases, which may cause the skin to ripen too quickly and wrinkle. If the fruits and vegetables maintain this degree of ripeness during transportation, it means that the quality of the fruits and vegetables is qualified. Therefore, it is impossible to judge whether the food has changed during transportation by using a fixed threshold for the number of defects.
[0065] Specifically, the average temperature and temperature range of the production area over the past three months are used as conditions. The temperature range reflects whether extreme weather conditions have occurred. The threshold for the number of defects of the corresponding level is determined by classifying the average temperature and temperature range. Specifically, the climate condition level includes defect level one to defect level five in ascending order. The classification standards are as follows: average temperature less than 10℃ and / or temperature range greater than 5℃; average temperature greater than 10℃ and less than 15℃ and temperature range greater than 5℃; average temperature greater than 15℃ and less than 25℃ or temperature range greater than 8℃; average temperature greater than 15℃ and less than 25℃ and temperature range greater than 8℃; average temperature greater than 25℃ or temperature range greater than 10℃. The defect quantity thresholds corresponding to defect levels one through five are generated by increasing the initial defect quantity threshold for each variety by 4, 8, 10, 15, and 20 respectively. These thresholds are all set based on the detection window area of the surface image described in this embodiment. The defect quantity threshold for each defect level can also be adjusted according to its visual sensor or the set detection window area. The surface image corresponding to each defect level is uploaded to the blockchain for easy monitoring. For example, the initial defect quantity for Shanghai bok choy, sweet potato leaves, Guangdong choy sum, oat lettuce, lettuce, water spinach, and red amaranth is 10.
[0066] It is understandable that the temperature and duration of sunlight in the production area affect the growth and development of fruits and vegetables, thereby influencing their skin color. The production area refers not only to the geographical location of the fruits and vegetables but also to whether they are grown in greenhouses, using either natural or artificial light. The duration of sunlight refers to the average daily duration, determined based on the average daily duration of sunlight in the production area over the past three months, with artificial light sources specified to have a duration of 13 hours per day.
[0067] Specifically, the temperature and light duration levels include growth levels one through five, increasing sequentially. The grading criteria are as follows: average temperature less than 10℃ and / or light duration less than 12 hours / day; average temperature greater than 10℃ and less than 15℃ with light duration greater than 12 hours / day and less than or equal to 13 hours / day; average temperature greater than 15℃ and less than 25℃ or light duration greater than 12 hours / day and less than or equal to 13 hours / day; average temperature greater than 15℃ and less than 25℃ with light duration greater than 13 hours / day and less than or equal to 14 hours / day; and average temperature greater than 25℃ or light duration greater than 14 hours / day. The color unevenness thresholds corresponding to growth levels one through five are 10, 15, 20, 30, and 40, respectively. The surface images corresponding to each growth level are uploaded to the blockchain for easy monitoring.
[0068] Preferably, when the number of defects exceeds a defect number threshold and the color unevenness exceeds a color unevenness threshold, the food quality is judged to be substandard, thus avoiding inaccurate judgment based on a single factor.
[0069] The above solution enables the adjustment of the testing and judgment process based on the food origin information of the traceability platform, thus achieving accurate supervision of food quality.
[0070] Furthermore, the spectral microbial detection model includes a feature wavelength extraction unit and a microbial detection unit; the feature wavelength extraction unit is used to obtain the feature wavelengths of microorganisms in the food spectral image through a spectral projection gradient algorithm; the microbial detection unit is a support vector machine model, used to generate a predicted total colony count based on the feature wavelengths; the detection result generation module is used to determine whether the food is contaminated by microorganisms based on a comparison between the predicted total colony count and a total colony count threshold; wherein, the microorganisms include Escherichia coli.
[0071] The Spectral Projection Gradient (SPA) algorithm is used for feature band selection because the original full-band spectral image data is large and contains a lot of redundancy and collinearity, which can severely reduce the prediction accuracy and computation speed of the model. The SPA algorithm employs a forward selection method for feature bands. This method selects one wavelength initially, iterates forward, calculates the projection vectors of other wavelengths at that wavelength, selects the wavelength corresponding to the vector with the largest projection value, and combines it with the initial wavelength until the loop ends. Therefore, the feature bands extracted using the SPA algorithm have low collinearity and low redundancy, and can represent the overall spectral information of the sample.
[0072] Specifically, see Figure 4 It represents a false-color image of apple samples with different levels of contamination. Figure 4The portion enclosed by a long, sparse dashed line is identified as the area containing microbial colonies. The pseudo-color image is derived by extracting the corresponding microbial colony characteristic wavelengths / content characteristic wavelengths from the full spectrum of the spectral imager. Specifically, the microbial colony characteristic wavelengths are set to the characteristic wavelength range of pesticides, i.e., 200 to 340 nm. A support vector machine model is then generated. The more microbial colonies there are, the more the color in the pseudo-color image gradually changes from blue to yellow, and then to red. In this way, the grayscale image predicted by pseudo-color processing can intuitively determine the degree of microbial contamination on the surface of fruits and vegetables.
[0073] Furthermore, the spectral pesticide safety detection model is a principal component analysis model used to identify the amount of pesticide residues on the food surface in the food spectral image.
[0074] Understandably, principal component analysis (PCA) is a multivariate statistical method based on dimensionality reduction, used to transform numerous indicators into a few comprehensive indicators. The higher the contribution rate of each principal component, the stronger its influence. This method considers the relationships between original variables, seeks comprehensive alternative targets for related variables, and minimizes information loss during the transformation process.
[0075] Specifically, multiple points in the food spectral image are used as evaluation objects, and the characteristic wavelengths of various pesticides are used as indicator variables. The principal component analysis model is used to calculate the principal component comprehensive score, and the principal component comprehensive score is used as the amount of pesticide residue on the food surface.
[0076] Specifically, see Figure 4 It represents a false-color image of apple samples with different levels of contamination. Figure 4 The densely dotted lines in the image indicate areas with pesticide residues. The pseudo-color image is derived by extracting the corresponding pesticide characteristic wavelengths / content characteristic wavelengths from the full spectrum of the spectral imager. Specifically, the pesticide characteristic wavelengths are set to the characteristic wavelength range of pesticides, i.e., 340nm to 690nm. Through principal component analysis, the types of pesticides such as imidacloprid, benzyl dichlorvos, soybean seed dressing agents, and organophosphorus pesticides can be detected. The higher the pesticide residue, the more the color in the pseudo-color image gradually changes from blue to yellow, and then to red. In this way, the grayscale image predicted by pseudo-color processing can intuitively determine the degree of internal contamination of the fruit.
[0077] Furthermore, the pesticide detection model addition module includes a pesticide spectral detection model generation unit and a pesticide spectral model confirmation unit; the pesticide spectral detection model generation unit is used to determine whether to add a spectral pesticide safety detection model for the applied pesticide type based on the pesticide metabolism capacity level of the variety and historical data on pesticide residues on the surface of the same variety of food; the pesticide spectral model confirmation unit uploads the confirmed spectral pesticide safety detection model to the blockchain.
[0078] Different fruit and vegetable varieties have different physiological structures, biochemical characteristics, and genetic backgrounds, resulting in some varieties having stronger enzyme systems that can more effectively metabolize and degrade pesticides, while others have weaker metabolic capabilities.
[0079] Specifically, the pesticide metabolism capacity level L is determined by classifying the pesticide application amount of fruit and vegetable varieties at the production end based on the data recorded on the platform. The number of times C of pesticide residue exceeding the pesticide residue threshold is determined based on historical data of pesticide residue levels on the surface of the same batch and variety of food. The product of the pesticide metabolism capacity level L and the number of times C is used is compared with the pesticide detection model's threshold to determine whether to increase the spectral pesticide safety detection model for the applied pesticide type.
[0080] Furthermore, the pesticide spectral detection model generation unit is used to extract the spectral images of food with qualified pesticide application and food with unqualified pesticide application from the blockchain, compare them, determine the additional pesticide characteristic wavelengths within the pesticide wavelength range, and add the additional pesticide characteristic wavelengths to the spectral pesticide safety detection model.
[0081] Specifically, the characteristic wavelength of pesticides is added as a new indicator variable to the original sample matrix, thereby increasing the number of columns in the original sample matrix.
[0082] The above scheme enables effective detection and supervision of various pesticide residues on food surfaces.
[0083] Furthermore, the PDA terminal is applied to the distribution process of food, including production, storage, transportation, and sales. The food regulatory information traceability PTS platform also includes a process early warning module. The process early warning module is used to determine if the test results of the same type of food are unqualified in a distribution process, and upload the distribution process to the blockchain so that regulatory authorities can receive the distribution process through the blockchain.
[0084] Specifically, the quality grade generation algorithm is as follows: In the formula, Q represents the quality grade, S represents the defect area, W represents the detection window area (the ratio of the defect area to the detection window area is rounded down to indicate the defect severity), L represents the correction value for different spectral imagers, and k is a setting parameter, which is set according to the defect type information. More specifically, the defect type information is 1, 8, 5, and 2 for dents, corrosion, discoloration, and deformation, respectively. The value for a quality grade that is unqualified is greater than 15, the value for a quality grade that is at risk is less than or equal to 15 but greater than 5, and the value for a quality grade that is good is less than or equal to 5.
[0085] Specifically, the quality grade is a weighted average of the pre-quality grade and the aforementioned quality grade Q. In the production stage, pesticide residues may be higher and will be removed naturally in subsequent transportation stages, so image detection is preferred to prevent food with obvious defects from circulating. In this case, their weights are 0.3 and 0.7, respectively. In the storage stage, image detection is preferred, with weights of 0.4 and 0.6, respectively. In the transportation stage, spectral detection is preferred, with weights of 0.6 and 0.4, respectively, to prevent food with pesticide residues from further circulating. In the sales stage, spectral detection and image detection are equally important, with weights of 0.5 and 0.5, respectively.
[0086] Furthermore, the food regulatory information traceability PTS platform also includes a boundary extraction module, which is used to perform optical correction and background removal on the spectral image in order to determine the food boundary of the surface image.
[0087] The above solution enables accurate determination of food quality grade through visual sensors.
[0088] Furthermore, the regulatory cloud platform also includes an early warning module, which determines the stage where the quality level has decreased based on the comparison results of multiple quality levels of food at multiple stages on the regulatory cloud platform, and generates early warning information.
[0089] Furthermore, the food regulatory information traceability PTS platform also includes a regulatory report generation module, which is used to generate a topological regulatory report from the electronic certificates, odor data, spectral images, surface images and quality grades of food at multiple stages, and send and display the test report to the user terminal.
[0090] The above-mentioned solution, through the regulatory cloud platform, enables the interconnection and interoperability of regulatory information in the production, storage, transportation and sales of food, and realizes intelligent judgment of potential risk points, providing decision support for regulatory authorities.
[0091] See Figure 3 Taking food safety supervision in a certain region as an example, the regulatory department uses the PDA terminal provided in this embodiment to implement an integrated intelligent supervision system for rapid on-site food safety enforcement and monitoring, conducting rapid testing on food production and distribution within its jurisdiction. After acquiring test data through the rapid testing PDA terminal, the data is uploaded in real time to the Food Supervision Information Traceability Platform (PTS). The PTS automatically filters, corrects, and issues warnings based on the test data, and promptly feeds the results back to the regulatory department. Simultaneously, the regulatory department can view historical test data, analyze risk trends, and formulate targeted regulatory measures through the system. Furthermore, the system also supports full traceability through electronic certificates, ensuring controllable food quality.
[0092] The integrated intelligent regulatory system combining a PDA terminal and a food regulatory information traceability PTS platform provided in this embodiment enables rapid on-site enforcement and monitoring of food safety. By integrating a rapid testing instrument, a testing cloud platform, a data management module, and an intelligent analysis module, it achieves rapid detection, real-time monitoring, and full traceability of food safety. This system boasts advantages such as a wide detection range, high accuracy, and ease of operation, significantly improving the efficiency and level of food safety supervision and safeguarding the public's food safety.
[0093] Understandably, using a handheld PDA terminal to quickly acquire visual and spectral images of food surfaces, and then using the PTS platform's blockchain to enforce detection and judgment of food quality, microbial content, and pesticide residues, avoids the possibility of cheating due to a lack of personnel supervision, thus achieving a low-cost, rapid food inspection and supervision process. It also allows for adjustments to the inspection and judgment process based on food origin information from the traceability platform, enabling accurate supervision of food quality. Furthermore, it enables effective detection and supervision of multiple pesticide residues on food surfaces.
[0094] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0095] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A rapid on-site food testing system, characterized in that, include: PDA terminals are used for on-site law enforcement rapid inspection of food, including RFID information collectors for obtaining electronic food certificates, spectral imagers for obtaining spectral images of food, and visual sensors for obtaining images of food surfaces. The food regulatory information traceability PTS platform communicates with the PDA terminal. The blockchain it carries stores the traceability and testing information of food. It includes a food matching module, a testing model matching module, a pesticide testing model adding module, a testing identification module, and a testing result generation module. The food matching module is connected to the detection model matching module and the pesticide detection model addition module, and is used to extract the food traceability detection information corresponding to the food electronic certificate from the traceability detection information through the blockchain smart contract; The detection model matching module is used to extract multiple detection models corresponding to the food types included in the electronic food certificate from the traceability detection information through the smart contract of the blockchain. The pesticide detection model is augmented with a module to add a spectral pesticide safety detection model to the detection model based on the food traceability risk determined by the food traceability detection information. The detection and identification module is connected to the detection model matching module and the pesticide detection model addition module, and is used to identify and detect the food spectral image and the food surface image through the detection model to generate detection parameters; The detection result generation module is connected to the detection and identification module. It generates parameter thresholds based on the food traceability detection information, determines the detection result by comparing the detection parameters and parameter thresholds, and uploads the detection result to the blockchain through a smart contract. The food includes fruits and vegetables, the food traceability and detection information includes variety, place of origin and pesticides used, the detection model includes a defect image detection model based on convolutional neural network, a color unevenness image detection model based on support vector machine, a spectral microbial detection model and the spectral pesticide safety detection model, and the detection parameters include at least the number of defects and color unevenness. The spectral pesticide safety detection model is a principal component analysis model used to identify the amount of pesticide residues on the food surface in the food spectral image. The pesticide detection model is augmented with modules including a pesticide spectral detection model generation unit and a pesticide spectral model verification unit. The pesticide spectral detection model generation unit is used to determine whether to add a spectral pesticide safety detection model for the applied pesticide type based on the pesticide metabolism capacity level of the variety and historical data on pesticide residues on the surface of the same variety of food. The pesticide spectral model verification unit uploads the verified spectral pesticide safety detection model to the blockchain; The pesticide spectral detection model generation unit is used to extract the spectral images of food that has been treated with pesticides in the blockchain, compare them with the spectral images of food that has been treated with pesticides but has not, determine the additional pesticide characteristic wavelengths within the pesticide wavelength range, and add the additional pesticide characteristic wavelengths to the spectral pesticide safety detection model.
2. The food on-site rapid detection system according to claim 1, characterized in that, The defect image detection model is used to identify the number of defects on the food surface in the food surface image; The color unevenness image detection model is used to identify color unevenness within a feature range in the food surface image.
3. The food on-site rapid detection system according to claim 2, characterized in that, The color unevenness image detection model calculates the color unevenness by using the brightness values and the squared difference of the RGB values from multiple sampling points.
4. The food on-site rapid detection system according to claim 3, characterized in that, The test result generation module is used to determine the defect quantity threshold and the color unevenness threshold according to the place of origin and the variety, and to determine whether the food quality is qualified by comparing the defect quantity and the defect quantity threshold, and comparing the color unevenness and the color unevenness threshold.
5. The food on-site rapid detection system according to any one of claims 1 to 4, characterized in that, The spectral microbial detection model includes a characteristic wavelength extraction unit and a microbial detection unit; The feature wavelength extraction unit is used to obtain the feature wavelengths of microorganisms in the food spectral image through a spectral projection gradient algorithm. The microbial detection unit is a support vector machine model used to generate a predicted total number of colonies based on the characteristic wavelength; The detection result generation module is used to determine whether food is contaminated by microorganisms based on the comparison between the predicted total colony count and the total colony count threshold. The microorganisms mentioned include Escherichia coli.
6. The food on-site rapid detection system according to any one of claims 1 to 4, characterized in that, The PDA terminal is used in the distribution of food, including production, storage, transportation and sales. The food regulatory information traceability PTS platform also includes a process early warning module; The aforementioned early warning module is used to determine if the test results of the same type of food are unqualified in the distribution process, and uploads the distribution process to the blockchain so that regulatory authorities can receive the distribution process through the blockchain.