Method and system for online multi-index priority grading and sorting of agricultural products
Patent Information
- Application Number
- CN202611101214.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-09-25
AI Technical Summary
然而,在连续输送分选场景中,仅获取品质检测结果尚不足以实现稳定分选,现有技术仍存在如下问题:其一,多个品质指标之间存在优先级差异;若对缺陷类指标与等级类指标不加区分,可能导致存在缺陷的样本因其某一品质指标较优而被误分入合格通道或高等级通道
[0035]本发明提供的农产品多指标优先级在线分级分选方法利用光谱信息获取农产品内部品质特征,通过上位机品质判别、优先级分级、控制器队列同步和分选执行机构联动,实现农产品在线分级分选,其能够将光谱采集、多品质指标判别、优先级分级、样本位置队列同步与分选执行集成为一体。
Smart Images

Figure CN122806772A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated sorting and control technology for agricultural products, and in particular to a method and system for online grading and sorting of agricultural products based on multiple priority indicators. Background Technology
[0002] The internal quality of agricultural products directly affects their processing suitability, commodity grade, and product stability. Taking tubers, fruits, and vegetables as examples, their internal defects, dry matter content, sugar content, starch content, and maturity are often difficult to judge directly from appearance. Existing methods such as manual grading, destructive sampling, and single-appearance inspection generally suffer from low detection efficiency, insufficient sample representativeness, and difficulty in achieving continuous online detection. Spectroscopic detection can obtain optical response information of the internal tissue of a sample, providing technical conditions for non-destructive testing of the internal quality of agricultural products. However, in continuous conveying and sorting scenarios, obtaining quality inspection results alone is insufficient to achieve stable sorting. Existing technologies still have the following problems: First, there are priority differences among multiple quality indicators; if defective indicators and grade indicators are not distinguished, samples with defects may be mistakenly sorted into the qualified channel or the high-grade channel because one of their quality indicators is better. Second, there is spatial distance and time delay during the process of samples moving from the inspection station to the sorting station; if the inspection results are not synchronously bound to the position of the corresponding sample, mismatches between the inspection object and the sorting object are likely to occur. Third, the model discrimination results from the host computer need to be stably transmitted to the field controller and converted into executable sorting channel actions. Fourth, existing solutions mostly focus on the discrimination accuracy of a single model or the control of a single actuator, lacking a closed-loop synchronization method for continuous conveying conditions that coordinates quality discrimination results, sample positions, and sorting execution.
[0003] The existing online quality inspection and sorting processes for agricultural products suffer from several problems, including difficulty in non-destructive testing of internal quality, difficulty in coordinating the judgment of multiple quality indicators, a high risk of mismatch between test results and actual samples on the conveyor line, and difficulty in reliably translating the model judgment results from the host computer into on-site sorting actions. In continuous conveying and sorting scenarios, there is spatial distance and time delay as the sample moves from the inspection station to the sorting station. If only the quality inspection results are obtained without synchronously binding the results with the corresponding sample positions, inconsistencies between the inspection object and the sorting object are likely to occur. Summary of the Invention
[0004] To address the shortcomings of the existing technologies, this invention provides a method and system for online grading and sorting of agricultural products with multiple priority indicators, enabling the linkage of spectral acquisition, quality discrimination, quality priority grading, controller queue synchronization, and sorting execution.
[0005] To achieve the above objectives, the present invention provides an online grading and sorting method for agricultural products based on multiple indicators of priority, comprising the following steps:
[0006] S1. The sample is transported to the testing station via the feeding and sorting module. A testing trigger signal is generated after the sample is in place.
[0007] S2. The controller module receives the sample arrival signal and outputs a spectral acquisition trigger signal;
[0008] S3. The spectral detection module collects the spectral data of the sample and sends the spectral data to the host computer or saves it to a data location that can be read by the host computer.
[0009] S4. The host computer preprocesses the spectral data and calls the trained quality discrimination model to obtain the discrimination results of high-priority defect indicators and low-priority quality indicators of the sample; wherein, a multi-quality indicator priority sorting mechanism is established in advance, setting defect indicators as high-priority indicators and indicators used for quality grade classification as low-priority indicators.
[0010] S5. Determine whether the high-priority defect indicator is abnormal: If it is determined to be abnormal, a defect removal level code is directly generated, and the low-priority quality level division is no longer performed; if it is determined to be normal, a corresponding quality level code is generated based on the threshold range into which the detected or predicted value of the low-priority quality indicator falls.
[0011] S6. The host computer writes the grade code into the designated data storage area of the controller module via industrial communication.
[0012] S7. The controller module adds the grade code to the sample position queue and updates the queue synchronously according to the conveying cycle, position detection signal or the operating status of the conveying mechanism, so that the grade code moves forward synchronously with the position of the corresponding sample on the conveying line, and realizes the binding and synchronization of the detection result with the position of the corresponding sample on the conveying line.
[0013] S8. When the target sample arrives at the sorting station, the controller module outputs the corresponding sorting channel control signal according to the grade code corresponding to the sample position queue, and drives the sorting execution mechanism to complete the grading or rejection action.
[0014] The spectral acquisition, priority determination, queue synchronization, and sorting execution form a closed-loop process.
[0015] In some embodiments, the sample sensing and acquisition method in step S3 includes one or more of the following: spectral detection, machine vision acquisition, and weighing; the spectral detection is used to obtain internal quality information of the sample, the machine vision acquisition is used to obtain surface defects and appearance features of the sample, and the weighing is used to obtain sample weight information; the host computer integrates the multi-source sensing data after fusion processing to obtain the sample quality discrimination result.
[0016] In some embodiments, the high-priority defect index in step S4 includes one or more internal defects and surface defects; multiple defects are judged by the same discrimination model, and as long as a sample is judged to have any one or more high-priority defects, a defect elimination level code is directly generated.
[0017] In some embodiments, the high-priority defects are handled by a unified rejection rule or a threshold-based classification rule. Under the unified rejection rule, any defect is directly rejected. Under the threshold-based classification rule, rejection, downgrading, and release are performed according to the threshold range corresponding to the defect severity quantification value.
[0018] In some embodiments, the low-priority quality indicators in step S4 include one or more of dry matter content, sugar content, starch content, and weight. When multiple low-priority indicators are used, a quality grade code is generated by combining the threshold ranges of each indicator. The grade can be further subdivided or modified based on the component content grading and weight.
[0019] In some embodiments, step S4 uses a cascaded discriminant model to complete the quality discrimination; the host computer first calls the high-priority defect discrimination model to output the defect judgment result, and only calls the low-priority quality discrimination model to complete the quantitative prediction for samples judged to be without defects; the defect judgment method is that the model directly outputs normal or abnormal, or the model outputs the probability value and compares it with the preset threshold; the threshold corresponding to each indicator can be adjusted according to the sample variety, processing purpose, enterprise grading standard, and model calibration result.
[0020] In some embodiments, after the model inference is completed in step S4, the host computer locally archives and saves the original spectral data, inference results, and grade codes for production traceability and equipment debugging.
[0021] In some embodiments, the grade coding adopts a combination structure of defect rejection coding and quality grade coding, and the coding format is an integer or enumeration value, which corresponds one-to-one with each sorting channel through a preset mapping relationship.
[0022] In some embodiments, the sample position queue is implemented through a circular shift register inside the controller; each unit of the queue corresponds to a sample position or a single conveying cycle on the conveyor line, and the queue shift update is triggered by a position detection signal or a conveying cycle signal.
[0023] In some embodiments, the spectral detection uses any one of the following spectral acquisition methods: visible light, near-infrared, visible near-infrared, and short-wave near-infrared; the quality discrimination model is selected from machine learning models, deep learning models, statistical discrimination models, or combinations thereof; and the host computer and the controller module transmit the grade code using any one of the following industrial communication methods: industrial Ethernet / fieldbus or serial communication.
[0024] In some embodiments, the sorting actuator is any one of a solenoid valve, cylinder, lever, flow guide mechanism, or jetting mechanism, and receives a control signal from the controller to guide the sample into the corresponding rejection channel or quality grading channel.
[0025] Another aspect of the present invention provides an online grading and sorting system for agricultural products with multiple priority indicators, used to execute the online grading and sorting method described above, the online grading and sorting system comprising:
[0026] The feeding and sorting module is connected to the spectral detection station along the sample conveying flow direction;
[0027] A spectral detection module and a host computer analysis module, wherein the signal output terminal of the spectral detection module is connected to the host computer analysis module;
[0028] The host computer module communicates bidirectionally with the controller module via the communication module.
[0029] The controller module is connected to the spectral detection module, the sample position queue module, and the sorting execution module. The sample position queue module is built into the controller, and the material and signal links of each module form a complete closed loop.
[0030] In some embodiments, the feeding and sorting module outputs a sample arrival trigger signal to the controller module to organize the single-column fixed-distance transport of samples and trigger acquisition; the spectral detection module receives the acquisition trigger signal sent by the controller module, acquires multi-band spectral data and uploads it to the host computer; the host computer is equipped with a cascaded discrimination model to complete spectral preprocessing, priority discrimination, level encoding generation and local data archiving, and the encoding is sent to the controller module via the communication module.
[0031] In some embodiments, the controller module is a PLC, motion controller, or embedded controller, with a built-in sample position queue module composed of a cyclic shift register. The controller module receives the grade code issued by the host computer and stores it in the queue. It drives the queue to shift synchronously according to the conveying rhythm and position signal, so as to realize the binding and matching of the code with the sample position. After the sample arrives at the sorting station, it outputs the sorting control signal.
[0032] In some embodiments, the sorting execution module is located at the sorting station and includes at least one actuating element such as a solenoid valve, cylinder, lever, flow guide mechanism or blowing mechanism; it receives sorting control signals from the controller and, according to the grade code and the preset mapping relationship between sorting channels, imports defective samples into the rejection channel and qualified samples into the corresponding quality grading channel.
[0033] In another aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements all the steps of the online grading and sorting method for multiple indicators of agricultural products as described above.
[0034] Compared with the prior art, the present invention has the following advantages:
[0035] The online grading and sorting method for agricultural products with multiple indicators and priorities provided by this invention utilizes spectral information to obtain the internal quality characteristics of agricultural products. Through the linkage of host computer quality discrimination, priority classification, controller queue synchronization and sorting execution mechanism, online grading and sorting of agricultural products can be realized. It can integrate spectral acquisition, multi-quality indicator discrimination, priority classification, sample position queue synchronization and sorting execution into one.
[0036] The online grading and sorting method for agricultural products with multiple indicators priority provided by this invention establishes a multi-quality indicator priority sorting mechanism. Defective quality indicators are set as high-priority indicators, and indicators used for quality grade classification are set as priority indicators. When a high-priority defective indicator is judged to be abnormal, a defect rejection code is directly generated. This can prevent samples with defects from being mistakenly classified into the qualified channel or the high-grade channel because one of their low-priority quality indicators is better.
[0037] The online grading and sorting method and system for agricultural products with multiple indicators priority provided by this invention binds the grade code generated by the host computer with the sample position queue in the controller, and coordinates the spatial distance, conveying cycle and sorting action between the detection station and the sorting station through the queue synchronization mechanism of the controller. This enables each quality judgment result to move synchronously with the position of the corresponding sample during the conveying process, thereby reducing the risk of mismatch between the detection result and the actual sorting object in the continuous conveying scenario, and enabling the model judgment result to be stably converted into the execution action at the sorting station.
[0038] The online grading and sorting method and system for agricultural products with multiple priority indicators provided by this invention integrates spectral acquisition, host computer quality judgment, grade coding, controller queue synchronization, and sorting execution into a closed-loop control. Compared with offline detection or manual grading methods, it can achieve non-destructive, continuous, and automated online grading and sorting of the internal quality of agricultural products. Furthermore, the quality indicators, number of grades, communication methods, controller types, and sorting execution mechanisms of this invention can all be adjusted according to the target variety, processing purpose, and production line configuration, exhibiting strong engineering adaptability and scalability. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the overall process of the online grading and sorting method for agricultural products with multiple priority indicators as shown in an embodiment of the present invention;
[0040] Figure 2 This is a diagram illustrating the architecture of an online grading and sorting system for agricultural products with multiple priority indicators, as shown in an embodiment of the present invention.
[0041] Figure 3 This is a flowchart of the online grading and sorting method for agricultural products with multiple priority indicators, as shown in an embodiment of the present invention.
[0042] Figure 4 This is a schematic diagram of the overall structure of the online grading and sorting system for agricultural products with multiple priority indicators, as shown in an embodiment of the present invention.
[0043] Figure 5 This is a schematic diagram illustrating the synchronization control of the controller level queue and sample position in an embodiment of the present invention. Figure 6 This is a schematic diagram of the communication process between the host computer model inference and the controller, as shown in an embodiment of the present invention.
[0044] Figure 7 This is a schematic diagram illustrating the correspondence between grade codes and sorting channels in an embodiment of the present invention;
[0045] In the attached figures, the following labels are used:
[0046] 300-Agricultural Products Multi-Indicator Priority Online Grading and Sorting System;
[0047] 310 - Material feeding and sorting module;
[0048] 320-Spectral Detection Module;
[0049] 330 - Host Computer Analysis Module;
[0050] 340 - Communication Module;
[0051] 350-Controller Module;
[0052] 360-Sample Location Queue Module;
[0053] 370 - Sorting Execution Module;
[0054] Steps: S1-S8. Detailed Implementation
[0055] See Figure 1-7 An embodiment of the present invention provides an online grading and sorting method for agricultural products based on multiple indicators of priority, comprising the following steps:
[0056] S1. The sample is transported to the testing station via the feeding and sorting module. A testing trigger signal is generated after the sample is in place.
[0057] S2. The controller module receives the sample arrival signal and outputs a spectral acquisition trigger signal;
[0058] S3. The spectral detection module collects the spectral data of the sample and sends the spectral data to the host computer or saves it to a data location that can be read by the host computer.
[0059] S4. The host computer preprocesses the spectral data and calls the trained quality discrimination model to obtain the discrimination results of high-priority defect indicators and low-priority quality indicators of the sample; wherein, a multi-quality indicator priority sorting mechanism is established in advance, setting defect indicators as high-priority indicators and indicators used for quality grade classification as low-priority indicators.
[0060] S5. Determine whether the high-priority defect indicator is abnormal: If it is determined to be abnormal, a defect removal level code is directly generated, and the low-priority quality level division is no longer performed; if it is determined to be normal, a corresponding quality level code is generated based on the threshold range into which the detected or predicted value of the low-priority quality indicator falls.
[0061] S6. The host computer writes the grade code into the designated data storage area of the controller module via industrial communication.
[0062] S7. The controller module adds the grade code to the sample position queue and updates the queue synchronously according to the conveying cycle, position detection signal or the operating status of the conveying mechanism, so that the grade code moves forward synchronously with the position of the corresponding sample on the conveying line, and realizes the binding and synchronization of the detection result with the position of the corresponding sample on the conveying line.
[0063] S8. When the target sample arrives at the sorting station, the controller module outputs the corresponding sorting channel control signal according to the grade code corresponding to the sample position queue, and drives the sorting execution mechanism to complete the grading or rejection action.
[0064] The spectral acquisition, priority determination, queue synchronization, and sorting execution form a closed-loop process.
[0065] The sample sensing and acquisition methods in step S3 include one or more of the following: spectral detection, machine vision acquisition, and weighing; the spectral detection is used to obtain internal quality information of the sample, the machine vision acquisition is used to obtain surface defects and appearance features of the sample, and the weighing is used to obtain sample weight information; the host computer integrates the multi-source sensing data after fusion processing to obtain the sample quality discrimination result.
[0066] In this embodiment, the high-priority defect index in step S4 includes one or more internal defects and surface defects. Multiple defects are judged by the same discrimination model, and as long as a sample is determined to have any one or more high-priority defects, a defect rejection level code is directly generated. The high-priority defects are subject to either a unified rejection rule or a threshold-based classification rule. Under the unified rejection rule, any defect is directly rejected. Under the threshold-based classification rule, rejection, downgrading, or release processing is performed based on the threshold range corresponding to the defect severity quantification value.
[0067] In this embodiment, the low-priority quality indicators in step S4 include one or more of dry matter content, sugar content, starch content, and weight. When multiple low-priority indicators are used, a quality grade code is generated by combining the threshold ranges of each indicator. The grade can be further subdivided or modified based on weight in addition to the component content grading. In step S4, a cascaded discriminant model is used to complete the quality discrimination. The host computer first calls the high-priority defect discrimination model to output the defect judgment result, and only calls the low-priority quality discrimination model to complete the quantitative prediction for samples judged to be without defects. The defect judgment method is that the model directly outputs normal or abnormal, or the model outputs a probability value and compares it with a preset threshold. The threshold corresponding to each indicator can be adjusted according to the sample variety, processing purpose, enterprise grading standards, and model calibration results. After the model inference is completed in step S4, the host computer locally archives and saves the original spectral data, inference results, and grade codes for production traceability and equipment debugging.
[0068] In this embodiment, the grade coding adopts a combination structure of defect rejection coding and quality grade coding. The coding format is an integer or enumerated value, which corresponds one-to-one with each sorting channel through a preset mapping relationship. The sample position queue is implemented through the internal circular shift register of the controller; each unit of the queue corresponds to a sample position or a single conveying cycle on the conveyor line, and the queue shift update is triggered by the position detection signal or the conveying cycle signal.
[0069] In this embodiment, the spectral detection adopts any one of the following spectral acquisition methods: visible light, near-infrared, visible near-infrared, and short-wave near-infrared; the quality discrimination model is selected from machine learning model, deep learning model, statistical discrimination model, or a combination thereof; the host computer and the controller module transmit the grade code using any one of the following industrial communication methods: industrial Ethernet / fieldbus, or serial communication.
[0070] In this embodiment, the sorting actuator is any one of a solenoid valve, cylinder, lever, flow guide mechanism, or jetting mechanism. It receives control signals from the controller and guides the sample into the corresponding rejection channel or quality grading channel.
[0071] To further elaborate, the online grading and sorting method for agricultural products with multiple priority indicators provided in this embodiment follows a preset timing relationship between sample arrival triggering, spectral acquisition triggering, and sorting execution: After the sample arrives at the detection station, the position detection element generates an arrival trigger signal; the controller module, in conjunction with the arrival trigger signal, interlock conditions, and a preset delay, outputs a spectral acquisition trigger signal; after the host computer reads the spectral data and completes model inference, it writes the grade code into the designated data area of the controller module; the controller module adds the grade code to the sample position queue, which shifts synchronously with the conveying cycle or position detection signal; when the target sample arrives at the sorting station, the controller module outputs the corresponding sorting channel action. Through the above timing control, timing deviations caused by factors such as conveying speed fluctuations and sensor response delays can be suppressed, thereby achieving spatiotemporal synchronization between sample position, spectral acquisition action, and sorting execution action.
[0072] The sample position queue can be implemented by a cyclic shift register within the controller. Each unit in the queue corresponds to a sample position or a conveying cycle on the conveyor line. As the conveyor mechanism operates, the controller module triggers the queue to shift and update based on the position detection signal or the conveying cycle, so that each grade code moves forward synchronously with the corresponding sample's position on the conveyor line, thereby reading the correct grade code when the sample arrives at the sorting station.
[0073] In this embodiment of the invention, for example, in a specific implementation, the sample is a potato, the high-priority defect indicator is black heart defect, and the low-priority quality indicator is dry matter content. When a sample is determined to be black heart, the system directly outputs a defect rejection level code; when a sample is determined to be non-black heart, the system outputs a corresponding quality level code based on its predicted dry matter content.
[0074] Specifically, in the online potato sorting embodiment, the system sets black-heart defects as a high-priority indicator and dry matter content as a low-priority quality indicator. When a potato sample is determined to have black heart or other internal defects, the system directly outputs a defect rejection code without further quality grading. When a sample is determined not to be black-hearted, the system grading its quality based on its dry matter content. Non-black-hearted samples can be divided into multiple quality grades according to their dry matter content, from high to low. The specific number of quality grades and their corresponding thresholds can be adjusted according to the potato variety, processing purpose, or enterprise grading standards. For example, samples with a dry matter content not lower than a certain upper threshold can be classified as the highest quality grade, and then classified into other quality grades according to the adjacent threshold ranges to which the dry matter content falls, thereby achieving multi-level quality grading for non-black-hearted samples.
[0075] After the aforementioned grade code is written into the controller module via the communication module, the queue synchronization control logic of the controller module tracks the sample position and drives the corresponding sorting channel when the sample arrives at the sorting station to complete the grading or rejection action of the corresponding grade.
[0076] It is worth noting that the spectral detection module in this embodiment can employ visible light, near-infrared, visible-near-infrared, short-wave near-infrared, or other spectral acquisition methods suitable for internal quality detection. The quality discrimination model can be a machine learning model, a deep learning model, a statistical discrimination model, or a combination of the above models; the deployment of the model can be adjusted according to the operating environment of the host computer. The communication module can employ industrial Ethernet, fieldbus, serial communication, or other industrial communication methods; the controller module can be a programmable logic controller (PLC), motion controller, embedded controller, or other control device with equivalent queue control and output control capabilities. The sorting execution module can employ solenoid valves, cylinders, levers, flow guiding mechanisms, spraying mechanisms, or other execution mechanisms that can guide samples into different channels.
[0077] Furthermore, the high-priority defect indicators in this embodiment may include one or more of internal and surface defects. Taking potatoes as an example, internal defects may include black heart, internal discoloration, hollowness, etc., which can be identified by transmission spectroscopy; surface defects may include black spur disease, scab disease, green skin, mechanical damage, insect damage, deformity, etc., which can be identified by machine vision; the above defect types can be defined with reference to relevant commercial potato grading standards (e.g., GB / T 31784). In the case of multiple defects coexisting, the system may adopt one or more arbitration rules such as unified rejection or threshold grading: under the unified rejection rule, as long as a sample is determined to have any one or more high-priority defects, the system generates a defect rejection level code and no longer performs low-priority quality grade classification; under the threshold grading rule, the system may set one or more degree thresholds for high-priority defects, and perform different treatments such as rejection, downgrading, or release on the sample according to the threshold range into which the quantified value of the defect degree falls. The selection of the above arbitration rules and the corresponding thresholds can be set according to the defect type, processing purpose, or production line configuration.
[0078] In this embodiment, the detection methods can be a combination of one or more of spectral detection, machine vision, and weighing. When multiple detection methods are used, the host computer analysis module can fuse and distinguish multi-source detection data; the specific type, quantity, and installation location of each detection method can be adjusted according to the sample object, defect type, and production line configuration. The low-priority quality indicators can include one or more of component content (e.g., dry matter content, sugar content, starch content, etc.) and weight. The weight information can be obtained by weighing and incorporated into the priority coding system as an independent quality grading dimension, participating in the quality grade division along with indicators such as component content. Weight is treated as a low-priority quality indicator in the priority system, meaning it only participates in quality grade division if the sample does not have high-priority defects; its threshold range and grading method can be adjusted according to processing purpose, enterprise grading standards, or production line configuration.
[0079] Another embodiment of the present invention provides an online grading and sorting system 300 for agricultural products with multiple priority indicators, used to execute the online grading and sorting method described above. The online grading and sorting system includes: a feeding and sorting module 310, which is connected to a spectral detection station at its discharge end along the sample conveying flow direction; a spectral detection module 320 and a host computer analysis module 330, with the signal output end of the spectral detection module 320 connected to the host computer analysis module 330; a communication module 340 and a controller module 350, with the host computer module 330 communicating bidirectionally with the controller module 350 via the communication module 340; a sample position queue module 360 and a sorting execution module 370, with the controller module 350 signal-connected to the spectral detection module 320, the sample position queue module 360, and the sorting execution module 370. The sample position queue module 360 is built into the controller, and the material and signal links of each module form a complete closed loop.
[0080] In this embodiment, the feeding and sorting module outputs a sample arrival trigger signal to the controller module, which is used to organize the single-column fixed-distance transport of samples and trigger acquisition; the spectral detection module receives the acquisition trigger signal sent by the controller module, acquires multi-band spectral data and uploads it to the host computer; the host computer is equipped with a cascaded discrimination model to complete spectral preprocessing, priority discrimination, level encoding generation and local data archiving, and the encoding is sent to the controller module via the communication module.
[0081] The controller module is a PLC, motion controller, or embedded controller, with a built-in sample position queue module composed of a cyclic shift register. The controller module receives grade codes from the host computer and stores them in the queue. Based on the conveying cycle and position signals, it drives the queue to shift synchronously, achieving a binding and matching between the code and the sample position. After the sample arrives at the sorting station, it outputs a sorting control signal. The sorting execution module is located at the sorting station and includes at least one actuator, such as a solenoid valve, cylinder, lever, flow guide mechanism, or blowing mechanism. It receives the sorting control signal from the controller and, according to the preset mapping relationship between the grade code and the sorting channel, guides defective samples into the rejection channel and qualified samples into the corresponding quality grading channel.
[0082] In this embodiment, the online grading and sorting system can be equipped with a machine vision acquisition module and / or a weighing module. Both the vision acquisition module and the weighing module are connected to the host computer. The host computer integrates spectral, visual, and weighing data for comprehensive discrimination. The system can configure unified rejection or threshold grading rules for high-priority defects, and low-priority indicators can be graded in combination with component content and weight for multi-dimensional joint grading, so as to realize non-destructive, continuous, and automated closed-loop sorting of agricultural products.
[0083] The online grading and sorting system for agricultural products with multiple priority indicators provided in this embodiment is described in more detail. This system includes a feeding and sorting module, a spectral detection module, a host computer analysis module, a communication module, a controller module, a sample position queue module, and a sorting execution module. Specifically, the feeding and sorting module transports the samples to be tested to the testing station in a single column or at a relatively stable interval; the spectral detection module collects the spectral information of the samples when they arrive at the testing station; the host computer analysis module preprocesses the spectral data and calls a trained quality discrimination model to obtain the discrimination results of multiple quality indicators for the samples; the communication module transmits the grade code generated by the host computer to the controller module; the controller module receives the grade code and tracks the samples during the transport process in conjunction with the sample position queue; and the sorting execution module drives the corresponding sorting channel to complete the grading or rejection action when a sample arrives at the corresponding sorting position.
[0084] Furthermore, the detection methods in this embodiment of the invention are not limited to spectral detection, but may also include one or more sensing methods such as machine vision acquisition and weighing. Specifically, the spectral detection module is used to acquire the internal quality information of the sample (e.g., internal defects and component content), the machine vision module is used to acquire the surface defects and appearance features of the sample, and the weighing module is used to acquire the weight information of the sample; the host computer analysis module processes and judges the detection data from the above-mentioned one or more sources, and comprehensively obtains the quality judgment result of the sample.
[0085] Furthermore, the high-priority defect indicators in this embodiment are not limited to a single defect, but may include multiple defect types. The discrimination of these multiple defects can be achieved by the same discrimination model, which outputs corresponding discrimination results for different defect types. When a sample is determined to have any one or more high-priority defects, the system generates a defect rejection level code and does not perform low-priority quality level classification. This embodiment establishes a multi-quality indicator priority sorting mechanism. The system sets defect-type quality indicators that affect safety, processing suitability, or marketability as high-priority indicators, and sets indicators used for quality level classification, such as dry matter content, sugar content, starch content, and maturity, as low-priority indicators. When a high-priority defect indicator is determined to be abnormal, the system directly generates a defect rejection level code; when a high-priority defect indicator is determined to be normal, the system then performs level classification based on the low-priority quality indicators.
[0086] In this embodiment, the grade coding adopts a hierarchical structure combining "defect rejection coding and quality grade coding". When a high-priority defect indicator is determined to be abnormal, the system directly generates a defect rejection code without further grade classification. When a high-priority defect indicator is determined to be normal, the system then generates a corresponding quality grade code based on the threshold range into which the detected or predicted values of low-priority quality indicators fall. The grade code can use integers, enumerated values, or other data formats recognizable by the controller, and corresponds one-to-one with different sorting channels through a pre-established mapping relationship. The low-priority quality indicators are not limited to a single component content, but can include one or more indicators used for quality grade classification, such as component content and weight. When multiple low-priority quality indicators are used, the system can comprehensively generate a corresponding quality grade code based on the threshold range into which the detected or predicted values of each indicator fall. For example, under the premise that a high-priority defect is determined to be normal, the system can further subdivide or modify the quality grade based on weight, in addition to classifying the quality grade according to component content.
[0087] In this embodiment, the quality discrimination can be implemented using a cascaded discrimination model. The host computer first calls a high-priority defect discrimination model to determine whether a sample has a defect; then, for samples determined to be non-defective, a low-priority quality discrimination model is called for quantitative prediction. The high-priority defect index can be obtained by directly outputting abnormal or normal results from the discrimination model, or by comparing the probability value output by the model with a preset threshold; the low-priority quality index generates corresponding grade codes based on the different threshold intervals into which its detected or predicted values fall. The aforementioned thresholds can be adjusted according to the sample type, processing purpose, enterprise grading standards, or model calibration results.
[0088] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements all the steps of the online grading and sorting method for multiple indicators of agricultural products as described above.
[0089] The following is a specific implementation plan: a complete example of online grading and sorting of agricultural products (taking potatoes as an example).
[0090] This embodiment uses potatoes as the sample to be tested to fully illustrate the online grading and sorting system and method of the present invention. The high-priority defect indicator is black heart defect, and the low-priority quality indicator is dry matter content.
[0091] System components: such as Figure 4As shown, the online grading and sorting system of this embodiment includes a feeding and sorting module, a spectral detection module, a host computer analysis module, a communication module, a controller module, a sample position queue module, and a sorting execution module. The feeding and sorting module arranges the samples into a suitable transport state for detection, allowing the samples to pass sequentially through the detection station and the sorting station. The spectral detection module collects the spectral data when the sample arrives at the detection station. The host computer analysis module preprocesses and performs quality judgment on the spectral data, generating the final grade code. The communication module transmits the grade code to the controller module. The controller module adds the grade code to the sample position queue and updates the queue according to the transport rhythm. The sorting execution module completes the grading or rejection action based on the output signal of the controller.
[0092] Method and process: such as Figure 3 As shown, after the sample arrives at the detection station, an arrival trigger signal is generated. Based on this, the controller module outputs a spectral acquisition trigger signal, and the spectral detection module completes spectral acquisition. The host computer reads the spectral data, performs preprocessing, and calls the quality discrimination model.
[0093] The host computer first determines whether high-priority defect indicators are abnormal: when a high-priority defect indicator is determined to be abnormal, the system generates a defect rejection level code; when a high-priority defect indicator is determined to be normal, the system generates a quality level code based on low-priority quality indicators. The final level code is then written to the designated data storage area of the controller module via the communication module.
[0094] Taking potatoes as an example, the host computer first determines whether the potato has a black heart defect: if it is determined to be black heart or has other internal defects, a defect rejection code is directly generated; if it is determined not to be black heart, it is classified into multiple grades based on the predicted value of its dry matter content. The grade code may include a defect rejection grade and multiple quality grades, and the specific number of grades, grade thresholds, and sorting channels can be adjusted according to the variety, processing purpose, or production line configuration.
[0095] Deployment and integration of cascaded discriminant models: such as Figure 6As shown, the host computer analysis module uses a cascaded discriminant model to determine the internal quality of samples. The cascaded discriminant model includes a high-priority defect discrimination sub-model and a low-priority quality prediction sub-model, both deployed on the host computer as pre-trained models and exportable to a general inference format for loading by the host computer's inference engine. Upon receiving a spectral acquisition trigger signal, the host computer synchronously acquires and caches spectral data, then calls the defect discrimination sub-model to output the defect discrimination result; for samples determined to be non-defective, it calls the quality prediction sub-model to output the predicted quality index value. The inference results are archived locally on the host computer and converted into a grade code, then transmitted in real-time to the controller module via industrial communication.
[0096] The defect discrimination sub-model and quality prediction sub-model can be obtained by using machine learning models, deep learning models or statistical discrimination models, and can be obtained by adopting the corresponding model calibration or update methods according to the sample varieties; the model deployment form, inference framework and data archiving method of the host computer can be adjusted according to the actual operating environment.
[0097] Communication, sample location queue synchronization and sorting execution: such as Figure 5 As shown, upon receiving the grade code, the controller module does not immediately drive the sorting mechanism. Instead, it adds the grade code to the sample position queue. Each unit in the queue corresponds to a sample position or a conveyor cycle on the conveyor line. As the conveyor mechanism operates, the controller module updates the queue based on the position detection signal or cycle signal. When a target sample moves to the sorting station, the controller module reads the queue unit corresponding to that position and outputs a sorting control signal based on the grade code within it, thereby ensuring that the detection results are synchronized with the actual samples on the conveyor line.
[0098] Furthermore, the sample position queue can be implemented by a circular shift register within the controller. After receiving and verifying the grade code data frame transmitted from the host computer, the controller writes the grade code into the queue entry unit. The queue is composed of multiple shift units connected in series. When the preconditions for sorting execution are met, the queue update enable is activated, and the controller sequentially performs shift operations on each shift unit, passing the grade codes in the queue forward in sequence to form a closed loop. The shift update can be triggered by a conveyor cycle signal, a grid cycle detection signal, or a position detection signal. The number of queue units can be configured according to the number of sample positions between the detection station and the sorting station, the number of sorting channels, and the conveyor cycle.
[0099] like Figure 7As shown, different grade codes correspond to different sorting channels. When a sample arrives at the sorting position, the controller module outputs a corresponding channel control signal to drive the actuator to guide the sample into the corresponding channel. The defect rejection grade corresponds to the defect rejection channel, and the non-defect quality grade corresponds to the corresponding quality grading channel.
[0100] Online Inspection and Grading Verification: To verify the performance of the system of this invention under continuous conveying dynamic conditions, the system described in this embodiment was used to conduct online inspection and grading verification of potato samples. The verification used 425 samples, independent of the model training and optimization process, including 250 defective (black-hearted) samples and 175 healthy samples (containing multiple varieties). Before the test, defective and healthy samples were randomly mixed and their testing order was shuffled. During the verification process, the samples were transported to the inspection station in a single column via the feeding and sorting module. The spectral detection module collected their visible and near-infrared transmission spectra. The host computer invoked the cascaded discrimination model to complete defect identification and dry matter content prediction and generate grade codes. After synchronizing with the sample position queue, the controller module drove the sorting actuator to complete defect rejection and quality grading.
[0101] The whole-machine verification in this embodiment focuses on two dimensions: black-heart defects in high-priority defects and dry matter content in low-priority quality indicators. The system architecture of this invention supports other defect types, machine vision, and weighing detection methods, which are part of the system's scalability and are not within the scope of the data statistics in this verification.
[0102] In terms of online identification of high-priority defects (black-hearted) samples, the system correctly identified 242 out of 250 defective samples and 168 out of 175 healthy samples, with a false negative rate of 3.2% for defective samples and a false negative rate of 4.0% for healthy samples. The accuracy, precision, recall, specificity, and F1 score of the online identification are shown in Table 1.
[0103] Table 1. Online identification performance of high-priority defects (black hearts)
[0104]
[0105] In terms of online prediction of low-priority quality indicators (dry matter content), the system's root mean square error (RMSEP) for multiple healthy varieties was controlled within 1.0 g / 100 g. The predicted and measured values for each variety showed a good linear correlation, indicating that the system can still maintain good quantitative prediction capabilities under mixed-variety conditions.
[0106] Regarding quality grading, this embodiment divides samples into five grades based on internal quality conditions: non-defective samples are graded from high to low dry matter content into grades one to four; samples with defects (black hearts) are no longer subdivided according to dry matter content, but are uniformly classified into five grades and directly rejected. The specific grading scheme is shown in Table 2 (where the dry matter content threshold can be adjusted according to the variety, processing purpose, or enterprise grading standards).
[0107] Table 2 Defect and Quality Grade Classification Scheme (Example)
[0108]
[0109] In the online grading verification of the whole machine, the overall grading accuracy of 425 independent samples reached 92.7%, and the grading results of each level are shown in Table 3. The results show that the priority grading mechanism and sample position queue synchronization mechanism of the present invention can stably and accurately convert the model discrimination results into sorting execution actions under continuous dynamic conveying conditions.
[0110] Table 3. Verification results of online grading of potatoes by machine
[0111]
[0112] The above-mentioned whole-machine verification results show that the system described in this invention can realize non-destructive, continuous, and automated online grading and sorting of the internal quality of agricultural products, and achieves good comprehensive performance in defect identification, quality prediction and grading execution under real dynamic working conditions, and has strong engineering adaptability and application feasibility.
[0113] In this embodiment, the high-priority defect indicators of the system include multiple defect types. The host computer acquires the internal quality information of the sample through spectral detection, acquires the surface defects and appearance features of the sample through machine vision, and can combine this with weighing to acquire the weight information of the sample. The discrimination between the aforementioned internal defects and surface defects is completed by the same discrimination model. This discrimination model outputs corresponding discrimination results for different defect types. The discrimination results can be the presence or absence of defects, or they can be quantitative values reflecting the degree of defects (e.g., defect probability, defect area ratio, or defect level).
[0114] The system can employ one or more of the following rules to handle various high-priority defects:
[0115] 1. Unified Rejection Rules. When a sample is determined to be free of any high-priority defects, the system proceeds to the low-priority quality level classification process, generating a corresponding quality level code based on the quality indicators. When a sample is determined to contain any one or more high-priority defects, regardless of its low-priority quality indicators, the system directly generates a defect rejection level code without further quality level classification.
[0116] 2. Threshold Classification Rules. The system can set one or more severity thresholds for high-priority defects and process samples differently based on the threshold range into which the quantified defect severity falls: When the defect severity exceeds the rejection threshold, a defect rejection level code is generated and the defect is rejected. When the defect severity does not exceed the rejection threshold but reaches the downgrade threshold, the sample is not rejected and is classified into the corresponding downgraded quality level or secondary channel. When the defect severity is below the downgrade threshold, it is considered acceptable and continues to enter the low-priority quality level classification process.
[0117] Regardless of the sorting rules used, any high-priority defect that meets the corresponding rejection criteria can disqualify the sample's quality level, thus preventing defective samples from being mistakenly classified into the qualified or high-grade channels simply because they have a superior quality indicator.
[0118] As an optional implementation, different defect types can correspond to different rejection codes, downgrade codes, and corresponding sorting channels, so as to classify and collect or process defect samples of different natures and degrees separately. The specific defect types, degree thresholds, number of channels, and their corresponding relationships can be configured according to actual production needs.
[0119] In this embodiment, assuming the sample does not have high-priority defects, the system's low-priority quality level classification can be based on multiple dimensions, including component content and weight. Component content may include dry matter content, sugar content, starch content, etc., while weight information can be obtained through weighing.
[0120] The system, based on quality grades determined by component content, can further subdivide or refine these grades by incorporating weight, resulting in a more precise quality classification. Weight is treated as a low-priority quality indicator in the priority system, meaning it only participates in quality grading when the sample does not exhibit high-priority defects. Its threshold range and grading method can be adjusted according to processing purpose, enterprise grading standards, or production line configuration.
[0121] In summary, the online grading and sorting method and system for agricultural products with multiple priority indicators provided by this invention forms a closed loop with spectral acquisition, priority discrimination, queue synchronization and sorting execution, which can realize non-destructive, continuous and automated online grading and sorting of the internal quality of agricultural products, and has strong engineering adaptability and scalability.
[0122] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only.
[0123] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. 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 method for online grading and sorting of agricultural products based on multiple priority indicators, characterized in that: Includes the following steps: S1. The sample is transported to the testing station via the feeding and sorting module. A testing trigger signal is generated after the sample is in place. S2. The controller module receives the sample arrival signal and outputs the spectral acquisition trigger signal; S3. The spectral detection module collects the spectral data of the sample and sends the spectral data to the host computer or saves it to a data location that can be read by the host computer. S4. The host computer preprocesses the spectral data and calls the trained quality discrimination model to obtain the discrimination results of high-priority defect indicators and low-priority quality indicators of the sample; wherein, a multi-quality indicator priority sorting mechanism is established in advance, setting defect indicators as high-priority indicators and indicators used for quality grade classification as low-priority indicators. S5. Determine whether the high-priority defect indicator is abnormal: If it is determined to be abnormal, a defect removal level code is directly generated, and the low-priority quality level division is no longer performed; if it is determined to be normal, a corresponding quality level code is generated based on the threshold range into which the detected or predicted value of the low-priority quality indicator falls. S6. The host computer writes the grade code into the designated data storage area of the controller module via industrial communication. S7. The controller module adds the grade code to the sample position queue and updates the queue synchronously according to the conveying cycle, position detection signal or the operating status of the conveying mechanism, so that the grade code moves forward synchronously with the position of the corresponding sample on the conveying line, and realizes the binding and synchronization of the detection result with the position of the corresponding sample on the conveying line. S8. When the target sample arrives at the sorting station, the controller module outputs the corresponding sorting channel control signal according to the grade code corresponding to the sample position queue, and drives the sorting execution mechanism to complete the grading or rejection action. The spectral acquisition, priority determination, queue synchronization, and sorting execution form a closed-loop process.
2. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 1, characterized in that: The sample sensing and acquisition methods in step S3 include one or more of the following: spectral detection, machine vision acquisition, and weighing; the spectral detection is used to obtain internal quality information of the sample, the machine vision acquisition is used to obtain surface defects and appearance features of the sample, and the weighing is used to obtain sample weight information; the host computer integrates the multi-source sensing data after fusion processing to obtain the sample quality discrimination result.
3. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 1, characterized in that: The high-priority defect indicators in step S4 include one or more internal defects and surface defects. Multiple defects are judged by the same discrimination model. As long as a sample is judged to have any one or more high-priority defects, a defect elimination level code is directly generated.
4. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 3, characterized in that: The high-priority defects are subject to either a unified rejection rule or a threshold-based classification rule. Under the unified rejection rule, any defect is directly rejected. Under the threshold-based classification rule, rejection, downgrading, or release are performed based on the threshold range corresponding to the quantified defect severity value.
5. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 1, characterized in that: In step S4, the low-priority quality indicators include one or more of dry matter content, sugar content, starch content, and weight. When multiple low-priority indicators are used, the quality grade code is generated by combining the threshold ranges of each indicator. The grade can be further subdivided or modified based on the component content grading and weight.
6. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 1, characterized in that: In step S4, a cascaded discriminant model is used to complete the quality discrimination. The host computer first calls the high-priority defect discrimination model to output the defect judgment result, and only calls the low-priority quality discrimination model to complete the quantitative prediction for samples that are judged to be without defects. The defect determination method is to directly output "normal" or "abnormal" from the model, or to compare the model output probability value with the preset threshold; the threshold corresponding to each indicator can be adjusted according to the sample variety, processing purpose, enterprise grading standards, and model calibration results.
7. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 6, characterized in that: After the model inference is completed in step S4, the host computer locally archives and saves the original spectral data, inference results, and grade codes for production traceability and equipment debugging.
8. The online grading and sorting method for agricultural products with multiple priority indicators as described in claim 1, characterized in that: The grade coding adopts a combination structure of defect rejection coding and quality grade coding. The coding format is an integer or enumeration value, and it corresponds one-to-one with each sorting channel through a preset mapping relationship.
9. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 1, characterized in that: The sample position queue is implemented through the internal cyclic shift register of the controller; each unit of the queue corresponds to a sample position or a single conveying cycle on the conveyor line, and the queue shift update is triggered by the position detection signal or the conveying cycle signal.
10. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 1, characterized in that: The spectral detection adopts any one of the following spectral acquisition methods: visible light, near-infrared, visible near-infrared, and short-wave near-infrared; the quality discrimination model selects a machine learning model, a deep learning model, a statistical discrimination model, or a combination thereof; the host computer and the controller module transmit the grade code using any one of the following industrial communication methods: industrial Ethernet / fieldbus or serial communication.
11. The online grading and sorting method for agricultural products with multiple priority indicators according to claim 1, characterized in that: The sorting actuator can be any one of a solenoid valve, cylinder, lever, flow guide mechanism, or spray mechanism. It receives control signals from the controller and guides the sample into the corresponding rejection channel or quality grading channel.
12. An online grading and sorting system for agricultural products with multiple priority indicators, characterized in that: For performing the online grading and sorting method as described in any one of claims 1-11, the online grading and sorting system comprises: The feeding and sorting module is connected to the spectral detection station along the sample conveying flow direction; A spectral detection module and a host computer analysis module, wherein the signal output terminal of the spectral detection module is connected to the host computer analysis module; The host computer module communicates bidirectionally with the controller module via the communication module. The controller module is connected to the spectral detection module, the sample position queue module, and the sorting execution module. The sample position queue module is built into the controller, and the material and signal links of each module form a complete closed loop.
13. The online grading and sorting system for agricultural products with multiple priority indicators according to claim 12, characterized in that: The feeding and sorting module outputs a sample arrival trigger signal to the controller module, which is used to organize the single-column fixed-distance transport of samples and trigger acquisition; the spectral detection module receives the acquisition trigger signal sent by the controller module, acquires multi-band spectral data and uploads it to the host computer; the host computer is equipped with a cascaded discrimination model to complete spectral preprocessing, priority discrimination, level encoding generation and local data archiving, and the encoding is sent to the controller module via the communication module.
14. The online grading and sorting system for agricultural products with multiple priority indicators according to claim 12, characterized in that: The controller module is a PLC, motion controller, or embedded controller, with a built-in sample position queue module composed of a cyclic shift register. The controller module receives the grade code issued by the host computer and stores it in the queue. It drives the queue to shift synchronously according to the conveying rhythm and position signal, so as to realize the binding and matching of the code with the sample position. After the sample arrives at the sorting station, it outputs the sorting control signal.
15. The online grading and sorting system for agricultural products with multiple priority indicators according to claim 12, characterized in that: The sorting execution module is located at the sorting station and includes at least one actuating element such as a solenoid valve, cylinder, lever, flow guide mechanism or spray mechanism; it receives sorting control signals from the controller and, according to the grade code and the preset mapping relationship between sorting channels, imports defective samples into the rejection channel and qualified samples into the corresponding quality grading channel.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements all the steps of the online grading and sorting method for multiple indicators of agricultural products as described in any one of claims 1-11.