Production process visualized agricultural product quality tracing generation method
Through real-time image processing at the edge, a structured traceability unit containing key operation evidence is generated, which solves the problems of data redundancy and retrieval difficulty in the production process and realizes efficient and accurate traceability of agricultural product quality.
Patent Information
- Application Number
- CN202511271714.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-08
AI Technical Summary
In the existing technology of long-term large-scale production process monitoring, continuous video recording leads to data redundancy and difficulty in retrieval, and post-analysis cannot change the front-end data generation method, resulting in high computing resource consumption and inefficient retrieval.
The technology maintains static visual baselines and dynamic visual baselines in parallel at the edge, and generates structured traceability units containing key operation evidence through real-time image processing, including difference detection between environmental visual baselines and dynamic visual baselines, causal spatial proximity verification, and temporal authenticity verification.
The image data generation is transformed from continuous recording to event-responsive generation, which reduces data redundancy, improves retrieval efficiency, ensures the time and causal accuracy of the traceability unit, and reduces computing resource consumption.
Smart Images

Figure CN120746408A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for generating agricultural product quality traceability with production process visualization, and belongs to the technical field of image data processing. Background Art
[0002] Currently, a widely accepted approach involves continuously capturing visual information from specific scenes using video cameras and using the resulting continuous video stream as the primary basis for subsequent analysis, verification, or traceability. Its core value lies in theoretically preserving a continuous visual record of the scene over time, providing a basis for subsequent analysis. However, when this approach is applied to production process monitoring scenarios requiring long-term, large-scale deployment, an inherent contradiction in its data processing becomes increasingly prominent: the very act of continuous recording leads to a mismatch between information and the data carrier. Specifically, critical operations with high traceability value in the production process, such as fertilizer application, are discrete and sporadic in time, but the video carriers that record them are continuous in time and have homogeneous information density. As a result, to capture critical events lasting only a few minutes, the system is forced to record and store days of mostly meaningless static or micro-dynamic images. This not only imposes a significant burden on data storage and management, but also makes subsequent information retrieval a process of searching for isolated islands of information in a vast ocean of data. The high retrieval cost hinders the feasibility of video information applications in certain scenarios.
[0003] To address this challenge, the industry has also explored post-processing of video streams, such as introducing AI-based target recognition or behavior analysis algorithms, attempting to automatically filter out key operation fragments from massive amounts of video data. However, this approach does not address the root of the problem. It still follows a technical logic of first passively recording the entire disk and then conducting concentrated and laborious analysis. Its essence is to transform the original storage pressure and manual retrieval pressure into the continuous consumption of expensive computing resources, and it does not change the fundamental cause of front-end data redundancy.
[0004] Specifically, existing technologies generally have the following limitations: 1. There is an inherent structural mismatch between the continuity of video as an information carrier and the discreteness of key production events, which leads to data redundancy; 2. The technical approach of recording first and then retrieving places the work of information screening and purification entirely at the back end of data processing, which cannot avoid the generation and storage of massive amounts of irrelevant data at the front end; 3. The technical path of post-analysis, whether manual review or algorithmic analysis, is subject to the retrieval efficiency and cost of the huge data base generated by the front end. Therefore, how to design an image data processing method that can actively separate and structure images containing key operational evidence from meaningless daily images at the source of data generation, that is, at the front end of image acquisition, and thereby change the data processing method of passive recording and post-retrieval, has become the technical problem to be solved by the present invention. Summary of the Invention
[0005] The present invention provides a method for generating agricultural product quality traceability with visualization of the production process. Its main purpose is to solve the problem in the prior art that the use of continuous video to record discrete production events leads to difficulty in retrieval of redundant data, and the technical path of post-analysis cannot change the front-end data generation method.
[0006] To achieve the above-mentioned purpose, the present invention provides a method for generating agricultural product quality traceability with visualization of the production process, comprising: The captured image streams are processed in parallel at the edge to maintain an ambient visual baseline describing the static color characteristics of the scene and a dynamic visual baseline describing the dynamic temporal characteristics of the scene; When the color feature difference between the current frame image and the environmental visual baseline exceeds a first trigger threshold, or the temporal feature difference between the current frame image and the dynamic visual baseline exceeds a second trigger threshold, the following steps are performed: the pre-operation image at the moment before the trigger and the post-operation image at the trigger moment are captured from the image cache to generate a temporary image evidence pair; inter-frame difference processing is performed on the temporary image evidence pair to determine a change area; within the spatially adjacent area of the change area, the pre-operation image and the post-operation image are locally compared to generate a cause verification result; a fixed reference object and its cast shadow are identified in the post-operation image, the actual image features of the shadow are measured, and compared with the theoretical shadow features calculated based on the time and geographic information associated with the temporary image evidence pair to generate a time authenticity verification mark; only when the cause verification result and the time authenticity verification mark both indicate that the verification is passed, the pre-operation image, the post-operation image, the difference image generated by the inter-frame difference, and the verification mark are encapsulated together into a structured traceability unit and stored.
[0007] Preferably, the environmental visual baseline and the dynamic visual baseline are maintained in parallel, specifically including: maintaining the environmental visual baseline by continuously calculating the statistical summary of the color histogram of the images in the image stream; and maintaining the dynamic visual baseline by gridding the images in the image stream into macroblocks and continuously calculating the short-term temporal variance of the pixel brightness values in each macroblock; wherein the first trigger threshold and the second trigger threshold are values determined based on a statistical analysis of the normal fluctuation range of the baseline of the production scene within a preset learning cycle.
[0008] Preferably, a cause verification result is generated, specifically including: taking the boundary of the changed area as a reference, setting a cause detection window toward its periphery; performing local inter-frame difference processing on the image before the operation and the image after the operation in the area corresponding to the cause detection window to obtain a local difference value; comparing the local difference value with a subject existence judgment threshold, if the local difference value is higher than the subject existence judgment threshold, generating a cause verification result indicating that the verification passed; if the local difference value is not higher than the subject existence judgment threshold, generating a cause verification result indicating that the verification failed.
[0009] Preferably, a time authenticity verification mark is generated, specifically including: in the image after the operation, through edge detection and linear Hough transform, automatically identifying fixed reference objects and shadows; performing image measurement on the identified shadows, and calculating their length and azimuth in the image coordinate system as actual image features; extracting the temporary image evidence pair's own timestamp and global positioning system geographical location coordinates, and calling the sun position algorithm to calculate the theoretical shadow length and azimuth as theoretical shadow features; calculating the deviation between the actual image features and the theoretical shadow features, and if the deviation is within an error tolerance, generating a time authenticity verification mark indicating that the verification has passed.
[0010] Preferably, before being encapsulated into a structured tracing unit, the method further includes: when triggering the capture of a temporary image evidence pair, capturing a continuous image sequence including the period before and after the triggering moment from the image cache; generating a differential evolution sequence based on the continuous image sequence, and calculating the maximum connected domain area growth rate AGR and the connected domain number growth rate CCR in parallel for the differential evolution sequence; and following the following judgment rules: Generate a physical state label for the structured traceability unit to represent the physical state of the operation object: ,in, and The physical state discrimination threshold is calibrated based on the spatiotemporal evolution characteristics of images to distinguish between liquid infiltration processes and solid scattering processes; and the physical state label is encapsulated into the structured traceability unit.
[0011] Preferably, maintaining the environmental visual baseline and the dynamic visual baseline also includes: setting a baseline update cycle, during which image data is collected in a rolling manner to continuously update the color histogram statistical summary and the baseline value of the short-term temporal variance of the pixel brightness value within the macroblock, so that the environmental visual baseline and the dynamic visual baseline can adapt to the slow changes in lighting and environment in the production scene.
[0012] Preferably, the cause detection window is set to an annular area with a pixel width of ten to thirty pixels surrounding the outside of the change area boundary; the subject existence judgment threshold is a quantifiable average change in pixel grayscale value caused by the operator's limb or the tool he holds entering the annular area.
[0013] Preferably, the determination of the error tolerance is also related to the accuracy of the geographic location information and the pixel size of the fixed reference object in the image. When the accuracy of the geographic location information decreases or the pixel size of the fixed reference object decreases, the value range of the error tolerance is relaxed accordingly.
[0014] Preferably, the time span of the continuous image sequence is from two frames before the trigger moment to three frames after the trigger moment, a total of six frames of images; the differential evolution sequence is composed of five frames of difference images generated by performing inter-frame difference processing on two adjacent frames in the continuous image sequence.
[0015] Preferably, encapsulating into a structured traceability unit further includes: generating a unique identifier for the structured traceability unit; and associating and storing the unique identifier with agricultural operation information associated with the triggering moment obtained from the production management system, the agricultural operation information including the operation batch number, operator identity information and applied material information, so as to construct a traceable link between image evidence and management data.
[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention acquires production scene images in real time and dynamically maintains an environmental visual baseline model that describes the static features of the scene. It continuously compares the current image features with the baseline and triggers the capture of an image evidence pair when the difference exceeds a threshold. The evidence pair contains images before and after the operation. This processing method transforms the generation of image data from an undifferentiated continuous time record to a discrete event-responsive generation driven by changes in the physical state of the scene itself. The system outputs no longer a raw video stream that requires subsequent interpretation, but a structured image data unit that has been initially purified and centered on change. The states before and after the operation are juxtaposed, providing a direct visual reference system for subsequent retrospective analysis.
[0017] 2. After generating a difference image through inter-frame differencing, the present invention further determines the changed area on the difference image and performs local comparison with the spatially adjacent areas of the changed area to verify whether there is an operating subject associated with the change. This couples global environmental change monitoring with local operating subject existence verification; global differences are used to identify the occurrence of events, while local verification is used to confirm the cause of the event. The two work together to enable the system to have an inherent identification capability when facing image changes caused by non-human factors, such as lighting changes or wind disturbances, avoiding the packaging of such unrelated environmental changes as effective tracing units.
[0018] 3. After capturing a continuous image sequence including the moments before and after the key event trigger, the present invention generates a differential evolution sequence based on this sequence, and then analyzes the spatiotemporal evolution characteristics of the change region to determine the physical form of the applied substance. This process extends the analysis of the event from the spatial form judgment of a single time section to the dynamic process analysis within a small time window; the system provides an image processing basis for distinguishing between liquid infiltration and solid scattering processes by identifying whether the change region appears as a continuous increase in the area of the connected domain between consecutive frames or as an instantaneous increase in the number of discrete connected domains, thereby generating semantic labels and generating visualization. After the tracing unit, fixed reference objects and their shadows are identified in the post-operation image, their actual image features are measured, and theoretical shadow features are calculated based on the time and geographic information associated with the tracing unit. The temporal authenticity is verified by comparing the two. This verification step cross-checks the visual characteristics of the image content itself with a stable physical law independent of the image system, namely the law of celestial motion. The shape of the shadow in the image becomes internal evidence of the authenticity of its timestamp, making the temporal attribute of the tracing unit no longer solely dependent on the records of the external clock system, but also subject to the logical constraints of the image content itself. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 An event processing flow chart generated by the tracing unit of the present invention; Figure 2 Schematic diagram of the relationship between the diurnal fluctuation of visual characteristics and the trigger threshold of the present invention; Figure 3 This is a schematic diagram of data flow and system deployment of the present invention; Figure 4 This is a diagram of the internal functional architecture of the edge processing unit of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0021] The present invention discloses a method for generating agricultural product quality traceability with visualization of the production process, which can be implemented by a system deployed at the edge. The system architecture is deployed at the edge and mainly consists of an event trigger module based on dual-channel parallel monitoring, an instantaneous image evidence capture module, a double verification module based on cross-arbitration of causal spatial proximity and physical laws, and a conditional encapsulation and storage module of a structured traceability unit. The data flow passes through the aforementioned modules in sequence, wherein the pass judgment of the double verification module is the control gate that determines whether the original image data is purified and converted into the final structured traceability unit; in the specific image data processing flow, in order to cope with the possible uncertainty of single visual feature monitoring under specific working conditions in the production scene, the system is configured to process the collected image stream in parallel at the edge to maintain an environmental visual baseline that describes the static color characteristics of the scene and a dynamic visual baseline that describes the dynamic temporal characteristics of the scene; wherein The maintenance of the environmental visual baseline is achieved by continuously calculating the color histogram statistical summary of each frame in the input image stream. For example, the system can quantize the image color space into 16 major intervals and calculate a normalized vector consisting of the pixel ratios of these 16 color intervals in real time as a baseline model to represent the global color distribution of the scene. The maintenance of the dynamic visual baseline is achieved by gridding the image into macroblocks, such as dividing it into a 16x16 macroblock matrix, and continuously calculating the short-term temporal variance of the brightness values of all pixels in each macroblock unit. The statistical average of this variance constitutes a dynamic baseline that represents the normal dynamic level of the scene. To ensure that the two baselines can adapt to the slow changes in lighting and environment in production scenes, the system also sets a baseline update cycle, for example, every 10 minutes, during which image data is rolled out to continuously update the aforementioned color histogram statistical summary and the baseline value of the short-term temporal variance of the pixel brightness values within the macroblock.
[0022] When it is necessary to determine whether a key event is triggered, the system compares the features of the current frame image with the two baseline models in parallel. When the vector cosine similarity between the color histogram statistical summary of the frame image and the environmental visual baseline is lower than the first trigger threshold, , or when the short-term temporal variance mean of multiple macroblocks in a spatially continuous area of the image exceeds the second trigger threshold of the dynamic visual baseline value When one of the two conditions is met, the key event is determined to be triggered; and It is not a fixed value, but is set through a deterministic calibration procedure. For example, in the initial deployment of the system, it will take 24 hours to learn the baseline normal fluctuation range within a complete light cycle, and set 1.5 times the historical maximum fluctuation value of color features and dynamic features as and , in order to distinguish the natural fluctuations of the environment from the sudden changes in image features caused by external intervention; once an event is triggered, the system immediately captures the image before the trigger from the onboard image buffer ( ) before the operation and the trigger moment ( ) to generate a temporary image evidence pair.
[0023] In order to filter out false alarms caused by environmental changes caused by non-target operating subjects, the system performs a check based on causal space proximity after generating a temporary image evidence pair. The specific procedure is as follows: first, the temporary image evidence pair is subjected to inter-frame difference processing to generate a difference image, and a change area with the most drastic pixel change is determined on the difference image by using binarization and connected domain analysis, i.e., the result area. Given that the operating subject that causes the environmental change physically exists in the adjacent space of the change area, the system then uses the boundary of the change area as a reference and sets a ring-shaped area with a pixel width of, for example, 10 to 30 pixels to its periphery. A cause detection window for the pixels is formed, and in the spatial area corresponding to the cause detection window, a local inter-frame difference processing is performed on the image before the operation and the image after the operation again to obtain a local difference value; if the local difference value is higher than a preset subject existence judgment threshold, a cause verification result indicating that the verification has passed is generated. The threshold is a quantifiable average change in pixel grayscale value caused by the operator's limb or the tool held by the operator entering the annular area. The value can be obtained by offline measurement and calibration of sample images of standard operations. For example, when the local difference mean is greater than the grayscale value of 15, it is determined that an operating subject exists.
[0024] At the same time, in order to establish the verifiability of the traceability unit in the time dimension, the system also performs a time authenticity verification based on the arbitration of physical laws; given that in any outdoor scene with geographic location and time information, the shadow shape cast by a fixed object is determined by the laws of celestial motion, the system uses this stable physical law as the basis for verification; its deterministic procedure is to automatically identify a fixed reference object with a clear outline that exists in the scene for a long time, such as a telephone pole, and its cast shadow through image processing technologies such as edge detection and linear Hough transform in the image after the operation passes the verification; then, through image measurement, the length and azimuth of the shadow in the image coordinate system are calculated as the actual image features; at the same time, the system extracts the temporary The time-stamp image evidence is associated with the GPS geographic location coordinates obtained through the built-in module of the camera, and a standard sun position algorithm is called to calculate the theoretical shadow length and azimuth that the reference object should form at that specific time and place as the theoretical shadow feature; finally, by comparing the deviation between the actual image feature and the theoretical shadow feature, if the deviation is within a preset error tolerance, for example, the angle deviation is less than 2 degrees and the length ratio deviation is less than 5%, a time authenticity verification mark indicating that the verification has passed is generated. The value of the error tolerance can also be dynamically associated with the accuracy of the GPS signal. When the positioning accuracy decreases, the tolerance is relaxed accordingly to adapt to the signal fluctuations in the real environment. This makes the authenticity of the timestamp associated with the image content.
[0025] Only when the aforementioned cause verification results and the time authenticity verification mark indicate that the verification has passed, the system will finally encapsulate the pre-operation image, the post-operation image, the difference image generated by the inter-frame difference, and the two verification marks into a structured visual tracing unit and store it; in other words, in order to further enhance the semantic information of the tracing unit and distinguish different operation types, when the trigger event is captured, the system can also capture a continuous image sequence including the period before and after the trigger moment from the image cache, for example, from arrive Based on this sequence, a differential evolution sequence consisting of five frames of difference images can be generated by performing inter-frame differences between two adjacent frames in sequence. The system then calculates two spatiotemporal texture indicators in parallel for this differential evolution sequence: the maximum connected domain area growth rate and the maximum connected domain area growth rate. and the growth rate of the number of connected domains To convert these two indicators into judgments on physical form, the system follows the following deterministic judgment rules: : ,in, and It is a physical state discrimination threshold calibrated based on the spatiotemporal evolution characteristics of images that distinguish between liquid infiltration processes and solid scattering processes; physical state labels generated according to this rule, such as liquid application, will also be encapsulated into the structured traceability unit, thereby realizing the generation of visual evidence for key events from attribution timing to qualitative analysis; finally, the system can also generate a unique identifier for the structured traceability unit, and associate it with the agricultural operation information associated with the triggering moment obtained from the external production management system, such as the operation batch number, for storage, to build a traceable link between image evidence and management data.
[0026] To achieve the associated storage between the aforementioned structured traceability unit and agricultural operation information, the method of the present invention can also be configured with an associated database deployed on the edge or cloud during specific implementation. For each structured traceability unit that is finally confirmed and encapsulated, the unique identifier generated by it, such as the SHA-256 hash value based on the unit content, is written as the primary key into an image evidence table in the database, and the operation batch number, operator identity information, and applied material information obtained in real time from the production management system that match the timestamp of the traceability unit within a preset time window, such as five minutes before and after, are stored as foreign keys or associated fields in the corresponding records of the table. By constructing such a relational data structure with a unique identifier as a bridge, a stable and clear traceable link that can be retrieved and verified at any time can be established between the physical storage of image evidence and the logical information of production management.
[0027] Example 1: In an application scenario where there is a traceability requirement for the compliance of agricultural operations, a field equipped with the image processing system of the present invention has two types of visual changes appearing simultaneously in the monitoring image at 3:00 p.m. One type is the image disturbance caused by a sudden strong wind blowing a shade cloth, and the other type is an operator using a spraying device to apply a colorless and transparent liquid fertilizer to the crop leaves, which only appears as a local color and reflectivity change in the image; traditional image data processing methods face the problems of information redundancy and difficulty in confirming the validity of evidence in this scenario, that is, the system must record all images including a large number of environmental disturbances, and it is impossible to verify the authenticity of the operation time recorded by the operator at 3:00 p.m. based on the video itself afterwards; under this working condition, the technical solution of the present invention deploys a dual-channel parallel monitoring module at the edge, and its dynamic visual baseline detects that the short-term temporal variance of multiple adjacent macroblocks caused by the wind blowing the shade cloth simultaneously exceeds the second trigger threshold Therefore, the system captured a temporary image evidence pair about the change of the sunshade cloth; in the subsequent causal spatial proximity verification link, the system performed inter-frame difference processing on the evidence pair. After determining the change area where the sunshade cloth was located, it performed a local comparison with its spatial adjacent area, namely the cause exploration window, and found that the local difference value in the window was lower than the preset subject existence judgment threshold, indicating that there was no adjacent operating subject as the cause of the change. The cause verification result was marked as failed, and the temporary image evidence pair was immediately discarded by the system and did not enter the subsequent processing and storage link. This processing flow requires the capture of highly sensitive dynamic events to pass the subsequent attribution verification of the event source before it can be confirmed as a valid record.
[0028] Almost at the same time, the operator's spraying behavior, although it did not cause severe dynamic disturbances, caused the crop leaves to become wet, and its color statistical summary deviated statistically from the ambient visual baseline and exceeded the first trigger threshold. , the system therefore captured a second temporary image evidence pair about the spraying operation; when performing a causal spatial proximity check on the evidence pair, after determining the area of leaf color change, the system detected a local differential value caused by the nozzle of the spraying equipment that was higher than the subject existence judgment threshold within the cause exploration window around it, and the cause verification result was therefore marked as passed; the passing of this check triggered a second time authenticity check, and the system automatically identified a fixed electric pole at the edge of the field and its cast shadow in the post-operation image, measured its actual image features, and compared them with the theoretical shadow features calculated based on the three-time timestamp and GPS geographic location information of the evidence pair. A comparison was performed and it was found that the two were consistent within the set error tolerance, and the time authenticity verification mark was also set to pass. Ultimately, only this image evidence pair that passed the double verification was encapsulated as a structured traceability unit and stored. This unit not only includes a direct visual comparison before and after the operation, but also records the dual confirmation results of event attribution and timestamp authenticity through its internal verification mark. This processing method, which introduces physical and logical verification at the front end of data generation, replaces the traceability link that originally relied on continuous video streams and external clock systems. It is replaced by a discrete data unit whose image content and timestamp have inherent physical consistency.
[0029] Example 2: In order to objectively verify the effectiveness of the method of the present invention in distinguishing between real human operation and environmental and data forgery interference, this example constructs a test platform for reproducing typical working conditions; the platform consists of an image acquisition device fixed at a height of 2.5 meters overlooking a 5m x 5m standard lawn area, a programmable six-axis robotic arm for simulating human operation, a high-power fan that can generate non-directional airflow to simulate a gust environment, and a control system that can adjust the time of the timestamp server through software; the purpose of the experiment is to quantitatively evaluate the dual verification mechanism in the method of the present invention, namely the causal space proximity verification and the time authenticity verification, and the discrimination results under different event types; before the experiment, the key parameters of the system are first calibrated, among which the setting of the subject existence judgment threshold is to balance the misjudgment of environmental noise and the omission of weak real operations. To determine this parameter, the experiment is carried out with only the fan turned on In a background noise environment, 1000 frames of images were continuously collected and the local difference values within the cause detection window were calculated. The mean was 3.2 and the standard deviation was 2.8. Subsequently, the robotic arm was controlled to perform a standard spraying action and repeated 100 times. The mean local difference value caused by this action within the cause detection window was measured to be 21.4. Based on this, the subject existence judgment threshold was set to the background noise mean plus three times the standard deviation, that is, 3.2 + 3 × 2.8 = 11.6, rounded to 12. The error tolerance for time authenticity verification was set to balance GPS positioning accuracy drift and sensitivity to timestamp forgery. Based on the nominal 3-meter positioning error of the GPS module of the device used, the theoretical deviation caused by the shadow length and angle of a fixed reference object, a vertical pole at the edge of the site, in the test scenario was inferred through a geometric model. The error tolerance was set to an angle deviation of less than 2.0 degrees and a length ratio deviation of less than 5.0%.
[0030] Three groups of events were designed during the experiment, and each group of events was repeated 100 times to test the system's ability to classify image changes of different natures. The experimental results showed that the double verification process can effectively distinguish between valid operations and various types of interference. Specifically, in the 100 valid operation group events, that is, the robot arm performed standard spraying operations, the system correctly generated 98 structured traceability units. As a control, in the 100 environmental interference group events, that is, only the wind fan blowing the ground debris, 99 events were identified and discarded by the causal space proximity verification link. The reason was that no operating subject with a local difference value higher than 12 was detected in the adjacent space of the change area. In other words, in the 100 data forgery group events, that is, the robot arm performed standard operations but its associated timestamp was forged, After passing the cause verification, 96 events were identified and discarded by the time authenticity verification link. The basis for this judgment was that there was a deviation exceeding the aforementioned error tolerance between the shadow features in the image content determined by the actual lighting conditions and the theoretical shadow features corresponding to the forged timestamp. Experimental data showed that the present invention extracted real and valid operation events from the interference at the environmental and data levels through a cascaded verification process based on causal attribution and arbitration of physical laws. The failure to identify two valid operations was due to the fact that the end effector of the robotic arm was partially blocked at a specific angle, which failed to generate a sufficiently high local differential value within the cause exploration window. The passing of a few interference events corresponded to the low-probability situation where random noise just fell into the tolerance interval in both verification links.
[0031] Example 3: This example combines Figures 1 to 4 ,A method for generating agricultural product quality traceability with a visualization of the production process is described, e.g. Figure 1 As shown, the image stream is received by a dual-channel parallel processing mechanism. This mechanism maintains an environmental visual baseline to describe the static color characteristics of the scene, and a dynamic visual baseline to describe the dynamic temporal characteristics of the scene. The mechanism then compares the current frame image with the dual baselines in real time to perform event triggering determination. When an event is determined to be triggered, the system immediately executes the operation of capturing image evidence, generating a temporary image pair containing the before and after operations. This temporary evidence pair then enters a dual verification process, which undergoes a causal proximity check in parallel to confirm event attribution and eliminate environmental interference, as well as a temporal authenticity check to cross-verify the physical authenticity of the timestamp. A decision node that determines whether the dual verification passes determines the direction of the data flow. If the check fails, the temporary data is discarded. If the check passes, the operation of encapsulating a structured traceability unit is executed, and the data unit encapsulated with the image, difference map, and verification mark is stored. Furthermore, an optional physical state label generation module can be used to distinguish between solid and liquid operations. At the same time, the encapsulated unit is also associated with external agricultural operation information through the steps of associative storage and constructing a traceability link.
[0032] like Figure 2 As shown, with time as the horizontal axis and feature difference as the vertical axis, the fluctuations of the two curves of color feature difference and dynamic feature difference within a 24-hour period are depicted, as well as a constant trigger threshold reference line. According to the technical solution of the present invention, when any value of the color feature difference curve or the dynamic feature difference curve exceeds the trigger threshold line at a certain point in time, the trigger condition is met, and the system will initiate the subsequent image evidence capture and double verification process.
[0033] like Figure 3 As shown in the figure, the real-time image stream generated by the production scene is sent to the core image acquisition and event triggering module. This module maintains the baseline by reading and writing baseline data to the visual baseline library, and reads image frames from the image cache to generate temporary image evidence pairs when an event is triggered. The evidence pairs are passed to the image evidence dual verification module. The output of this module is divided into two paths. One is the verification failed data, which will be discarded, and the other is the verification passed image evidence, which will be used to generate a structured traceability unit. The generated structured traceability unit is sent to the traceability data association storage module on the one hand, and the module also receives agricultural operation information from the production management system to jointly build the association between the stored traceability unit and the management data. On the other hand, the final form of the unit is stored in the structured traceability unit library.
[0034] like Figure 4 As shown, the unit receives the image stream from the image acquisition device and is first processed by a dual-channel parallel monitoring module. The module contains an environmental visual baseline for extracting color histogram statistics and a dynamic visual baseline for calculating macroblock time variance. The trigger judgment result output by the module determines whether to generate an image evidence pair. The evidence pair is then sent to a dual verification module, which contains two submodules. One is a causal space proximity verification module, which determines the change area through inter-frame difference and sets up a cause exploration window for local comparison. The other is a physical law arbitration verification module, which obtains the change area through shadow recognition. The actual characteristics are calculated and the theoretical characteristics are calculated by calling the sun position algorithm for comparison. In addition, an optional physical state recognition module can perform differential evolution analysis on a series of 6 consecutive frames and calculate the AGR / CCR index to attach a physical state label of liquid application or solid spreading to the event according to the physical state judgment rules. Only the image evidence that passes the verification will be structured and encapsulated into a traceability unit containing pre / post-operation images, difference images, verification marks and physical state labels, and finally stored in the traceability unit. At the same time, it will be associated with the operation batch number, operator and material information from the production management system.
[0035] Example 4: In a deployment scenario where it is necessary to distinguish between liquid spraying and solid spreading, due to the atomization effects of different spraying equipment and the morphological differences of different granular fertilizers, the growth rate of the connected domain area representing liquid infiltration in the spatiotemporal evolution characteristics of the image is The growth rate of the number of connected domains representing solid scattering , its specific numerical distribution is scene-dependent; in order to make the judgment rule for physical state identification in the method of the present invention To be adaptable to the scene, a standardized engineering calibration procedure is required to determine a set of physical state discrimination thresholds applicable to the scene. and ; To this end, this embodiment discloses an offline calibration method performed before the system is officially deployed. The method is performed in a test environment with the same camera model installation height and lighting conditions as the actual application scenario; the input of the calibration process is clean water as the representative liquid material to be used in actual applications, and urea particles with a diameter of 2 to 4 mm as the representative solid material; the calibration process first enters the liquid physical characteristic acquisition stage, through a pressure nozzle, at a fixed flow rate and angle, the spraying operation is repeated 100 times in the test area. For each operation, the system captures a continuous 6-frame image sequence including before and after the trigger moment in accordance with the above procedure, and calculates the corresponding 5-frame differential evolution sequence. Then, the system extracts from each differential evolution sequence. The maximum and maximum of the time series The maximum value of the time series, and these 100 sets of maximum values are stored in the liquid Sample set and liquid Sample set.
[0036] Subsequently, the calibration process enters the solid state feature acquisition phase. Through a spreading device, the particle spreading operation is repeated 100 times in the test area, and the image sequence capture and feature extraction steps are exactly the same as those in the liquid acquisition phase to obtain 100 sets of solid Sample Set and Solid Sample set; after completing the collection of four sets of sample data, the system performs statistical analysis on the data and calculates that the liquid The mean of the sample set is 5.1, the standard deviation is 1.5, and the solid The mean of the sample set is 62.7 and the standard deviation is 8.2. In order to set a threshold that can distinguish the two physical states, the physical state discrimination threshold The mean of the sample set plus three times the standard deviation, that is, ; Using the same statistical principles, based on liquid Sample Set and Solid The statistical distribution of the sample set can be used to calculate the physical state discrimination threshold The value of is 0.31, here is the normalized growth rate of the largest connected domain area per unit time; finally, a set of specific physical state discrimination thresholds determined by this calibration procedure, , is written into the configuration file of the edge device; this process converts the key parameters of the physical state identification model from a fixed prior value to a posterior value based on sampling and statistical analysis of the image physical process in a specific application scenario, so that the classification basis of physical state identification of this method in specific engineering practice has obtained a reproducible calibration process.
[0037] Example 5: When the method of the present invention is deployed in a new farmland environment whose scene features have not been pre-calibrated, in order to ensure the uniqueness and stability of the identification of fixed reference objects in the time authenticity verification function, the system is configured to perform a standardized field deployment pre-calibration procedure when it is first started; under this procedure, the system first enters a reference object calibration mode, automatically performs one hour of continuous image acquisition on the current scene, and identifies all statistically stationary objects in the scene by performing inter-frame difference and feature point tracking on the image sequence. Subsequently, the system screens out candidate reference objects with stable and clear linear geometric contours from these stationary objects through edge detection and linear Hough transform, and sorts these candidate reference objects according to their pixel size contrast and geometric stability in the image. Finally, the system provides a list of the top three candidate reference objects to the deployment personnel, and the deployment personnel, combined with the on-site survey, selects one of the metal fence posts as the only fixed reference object for shadow measurement in the scene and confirms it.
[0038] After completing the confirmation of the fixed reference object, the calibration procedure continues by calibrating the error tolerance for temporal authenticity verification. The system first measures the pixel size of the confirmed fixed reference object in the current image coordinate system and records this value. At the same time, the system reads the current horizontal dilution of precision (HDOP) value from the associated global positioning system module to quantify the positioning signal quality at the current deployment location. The final value of the error tolerance is determined by a function that combines the image size of the fixed reference object and the positioning signal quality. This function superimposes the basic error tolerance with a visual measurement error term that is inversely proportional to the pixel size and a positioning error term that is proportional to the horizontal dilution of precision. This allows the system to automatically adjust its tolerance for deviations between theoretical shadow features and actual image features when the fixed reference object accounts for a small proportion of the image or the positioning signal quality degrades. This procedure transforms the error tolerance setting from a fixed value to a system parameter whose value can be dynamically adjusted based on the quality of key input data.
[0039] Example 6: In a specific system deployment scenario, in order to enable the establishment of a visual baseline and the setting of key verification parameters to accurately adapt to the lighting crops and operating characteristics of a specific farmland, the present invention provides a set of standardized pre-calibration and verification procedures; the procedure is intended to build a verified scenario-specific baseline reference model for the subsequent online operation of the system. The process first starts a 24-hour unsupervised collection cycle of baseline data. During this period, the system segments the collected image stream in units of 15 minutes and independently calculates the statistical summary of the color and dynamic features in each segment. After the collection cycle ends, the system performs outlier analysis on the statistical results of all segments, and identifies those segmented data whose statistical values deviate from the global median by more than three standard deviations as contaminated data caused by temporary abnormal events and eliminates them.
[0040] After calculating the final environmental and dynamic visual baselines using the cleaned dataset from the previous steps, the procedure proceeds to set event trigger thresholds. The system calculates the complete probability distribution of color feature differences and temporal feature differences across all time series in the cleaned dataset and sets the 99.9th percentile of this distribution as the first and second trigger thresholds, respectively. Next, the procedure proceeds to offline optimization of key geometric parameters for the causal spatial proximity check, aiming to determine a cause-detection window width that maximizes the signal-to-noise ratio for this check. The system prompts the deployment personnel to repeat several standardized key operations at representative locations within the field of view. For each operation, after identifying the region of change, the system sets a set of concentric circular test windows with widths ranging from 5 to 50 pixels, with increments of 1 pixel, centered on the region's boundary. The system calculates the local difference mean within each test window as the signal. Finally, the system determines the test window width that achieves the maximum signal-to-background noise ratio as the pixel width of the cause-detection window for that scenario and fixes it.
[0041] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0042] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for generating agricultural product quality traceability with production process visualization, characterized in that: The method comprises: The captured image streams are processed in parallel at the edge to maintain an ambient visual baseline describing the static color characteristics of the scene and a dynamic visual baseline describing the dynamic temporal characteristics of the scene; When the color feature difference between the current frame image and the environmental visual baseline exceeds a first trigger threshold, or the temporal feature difference between the current frame image and the dynamic visual baseline exceeds a second trigger threshold, the following steps are performed: the pre-operation image at the moment before the trigger and the post-operation image at the trigger moment are captured from the image cache to generate a temporary image evidence pair; inter-frame difference processing is performed on the temporary image evidence pair to determine a change area; within the spatially adjacent area of the change area, the pre-operation image and the post-operation image are locally compared to generate a cause verification result; a fixed reference object and its cast shadow are identified in the post-operation image, the actual image features of the shadow are measured, and compared with the theoretical shadow features calculated based on the time and geographic information associated with the temporary image evidence pair to generate a time authenticity verification mark; only when the cause verification result and the time authenticity verification mark both indicate that the verification is passed, the pre-operation image, the post-operation image, the difference image generated by the inter-frame difference, and the verification mark are encapsulated together into a structured traceability unit and stored.
2. The method for generating agricultural product quality traceability with production process visualization according to claim 1, characterized in that: Maintaining the environmental visual baseline and the dynamic visual baseline in parallel specifically includes: maintaining the environmental visual baseline by continuously calculating the statistical summary of the color histogram of the images in the image stream; and maintaining the dynamic visual baseline by gridding the images in the image stream into macroblocks and continuously calculating the short-term temporal variance of the pixel brightness values in each macroblock; wherein the first trigger threshold and the second trigger threshold are values determined based on a statistical analysis of the normal fluctuation range of the baseline of the production scene within a preset learning cycle.
3. The method for generating agricultural product quality traceability with production process visualization according to claim 1, characterized in that: Generate a cause verification result, specifically including: setting a cause detection window to the periphery of the change area based on the boundary of the change area; performing local inter-frame difference processing on the image before the operation and the image after the operation in the area corresponding to the cause detection window to obtain a local difference value; comparing the local difference value with a subject existence judgment threshold, if the local difference value is higher than the subject existence judgment threshold, generating a cause verification result indicating that the verification is passed; if the local difference value is not higher than the subject existence judgment threshold, generating a cause verification result indicating that the verification is failed.
4. The method for generating agricultural product quality traceability with production process visualization according to claim 1, characterized in that: Generating a temporal authenticity verification mark specifically includes: automatically identifying fixed reference objects and shadows in the post-operation image through edge detection and linear Hough transform; performing image measurement on the identified shadows, and calculating their length and azimuth in the image coordinate system as actual image features; extracting the temporary image evidence pair's own timestamp and global positioning system geographic location coordinates, and calling the sun position algorithm to calculate the theoretical shadow length and azimuth as theoretical shadow features; calculating the deviation between the actual image features and the theoretical shadow features, and if the deviation is within an error tolerance, generating a temporal authenticity verification mark indicating that the verification has passed.
5. The method for generating agricultural product quality traceability with production process visualization according to claim 1, characterized in that: Before being encapsulated into a structured tracing unit, it also includes: when the capture of a temporary image evidence pair is triggered, a continuous image sequence including the time before and after the triggering moment is captured from the image cache; a differential evolution sequence is generated based on the continuous image sequence, and the maximum connected domain area growth rate AGR and the connected domain number growth rate CCR are calculated in parallel for the differential evolution sequence; and the following judgment rules are followed Generate a physical state label for the structured traceability unit to represent the physical state of the operation object: ,in, and The physical state discrimination threshold is calibrated based on the spatiotemporal evolution characteristics of images to distinguish between liquid infiltration processes and solid scattering processes; and the physical state label is encapsulated into the structured traceability unit.
6. The method for generating agricultural product quality traceability with production process visualization according to claim 2, characterized in that: Maintaining the environmental visual baseline and the dynamic visual baseline also includes: setting a baseline update period, rolling the image data acquisition during the period to continuously update the color histogram statistical summary and the benchmark value of the short-term temporal variance of the pixel brightness value in the macroblock.
7. The method for generating agricultural product quality traceability with production process visualization according to claim 3 is characterized in that: The cause detection window is set to a ring area with a width of ten to thirty pixels surrounding the outside of the change area boundary; the subject existence judgment threshold is a quantifiable average change in pixel grayscale value caused by the operator's limb or the tool he holds entering the ring area.
8. The method for generating agricultural product quality traceability with production process visualization according to claim 4, characterized in that: The determination of the error tolerance is also related to the accuracy of the geographic location information and the pixel size of the fixed reference object in the image. When the accuracy of the geographic location information decreases or the pixel size of the fixed reference object decreases, the value range of the error tolerance is relaxed.
9. The method for generating agricultural product quality traceability with production process visualization according to claim 5, characterized in that: The time span of the continuous image sequence is from two frames before the trigger moment to three frames after the trigger moment, with a total of six frames of images; the differential evolution sequence consists of five frames of difference images generated by performing inter-frame difference processing on two adjacent frames in the continuous image sequence.
10. The method for generating agricultural product quality traceability with production process visualization according to claim 1, characterized in that: Encapsulating into a structured traceability unit also includes: generating a unique identifier for the structured traceability unit; and associating and storing the unique identifier with agricultural operation information associated with the triggering moment obtained from the production management system, where the agricultural operation information includes an operation batch number, operator identity information, and applied material information.
Citation Information
Patent Citations
Video saliency detection method based on Bayesian fusion
CN107564022A
Hydropower station video data digital safety early warning method and device
CN114550037A
Video analysis method and system of monitoring terminal
CN118781526A
Logistics product positioning data management method and system based on cloud computing
CN119181046A
Packing machine two-dimensional code dynamic tracing method, device and equipment
CN119295104A