Food processing metal detection system and equipment based on intelligent sensor

Through the intelligent sensor system combined with multi-frequency electromagnetic induction and image acquisition technology, the misjudgment problem caused by condensation in frozen or high-humidity foods is solved, and the accurate detection and removal of metal foreign matters is achieved, which improves food production efficiency and safety.

CN120294133AInactive Publication Date: 2025-07-11JIANGXI WEIRBAO FOOD BIOTECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510366886.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-07-11
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure CN120294133A_ABST
    Figure CN120294133A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of metal detection, and discloses a food processing metal detection system and equipment based on an intelligent sensor, which are used for solving the problem that when food processing metal detection is carried out, condensed water is attached to the surface of food, so that metal substances are misjudged to exist, and the method comprises the following steps: acquiring a metal disturbance characteristic signal of target food; preliminarily judging whether a metal substance exists in the target food according to the metal disturbance characteristic signal, if the metal substance exists in the target food, acquiring food image information, evaluating to obtain a condensate water influence index, judging whether metal detection is influenced by condensate water according to the condensate water influence index, and if the metal detection is influenced by the condensate water, judging whether the metal detection is influenced by the condensate water. If yes, the metal disturbance characteristic signal is corrected, final judgment is carried out, if it is finally judged that the target food contains the metal substance, the target food is marked, tracked and removed, the misjudgment probability of the metal substance is effectively reduced, and the food production efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of metal detection, and more particularly to a food processing metal detection system and device based on intelligent sensors. Background Art

[0002] Food foreign object detection is a key link in food processing quality control, and is widely used in many fields such as meat processing, aquatic product treatment, frozen foods, prepared foods, and baked foods. As the most common type of pollution source, metal foreign objects may not only cause direct physical harm to consumers, such as cuts, tooth damage, internal injuries, etc., but may also lead to serious consequences such as food recalls and damage to brand reputation.

[0003] Currently, existing metal foreign object detection technologies mostly adopt metal detection systems based on the principle of electromagnetic induction. Such systems generate an electromagnetic field through a sensor coil. When a food item with a metal substance passes through the detection area, the metal conductor disturbs the electromagnetic field, forming a recognizable detection signal, thereby realizing the identification and removal of metal foreign objects.

[0004] However, in the process of implementing the technical solutions of the present invention in the embodiments of the present application, it is found that the above technologies have at least the following technical problems:

[0005] In practical applications, for certain types of foods, especially frozen foods or high-humidity foods, after thawing, cold chain transportation or cleaning, there is often condensed water or a residual water film on the surface. Such liquid components have a certain electrical conductivity. When such products pass through an electromagnetic induction detection device, the condensed water will cause a slight disturbance to the electromagnetic field, and the signal characteristics are similar to those of trace metal signals, which are extremely likely to be misjudged by the system as the presence of metal foreign objects, resulting in a large number of mis-removals, causing food waste and a decrease in production efficiency, and may also mask the true metal signal, increasing the risk of missed detection.

[0006] In view of the above problems, the present invention proposes a solution. Summary of the Invention

[0007] In order to overcome the above-mentioned defects of the prior art, the present invention provides a food processing metal detection system and device based on intelligent sensors to solve the problems existing in the above background art.

[0008] To achieve the above object, the present invention provides the following technical solutions:

[0009] Food processing metal detection system based on intelligent sensors, the system includes: a metal detection module, which is used to continuously detect the target food through a multi-frequency intelligent electromagnetic induction sensor, output a metal disturbance characteristic signal, obtain key characteristic parameters according to the metal disturbance characteristic signal, and preliminarily judge whether there is a metal substance in the target food according to the key characteristic parameters; an image acquisition module, if it is judged that there is a metal substance in the target food, the target food is imaged through a camera device to obtain a food image, food image information is obtained from the food image, the food image information includes optical reflection data, texture feature data and edge blur data, and the food image information is transmitted to the preliminary condensate influence judgment module; a preliminary condensate influence judgment module, which is used to evaluate a condensate influence index according to the food image information, and judge whether the metal detection is affected by condensate according to the condensate influence index; a signal correction module, if the metal detection is affected by condensate, correct the metal disturbance characteristic signal to obtain an actual metal disturbance characteristic signal, and transmit the actual metal disturbance characteristic signal to the final condensate influence judgment module; a final condensate influence judgment module, which is used to finally judge whether there is a metal substance in the target food again according to the actual metal disturbance characteristic signal; a tracking and removal module, if it is finally determined that there is a metal substance in the target food, a warning is given, and the target food is marked, tracked and removed. If it is finally determined that there is no metal substance in the target food, the next food is continuously detected.

[0010] Preferably, the steps for obtaining the condensate influence index are as follows: obtaining optical reflection data from the food image, the optical reflection data includes the proportion of the surface highlight area and the brightness gradient value, and evaluating an optical reflection coefficient according to the optical reflection data; obtaining the texture feature data of the food image, the texture feature data includes the surface smoothness and the local texture energy, and calculating a texture feature coefficient according to the texture feature data; detecting the food image by the sobel edge detection method according to the food image, and evaluating an edge blur coefficient; normalizing the optical reflection coefficient, the texture feature coefficient and the edge blur coefficient, and evaluating a condensate influence index according to the normalized optical reflection coefficient, texture feature coefficient and edge blur coefficient. The specific obtaining steps are as follows: In the formula, IW represents the condensate influence index, OR represents the normalized optical reflection coefficient, TF represents the normalized texture feature coefficient, EB represents the normalized edge blur coefficient, and a1, a2, a3 represent the weight coefficients of the optical reflection coefficient, the weight coefficient of the texture feature coefficient and the weight coefficient of the edge blur coefficient.

[0011] Preferably, the step of obtaining the optical reflection coefficient is as follows: perform grayscale processing on the food image to obtain a grayscale image, and set a brightness threshold; obtain the brightness values of the grayscale image, traverse all pixel points in the grayscale image, compare the brightness values of the pixel points with the brightness threshold, filter out the pixel points with brightness values greater than the brightness threshold, and mark them as highlight regions; obtain the area of the highlight regions, calculate the ratio of the area of the highlight regions to the area of the grayscale image to obtain the proportion of the surface highlight regions; divide the grayscale image into several local windows of a fixed size, and slide 1 pixel point each time, calculate the average grayscale value within the local window, and calculate the local window brightness gradient value according to the average grayscale; calculate the mean value of the brightness gradient values of all local windows to obtain the brightness gradient value; perform normalization processing on the proportion of the highlight regions and the brightness gradient value, and calculate the optical reflection coefficient according to the proportion of the highlight regions and the brightness gradient value after normalization processing.

[0012] Preferably, the step of obtaining the texture feature coefficient is as follows: perform grayscale processing on the food image to obtain a grayscale image, divide the grayscale image into m equal parts, denoted as sub-images, obtain the grayscale values of each pixel in the sub-images, calculate the variance of the grayscale values in the sub-images according to the grayscale values of each pixel, and calculate the smoothness according to the variance of the grayscale values; use the K-means clustering method to cluster the smoothness of each sub-image, and calculate the surface smoothness according to the clustering results; construct a pixel grayscale matrix according to the grayscale values of each pixel in the grayscale image, set a given direction and distance, and construct a gray-level co-occurrence matrix; obtain the gray levels of the gray-level co-occurrence matrix, divide each data in the gray-level co-occurrence matrix by the total number of occurrences to obtain a normalized matrix, and calculate the angular second moment of the normalized matrix as the texture energy value; perform normalization processing on the surface smoothness and the texture energy value, and calculate the texture feature coefficient according to the surface smoothness and the texture energy value after normalization processing.

[0013] Preferably, the step of using the K-means clustering method to cluster the smoothness of each sub-image is as follows: Step 1: Use the smoothness as the clustering feature, and use the smoothness of all sub-images as the data set, and each smoothness in the data set is a data point; Step 2: Use the silhouette coefficient method to determine the number of clusters K of the data set; Step 3: Randomly select K data points in the data set as the initial clustering centers, for each data point, calculate its Euclidean distance to each initial clustering center, for each data point, traverse the K initial clustering centers, and assign it to the clustering cluster corresponding to the nearest initial clustering center; Step 4: After traversing all data points, obtain the initial clustering clusters, for each initial clustering cluster, calculate the mean value of the data points within it to obtain a new clustering center; Step 5: Repeat Step 3 and Step 4 until the clustering centers no longer change, and obtain the final clustering clusters and the final clustering centers.

[0014] Preferably, the step of calculating the surface smoothness according to the clustering result is as follows: calculating the ratio of the number of data points in each final clustering cluster to the total number of data points to obtain the weight of each final clustering cluster; performing weighted summation of the weight of each final clustering cluster and the final clustering center to obtain the surface smoothness.

[0015] Preferably, the step of obtaining the edge blur coefficient is as follows: converting the food image into a grayscale image, using the Sobel operator to perform edge detection on the grayscale image in the horizontal and vertical directions respectively to obtain the horizontal direction gradient and the vertical direction gradient; at each pixel position of the grayscale image, performing square summation of the horizontal direction gradient and the vertical direction gradient and then performing square root calculation to obtain the total gradient amplitude; traversing all pixel points on the grayscale image, calculating the standard deviation of the total gradient amplitude, obtaining the maximum theoretical amplitude of the Sobel edge amplitude, and calculating the ratio of the standard deviation of the total gradient amplitude to the maximum theoretical amplitude and then taking the inverse to obtain the edge blur coefficient.

[0016] Preferably, the step of judging whether metal detection is affected by condensate water according to the condensate water influence index is as follows: comparing the condensate water influence index with the influence threshold. If the condensate water influence index is greater than or equal to the influence threshold, it is judged that the metal detection is affected by condensate water; if the condensate water influence index is less than the influence threshold, it is judged that the metal detection is not affected by condensate water.

[0017] Preferably, the step of correcting the metal perturbation characteristic signal to obtain the actual metal perturbation characteristic signal is as follows: calculating the ratio of the influence threshold to the condensate water influence index to obtain the correction factor; performing product calculation of the correction factor and the key characteristic parameters to obtain the actual metal perturbation characteristic signal.

[0018] Preferably, a food processing metal detection device based on an intelligent sensor, the device includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to...

[0019] The technical effects and advantages of the present invention:

[0020] Obtain the metal perturbation characteristic signal of the target food, preliminarily judge whether there is a metal substance in the target food according to the metal perturbation characteristic signal. If it is judged that there is a metal substance in the target food, obtain the food image information, evaluate and obtain the condensate water influence index, judge whether the metal detection is affected by condensate water according to the condensate water influence index. If it is judged that the metal detection is affected by condensate water, correct the metal perturbation characteristic signal and perform a final judgment. If it is finally judged that there is a metal substance in the target food, mark, track and remove the target food, effectively reducing the probability of misjudgment of metal substances and improving the food production efficiency. Brief Description of the Drawings

[0021] Figure 1 This is the overall structure diagram of the present invention. Specific embodiments

[0022] Next, the technical solutions in the present invention will be clearly and completely described in conjunction with the accompanying drawings in the present invention. In addition, the forms of the various structures described in the following embodiments are merely examples, and the food processing metal detection system and equipment based on intelligent sensors involved in the present invention are not limited to the various structures described in the following embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.

[0023] The present invention provides a food processing metal detection system based on intelligent sensors, as Figure 1 shown, the system includes:

[0024] A metal detection module, which is used to continuously detect the target food through a multi-frequency intelligent electromagnetic induction sensor, output a metal disturbance characteristic signal, and preliminarily judge whether there is a metal substance in the target food according to the metal disturbance characteristic signal;

[0025] The multi-frequency intelligent electromagnetic induction sensor is a high-sensitivity sensing device for detecting metal foreign objects. It simultaneously applies multiple groups of alternating electromagnetic fields with different frequencies in the detection area to sense the electromagnetic disturbances caused by the possible metal substances in the target object. Compared with the traditional single-frequency detection method, multi-frequency induction can take into account the recognition ability of magnetic metals and non-magnetic metals, improving the detection accuracy and anti-interference ability. This sensor combines an embedded intelligent algorithm, which can perform real-time analysis and feature extraction on the induction signal, so as to realize the rapid detection and early warning of tiny metal foreign objects in food, and is widely used in high-requirement scenarios such as food processing and quality control.

[0026] In this embodiment, it should be specifically noted that the steps for preliminarily judging whether there is a metal substance in the target food according to the metal disturbance characteristic signal are as follows:

[0027] Establish a stable electromagnetic field environment in the detection channel through the multi-frequency intelligent electromagnetic induction sensor, so that the electromagnetic field environment covers the entire area where the food passes;

[0028] The target food passes through the sensor detection area in sequence along the conveyor belt, and the electromagnetic disturbance signal of each food is obtained. When each food unit passes through the sensor coil area, it will have a certain impact on the electromagnetic field. For ordinary food without metal, this impact is usually small or regular;

[0029] Preprocess the electromagnetic disturbance signals of each food. The preprocessing includes signal amplification, signal filtering, and feature extraction. Key feature parameters are obtained through feature extraction. The key feature parameters include the amplitude, spectrum, and phase difference of the signal;

[0030] Obtain a reference signal set of metal-free foods, and compare and analyze the extracted key feature parameters with the reference signal set of metal-free foods;

[0031] If the degree of change in the key feature parameters exceeds the set threshold, it is preliminarily judged that there may be metal substances in the target food. If the degree of change in the key feature parameters does not exceed the set threshold, it is judged that there are no metal substances in the target food, and then continue to perform metal detection on the next food.

[0032] The metal detection module continuously detects the target food through a multi-frequency intelligent electromagnetic induction sensor, which can simultaneously excite and identify electromagnetic response signals at different frequencies, thereby improving the detection sensitivity and accuracy for various types of metal foreign objects. This module outputs metal disturbance characteristic signals in real time and makes a preliminary judgment based on them, which helps to quickly identify foods suspected of containing metal foreign objects. It has the advantages of fast response speed, strong adaptability, and being suitable for high-throughput production lines, providing a reliable basis for subsequent interference correction and rejection control.

[0033] Image acquisition module. If it is judged that there are metal substances in the target food, the target food is imaged through a camera device to obtain a food image. The camera device can be a visible light industrial camera, a structured light or laser profile camera, and a multi-spectral or hyperspectral camera, etc. Food image information is obtained from the food image. The food image information includes optical reflection data, texture feature data, and edge blur data, and the food image information is transmitted to the preliminary influence judgment module of condensed water;

[0034] In the case of preliminarily judging that the target food may contain metal substances, the image acquisition module images the food through a camera device and extracts image information such as optical reflection data, texture feature data, and edge blur data, realizing multi-dimensional perception of the surface state of the food. The introduction of this module can effectively capture external interference factors that may affect the accuracy of metal detection, such as condensed water, water film, or surface reflection, etc., providing an image basis for subsequent interference recognition and signal correction, thereby improving the adaptability of the system to complex detection environments and the reliability of the final judgment result.

[0035] The preliminary influence judgment module of condensed water is used to evaluate the condensed water influence index based on the food image information and judge whether the metal detection is affected by condensed water according to the condensed water influence index;

[0036] The condensate preliminary impact judgment module is used to evaluate the condensate impact index based on food image information and determine whether the metal detection result is interfered by condensate accordingly. The introduction of this module can achieve the intelligent identification and quantitative analysis of condensate interference factors, effectively solve the problem of misjudgment in metal detection caused by condensate adhering to the food surface, improve the stability and judgment accuracy of the detection system, and is especially applicable to the online detection scenarios of refrigerated, frozen and high-humidity foods. This module enhances the environmental adaptability of the system and provides a reliable basis for subsequent signal correction and false alarm avoidance.

[0037] In this embodiment, it should be specifically noted that the steps for obtaining the condensate impact index are as follows:

[0038] Obtain the optical reflection data through the food image. The optical reflection data includes the proportion of the surface highlight area and the brightness gradient value, and evaluate the optical reflection coefficient according to the optical reflection data;

[0039] Obtain the texture feature data of the food image. The texture feature data includes the surface smoothness and the local texture energy, and calculate the texture feature coefficient according to the texture feature data;

[0040] According to the food image, detect the food image by the Sobel edge detection method and evaluate the edge blur coefficient. The Sobel edge detection method is a classic image gradient algorithm, mainly used to extract the edge information with obvious gray-scale changes in the image. This method applies the Sobel operator in the horizontal and vertical directions respectively to calculate the gradient intensity and direction of each pixel point in the image, so as to highlight the structural features of the edge part in the image;

[0041] Normalize the optical reflection coefficient, texture feature coefficient and edge blur coefficient, and evaluate the condensate impact index according to the normalized optical reflection coefficient, texture feature coefficient and edge blur coefficient. The specific obtaining steps are as follows:

[0042]

[0043] In the formula, IW represents the condensate influence index, OR represents the optical reflection coefficient after normalization. Since condensate usually forms a smooth water film on the food surface, resulting in obvious high-light reflection and specular effect in local areas, a higher optical reflection coefficient often means more condensate on the surface, thus increasing the risk of false alarms in metal detection. TF represents the texture feature coefficient after normalization. Since condensate is more likely to form a uniform water film in areas with a smooth surface and lack of texture, while it is more difficult to form a stable reflective layer on the surface with obvious texture or roughness, a higher texture feature coefficient usually means less condensate attachment and less influence on the detection signal. EB represents the edge blur coefficient after normalization. Since condensate forms a transparent water film or water droplets on the food surface, resulting in light scattering and reflection blur in the edge area of the image, thus making the edge contour of the image unclear. A higher edge blur coefficient reflects the weakening of the contour information in the image and is usually closely related to the condensate attachment. Therefore, this coefficient can be used as a positive evaluation index for the degree of condensate influence. a1, a2, and a3 represent the weight coefficients of the optical reflection coefficient, the texture feature coefficient, and the edge blur coefficient, respectively, and a1 + a2 + a3 = 1. a1, a2, and a3 are obtained through the analytic hierarchy process. The analytic hierarchy process is a multi-criteria decision-making analysis method used to systematically and quantitatively allocate weights to multiple influencing factors in complex problems. This method decomposes the goal, criteria, and factors layer by layer by constructing a hierarchical structure model, and calculates the relative weights of the importance between factors by means of expert scoring or comparing judgment matrices. Finally, scientific and reasonable weight coefficients are obtained through consistency tests. In this embodiment, the analytic hierarchy process is used to allocate weights to the three indicators of the optical reflection coefficient, the texture feature coefficient, and the edge blur coefficient, making the weighted calculation of the condensate influence index more objective and accurate.

[0044] In this embodiment, it should be specifically noted that the steps for obtaining the optical reflection coefficient are as follows:

[0045] Perform grayscale processing on the food image to obtain a grayscale image, and set a brightness threshold to distinguish the normal area from the high-light area;

[0046] Obtain the brightness value of the grayscale image, traverse all pixel points in the grayscale image, compare the brightness value of the pixel points with the brightness threshold, screen out the pixel points with brightness values greater than the brightness threshold, and mark them as high-light areas;

[0047] Obtain the area of the high-light area, and calculate the ratio of the area of the high-light area to the area of the grayscale image to obtain the proportion of the surface high-light area;

[0048] Divide the grayscale image into several local windows of a fixed size, and slide 1 pixel each time to cover the entire grayscale image. Calculate the average grayscale value within the local window, and calculate the local window brightness gradient value based on the average grayscale. The specific acquisition steps are as follows:

[0049]

[0050] In the formula, G represents the local window brightness gradient value, n is the number of pixels in the local window, I j represents the grayscale value of the jth pixel, represents the average grayscale value;

[0051] Calculate the mean value of the brightness gradient values of all local windows to obtain the brightness gradient value;

[0052] Normalize the proportion of the highlight area and the brightness gradient value, and calculate the optical reflection coefficient based on the normalized proportion of the highlight area and the brightness gradient value. The specific acquisition steps are as follows:

[0053]

[0054] In the formula, OR represents the optical reflection coefficient, ht represents the proportion of the highlight area, bg represents the brightness gradient value. By taking the square root of the product result, the influence of a single feature value being too large on the final score can be effectively alleviated, making the optical reflection coefficient more stable, continuous, and comparable in the numerical range.

[0055] In this embodiment, it should be specifically noted that the steps for obtaining the texture feature coefficient are as follows:

[0056] Grayscale the food image to obtain a grayscale image. Divide the grayscale image into m equal parts, denoted as sub-images. Obtain the grayscale value of each pixel in the sub-image, and calculate the variance of the grayscale values in the sub-image based on the grayscale value of each pixel. Calculate the smoothness based on the variance of the grayscale values. The specific acquisition steps are as follows:

[0057]

[0058] In the formula, S represents the smoothness, f represents the variance of the grayscale values. Since the smaller the variance, the smoother the image, the inverse form of the variance is defined as the smoothness, and 1 is added to the denominator to avoid the situation where the denominator is 0 and the formula is meaningless;

[0059] Use the K-means clustering method to cluster the smoothness of each sub-image, and calculate the surface smoothness based on the clustering results;

[0060] K-means clustering is a commonly used unsupervised clustering algorithm that divides data into K clusters through an iterative process, where the data within each cluster has high similarity. The algorithm starts with K randomly selected initial centers and repeatedly performs the processes of "assigning each data point to the nearest center" and "updating the center of each cluster" as the mean until the clustering result is stable.

[0061] Construct a pixel grayscale matrix based on the grayscale value of each pixel in the grayscale image. Set a given direction and distance, such as 0° in the horizontal direction and 1 pixel, to construct a gray-level co-occurrence matrix P(h1, h2), which represents the frequency of pixels with grayscale value h1 appearing simultaneously with pixels with grayscale value h2 in the given direction.

[0062] Obtain the gray level of the gray-level co-occurrence matrix. The gray level refers to the discrete series used to represent the number of gray values in an image during the image processing process, reflecting the resolution accuracy of the image gray scale. Divide each data in the gray-level co-occurrence matrix by the total number of occurrences to obtain a normalized matrix P'(h1, h2), and calculate the angular second moment of the normalized matrix as the texture energy value. The angular second moment is a texture feature quantity in the image gray-level co-occurrence matrix, used to measure the uniformity and repeatability of the image gray scale distribution. It is obtained by summing the squares of each element in the normalized gray-level co-occurrence matrix. The larger the value, the more concentrated the distribution of gray pairs in the image and the more regular the texture; the smaller the value, the more dispersed the image gray changes and the more complex the texture. The specific acquisition steps are as follows:

[0063]

[0064] In the formula, te represents the texture energy value, and te ∈ [0, 1]. The larger the value, the more regular and significant the texture, that is, the higher the energy value when the texture is complex, and the lower the energy value when the texture is uniform and smooth. G represents the gray level of the gray-level co-occurrence matrix.

[0065] Normalize the surface smoothness and the texture energy value, and calculate the texture feature coefficient based on the normalized surface smoothness and texture energy value. The specific acquisition steps are as follows:

[0066]

[0067] In the formula, TF represents the texture feature coefficient, te represents the texture energy value, and sh represents the surface smoothness. The square root is used to compress the smoothness to avoid its overly drastic impact on the result, enabling the medium-smooth region to still reflect the difference in texture strength. The calculation formula of the texture feature coefficient is constructed based on the complementary relationship between the image texture intensity and the smoothness. By forming a coefficient with the ratio of the texture energy to the square root of the smoothness, it can effectively enhance the ability to distinguish images with different texture structures while keeping the calculation simple, thereby providing an accurate and stable numerical basis for the texture feature analysis in food images.

[0068] In this embodiment, it should be specifically noted that when using the K-means clustering method to cluster the smoothness of each sub-image, the steps are as follows:

[0069] Step 1: Take the smoothness as the clustering feature, and use the smoothness of all sub-images as the data set. Each smoothness in the data set is a data point.

[0070] Step 2: Use the silhouette coefficient method to determine the number of clusters K of the data set.

[0071] The silhouette coefficient method is a method for evaluating the clustering effect and determining the optimal number of clusters K. By measuring the relationship between the compactness of each sample point within its own cluster and the separation from the nearest neighboring cluster, a silhouette coefficient value is calculated, with a value range of [-1, 1]. The closer the silhouette coefficient is to 1, the better the clustering effect, that is, the higher the similarity of samples within the cluster and the greater the difference between clusters. Compare the average silhouette coefficients corresponding to different numbers of clusters and select the value with the largest silhouette coefficient as the optimal number of clusters.

[0072] Step 3: Randomly select K data points in the data set as the initial clustering centers. For each data point, calculate its Euclidean distance to each initial clustering center. For each data point, traverse the K initial clustering centers and assign it to the clustering cluster corresponding to the nearest initial clustering center.

[0073] The Euclidean distance is one of the most commonly used distance measurement methods, used to measure the "straight-line distance" or "spatial interval" between two data points in a multi-dimensional space. The Euclidean distance has the advantages of intuitiveness and simple calculation, and is widely used in fields such as clustering analysis, image recognition, and pattern matching. In K-means clustering, the Euclidean distance is used to judge the proximity of each data point to each clustering center, and then determine the category to which it belongs.

[0074] Step 4: After traversing all data points, obtain the initial clustering clusters. For each initial clustering cluster, calculate the mean of the data points within it to obtain a new clustering center.

[0075] Step 5: Repeat Step 3 and Step 4 until the cluster centers no longer change, obtaining the final cluster clusters and the final cluster centers.

[0076] In this embodiment, it should be specifically noted that the steps for calculating the surface smoothness according to the clustering result are as follows:

[0077] Calculate the ratio of the number of data points in each final cluster cluster to the total number of data points to obtain the weight of each final cluster cluster;

[0078] Perform weighted summation of the weights of each final cluster cluster and the final cluster center to obtain the surface smoothness.

[0079] In this embodiment, it should be specifically noted that the steps for obtaining the edge blur coefficient are as follows:

[0080] Convert the original food image into a grayscale image, and use the Sobel operator to perform edge detection on the grayscale image in the horizontal and vertical directions respectively to obtain the horizontal direction gradient and the vertical direction gradient;

[0081] At each pixel position of the grayscale image, square and sum the horizontal direction gradient and the vertical direction gradient and then perform a square root calculation to obtain the total gradient amplitude. The total gradient amplitude reflects the intensity of the edge at each pixel position in the image. The amplitude in the edge clear area is higher, and the amplitude in the blurred area is lower;

[0082] Traverse all pixel points on the grayscale image, calculate the standard deviation of the total gradient amplitude, obtain the maximum theoretical amplitude of the Sobel edge amplitude, calculate the ratio of the standard deviation of the total gradient amplitude to the maximum theoretical amplitude and then take the inverse to obtain the edge blur coefficient. By calculating the standard deviation of the gradient amplitude in the entire image, the degree of dispersion of the edge intensity is obtained. The larger the standard deviation, the more significant the change in the image edge and the clearer the edge contour; the smaller the standard deviation, the slower the overall change in the image edge and the more blurred it tends to be. On this basis, normalize the standard deviation and then take its inverse to construct the edge blur coefficient, so that the larger the coefficient value, the more blurred the image edge, and the smaller the coefficient value, the clearer the edge.

[0083] In this embodiment, it should be specifically noted that the steps for judging whether metal detection is affected by condensed water according to the condensed water influence index are as follows:

[0084] Compare the condensate water influence index with the influence threshold. If the condensate water influence index is greater than or equal to the influence threshold, it is determined that the metal detection is affected by condensate water; if the condensate water influence index is less than the influence threshold, it is determined that the metal detection is not affected by condensate water. The influence threshold is obtained through an adaptive threshold method, which is an algorithm method that dynamically adjusts the determination threshold according to the actual environment or input data, aiming to improve the adaptability and judgment accuracy of the system under different conditions. This method analyzes the statistical characteristics of historical detection samples or real-time image data, and combines the set tolerance strategy or optimization criterion to automatically calculate the optimal threshold that can best distinguish between the interference and non-interference states. In this embodiment, the adaptive threshold method is used to determine the condensate water influence threshold, and a reasonable judgment standard is dynamically set to improve the stability and accuracy of the metal detection result.

[0085] Signal correction module. If it is determined that the metal detection is affected by condensate water, the metal perturbation characteristic signal is corrected to obtain the actual metal perturbation characteristic signal, and the actual metal perturbation characteristic signal is transmitted to the final condensate water influence judgment module;

[0086] The signal correction module is used to correct the original metal perturbation characteristic signal when it is determined that the metal detection result is affected by condensate water, generate a more accurate actual metal perturbation characteristic signal, and transmit it to the final condensate water influence judgment module. The setting of this module can effectively offset the interference caused by condensate water to the electromagnetic detection signal, improve the authenticity and credibility of the detection data, and avoid misjudgment or mis-removal caused by interference. By introducing a dynamic correction mechanism, this module significantly improves the detection stability and fault tolerance of the system in a complex humidity environment, laying a foundation for realizing more reliable metal foreign object identification.

[0087] In this embodiment, it should be specifically noted that the steps for correcting the metal perturbation characteristic signal to obtain the actual metal perturbation characteristic signal are as follows:

[0088] Calculate the ratio of the influence threshold to the condensate water influence index to obtain a correction factor;

[0089] Multiply the correction factor by the key characteristic parameters to obtain the actual metal perturbation characteristic signal, which can realize the dynamic correction of the detection signal affected by condensate water, can adaptively adjust the detection signal according to the actual change of the interference intensity, can effectively suppress the abnormal amplification of the signal caused by condensate water, and will not mis-suppress the real metal signal, thereby improving the robustness and accuracy of the detection system in a changing humidity environment.

[0090] The final condensate water influence judgment module is used to make a final judgment on whether there is metal in the target food again according to the actual metal perturbation characteristic signal;

[0091] The condensate water final impact judgment module is used to make a final judgment on whether there is metal in the target food based on the actual metal disturbance characteristic signal after signal correction. The setting of this module can perform more accurate and reliable metal foreign object identification on the basis of excluding the interference of condensate water, ensure that foods with real metal contamination are effectively identified, and at the same time avoid food waste and production interference caused by misjudgment. By introducing this module, the system can achieve secondary verification and control of metal detection results, and further improve the detection accuracy and the overall food safety prevention and control level.

[0092] The tracking and rejection module, if it is finally judged that the target food contains metal, will give an early warning prompt, and mark, track and reject the target food. If it is finally judged that the target food does not contain metal, it will continue to detect the next food.

[0093] The tracking and rejection module is used to give an early warning prompt in time and perform marking, tracking and rejection processing on the food when it is finally judged that the target food contains metal; if it is finally judged that there is no metal, the system will automatically enter the next round of detection process. The setting of this module can achieve precise identification and automatic rejection of foods containing metal foreign objects, prevent unqualified products from entering the market, and ensure food safety. At the same time, through the marking and tracking functions, it is convenient to trace the problem products and manage the batches, improve the intelligence and closed-loop control ability of the production process, and thus improve the operation efficiency and quality control level of the entire detection system.

[0094] In this embodiment, it should be specifically noted that the food processing metal detection device based on intelligent sensors includes one or more processors and a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors are caused to...

[0095] Finally: The above are only the preferred embodiments of the present invention and are not used to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0096] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, and all of them should be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claimed rights.

Claims

1. A food processing metal detection system based on intelligent sensors, characterized in that, Including the following steps: A metal detection module, which is used to continuously detect the target food through a multi-frequency intelligent electromagnetic induction sensor, output a metal disturbance characteristic signal, obtain key characteristic parameters according to the metal disturbance characteristic signal, and preliminarily judge whether there is a metal substance in the target food according to the key characteristic parameters; An image acquisition module, if it is judged that there is a metal substance in the target food, then image the target food through a camera device to obtain a food image, obtain food image information according to the food image, the food image information includes optical reflection data, texture feature data and edge blur data, and transmit the food image information to the preliminary condensate influence judgment module; A preliminary condensate influence judgment module, which is used to evaluate a condensate influence index according to the food image information and judge whether the metal detection is affected by condensate according to the condensate influence index; A signal correction module, if the metal detection is affected by condensate, then correct the metal disturbance characteristic signal to obtain an actual metal disturbance characteristic signal, and transmit the actual metal disturbance characteristic signal to the final condensate influence judgment module; A final condensate influence judgment module, which is used to finally judge whether there is a metal substance in the target food again according to the actual metal disturbance characteristic signal; A tracking and rejection module, if it is finally determined that there is a metal substance in the target food, then give an early warning prompt, and mark, track and reject the target food. If it is finally determined that there is no metal substance in the target food, then continue to detect the next food.

2. The food processing metal detection system based on an intelligent sensor according to claim 1, characterized in that: The steps for obtaining the condensate influence index are as follows: Obtain optical reflection data through the food image. The optical reflection data includes the proportion of the surface highlight area and the brightness gradient value, and evaluate the optical reflection coefficient according to the optical reflection data; Obtain the texture feature data of the food image. The texture feature data includes the surface smoothness and the local texture energy, and calculate the texture feature coefficient according to the texture feature data; Detect the food image of the target food by the sobel edge detection method according to the food image, and evaluate the edge blur coefficient; Normalize the optical reflection coefficient, the texture feature coefficient and the edge blur coefficient, and evaluate the condensate influence index according to the normalized optical reflection coefficient, texture feature coefficient and edge blur coefficient. The specific obtaining steps are as follows: In the formula, IW represents the condensate influence index, OR represents the normalized optical reflection coefficient, TF represents the normalized texture feature coefficient, EB represents the normalized edge blur coefficient, and a1, a2, a3 represent the weight coefficients of the normalized optical reflection coefficient, the weight coefficient of the texture feature coefficient and the weight coefficient of the edge blur coefficient.

3. The food processing metal detection system based on an intelligent sensor according to claim 2, wherein: The steps for obtaining the optical reflection coefficient are as follows: Perform grayscale processing on the food image to obtain a grayscale image and set a brightness threshold; Obtain the brightness value of the grayscale image, traverse all pixel points in the grayscale image, compare the brightness value of the pixel points with the brightness threshold, screen out the pixel points with a brightness value greater than the brightness threshold, and mark them as highlight areas; Obtain the highlight area area, and calculate the ratio of the highlight area area to the grayscale image area to obtain the proportion of the surface highlight area; Divide the grayscale image into several local windows of a fixed size, and slide 1 pixel each time. Calculate the average grayscale value within the local window, and calculate the local window brightness gradient value based on the average grayscale value. Calculate the mean value of the brightness gradient values of all local windows to obtain the brightness gradient value. Normalize the proportion of the highlight area and the brightness gradient value, and calculate the optical reflection coefficient based on the normalized proportion of the highlight area and the brightness gradient value.

4. The food processing metal detection system based on an intelligent sensor according to claim 2, wherein: The steps for obtaining the texture feature coefficient are as follows: Perform grayscale processing on the food image to obtain a grayscale image. Divide the grayscale image into m equal parts, denoted as sub-images. Obtain the grayscale value of each pixel in the sub-image, calculate the variance of the grayscale values in the sub-image based on the grayscale value of each pixel, and calculate the smoothness based on the variance of the grayscale values. Use the K-means clustering method to cluster the smoothness of each sub-image, and calculate the surface smoothness based on the clustering result. Construct a pixel grayscale matrix based on the grayscale value of each pixel in the grayscale image, set a given direction and distance, and construct a gray-level co-occurrence matrix. Obtain the gray level of the gray-level co-occurrence matrix, divide each data in the gray-level co-occurrence matrix by the total number of occurrences to obtain a normalized matrix, and calculate the angular second moment of the normalized matrix as the texture energy value. Normalize the surface smoothness and the texture energy value, and calculate the texture feature coefficient based on the normalized surface smoothness and the texture energy value.

5. The food processing metal detection system based on intelligent sensors according to claim 4, characterized in that: The steps of using the K-means clustering method to cluster the smoothness of each sub-image are as follows: Step 1: Use the smoothness as the clustering feature, and use the smoothness of all sub-images as the data set. Each smoothness in the data set is a data point. Step 2: Use the silhouette coefficient method to determine the number of clusters K of the data set. Step 3: Randomly select K data points in the data set as the initial cluster centers. For each data point, calculate its Euclidean distance to each initial cluster center. For each data point, traverse the K initial cluster centers and assign it to the cluster corresponding to the nearest initial cluster center. Step 4: After traversing all data points, obtain the initial clusters. For each initial cluster, calculate the mean value of the data points within it to obtain a new cluster center. Step 5: Repeat Step 3 and Step 4 until the cluster centers no longer change, and obtain the final clusters and the final cluster centers.

6. The food processing metal detection system based on intelligent sensors according to claim 5, characterized in that: The steps of calculating the surface smoothness based on the clustering result are as follows: Calculate the ratio of the number of data points in each final cluster to the total number of data points to obtain the weight of each final cluster. Perform weighted summation of the weight of each final cluster and the final cluster center to obtain the surface smoothness.

7. The metal detection system for food processing based on intelligent sensors according to claim 2, wherein: The steps for obtaining the edge blur coefficient are as follows: Convert the food image into a grayscale image, and use the Sobel operator to perform edge detection on the grayscale image in the horizontal and vertical directions respectively to obtain the horizontal direction gradient and the vertical direction gradient. At each pixel position of the grayscale image, perform square summation of the horizontal direction gradient and the vertical direction gradient and then perform square root calculation to obtain the total gradient amplitude. Traverse all pixel points on the grayscale image, calculate the standard deviation of the total gradient magnitude, obtain the maximum theoretical magnitude of the Sobel edge magnitude, calculate the ratio of the standard deviation of the total gradient magnitude to the maximum theoretical magnitude, and then take the inverse to obtain the edge blur coefficient.

8. The metal detection system for food processing based on intelligent sensors according to claim 1, characterized in that: The steps for judging whether metal detection is affected by condensate water according to the condensate water influence index are as follows: Compare the condensate water influence index with the influence threshold. If the condensate water influence index is greater than or equal to the influence threshold, it is judged that the metal detection is affected by condensate water; if the condensate water influence index is less than the influence threshold, it is judged that the metal detection is not affected by condensate water.

9. The metal detection system for food processing based on intelligent sensors according to claim 8, wherein: The steps for correcting the metal disturbance characteristic signal to obtain the actual metal disturbance characteristic signal are as follows: Calculate the ratio of the influence threshold to the condensate water influence index to obtain a correction factor; Calculate the product of the correction factor and the key characteristic parameters to obtain the actual metal disturbance characteristic signal.

10. Food processing metal detection equipment based on intelligent sensors, characterized in that, The device includes: One or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors are used to implement the food processing metal detection system based on intelligent sensors according to any one of claims 1-9.