A food safety traceability method and system
Through intelligent evaluation and dynamic adjustment strategies based on machine learning models, the speed of the grain processing production line is dynamically adjusted, and the problem of fixed speed in the existing technology cannot cope with complex foreign object detection, achieving higher detection accuracy and quality safety.
Patent Information
- Application Number
- CN202411808912.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, grain processing production lines transport grain at a fixed speed and cannot flexibly respond to the detection needs of different types of foreign objects, resulting in some foreign objects being missing in complex foreign object scenarios, affecting the quality and safety of grain products.
Intelligent evaluation and dynamic adjustment strategies based on machine learning models are introduced to capture foreign body characteristics through micro foreign body accumulation index and dynamic foreign body change index, and dynamically adjust the production line speed to ensure the comprehensive identification and removal of foreign matter.
It significantly improves the accuracy and flexibility of foreign object detection, reduces missed inspections, improves the quality and safety of grain products, and optimizes the production line operation efficiency.
Smart Images

Figure CN119762088A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of food safety tracing, and in particular to a food safety tracing method and system. Background Art
[0002] Food safety traceability refers to the establishment of a transparent and reliable traceability system to achieve traceability of the entire process of food production, processing, circulation and consumption. This system uses information technology, such as barcodes, QR codes or Internet of Things technology, to record key data in the source information, production process, quality inspection and circulation of food, forming a complete information chain for query. The core of the traceability system is to ensure food quality and safety, to quickly locate the source of problems when they occur, to ensure rapid recall or corrective measures, and to enhance consumer confidence in food products.
[0003] Through food safety traceability, we can not only ensure the food safety of the public and avoid health risks caused by negligence in the circulation or production links, but also regulate the food market and improve industry transparency and regulatory efficiency. This system also has positive social and economic benefits for the food industry, such as enhancing brand image, reducing economic losses caused by food safety issues, and strengthening industrial chain collaboration.
[0004] The automatic foreign body detector is a device specially used in grain processing. It can efficiently and accurately detect and remove various foreign bodies that may be present in grain. These foreign bodies include metal particles, stones, plastic fragments, glass and other non-grain impurities. By installing the foreign body detector on the processing line, the equipment can scan the flow state of grain in real time and automatically remove or alarm the detected foreign bodies.
[0005] The prior art has the following deficiencies:
[0006] In the prior art, processing production lines usually convey grains at a fixed speed to pass through foreign matter detectors for inspection. However, this method cannot flexibly respond to the detection needs of different types of foreign matter in grains. When only a small amount of foreign matter is mixed in the grain, the fixed speed can meet the detection needs, but when the foreign matter is of many types and large in number, the fixed speed may limit the recognition ability of the detector. In particular, for certain types of foreign matter (such as smaller metal shavings or lightweight plastics), their detection often takes longer to accurately identify and remove. If the conveying speed is too fast, the detector may not be able to analyze all targets one by one, resulting in some foreign matter being missed, thereby affecting the quality and safety of grain products and increasing food safety risks.
[0007] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0008] The purpose of the present invention is to provide a food safety traceability method and system, which significantly improves the accuracy and flexibility of foreign matter detection by introducing intelligent evaluation and dynamic adjustment strategies based on machine learning models. The micro-foreign matter accumulation index and the dynamic foreign matter change index are used to effectively capture the characteristics of small foreign matter and complex dynamic change scenes. By comparing the foreign matter proportion coefficient with the reference threshold, the simple and complex foreign matter mixing can be accurately distinguished and the production line speed can be dynamically adjusted. In complex scenes, the speed is reduced to ensure comprehensive identification of foreign matter, reduce missed detection, and improve quality and safety; in simple scenes, the preset speed is maintained to optimize efficiency. Combined with real-time data management and intelligent analysis, the system supports food safety traceability, quickly locates risks, ensures safety and helps industry development to solve the problems in the above-mentioned background technology.
[0009] In order to achieve the above object, the present invention provides the following technical solution: a food safety traceability method, comprising the following steps:
[0010] First, the grain processing production line runs at a preset speed, and the foreign matter detector installed on the production line monitors the foreign matter in the grain in real time to obtain real-time foreign matter data information;
[0011] Collect and organize the foreign matter data information obtained in real time to establish an analysis set, and extract key features reflecting the complexity of grain foreign matter from the analysis set;
[0012] Under the detection window, the extracted key feature data is analyzed and processed and then input into the pre-learned machine learning model, and the complexity of foreign matter in the grain is intelligently evaluated through the machine learning model;
[0013] Based on the evaluation results of the machine learning model, the foreign matter mixed in the detection window is divided into simple foreign matter mixed and complex foreign matter mixed;
[0014] For simple foreign matter mixed in, the production line maintains the preset running speed, and the detection system identifies and extracts the foreign matter in the grain according to the normal process;
[0015] In response to the mixing of complex foreign objects, based on the preset production line operation speed, the production line speed is intelligently reduced to provide the detector with more sufficient analysis and processing time, thereby ensuring that foreign objects can be accurately identified and removed while taking production efficiency into consideration as much as possible.
[0016] Preferably, key features reflecting the complexity of foreign matter in grain are extracted from the analysis set, wherein the extracted features include the cumulative proportion of fine foreign matter and the dynamic change characteristics of foreign matter. Within the detection window, the cumulative proportion of fine foreign matter and the dynamic change characteristics of foreign matter are analyzed to generate a micro-foreign matter accumulation index and a dynamic foreign matter change index, respectively. The cumulative proportion of fine foreign matter quantifies the proportion of fine foreign matter in the grain to the total number of foreign matter within the detection window, and the dynamic change characteristics of foreign matter quantify the degree of fluctuation of the types and quantities of foreign matter over time within the detection window, which is expressed by the number of newly added foreign matter and the rate of change of the types per unit time.
[0017] Preferably, the micro-foreign matter accumulation index and the dynamic foreign matter change index obtained after analyzing the extracted key features are input into a pre-learned machine learning model, and a foreign matter proportion coefficient is generated by the machine learning model, and the complexity of foreign matter in the grain is intelligently evaluated by the foreign matter proportion coefficient.
[0018] Preferably, the foreign matter proportion coefficient generated after analyzing the extracted key features is compared and analyzed with a preset foreign matter proportion coefficient reference threshold, and the foreign matter mixing situation of grains under the detection window is divided, and the division steps are as follows:
[0019] If the foreign matter ratio coefficient is greater than or equal to a preset foreign matter ratio coefficient reference threshold, the foreign matter mixing situation of grain under the detection window is classified as complex foreign matter mixing;
[0020] If the foreign matter proportion coefficient is less than a preset foreign matter proportion coefficient reference threshold, the foreign matter mixing in the grain under the detection window is classified as simple foreign matter mixing.
[0021] Preferably, for complex foreign matter mixed in, based on the preset production line running speed, the specific steps of intelligently reducing the production line speed are as follows:
[0022] The deviation of the foreign body ratio coefficient is calculated, and a weighted dynamic adjustment factor is introduced to further enhance the flexibility of complexity judgment. The calculation expression is as follows:
[0023]
[0024] , where ΔFOPC is the foreign body proportional coefficient deviation, FOPC is the foreign body proportional coefficient, and FOPC ref is the reference threshold of the foreign body ratio coefficient, τ is the weighted dynamic adjustment factor, t current is the current detection time point, T window is the total duration of the detection window;
[0025] The target speed adjustment coefficient is calculated according to the foreign body proportional coefficient deviation ΔFOPC, and a nonlinear function is introduced to control the sensitivity of the adjustment. The calculation expression is as follows:
[0026]
[0027] , where is the target speed adjustment coefficient, λ is the sensitivity adjustment parameter, FOPC max is the maximum allowed foreign matter ratio factor, used to normalize the complexity deviation;
[0028] Adjustment factor based on target speed The dynamically adjusted production line speed is calculated based on the preset running speed. In order to enhance robustness, the upper and lower speed limits and foreign body type weights are added. The calculation expression is as follows:
[0029]
[0030] , where v adjusted is the adjusted line speed, v min is the lower limit of production line speed, v max is the upper limit of production line speed, v preset is the preset running speed, max(v min , ...) and min(v max , ...) is to ensure that the adjustment speed is within a safe range;
[0031] In order to monitor the performance of the detection system in real time, the efficiency index is introduced as a measurement indicator to comprehensively evaluate the detection effect after the current production line speed is adjusted. The calculation expression is as follows:
[0032]
[0033] , where η eff is the detection efficiency index, η detect is the foreign body recognition rate η remove is the foreign matter rejection rate, ω· is the complexity deviation influencing factor, reflecting the influence of the foreign body proportion coefficient deviation ΔFOPC on the detection efficiency, ω is the complexity influence weight, is the speed adjustment impact factor, reflecting the impact of speed adjustment on detection efficiency, and K is the speed adjustment impact weight;
[0034] Detection efficiency index η by real-time monitoring eff If the efficiency drops significantly, the dynamic parameters are adjusted through the feedback mechanism to optimize the speed adjustment formula and detection performance, so that the production line maintains the optimal balance between detection accuracy and operating efficiency, forming a closed-loop optimization system.
[0035] Preferably, the specific steps of analyzing the cumulative proportion of fine foreign matter in the detection window and generating the micro foreign matter accumulation index are as follows:
[0036] Under the detection window, the data of all small foreign matter is obtained through the foreign matter detector, including the total number of foreign matter, the number of small foreign matter, the type distribution characteristic vector of small foreign matter and the particle size distribution range of small foreign matter, and the total number of foreign matter is calibrated as N total , the number of small foreign bodies is calibrated as N micro , the type distribution feature vector of small foreign matter is calibrated as F type The particle size distribution range of fine foreign matter is calibrated as D size ;
[0037] In order to quantify the contribution of small foreign matter to the overall foreign matter complexity, the cumulative weight is defined and the calculation expression is as follows:
[0038]
[0039] , where W micro is the cumulative weight, N micro,i is the number of small foreign matter type i, k is the total number of small foreign matter types, that is, the number and types of different types of small foreign matter in the detection window, D size,i It is the particle size range ratio, which indicates the particle size distribution range of fine foreign matter type i. It is calculated as the ratio of the maximum particle size to the minimum particle size of the current type of foreign matter. The calculation formula is as follows:
[0040]
[0041] , where d max,i is the maximum particle size of fine foreign matter type i, d min,i is the minimum particle size of fine foreign matter type i, F type,i is the distribution characteristic component of small foreign body type i, calculated as the normalized probability value, and the calculation formula is as follows:
[0042]
[0043] , where N micro,j is the number of small foreign bodies of type j;
[0044] The time dynamic characteristics are introduced to calculate the accumulation rate adjustment factor of small foreign matter. The calculation expression is as follows:
[0045]
[0046] , where R dynamic is the accumulation rate adjustment factor, t0 and t1 are the detection window start time and detection window end time respectively, ΔN micro (t) is the change in the number of small foreign bodies at time point t, Δt is the time difference, that is, the time interval between two adjacent sampling moments, and ln(1+Δt) is the time adjustment factor;
[0047] Comprehensive cumulative weight W micro and the accumulation rate adjustment factor R dynamic , generate the micro foreign matter accumulation index, the calculation expression is as follows:
[0048]
[0049] , where MFOAI is the micro foreign matter accumulation index.
[0050] Preferably, in the detection window, the dynamic change characteristics of the foreign matter are analyzed to generate the dynamic foreign matter change index in the following specific steps:
[0051] Under the detection window, obtain the foreign body related data, including the type of each foreign body and the distribution of the number of each foreign body over time, and record the data in the form of time series, denoted as S(t), expressed as follows:
[0052] S(t)={C y , N y (t)}=={(C1, N1(t)), (C2, N2(t)), ..., (C m , N m (t))}, S(t) represents the foreign body detection state set at time point t, C y is the type of the yth foreign body, N y (t) represents the number of the yth type of foreign matter at time point t, and m is the total number of foreign matter types detected, that is, C y The total number of types;
[0053] Decompose the time series to extract the newly added type sequence ΔC(t) and the quantity change sequence ΔN y (t), the newly added type sequence ΔC(t) is the number of newly added foreign matter types compared with the time point (t-1), and the calculation expression is as follows:
[0054] ΔC(t)=count(C y (t)\C y (t-1))
[0055] , where C y (t) is the set of foreign body types detected at time point t, C y (t-1) is the set of foreign body types detected at time point (t-1), \ is the difference operation of the set, that is, to filter out the types newly added at the current time point,
[0056] Quantity change sequence ΔN y (t) is the change in quantity between time point t and time point t-1, and the calculation expression is as follows:
[0057] ΔN y (t) = N y (t)-N y (t-1)
[0058] , where N y (t-1) is the number of the yth type of foreign matter at time point t-1;
[0059] In order to evaluate the dynamic changes of foreign body types, the type fluctuation characteristic factor is defined, and the calculation expression is as follows:
[0060]
[0061] , where F C is the type fluctuation characteristic factor, C(t) is the number of foreign matter types accumulated at time point t, and T is the total number of time points;
[0062] In order to quantify the dynamic change of the number of foreign matter, the number change characteristic factor is defined, and the calculation expression is as follows:
[0063]
[0064] , where F N is the quantity change characteristic factor, e -α·t is the time decay weight, α is the time decay factor, and e is the natural base;
[0065] The type fluctuation characteristic factor F C and quantity variation characteristic factor F N Combined, the final dynamic foreign body change index is generated, and the calculation expression is as follows:
[0066]
[0067] , where DFOVI is the dynamic foreign body change index and γ is the type fluctuation characteristic factor F C The weight of β is the quantity change characteristic factor F N The weight of .
[0068] A food safety traceability system, comprising a real-time data acquisition module, a data collection and analysis module, an intelligent evaluation module, a complexity division module, an efficient detection module and an intelligent speed regulation module;
[0069] Real-time data acquisition module, first, the grain processing production line runs at a preset speed, and the foreign matter detector installed on the production line monitors the foreign matter in the grain in real time to obtain real-time foreign matter data information;
[0070] The data collection and analysis module collects and organizes the foreign matter data information obtained in real time to establish an analysis set, and extracts key features reflecting the complexity of foreign matter in grain from the analysis set;
[0071] The intelligent assessment module analyzes and processes the extracted key feature data in the detection window and inputs them into the pre-learned machine learning model, which then conducts an intelligent assessment of the complexity of foreign matter in grains.
[0072] The complexity classification module divides the foreign matter mixed in the detection window into simple foreign matter mixed and complex foreign matter mixed based on the evaluation results of the machine learning model;
[0073] Efficient detection module: for simple foreign matter mixed in, the production line maintains the preset running speed, and the detection system identifies and extracts foreign matter in the grain according to the normal process;
[0074] The intelligent speed control module can intelligently reduce the production line speed based on the preset production line running speed to target the mixing of complex foreign objects, providing the detector with more sufficient analysis and processing time, thereby ensuring that foreign objects can be accurately identified and removed while taking production efficiency into consideration as much as possible.
[0075] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0076] The present invention significantly improves the accuracy and flexibility of foreign matter detection by introducing intelligent evaluation and dynamic adjustment strategies based on machine learning models. The micro-foreign matter accumulation index and dynamic foreign matter change index can effectively capture the characteristics of small foreign matter and foreign matter in complex dynamic change scenarios. By generating a foreign matter proportion coefficient and combining it with a pre-set reference threshold, the system can accurately distinguish between simple foreign matter mixing and complex foreign matter mixing, and then dynamically adjust the production line speed. In complex foreign matter scenarios, reducing the conveying speed provides the detector with sufficient analysis time, ensuring comprehensive identification and removal of foreign matter, effectively reducing missed detections, and improving the quality and safety of grain products.
[0077] The present invention optimizes the operating efficiency of the production line and the food safety management capabilities while ensuring accurate detection of foreign matter. For simple foreign matter mixing scenarios, the preset speed is maintained to avoid unnecessary speed adjustments and ensure production efficiency; while in complex foreign matter mixing scenarios, the speed is dynamically adjusted to ensure detection accuracy and achieve a balance between efficiency and quality. In addition, through real-time data management and intelligent analysis, the system provides comprehensive support for quality traceability throughout the entire life cycle of food, can quickly locate potential sources of food safety risks, enhance regulatory capabilities, and reduce food safety hazards. This intelligent technical solution takes into account the actual needs and safety assurance of grain processing, and provides a more efficient and reliable solution for industry development. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0079] Figure 1 The present invention is a method flow chart of a food safety traceability method.
[0080] Figure 2 This is a module schematic diagram of a food safety traceability system of the present invention. DETAILED DESCRIPTION
[0081] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art.
[0082] The present invention provides Figure 1 A food safety traceability method shown includes the following steps:
[0083] First, the grain processing production line runs at a preset speed, and the foreign matter detector installed on the production line monitors the foreign matter in the grain in real time to obtain real-time foreign matter data information;
[0084] The preset speed refers to the standard conveying speed used by the grain processing production line in the initial operation stage. This speed is usually determined based on the design parameters of the production line, equipment performance and normal production efficiency requirements. It is a fixed value or a speed standard that can be adjusted within a certain range. It represents the balance point that can maintain high production efficiency and meet quality inspection requirements under normal operating conditions.
[0085] The pre-set speed needs to meet the following conditions; first, the speed setting needs to consider the target capacity of the production line, that is, the amount of grain delivered per unit time. It should be able to meet the company's daily production tasks and market demand without affecting the overall capacity due to too low a speed. Secondly, the speed cannot exceed the recognition limit of the foreign body detector. At this speed, the detector needs to ensure that it can accurately collect images or other detection signals of foreign bodies in grains and complete data processing. Too fast a speed may lead to a decrease in detection accuracy, while too slow a speed may reduce production efficiency. Therefore, the pre-set speed must find a reasonable balance between the two.
[0086] Collect and organize the foreign matter data information obtained in real time to establish an analysis set, and extract key features reflecting the complexity of grain foreign matter from the analysis set;
[0087] Collecting and organizing the real-time foreign body data information to establish an analysis set means systematically storing, classifying and structuring the raw data captured by the foreign body detection equipment to form a database or data set that can be used for subsequent analysis and evaluation. This set includes all key information related to foreign bodies, such as quantity, type, size, shape, material, location and timestamp, etc., to facilitate subsequent feature extraction, complexity assessment and decision support.
[0088] The steps involved in collecting and organizing are:
[0089] 1. Data acquisition: Get raw data from the foreign body detector in real time, including foreign body images, characteristic signals or classification information detected by the sensor. Data acquisition needs to ensure that the sampling frequency is high enough to capture all potential foreign bodies and ensure the integrity and non-loss of data.
[0090] 2. Data cleaning: Preprocess the collected raw data to remove redundant, incomplete or abnormal data, such as signal noise or duplicate records.
[0091] 3. Data classification and structuring: Classify and organize the data according to the key attributes of the foreign objects (such as type, size, material, etc.), and store them in a structured format (such as a database table, nested dictionary or a specific data model). This step can improve the operability of the data and facilitate subsequent analysis and feature extraction.
[0092] 4. Time and space tagging: Add a timestamp and a detection location tag to each piece of data so that the distribution characteristics of foreign matter can be associated with the detection time and space range in subsequent analysis.
[0093] 5. Data storage: Store the organized data into an analysis collection to ensure secure storage and accessibility of the data, and provide a standardized data source for subsequent evaluation and model input.
[0094] Through the above steps, the analysis set can not only comprehensively reflect the situation of foreign matter mixing, but also provide accurate data support for subsequent intelligent evaluation and adjustment strategies.
[0095] Under the detection window, the extracted key feature data is analyzed and processed and then input into the pre-learned machine learning model, and the complexity of foreign matter in the grain is intelligently evaluated through the machine learning model;
[0096] Key features reflecting the complexity of foreign matter in grain are extracted from the analysis set, wherein the extracted features include the cumulative proportion of fine foreign matter (such as metal shavings and tiny particles) and the dynamic change characteristics of foreign matter. Within the detection window, the cumulative proportion of fine foreign matter (such as metal shavings and tiny particles) and the dynamic change characteristics of foreign matter are analyzed to generate a micro-foreign matter accumulation index and a dynamic foreign matter change index, respectively. The cumulative proportion of fine foreign matter quantifies the proportion of fine foreign matter in the grain to the total number of foreign matter within the detection window; the dynamic change characteristics of foreign matter quantify the degree of fluctuation of the types and quantities of foreign matter over time within the detection window, which is expressed by the number of new foreign matter added per unit time and the rate of change of the types.
[0097] The micro-foreign matter accumulation index and dynamic foreign matter change index after analyzing the extracted key features are input into the pre-learned machine learning model, and the foreign matter proportion coefficient is generated by the machine learning model. The complexity of foreign matter in grain is intelligently evaluated by the foreign matter proportion coefficient;
[0098] A pre-learned machine learning model refers to an algorithm model that has been fully trained with historical data sets. The model has learned the laws and characteristic patterns related to grain foreign matter detection and can map input data to expected output results. In this scenario, this model generates a foreign matter ratio coefficient by analyzing the micro-foreign matter accumulation index and the dynamic foreign matter change index to quantify the complexity of grain foreign matter. When training the model, it is usually based on a rich and diverse historical foreign matter detection data set that records the correspondence between the number of foreign matter, type distribution, dynamic change characteristics and complexity level. Through training, the model can master the ability to extract features from input data (such as index values), identify complex patterns, and output reliable evaluation results.
[0099] Using a pre-trained model helps to quickly and accurately complete the intelligent assessment of the complexity of foreign matter. First, it can avoid the time cost of repeated learning in real-time detection, and make rapid inferences directly based on the feature patterns mastered in training. Secondly, the model can use complex nonlinear calculations to dig out deep correlations and influences from multiple features (such as the micro-foreign matter accumulation index and the dynamic foreign matter change index) to generate the key evaluation indicator of the foreign matter proportion coefficient. Compared with traditional rule algorithms, machine learning models are more adaptable to the diversity of foreign matter characteristics and fluctuations in complexity, especially in the face of highly dynamic and complex scenarios. It has strong robustness and accuracy. Therefore, pre-trained models are an important technical basis for achieving intelligent, efficient and accurate assessments in grain foreign matter detection scenarios.
[0100] The rapid increase in the cumulative proportion of fine foreign matter (such as metal shavings and tiny particles) usually indicates that the foreign matter in the currently detected grain is of many types and large in number, reflecting the high complexity of foreign matter mixing. This is because fine foreign matter often comes from multiple process links or external pollution sources, and the rapid increase in its proportion may mean that multiple sources have caused mixing at the same time. For example, fine metal shavings may come from mechanical wear, and tiny particles may come from environmental dust or processing residues. Although these foreign matter types are subtle but have different characteristics, the rapid increase in their proportion may be accompanied by a surge in the overall number of foreign matter, and also requires the detection system to cope with a higher complexity of foreign matter distribution. In addition, the difficulty of identifying fine foreign matter is usually higher than that of ordinary foreign matter. The increase in their number will significantly increase the complexity of detection and removal, and increase the diversity and challenge of the overall foreign matter mixing. Therefore, the rapid increase in the cumulative proportion is an important signal of increased foreign matter complexity.
[0101] Under the detection window, the cumulative proportion of small foreign matter is analyzed and the specific steps to generate the micro foreign matter accumulation index are as follows:
[0102] Under the detection window, the data of all small foreign matter (such as metal chips and tiny particles) is obtained through the foreign matter detector, including the total number of foreign matter, the number of small foreign matter, the type distribution feature vector of small foreign matter and the particle size distribution range of small foreign matter, and the total number of foreign matter is calibrated as N total , the number of small foreign bodies is calibrated as N micro , the type distribution feature vector of small foreign matter is calibrated as F type The particle size distribution range of fine foreign matter is calibrated as D size ;
[0103] The type distribution feature vector of small foreign matter is a multidimensional data structure used to represent the proportion or frequency distribution of different types of small foreign matter in the detection window. Each component of this vector corresponds to a type of small foreign matter (such as metal shavings, plastic microparticles, glass fragments, etc.), and the value reflects the proportion of this type of foreign matter to the total number of small foreign matter. For example, the vector F type = [0.4, 0.3, 0.3] means that metal shavings account for 40%, plastic microparticles account for 30%, and glass fragments account for 30% in the detection window. This vector not only reflects the diversity of species, but also reveals the prominent proportion of specific types of small foreign objects. When used to evaluate complexity, the more uniform the distribution of species or the more diverse the types, the higher the complexity.
[0104] The particle size distribution range of fine foreign matter refers to the numerical range of all fine foreign matter particle sizes within the detection window, usually expressed as the ratio or difference between the maximum particle size and the minimum particle size. It reflects the degree of fluctuation in particle size. The greater the difference in particle size, the more complex the physical properties of the foreign matter. For example, metal shavings may have a large particle size range, while plastic microparticles are more concentrated in a certain particle size range. The breadth of the particle size distribution range is an important basis for complexity assessment. A large particle size span may mean a diversity of foreign matter sources, which increases the difficulty of identification and removal by the detection system.
[0105] In order to quantify the contribution of small foreign matter to the overall foreign matter complexity, the cumulative weight is defined and the calculation expression is as follows:
[0106]
[0107] , where W micro is the cumulative weight, N micro,i is the number of small foreign matter type i, indicating the number of a certain type of small foreign matter (such as metal shavings, plastic microparticles, glass fragments, etc.) in the detection window, k is the total number of small foreign matter types, that is, the number of different types of small foreign matter in the detection window, D size,i It is the particle size range ratio, which indicates the particle size distribution range of fine foreign matter type i. It is calculated as the ratio of the maximum particle size to the minimum particle size of the current type of foreign matter. The calculation formula is as follows:
[0108]
[0109] , where d max,i is the maximum particle size of fine foreign matter type i, d min,i is the minimum particle size of fine foreign matter type i, F type,i is the distribution characteristic component of small foreign body type i, indicating the proportion or significance weight of small foreign body type i in the total number of small foreign bodies. It is calculated as the normalized probability value, and the calculation formula is as follows:
[0110]
[0111] , where N micro,j is the number of small foreign bodies of type j;
[0112] Cumulative weight is a comprehensive indicator used to quantify the contribution of fine foreign matter to the complexity of foreign matter within the detection window. It combines multi-dimensional factors such as the number ratio, particle size distribution range, and type distribution characteristics of foreign matter, and evaluates the overall impact of various types of fine foreign matter through weighted accumulation. The core role of cumulative weight is to convert the diversity and complexity of foreign matter into a numerical value that can be used for model analysis, helping to reveal the degree of influence of fine foreign matter on the overall complexity within the current detection window. It can not only reflect the significance of the presence of fine foreign matter (measured by the number ratio), but also evaluate their structural complexity (measured by the particle size distribution range and type characteristics). The cumulative weight provides an accurate and explanatory intermediate variable for the subsequent generation of the foreign matter complexity index, and can serve as an important basis for regulating the speed of the production line or improving the detection strategy.
[0113] The time dynamic characteristics are introduced to calculate the accumulation rate adjustment factor of small foreign matter. The calculation expression is as follows:
[0114]
[0115] , where R dynamic is the accumulation rate adjustment factor, t0 and t1 are the detection window start time and detection window end time respectively, ΔN micro (t) is the change in the number of small foreign bodies at time point t, Δt is the time difference, that is, the time interval between two adjacent sampling moments, and ln(1+Δt) is the time adjustment factor;
[0116] Accumulation rate adjustment factor R dynamic It is a rate indicator used to quantify the dynamic change of the number of small foreign objects in the detection window over time. It reflects the changing trend of small foreign objects at different time points, that is, whether the small foreign objects are mixed in at a steady speed or show a trend of rapid accumulation. The role of the accumulation rate adjustment factor is to reveal the time dynamic characteristics of foreign object mixing. When R dynamic When the value is high, it means that the number of small foreign matter increases rapidly in a short period of time, indicating that the current foreign matter complexity is high, and there may be sudden pollution sources or abnormal fluctuations. This factor places higher demands on the real-time response capability of the detection equipment, and is also an important basis for dynamically adjusting the production line speed.
[0117] The time adjustment factor ln(1+Δt) is a quantitative indicator for nonlinear adjustment of the time interval Δt, which is used to balance the impact of short-term changes and long-term accumulation. Its main function is to give higher weight to situations that change rapidly in a short period of time, while weakening the impact of gentle changes over a longer period of time on the accumulation rate, thereby highlighting the changes of small foreign matter with strong dynamic characteristics. Specifically, the time adjustment factor can keenly capture abnormal fluctuations in a short period of time, help identify the mixing of rapidly changing small foreign matter, and avoid the amplification of changes caused by too long time intervals, thereby making the evaluation results more accurate and sensitive.
[0118] Comprehensive cumulative weight W micro and the accumulation rate adjustment factor R dynamic , generate the micro foreign matter accumulation index, the calculation expression is as follows:
[0119]
[0120] , where MFOAI is the micro foreign matter accumulation index.
[0121] Under the detection window, the larger the performance value of the micro-foreign matter accumulation index generated after analyzing the cumulative proportion of fine foreign matter, the higher the cumulative proportion of fine foreign matter in the currently detected grain, reflecting that the foreign matter is of many types and large in number, and its complexity is relatively high. The increase in the fine foreign matter accumulation index is usually a direct reflection of the diversification of foreign matter sources and the increase in mixing density, indicating that the number of fine foreign matter detected within the monitoring window has increased significantly. This situation is often accompanied by an increase in the diversity and distribution complexity of foreign matter, which places higher demands on the recognition accuracy and rejection ability of the detection system. On the contrary, if the performance value of the micro-foreign matter accumulation index is small, it means that the proportion of fine foreign matter is low, the total amount of foreign matter in the grain is small, the types and distribution characteristics are simpler, the complexity is low, and it is easier to detect and handle.
[0122] The rapid changes in the dynamic characteristics of foreign matter usually indicate that the foreign matter in the currently detected grain is of many types and large in number, and its complexity is high. Rapid changes mean that the number or type of new foreign matter fluctuates significantly in a unit of time, which indicates that the mixing environment of foreign matter is highly uncertain and dynamic. For example, the frequent increase in the types of foreign matter may be due to the coexistence of multiple pollution sources or the uneven distribution of foreign matter during transportation; while the rapid increase in quantity may indicate that pollutants are concentrated in a certain detection window. This dynamic change increases the difficulty of the detection system to quickly identify the types, characteristics and quantities of foreign matter, and at the same time puts higher requirements on the foreign matter removal strategy. Therefore, it is one of the important signals of the high complexity of grain foreign matter. Rapid dynamic changes not only mean the simple accumulation of a single category of foreign matter, but also reveal the diverse characteristics of the mixing of multiple types of foreign matter, which significantly increases the difficulty of detection and management.
[0123] Under the detection window, the dynamic change characteristics of foreign matter are analyzed and the specific steps for generating the dynamic foreign matter change index are as follows:
[0124] Under the detection window, obtain the foreign body related data, including the type of each foreign body and the distribution of the number of each foreign body over time, and record the data in the form of time series, denoted as S(t), expressed as follows:
[0125] S(t)={C y , N y (t)}={(C1, N1(t)), (C2, N2(t)), ..., (C m , N m (t))}
[0126] , S(t) represents the foreign body detection state set at time point t, C y is the type of the yth foreign body, N y (t) represents the number of the yth type of foreign matter at time point t, and m is the total number of foreign matter types detected, that is, C y The total number of types;
[0127] Decompose the time series to extract the newly added type sequence ΔC(t) and the quantity change sequence ΔN y (t), the newly added type sequence ΔC(t) is the number of newly added foreign matter types compared with the time point (t-1), and the calculation expression is as follows:
[0128] ΔC(t)=count(C y (t)\C y (t-1))
[0129] , where C y (t) is the set of foreign body types detected at time point t, C y (t-1) is the set of foreign body types detected at time point (t-1), \ is the difference operation of the set, that is, to filter out the types newly added at the current time point,
[0130] Quantity change sequence ΔN y (t) is the change in quantity between time point t and time point t-1, and the calculation expression is as follows:
[0131] ΔN y (t) = N y (t)-N y (t-1)
[0132] , where N y (t-1) is the number of the yth type of foreign matter at time point t-1;
[0133] The role of the newly added species sequence is to reflect the dynamic change characteristics of the foreign matter types within the detection window. Specifically, it records the number of newly added foreign matter types at each time point to reveal the changing trend of species diversity over time. This sequence can capture the suddenness and complexity of foreign matter types mixed in grains. For example, at certain moments, the number of foreign matter types suddenly increases due to new pollution sources or fluctuations in transportation processes. By analyzing the newly added species sequence, we can judge the complexity of the current pollution environment and the diversity of pollution sources, and put forward higher requirements on the classification ability of the foreign matter detection system. If the newly added species sequence value is high, it means that the source of the pollution types is complex, and more flexible identification and elimination strategies are required.
[0134] The role of the quantity change sequence is to quantify the dynamic change amplitude of the number of each foreign body within the detection window, reflecting the scale fluctuation and unevenness of foreign body mixing. This sequence can help identify whether a certain foreign body is growing or decreasing rapidly within a specific time period, such as a sudden increase in the number of a certain type of foreign body flowing in due to concentrated pollution or adjustment of the detection process. By analyzing the quantity change sequence, the foreign body removal strategy can be optimized, especially for foreign bodies with drastic quantity fluctuations, the parameters of the detection equipment can be dynamically adjusted to more effectively clean up the mixed foreign bodies. If most of the values in the quantity change sequence show significant fluctuations, it means that the current foreign body mixing environment is unstable and further intervention and process optimization are required.
[0135] In order to evaluate the dynamic changes of foreign body types, the type fluctuation characteristic factor is defined, and the calculation expression is as follows:
[0136]
[0137] , where F C is the type fluctuation characteristic factor, C(t) is the number of foreign matter types accumulated at time point t, and T is the total number of time points;
[0138] The type fluctuation characteristic factor is a quantitative indicator used to evaluate the dynamic change characteristics of foreign body types within the detection window. It reveals the diversity and dynamics of foreign body types by comprehensively considering the time changes of the number of newly added types ΔC(t) and the cumulative number of types C(t). Specifically, the type fluctuation characteristic factor reflects the fluctuation amplitude and frequency of foreign body types in the time dimension. For example, when the factor value is high, it means that the frequency of new foreign body types is high or the types change significantly, indicating that the current detection environment is complex and the sources of foreign body types are diverse; when the factor value is low, it means that the foreign body types are relatively stable and the environmental complexity is low. The role of the type fluctuation characteristic factor is to help the detection system identify complex types of mixing, provide a basis for dynamically adjusting the detection strategy (such as classification model or rejection parameters), thereby improving the system's detection capability and adaptability to diverse foreign bodies.
[0139] In order to quantify the dynamic change of the number of foreign matter, the number change characteristic factor is defined, and the calculation expression is as follows:
[0140]
[0141] , where F N is the quantity change characteristic factor, e -α·t is the time decay weight, α is the time decay factor, and e is the natural base;
[0142] The quantity change characteristic factor is a comprehensive indicator used to quantify the dynamic fluctuation characteristics of the number of foreign objects in the detection window. It analyzes the increase and decrease of the number of each foreign object at different times (the quantity change increment ΔN y (t)) and the overall fluctuation of the number of various foreign objects, reflecting the complexity and dynamic change of foreign object mixing. Its function is to measure the frequency and amplitude of the change in the number of foreign objects, and provide a basis for subsequent complexity assessment.
[0143] Time decay weight is an adjustment mechanism used to give more weight to data at recent time points in calculations, while gradually reducing the weight of data at distant time points. It is specifically expressed as an exponential function e -α·t , as time t increases, the weight gradually decreases, highlighting the impact of recent quantity changes on characteristic factors. Its function is to focus on the dynamic change characteristics of recent data, thereby improving the real-time and sensitivity of the results.
[0144] The time decay factor α is the core parameter in the time decay weight, which controls the speed and magnitude of decay. A larger α value means that the weight decays faster and the impact of distant data on the results is lower; a smaller α value makes the decay slower and the impact of distant data is higher. Its function is to adjust the intensity of time decay to adapt to different dynamic detection needs, such as giving priority to recent data in a rapidly changing environment.
[0145] The type fluctuation characteristic factor F C and quantity variation characteristic factor F N Combined, the final dynamic foreign body change index is generated, and the calculation expression is as follows:
[0146]
[0147] , where DFOVI is the dynamic foreign body change index and γ is the type fluctuation characteristic factor F C The weight of the type change indicates the importance of the type change in the dynamic complexity evaluation, and β is the quantity change characteristic factor F N The weight represents the regulation of the impact of quantity dynamics on the index.
[0148] The larger the performance value of the dynamic foreign matter change index generated after analyzing the dynamic change characteristics of foreign matter in the detection window, the more complex the foreign matter in the grain being detected is. On the contrary, a smaller performance value indicates that the foreign matter is of a single type and small in number, and the complexity is low. The dynamic foreign matter change index reflects the degree of dynamic fluctuation of the number and type of foreign matter within the monitoring window. When the index value is high, it means that the inflow of foreign matter is high-frequency, diverse, and unstable, which is usually accompanied by more complex detection and processing requirements; when the index value is low, it means that the mixing of foreign matter is relatively stable and small in scale, and the complexity and pressure faced by the system are relatively low.
[0149] The machine learning model is not limited here, and any machine learning model that can perform a comprehensive analysis of the micro foreign matter accumulation index MFOAI and the dynamic foreign matter change index DFOVI to generate the foreign matter proportion coefficient FOPC can be used. In order to realize the technical solution of the present invention, the present invention provides a specific implementation method;
[0150] The foreign body proportion coefficient FOPC is generated by the following expression:
[0151]
[0152] , where k1 and k2 are the preset proportional coefficients of the micro foreign matter accumulation index MFOAI and the dynamic foreign matter change index DFOVI, respectively, and both k1 and k2 are greater than 0.
[0153] The preset proportionality coefficients k1 and k2 are important parameters used to balance and weigh the two core indices (micro foreign matter accumulation index MFOAI and dynamic foreign matter change index DFOVI) in the formula for generating the foreign matter proportionality coefficient FOPC. Their role is to reflect the relative importance of these two indices in complexity assessment. Specifically, the preset proportionality coefficients represent the prior knowledge of the degree of influence of the two indices in experience or system design. For example, the accumulation of micro foreign matter may be more critical to certain scenarios, while dynamic changes may be more important in high-frequency mixing scenarios. By reasonably setting k1 and k2, the sensitivity and weight distribution of the calculation results can be adjusted according to actual application requirements to achieve a more accurate complexity assessment.
[0154] It can be seen from the foreign matter proportion coefficient that, under the detection window, the larger the micro-foreign matter cumulative index expression value generated after analyzing the cumulative proportion of small foreign matter, the larger the dynamic foreign matter change index expression value generated after analyzing the dynamic change characteristics of foreign matter, and the larger the foreign matter proportion coefficient expression value generated after analyzing the extracted key features under the detection window, indicating that there are more types and larger quantities of foreign matter under the detection window, and the complexity of foreign matter is high. Conversely, it indicates that there are fewer types and smaller quantities of foreign matter under the detection window, and the complexity of foreign matter is low.
[0155] Based on the evaluation results of the machine learning model, the foreign matter mixed in the detection window is divided into simple foreign matter mixed and complex foreign matter mixed;
[0156] The foreign matter ratio coefficient generated after analyzing the extracted key features is compared with the preset foreign matter ratio coefficient reference threshold, and the foreign matter mixing situation of grains under the detection window is divided. The division steps are as follows:
[0157] If the foreign matter ratio coefficient is greater than or equal to a preset foreign matter ratio coefficient reference threshold, the foreign matter mixing situation of grain under the detection window is classified as complex foreign matter mixing;
[0158] If the foreign matter ratio coefficient is less than a preset foreign matter ratio coefficient reference threshold, the foreign matter mixing in the grain under the detection window is classified as simple foreign matter mixing;
[0159] Simple foreign matter mixing usually refers to a situation where the number of foreign matter is small, the type is single, and the characteristics are obvious; complex foreign matter mixing refers to a situation where the number of foreign matter is large, the types are complex, and the characteristics are diverse.
[0160] For simple foreign matter mixed in, the production line maintains the preset running speed, and the detection system identifies and extracts the foreign matter in the grain according to the normal process;
[0161] For simple foreign matter mixed in, the production line maintains the preset running speed, and the detection system identifies and extracts foreign matter in the grain according to the normal process. The purpose is to make full use of the efficiency and accuracy of existing detection equipment when the types and quantities of foreign matter are relatively simple, and complete the detection and removal tasks at a stable running speed. Due to the low detection difficulty, the production line does not need additional adjustments, thus avoiding unnecessary pauses or efficiency losses, and effectively ensuring product quality and ensuring the efficiency and stability of the production process.
[0162] In case of mixed complex foreign bodies, the production line speed is intelligently reduced based on the preset production line running speed, providing the detector with more sufficient analysis and processing time, thereby ensuring that foreign bodies can be accurately identified and removed, while taking into account production efficiency as much as possible;
[0163] In view of the mixing of complex foreign matter, based on the preset production line running speed, the specific steps of intelligently reducing the production line speed are as follows:
[0164] The deviation of the foreign body ratio coefficient is calculated, and a weighted dynamic adjustment factor is introduced to further enhance the flexibility of complexity judgment. The calculation expression is as follows:
[0165]
[0166] , where ΔFOPC is the foreign body proportional coefficient deviation, FOPC is the foreign body proportional coefficient, and FOPC refis the reference threshold of the foreign body ratio coefficient, τ is the weighted dynamic adjustment factor, t current is the current detection time point, T window is the total duration of the detection window;
[0167] The total duration of the detection window is T window Refers to the time range set by the system for data collection and analysis during the operation of the production line. This period of time is the periodic unit for the foreign body detection system to perform real-time data processing, feature extraction and complexity evaluation.
[0168] The weighted dynamic adjustment factor is a dynamic adjustment parameter used to introduce the weighted influence of time or other specific dimensions into the complexity assessment formula. Its core purpose is to enhance the system's sensitivity to changes in foreign body complexity, especially when foreign body characteristics fluctuate significantly (such as the number or type of foreign bodies increases rapidly in a short period of time). For example, in the late stage of the detection window, if the complexity of foreign bodies suddenly increases, τ can amplify this effect and prompt the system to make adjustments to possible risks in advance. Its role is to help the system achieve dynamic responsiveness, ensuring that the complexity assessment not only reflects the current state, but also takes into account the potential need for production line adjustments due to time trends or other external factors, thereby improving the adaptability and accuracy of the entire detection process.
[0169] The target speed adjustment coefficient is calculated according to the foreign body proportional coefficient deviation ΔFOPC, and a nonlinear function is introduced to control the sensitivity of the adjustment. The calculation expression is as follows:
[0170]
[0171] , where is the target speed adjustment coefficient, λ is the sensitivity adjustment parameter, FOPC max is the maximum allowed foreign matter ratio factor, used to normalize the complexity deviation;
[0172] Target speed adjustment factor It is a key parameter used to dynamically adjust the production line speed. It is based on the complexity of foreign objects in the current detection window (usually calculated by the foreign object proportion coefficient deviation ΔFOPC). The value is taken within the range of , which is used to determine the adjustment range of the production line speed. Its core function is to provide the detector with more time to analyze the complex characteristics of foreign matter by reducing the running speed, especially to ensure the detection accuracy when complex foreign matter is mixed. On the contrary, when the complexity of foreign matter is low, When the value is close to 1, the production line speed remains close to the original speed, thus ensuring production efficiency. Therefore, the main function of the target speed adjustment coefficient is to balance efficiency and detection accuracy and dynamically adapt to foreign body scenes of different complexity.
[0173] The sensitivity adjustment parameter λ is the control parameter of the target speed adjustment coefficient, which is used to determine the response intensity of φ to the foreign body proportion coefficient deviation ΔFOPC. It usually appears in exponential, nonlinear or normalized formulas, affecting the sensitivity of the production line speed to changes in the complexity of foreign bodies. A higher λ value will make φ more sensitive to complexity deviations, that is, when the complexity of foreign bodies slightly exceeds the threshold, the speed will drop significantly; while a lower λ value means that the speed adjustment range is smoother and will not change drastically due to small complexity fluctuations. The role of the sensitivity adjustment parameter is to provide the system with a flexible adjustment mechanism to optimize the response intensity of the speed adjustment according to actual production needs to adapt to different production scenarios and fault tolerance requirements.
[0174] Adjustment factor based on target speed The dynamically adjusted production line speed is calculated based on the preset running speed. In order to enhance robustness, the upper and lower speed limits and foreign body type weights are added. The calculation expression is as follows:
[0175]
[0176] , where v adjusted is the adjusted line speed, v min is the lower limit of production line speed, v max is the upper limit of production line speed, v preset is the preset running speed, max(v min , ...) and min(v max , ...) is to ensure that the adjustment speed is within a safe range;
[0177] In order to monitor the performance of the detection system in real time, the efficiency index is introduced as a measurement indicator to comprehensively evaluate the detection effect after the current production line speed is adjusted. The calculation expression is as follows:
[0178]
[0179] , where η eff is the detection efficiency index, η detect is the foreign body recognition rate η remove is the foreign matter rejection rate, ω· is the complexity deviation influencing factor, reflecting the influence of the foreign body proportion coefficient deviation ΔFOPC on the detection efficiency, ω is the complexity influence weight, is the speed adjustment impact factor, reflecting the impact of speed adjustment on detection efficiency, and K is the speed adjustment impact weight;
[0180] The role of the complexity influence weight ω is to measure the influence of the foreign body proportion coefficient deviation ΔFOPC on the detection efficiency. It amplifies or weakens the interference effect of foreign body complexity on the detection performance, which is particularly critical in the scene where complex foreign bodies are mixed. When the ω value is large, the system will be more sensitive to the complexity deviation, and the detection efficiency η eff It decreases rapidly with the increase of the proportional coefficient deviation ΔFOPC, indicating that the system complexity is too much of a load on the detector, and it may be necessary to further optimize the detection capability or adjust the speed parameters. When the ω value is small, the influence of the complexity deviation is weakened, and the system responds smoothly to the changes in the foreign body proportional coefficient deviation ΔFOPC, which is more suitable for processing scenes with mild complexity changes. Therefore, the main function of ω is to regulate the system's sensitivity to the complexity of foreign bodies, provide a rapid response when the complexity changes dramatically, and avoid unnecessary overreaction in simple scenes.
[0181] The role of the speed adjustment impact weight κ is to measure the impact of production line speed adjustment on detection efficiency, especially when the adjustment range is large, it is used to control the decline in efficiency. When the κ value is large, the formula will highlight the negative impact of speed deviation from the preset value on detection efficiency, indicating that the speed adjustment may have affected the stability of the detection system; this is especially important in scenarios with many small foreign objects or limited detection windows. When the κ value is small, the system's sensitivity to speed adjustment is reduced, allowing larger speed adjustments without significantly affecting efficiency calculations, which is suitable for scenarios with low complexity but requiring speed optimization. Therefore, the role of K is to balance the relationship between speed adjustment and detection efficiency, ensuring that speed adjustment can both improve detection capabilities and not significantly damage the stability of system performance.
[0182] Detection efficiency index η by real-time monitoring eff If the efficiency drops significantly, the dynamic parameters (such as the sensitivity adjustment parameter λ, the complexity influence weight μ, and the speed adjustment influence weight κ) are adjusted through the feedback mechanism to optimize the speed adjustment formula and detection performance, so that the production line maintains the optimal balance between detection accuracy and operation efficiency, forming a closed-loop optimization system.
[0183] In response to the mixing of complex foreign matter, the production line speed is intelligently reduced to provide the detector with more sufficient analysis and processing time. The core role of this step is to balance the detection accuracy and production efficiency, and ensure that foreign matter in the grain can be accurately identified and removed. The mixing of complex foreign matter is usually manifested as a wide variety of foreign matter, a large number, and may contain small or dynamic foreign matter (such as tiny metal chips or lightweight plastics), which significantly increase the difficulty of detection. If the production line is kept running at a preset high speed, the detection system may not be able to accurately analyze all foreign matter targets one by one, resulting in an increased risk of omission or misjudgment, thereby threatening product quality and safety. By intelligently reducing the speed, the detection equipment can obtain a longer processing time, perform more detailed analysis and classification of complex characteristics, and ensure the comprehensiveness and accuracy of foreign matter identification. In addition, this adjustment does not sacrifice efficiency indefinitely, but realizes dynamic optimization under the premise of taking into account production needs, ensuring that the production line can maintain reasonable production capacity and meet high standards of quality requirements, thereby achieving the best balance between efficiency and safety. This strategy is particularly important for dealing with sudden or complex pollution scenarios, which can effectively reduce food safety risks and improve the reliability and intelligence level of the overall production line.
[0184] The present invention significantly improves the accuracy and flexibility of foreign matter detection by introducing intelligent evaluation and dynamic adjustment strategies based on machine learning models. The micro-foreign matter accumulation index and dynamic foreign matter change index can effectively capture the characteristics of small foreign matter and foreign matter in complex dynamic change scenarios. By generating a foreign matter proportion coefficient and combining it with a pre-set reference threshold, the system can accurately distinguish between simple foreign matter mixing and complex foreign matter mixing, and then dynamically adjust the production line speed. In complex foreign matter scenarios, reducing the conveying speed provides the detector with sufficient analysis time, ensuring comprehensive identification and removal of foreign matter, effectively reducing missed detections, and improving the quality and safety of grain products.
[0185] The present invention optimizes the operating efficiency of the production line and the food safety management capabilities while ensuring accurate detection of foreign matter. For simple foreign matter mixing scenarios, the preset speed is maintained to avoid unnecessary speed adjustments and ensure production efficiency; while in complex foreign matter mixing scenarios, the speed is dynamically adjusted to ensure detection accuracy and achieve a balance between efficiency and quality. In addition, through real-time data management and intelligent analysis, the system provides comprehensive support for quality traceability throughout the entire life cycle of food, can quickly locate potential sources of food safety risks, enhance regulatory capabilities, and reduce food safety hazards. This intelligent technical solution takes into account the actual needs and safety assurance of grain processing, and provides a more efficient and reliable solution for industry development.
[0186] The present invention provides Figure 2A food safety traceability system shown includes a real-time data acquisition module, a data collection and analysis module, an intelligent evaluation module, a complexity division module, an efficient detection module and an intelligent speed regulation module;
[0187] Real-time data acquisition module, first, the grain processing production line runs at a preset speed, and the foreign matter detector installed on the production line monitors the foreign matter in the grain in real time to obtain real-time foreign matter data information;
[0188] The data collection and analysis module collects and organizes the foreign matter data information obtained in real time to establish an analysis set, and extracts key features reflecting the complexity of grain foreign matter from the analysis set;
[0189] The intelligent assessment module analyzes and processes the extracted key feature data in the detection window and inputs them into the pre-learned machine learning model, which then conducts an intelligent assessment of the complexity of foreign matter in grains.
[0190] The complexity classification module divides the foreign matter mixed in the detection window into simple foreign matter mixed and complex foreign matter mixed based on the evaluation results of the machine learning model;
[0191] Efficient detection module: for simple foreign matter mixed in, the production line maintains the preset running speed, and the detection system identifies and extracts foreign matter in the grain according to the normal process;
[0192] The intelligent speed control module can intelligently reduce the production line speed based on the preset production line running speed to target the mixing of complex foreign objects, providing the detector with more sufficient analysis and processing time, thereby ensuring that foreign objects can be accurately identified and removed while taking production efficiency into consideration as much as possible.
[0193] A food safety tracing method provided in an embodiment of the present invention is implemented by the above-mentioned food safety tracing system. The specific method and process of a food safety tracing system are detailed in the embodiment of the above-mentioned food safety tracing method, which will not be repeated here.
[0194] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
Claims
1. A food safety traceability method, characterized in that: The following steps are involved: First, the grain processing production line runs at a preset speed, and the foreign matter detector installed on the production line monitors the foreign matter in the grain in real time to obtain real-time foreign matter data information; Collect and organize the foreign matter data information obtained in real time to establish an analysis set, and extract key features reflecting the complexity of grain foreign matter from the analysis set; Under the detection window, the extracted key feature data is analyzed and processed and then input into the pre-learned machine learning model, and the complexity of foreign matter in the grain is intelligently evaluated through the machine learning model; Based on the evaluation results of the machine learning model, the foreign matter mixed in the detection window is divided into simple foreign matter mixed and complex foreign matter mixed; For simple foreign matter mixed in, the production line maintains the preset running speed, and the detection system identifies and extracts the foreign matter in the grain according to the normal process; In response to the mixing of complex foreign objects, based on the preset production line operation speed, the production line speed is intelligently reduced to provide the detector with more sufficient analysis and processing time, thereby ensuring that foreign objects can be accurately identified and removed while taking production efficiency into consideration as much as possible.
2. A food safety traceability method according to claim 1, characterized in that: Key features reflecting the complexity of foreign matter in grain are extracted from the analysis set, wherein the extracted features include the cumulative proportion of fine foreign matter and the dynamic change characteristics of foreign matter. Within the detection window, the cumulative proportion of fine foreign matter and the dynamic change characteristics of foreign matter are analyzed to generate a micro-foreign matter accumulation index and a dynamic foreign matter change index, respectively. The cumulative proportion of fine foreign matter quantifies the proportion of fine foreign matter in the grain to the total number of foreign matter within the detection window, and the dynamic change characteristics of foreign matter quantify the degree of fluctuation of the types and quantities of foreign matter over time within the detection window, which is expressed by the number of new foreign matter added per unit time and the rate of change of the types.
3. A food safety traceability method according to claim 2, characterized in that: The micro-foreign matter accumulation index and dynamic foreign matter change index obtained after analyzing the extracted key features are input into the pre-learned machine learning model. The foreign matter proportion coefficient is generated by the machine learning model, and the complexity of foreign matter in the grain is intelligently evaluated through the foreign matter proportion coefficient.
4. A food safety traceability method according to claim 3, characterized in that: The foreign matter ratio coefficient generated after analyzing the extracted key features is compared with the preset foreign matter ratio coefficient reference threshold, and the foreign matter mixing situation of grains under the detection window is divided. The division steps are as follows: If the foreign matter ratio coefficient is greater than or equal to a preset foreign matter ratio coefficient reference threshold, the foreign matter mixing situation of grain under the detection window is classified as complex foreign matter mixing; If the foreign matter proportion coefficient is less than a preset foreign matter proportion coefficient reference threshold, the foreign matter mixing in the grain under the detection window is classified as simple foreign matter mixing.
5. A food safety traceability method according to claim 4, characterized in that: In view of the mixing of complex foreign matter, based on the preset production line running speed, the specific steps of intelligently reducing the production line speed are as follows: The deviation of the foreign body ratio coefficient is calculated, and a weighted dynamic adjustment factor is introduced to further enhance the flexibility of complexity judgment. The calculation expression is as follows: , Where ΔFOPC is the foreign body proportion coefficient deviation, FOPC is the foreign body proportion coefficient, and FOPC ref is the reference threshold of the foreign body ratio coefficient, τ is the weighted dynamic adjustment factor, t current is the current detection time point, T window is the total duration of the detection window; The target speed adjustment coefficient is calculated according to the foreign body proportional coefficient deviation ΔFOPC, and a nonlinear function is introduced to control the sensitivity of the adjustment. The calculation expression is as follows: , In the formula, is the target speed adjustment coefficient, λ is the sensitivity adjustment parameter, FOPC max is the maximum allowed foreign matter ratio factor, used to normalize the complexity deviation; Adjustment factor based on target speed The dynamically adjusted production line speed is calculated based on the preset running speed. In order to enhance robustness, the upper and lower speed limits and foreign body type weights are added. The calculation expression is as follows: , In the formula, v adjusted is the adjusted line speed, v min is the lower limit of production line speed, v max is the upper limit of production line speed, v preset is the preset running speed, max(v min , ...) and min(v max , ...) is to ensure that the adjustment speed is within a safe range; In order to monitor the performance of the detection system in real time, the efficiency index is introduced as a measurement indicator to comprehensively evaluate the detection effect after the current production line speed is adjusted. The calculation expression is as follows: , Where η eff is the detection efficiency index, η detect is the foreign body recognition rate η remove is the foreign matter rejection rate, is the complexity deviation influencing factor, reflecting the influence of the foreign body proportion coefficient deviation ΔFOPC on the detection efficiency, ω is the complexity influence weight, is the speed adjustment influencing factor, reflecting the impact of speed adjustment on detection efficiency, and κ is the speed adjustment impact weight; Detection efficiency index η by real-time monitoring eff If the efficiency drops significantly, the dynamic parameters are adjusted through the feedback mechanism to optimize the speed adjustment formula and detection performance, so that the production line maintains the optimal balance between detection accuracy and operating efficiency, forming a closed-loop optimization system.
6. A food safety traceability method according to claim 2, characterized in that: Under the detection window, the cumulative proportion of small foreign matter is analyzed and the specific steps to generate the micro foreign matter accumulation index are as follows: Under the detection window, the data of all small foreign matter is obtained through the foreign matter detector, including the total number of foreign matter, the number of small foreign matter, the type distribution characteristic vector of small foreign matter and the particle size distribution range of small foreign matter, and the total number of foreign matter is calibrated as N total , the number of small foreign bodies is calibrated as N micro , the type distribution feature vector of small foreign matter is calibrated as F type The particle size distribution range of fine foreign matter is calibrated as D size ; In order to quantify the contribution of small foreign matter to the overall foreign matter complexity, the cumulative weight is defined and the calculation expression is as follows: , Where W micro is the cumulative weight, N micro,i is the number of small foreign matter type i, k is the total number of small foreign matter types, that is, the number and types of different types of small foreign matter in the detection window, D size,i It is the particle size range ratio, which indicates the particle size distribution range of fine foreign matter type i. It is calculated as the ratio of the maximum particle size to the minimum particle size of the current type of foreign matter. The calculation formula is as follows: , Where, d max,i is the maximum particle size of fine foreign matter type i, d min,i is the minimum particle size of fine foreign matter type i, F type,i is the distribution characteristic component of small foreign body type i, calculated as the normalized probability value, and the calculation formula is as follows: , Where N micro,j is the number of small foreign bodies of type j; The time dynamic characteristics are introduced to calculate the accumulation rate adjustment factor of small foreign matter. The calculation expression is as follows: , In the formula, R dynamic is the accumulation rate adjustment factor, t0 and t1 are the detection window start time and detection window end time respectively, ΔN micro (t) is the change in the number of small foreign bodies at time point t, Δt is the time difference, that is, the time interval between two adjacent sampling moments, and ln(1+Δt) is the time adjustment factor; Comprehensive cumulative weight W micro and the accumulation rate adjustment factor R dynamic , generate the micro foreign matter accumulation index, the calculation expression is as follows: , Where MFOAI is the micro foreign matter accumulation index.
7. A food safety traceability method according to claim 2, characterized in that: Under the detection window, the dynamic change characteristics of foreign matter are analyzed and the specific steps for generating the dynamic foreign matter change index are as follows: Under the detection window, obtain the foreign body related data, including the type of each foreign body and the distribution of the number of each foreign body over time, and record the data in the form of time series, denoted as S(t), expressed as follows: S(t)={C y ,N y (t)}={(C1,N1(t))、(C2,N2(t))、……、(C m ,N m (t))}, S(t) represents the foreign object detection state set at time point t, C y is the type of the yth foreign body, N y (t) represents the number of the yth type of foreign matter at time point t, and m is the total number of foreign matter types detected, that is, C y The total number of types; Decompose the time series to extract the newly added type sequence ΔC(t) and the quantity change sequence ΔN y (t), the newly added type sequence ΔC(t) is the number of newly added foreign matter types compared with the time point (t-1), and the calculation expression is as follows: ΔC(t)=count(C y (t)\C y (t-1)), In the formula, C y (t) is the set of foreign body types detected at time point t, C y (t-1) is the set of foreign body types detected at time point (t-1), \ is the difference operation of the set, that is, to filter out the types newly added at the current time point, Quantity change sequence ΔN y (t) is the change in quantity between time point t and time point t-1, and the calculation expression is as follows: ΔN y (t)=N y (t)-N y (t-1), Where N y (t-1) is the number of the yth type of foreign matter at time point t-1; In order to evaluate the dynamic changes of foreign body types, the type fluctuation characteristic factor is defined, and the calculation expression is as follows: , In the formula, F C is the type fluctuation characteristic factor, C(t) is the number of foreign matter types accumulated at time point t, and T is the total number of time points; In order to quantify the dynamic change of the number of foreign matter, the number change characteristic factor is defined, and the calculation expression is as follows: , In the formula, F N is the quantity change characteristic factor, e -α·t is the time decay weight, α is the time decay factor, and e is the natural base; The type fluctuation characteristic factor F C and quantity variation characteristic factor F N Combined, the final dynamic foreign body change index is generated, and the calculation expression is as follows: , Where DFOVI is the dynamic foreign matter variation index, and γ is the type fluctuation characteristic factor F C The weight of β is the quantity change characteristic factor F N The weight of .
8. A food safety traceability system, used to implement a food safety traceability method as described in any one of claims 1 to 7, characterized in that: It includes real-time data acquisition module, data collection and analysis module, intelligent evaluation module, complexity division module, efficient detection module and intelligent speed regulation module; Real-time data acquisition module, first, the grain processing production line runs at a preset speed, and the foreign matter detector installed on the production line monitors the foreign matter in the grain in real time to obtain real-time foreign matter data information; The data collection and analysis module collects and organizes the foreign matter data information obtained in real time to establish an analysis set, and extracts key features reflecting the complexity of grain foreign matter from the analysis set; The intelligent assessment module analyzes and processes the extracted key feature data in the detection window and inputs them into the pre-learned machine learning model, which then conducts an intelligent assessment of the complexity of foreign matter in grains. The complexity classification module divides the foreign matter mixed in the detection window into simple foreign matter mixed and complex foreign matter mixed based on the evaluation results of the machine learning model; Efficient detection module: for simple foreign matter mixed in, the production line maintains the preset running speed, and the detection system identifies and extracts foreign matter in the grain according to the normal process; The intelligent speed control module can intelligently reduce the production line speed based on the preset production line running speed to target the mixing of complex foreign objects, providing the detector with more sufficient analysis and processing time, thereby ensuring that foreign objects can be accurately identified and removed while taking production efficiency into consideration as much as possible.