Method and system for detecting harmful substances in food packaging material

Through the risk value evaluation model and the method of optimizing X-ray tube parameters by graph neural network, the problems of inefficient detection efficiency and insufficient accuracy of harmful substances in food packaging materials are solved, and the rapid and accurate detection effect is achieved.

CN120177533AInactive Publication Date: 2025-06-20SICHUAN SINAS ANALYSIS & TESTING CO LTD

Patent Information

Application Number
CN202510655336.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-06-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is inefficient in the detection of harmful substances in food packaging materials, is susceptible to subjective factors, and the response of X-ray fluorescence spectral imaging equipment is inconsistent, affecting the efficiency and accuracy of the detection.

Method used

By acquiring food packaging images and X-ray fluorescence spectral imaging equipment parameters, using the risk value evaluation model to determine the risk values ​​of multiple risk areas and each risk area, multiple sets of X-ray tube parameters are generated, and parameters are optimized through graph neural networks to improve detection efficiency and accuracy.

Benefits of technology

It realizes rapid and accurate detection of harmful substances in food packaging materials, reduces the subjective impact of manually selecting detection areas, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120177533A_ABST
    Figure CN120177533A_ABST
Patent Text Reader

Abstract

The invention provides a method and system for detecting harmful substances in a food packaging material, and relates to the technical field of harmful substance detection.The method comprises the steps that a plurality of risk areas and the risk value of each risk area are determined based on a food packaging image through a risk value evaluation model; taking the area with the maximum risk value as a detected target area, and obtaining an image corresponding to the target area; generating a plurality of sets of X-ray tube parameters based on the image corresponding to the target area and the X-ray fluorescence spectrum imaging equipment parameters, wherein the X-ray tube parameters comprise tube voltage and tube current; detecting the target area of the food package based on the multiple sets of X-ray tube parameters and obtaining multiple sets of detected X-ray fluorescence spectrum imaging data; target X-ray tube parameters are determined based on the multiple sets of detected X-ray fluorescence spectrum imaging data; harmful substance detection is performed on the target area of the food package based on the target X-ray tube parameters. The method can quickly and accurately perform harmful substance detection on the food package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of harmful substance detection, and particularly relates to a method and system for detecting harmful substances in food packaging materials. Background Art

[0002] In the food industry, the safety issues of food packaging materials have attracted increasing attention. Food packaging materials are in direct contact with food and will residual or release various harmful substances such as heavy metals, harmful chemical substances, microorganisms, etc. during the processes of production, processing, storage and transportation. These substances migrating into food will pose potential threats to human health. At present, the detection of harmful substances in traditional food packaging materials generally uses X-ray fluorescence spectroscopy imaging equipment to conduct a comprehensive and undifferentiated scanning detection on food packaging. Although it can cover the entire packaging, the efficiency is low, resulting in relatively large waste in terms of time and resources. And when manually selecting the detection area, it is easily affected by subjective factors. For example, the differences in the professional levels of detection personnel lead to inaccurate detection areas or judgment errors, thus missing potential harmful substance risk areas. In addition, different detection areas have different responses to the X-rays of the X-ray fluorescence spectroscopy imaging equipment. When manually adjusting the parameters of the X-ray tube, it is difficult to adapt to various changes, thus affecting the detection efficiency and accuracy.

[0003] Therefore, how to quickly and accurately detect harmful substances in food packaging is an urgent problem to be solved currently. Summary of the Invention

[0004] The main technical problem to be solved by the present invention is how to quickly and accurately detect harmful substances in food packaging.

[0005] According to the first aspect, the present invention provides a method for detecting harmful substances in food packaging materials, including: obtaining a food packaging image and X-ray fluorescence spectroscopy imaging equipment parameters; determining a plurality of risk areas and the risk value of each risk area based on the food packaging image using a risk value evaluation model; taking the area with the largest risk value as the target area for detection and obtaining the image corresponding to the target area; generating multiple sets of X-ray tube parameters based on the image corresponding to the target area and the X-ray fluorescence spectroscopy imaging equipment parameters, where the X-ray tube parameters include tube voltage and tube current; detecting the target area of the food packaging based on the multiple sets of X-ray tube parameters and obtaining multiple sets of detected X-ray fluorescence spectroscopy imaging data; determining the target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectroscopy imaging data; and detecting harmful substances in the target area of the food packaging based on the target X-ray tube parameters.

[0006] In a possible implementation, the determining the target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectral imaging data includes: constructing a knowledge graph, which includes multiple X-ray tube parameter nodes and multiple edges between the nodes. The node features of the X-ray tube parameter nodes include a set of detected X-ray fluorescence spectral imaging data and a set of X-ray tube parameters. The edges between the nodes represent the difference in tube voltage and the difference in tube current; processing the knowledge graph based on a graph neural network to determine the target X-ray tube parameters.

[0007] In a possible implementation, the risk value assessment model is a convolutional neural network model.

[0008] In a possible implementation, the generating multiple sets of X-ray tube parameters based on the image corresponding to the target area and the X-ray fluorescence spectral imaging device parameters includes: using a generative adversarial network to generate multiple sets of X-ray tube parameters based on the image corresponding to the target area and the X-ray fluorescence spectral imaging device parameters.

[0009] According to a second aspect, the present invention provides a harmful substance detection system for food packaging materials, including: an acquisition module, configured to acquire a food packaging image and X-ray fluorescence spectral imaging device parameters; a risk assessment module, configured to determine multiple risk areas and the risk value of each risk area based on the food packaging image using a risk value assessment model; a region determination module, configured to use the area with the maximum risk value as the target area for detection and acquire the image corresponding to the target area; a parameter generation module, configured to generate multiple sets of X-ray tube parameters based on the image corresponding to the target area and the X-ray fluorescence spectral imaging device parameters, where the X-ray tube parameters include tube voltage and tube current; a preliminary detection module, configured to detect the target area of the food packaging based on the multiple sets of X-ray tube parameters and obtain multiple sets of detected X-ray fluorescence spectral imaging data; a parameter optimization module, configured to determine the target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectral imaging data; a detection module, configured to detect harmful substances in the target area of the food packaging based on the target X-ray tube parameters.

[0010] In a possible implementation, the parameter optimization module is further configured to: construct a knowledge graph, which includes multiple X-ray tube parameter nodes and multiple edges between the nodes. The node features of the X-ray tube parameter nodes include a set of detected X-ray fluorescence spectral imaging data and a set of X-ray tube parameters. The edges between the nodes represent the difference in tube voltage and the difference in tube current; process the knowledge graph based on a graph neural network to determine the target X-ray tube parameters.

[0011] In a possible implementation, the risk value assessment model is a convolutional neural network model.

[0012] In a possible implementation, the parameter generation module is further configured to: generate multiple sets of X-ray tube parameters using a generative adversarial network based on the image corresponding to the target region and the X-ray fluorescence spectroscopy imaging device parameters.

[0013] According to a third aspect, an embodiment of the present invention provides an electronic device, including: a processor; a memory; and a computer program; wherein, the computer program is stored in the memory and configured to be executed by the processor to implement the method as described above, the method including: obtaining a food packaging image and X-ray fluorescence spectroscopy imaging device parameters; determining multiple risk regions and the risk value of each risk region based on the food packaging image using a risk value evaluation model; taking the region with the maximum risk value as the target region to be detected and obtaining the image corresponding to the target region; generating multiple sets of X-ray tube parameters based on the image corresponding to the target region and the X-ray fluorescence spectroscopy imaging device parameters, the X-ray tube parameters including tube voltage and tube current; detecting the target region of the food packaging based on the multiple sets of X-ray tube parameters and obtaining multiple sets of detected X-ray fluorescence spectroscopy imaging data; determining the target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectroscopy imaging data; and detecting harmful substances in the target region of the food packaging based on the target X-ray tube parameters.

[0014] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the method for detecting harmful substances in food packaging materials as provided above, the method including: obtaining a food packaging image and X-ray fluorescence spectroscopy imaging device parameters; determining multiple risk regions and the risk value of each risk region based on the food packaging image using a risk value evaluation model; taking the region with the maximum risk value as the target region to be detected and obtaining the image corresponding to the target region; generating multiple sets of X-ray tube parameters based on the image corresponding to the target region and the X-ray fluorescence spectroscopy imaging device parameters, the X-ray tube parameters including tube voltage and tube current; detecting the target region of the food packaging based on the multiple sets of X-ray tube parameters and obtaining multiple sets of detected X-ray fluorescence spectroscopy imaging data; determining the target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectroscopy imaging data; and detecting harmful substances in the target region of the food packaging based on the target X-ray tube parameters.

[0015] A method and system for detecting harmful substances in a food packaging material provided by the present invention, the method comprising: acquiring a food packaging image and X-ray fluorescence spectroscopy imaging device parameters; determining a plurality of risk regions and the risk value of each risk region based on the food packaging image using a risk value assessment model; taking the region with the largest risk value as the target region to be detected and acquiring the image corresponding to the target region; generating multiple sets of X-ray tube parameters based on the image corresponding to the target region and the X-ray fluorescence spectroscopy imaging device parameters, the X-ray tube parameters including tube voltage and tube current; detecting the target region of the food packaging based on the multiple sets of X-ray tube parameters and obtaining multiple sets of detected X-ray fluorescence spectroscopy imaging data; determining the target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectroscopy imaging data; and detecting harmful substances in the target region of the food packaging based on the target X-ray tube parameters, the method being capable of quickly and accurately detecting harmful substances in the food packaging. Description of the Drawings

[0016] Figure 1 It is a schematic flowchart of a method for detecting harmful substances in a food packaging material provided by an embodiment of the present invention; Figure 2 It is a schematic flowchart of a method for determining target X-ray tube parameters provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of a system for detecting harmful substances in a food packaging material provided by an embodiment of the present invention; Detailed Description of the Embodiments

[0017] The present invention will be further described in detail below in conjunction with the drawings through specific embodiments. Similar elements in different embodiments are labeled with related similar element numbers. In the following embodiments, many details are described to enable a better understanding of the present invention. However, those skilled in the art can easily recognize that some of the features can be omitted in different situations, or can be replaced by other elements, materials, or methods. In some cases, some operations related to the present invention are not shown or described in the specification to avoid the core part of the present invention being overwhelmed by excessive description. For those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations based on the description in the specification and the general technical knowledge in the art.

[0018] In an embodiment of the present invention, there is provided a method for detecting harmful substances in a food packaging material as shown in Figure 1 The method for detecting harmful substances in the food packaging material includes steps S1 to S7: Step S1, acquiring a food packaging image and X-ray fluorescence spectroscopy imaging device parameters.

[0019] The food packaging image is a digital image obtained by scanning the food packaging through a high-resolution industrial camera scanning device. The physical characteristics of the packaging material, including information such as printing patterns, seam structures, and coating distributions, are recorded in the food packaging image.

[0020] The X-ray fluorescence spectroscopy imaging device is an analytical instrument that uses X-rays to excite a sample to generate characteristic fluorescence, and then determines the elemental composition and distribution of the sample by analyzing the fluorescence spectrum, and generates corresponding imaging data to detect the composition and structure of substances.

[0021] The X-ray fluorescence spectroscopy imaging device works based on the principle of X-ray fluorescence spectroscopy. When high-energy X-rays irradiate the food packaging material, the atoms in the food packaging material will absorb the energy of the X-rays and cause the inner electrons to transition. When the outer electrons fill the inner electron vacancies, X-ray fluorescence with specific energy will be released. By detecting and analyzing the energy and intensity of the released X-ray fluorescence, the types and contents of the elements contained in the food packaging material can be determined.

[0022] The parameters of the X-ray fluorescence spectroscopy imaging device refer to the specific parameters that affect the operation and imaging effect of the X-ray fluorescence spectroscopy imaging device. The parameters of the X-ray fluorescence spectroscopy imaging device include, but are not limited to, the type of detector, resolution, scanning range, scanning speed, pixel size, etc. Different food packaging materials, due to differences in their materials, thicknesses, densities, etc., have different absorption and scattering situations for X-rays. Therefore, appropriate device parameters, such as tube voltage and tube current, need to be adjusted to ensure that the elements in the material can be accurately and effectively excited to generate fluorescence signals, so as to obtain high-quality detection data.

[0023] Step S2, based on the food packaging image, use the risk value assessment model to determine multiple risk regions and the risk value of each risk region.

[0024] The risk value assessment model is a convolutional neural network model. The input of the risk value assessment model is the food packaging image, and the output of the risk value assessment model is multiple risk regions and the risk value of each risk region.

[0025] The risk region is a local area determined by the risk value assessment model that may cause the migration or leakage of harmful substances or pose a potential threat to food safety. For example, the small gaps that appear at the seams of the food packaging box body due to poor welding in the image of a plastic food packaging box, the areas with uneven coatings inside the box, all belong to the risk regions. The pattern part with excessive ink accumulation on a paper food packaging bag will also be determined as a risk region.

[0026] The risk value is an indicator value that can be used to quantify the severity of food safety risks existing in a risk area. The higher the risk value of a risk area, the greater the likelihood of the presence of harmful substance migration or safety risks in that risk area, and the more serious the risk level.

[0027] The convolutional neural network model includes a convolutional neural network (CNN). A convolutional neural network is a deep learning model that is good at processing image and audio data. The convolutional neural network can extract useful features from images and gradually understand and learn the context information of the images. The convolutional neural network (CNN) consists of multiple convolutional layers, pooling layers, and fully connected layers. Among them, the convolutional layer can perform a convolution operation by sliding a convolution kernel on the input data and extract the local features of the data; the pooling layer can be used to reduce the dimension of the data, thereby reducing the computational amount to prevent overfitting; the fully connected layer can integrate the extracted features and output the final classification and regression results.

[0028] For a food packaging image, the convolutional neural network can extract the high-dimensional features of the image by using the convolutional layer and the pooling layer, and capture the visual patterns of different regions on the food packaging, such as color, texture, shape, etc. Through the fully connected layer and the risk assessment algorithm, the convolutional neural network can analyze and quantify the possibility of risks existing in each region, and thus output the risk value. By training a large number of food packaging image sample data with risk annotations, the convolutional neural network can learn the mapping relationship between the regional features of the food packaging and the risk value, and thus can accurately determine multiple risk areas and the risk value of each risk area.

[0029] In some embodiments, the risk value assessment model includes an image region division layer, a primary risk region selection layer, and a risk region determination layer. The input of the image region division layer is the food packaging image, and the output of the image region division layer is multiple segmented regions of the food packaging image, the risk judgment criteria for each segmented region, and the appearance features of each segmented region. The input of the primary risk region selection layer is multiple segmented regions of the food packaging image and the appearance features of each segmented region, and the output of the primary risk region selection layer is multiple preliminary screened risk regions, the risk possibility of each preliminary screened region, and the risk type of each preliminary screened region. The input of the risk region determination layer is multiple preliminary screened risk regions, the risk possibility of each preliminary screened region, the risk type of each preliminary screened region, and the risk judgment criteria for each segmented region, and the output of the risk region determination layer is the risk region and the risk value of each risk region.

[0030] The multiple segmented regions of the food packaging image are multiple local image blocks obtained by dividing the overall image of the food packaging according to specific rules, such as the functional parts of the packaging (sealing area, printing area, main bearing area, etc.), material differences (joints of different plastic materials, joints of plastic and metal, etc.). The multiple segmented regions together constitute the complete food packaging image.

[0031] The risk assessment criteria for each segmented area are a series of guidelines determined for each area divided from the food packaging image to measure whether there is a risk in that area and the degree of risk. The risk assessment criteria involve characteristic indicators in multiple aspects such as the color, texture, shape, size, etc. of the area. For example, for the printed area of food packaging, the assessment criteria can be set as the allowable content range of specific color inks, the minimum threshold of the clarity of printed patterns, the flatness standard of the edge of the printed area, etc., while for the sealed area of the packaging, the assessment criteria can be the width uniformity of the sealing line, the transparency consistency of the material at the sealed part, etc.

[0032] The appearance features of each segmented area refer to the external visual features presented by each segmented area of the food packaging image, including characteristics in aspects such as color, texture, shape, glossiness, etc.

[0033] Multiple preliminarily screened risk areas refer to the areas of the food packaging image that are preliminarily screened and considered to have a relatively high possibility of having risks.

[0034] The risk possibility of each preliminarily screened area is a value used to quantify the likelihood of the existence of risks in that area.

[0035] The risk types can include risks such as material contamination risk, poor sealing risk, excessive printing ink risk, etc.

[0036] The image area division layer can classify and divide the food packaging image according to different dimensions such as packaging usage, parts, etc. For example, the sealed part, printed pattern part, material main body part, etc. of the packaging are divided into different areas respectively, and different risk area assessment criteria are formulated for different areas. At the same time, the appearance features of each area, such as color, texture, shape, etc. information, are extracted. The preliminary risk area selection layer can be based on the divided areas and their appearance features, then calculate indicators and analyze for each area to screen out the areas that may have risks, and calculate the risk possibility degree and risk type of each area, so as to initially locate the risk areas. The risk area determination layer can combine the information of the preliminarily screened risk areas and the assessment criteria of the corresponding segmented areas where the preliminarily screened risk areas are located, and further screen and in-depth analyze, so as to accurately determine the final risk areas and the risk values of each area.

[0037] Through this layering, each layer can perform its own functions, and the modularization of tasks is achieved. The image region division layer can focus on the preprocessing and region division of images, the initial risk region selection layer can focus on the preliminary screening of risk regions, and the risk region determination layer can focus on accurate risk assessment, and each layer processes data step by step. This layered structure can not only improve the accuracy and efficiency of risk assessment, but also enhance the interpretability and reliability of the entire model, so as to more efficiently and accurately identify the risk regions and their risk levels in food packaging.

[0038] Step S3: Take the region with the maximum risk value as the target region for detection and obtain the image corresponding to the target region.

[0039] The target region is a specific region designated for detailed detection to determine whether there are harmful substances. When multiple risk regions and the risk values of each risk region are determined, the one with the maximum value is selected from the multiple risk values, and the corresponding risk region is determined as the target region for detection.

[0040] The image corresponding to the target region is an image separately extracted from the food packaging image for the target region to be detected.

[0041] Step S4: Generate multiple sets of X-ray tube parameters based on the image corresponding to the target region and the X-ray fluorescence spectroscopy imaging device parameters. The X-ray tube parameters include tube voltage and tube current.

[0042] In some embodiments, multiple sets of X-ray tube parameters are generated using a generative adversarial network based on the image corresponding to the target region and the X-ray fluorescence spectroscopy imaging device parameters. The input of the generative adversarial network is the image corresponding to the target region, and the output of the generative adversarial network is multiple sets of X-ray tube parameters.

[0043] The generative adversarial network (GAN) is a deep learning model. The generative adversarial network consists of two parts: a generator and a discriminator. The generator can generate new data samples based on the input data, and the discriminator is used to distinguish data samples from real data. Through this continuous adversarial training, the generation ability of the generator will gradually improve, and the discrimination ability of the discriminator can also be continuously enhanced, so as to finally reach a dynamic balance, and then enable the generator to generate high-quality samples close to the real data distribution.

[0044] X-ray tube parameters are the key parameters for controlling the generation of X-rays by an X-ray tube. X-ray tube parameters include tube voltage and tube current, and each set of X-ray tube parameters is a combination containing a specific set of tube voltage and tube current. The tube voltage determines the energy of the X-rays, while the tube current affects the intensity of the X-rays.

[0045] Generative adversarial networks have powerful learning and generation capabilities. Through a large amount of training on data such as images of different target regions, device parameters, and samples of corresponding effective X-ray tube parameters, the generator can learn the potential mapping relationship between image features, device parameters, and X-ray tube parameters. When the image and device parameters corresponding to the target region are input, the generator can generate multiple sets of X-ray tube parameters that meet the requirements based on the learned knowledge, and the discriminator evaluates and screens the generated parameters, thereby ensuring that the multiple sets of finally generated X-ray tube parameters can not only meet the actual detection requirements but also have high accuracy and effectiveness.

[0046] Step S5, detect the target region of the food packaging based on the multiple sets of X-ray tube parameters and obtain multiple sets of detected X-ray fluorescence spectroscopy imaging data.

[0047] The multiple sets of detected X-ray fluorescence spectroscopy imaging data are multiple sets of spectral data that reflect the elemental composition, content, etc. of the target region obtained by detecting the target region using different X-ray tube parameters. The X-ray fluorescence spectroscopy imaging data is presented in the form of a spectrum diagram, with the abscissa being the energy of the X-rays and the ordinate being the fluorescence intensity at the corresponding energy.

[0048] Step S6, determine the target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectroscopy imaging data.

[0049] In some embodiments, Figure 2 is a schematic flowchart of a process for determining target X-ray tube parameters provided by an embodiment of the present invention. The determination of the target X-ray tube parameters includes steps S21 to S22: Step S21, construct a knowledge graph. The knowledge graph includes multiple X-ray tube parameter nodes and multiple edges between the nodes. The node features of the X-ray tube parameter nodes include a set of detected X-ray fluorescence spectroscopy imaging data and a set of X-ray tube parameters. The edges between the nodes represent the difference in tube voltage and the difference in tube current.

[0050] A knowledge graph is a data structure that graphically displays entities and their relationships. A knowledge graph can describe the associations between things through nodes (vertices) and edges. In some embodiments, a knowledge graph can be used to integrate the relationship between X-ray tube parameters and corresponding detection data and can provide a structured data representation.

[0051] Each node represents a specific set of X-ray tube parameters, and the node features of the node include the X-ray fluorescence spectral imaging data obtained after detecting the target area of the food packaging using this set of X-ray tube parameters.

[0052] An edge is a connection line between the X-ray tube parameter nodes in the knowledge graph and is used to represent the relationship between the X-ray tube parameters represented by two nodes. The edge can represent the difference in tube voltage and the difference in tube current between the two nodes.

[0053] Step S22: Process the knowledge graph based on the graph neural network to determine the target X-ray tube parameters.

[0054] A graph neural network (Graph Neural Network, GNN) is a data processing model based on deep learning that can process knowledge graphs. The graph neural network can perform information transfer and aggregation between nodes in the knowledge graph and can learn the feature representations of nodes and graphs. The core of the graph neural network is that it can use the message passing mechanism to enable each node to absorb the feature information of its neighbor nodes, thereby updating its own representation. The graph neural network is suitable for processing unstructured data with complex relationships and shows strong advantages especially in knowledge graph analysis.

[0055] The knowledge graph can intuitively and systematically represent the internal relationship between different X-ray tube parameter settings and their corresponding X-ray fluorescence spectral imaging data. Through the knowledge graph, it is possible to clearly see the change trend of the X-ray fluorescence spectral imaging data under different combinations of tube voltage and tube current, as well as the impact of the differences between parameter combinations on the detection results.

[0056] The node features of the X-ray tube parameter nodes can provide rich context information for the graph neural network model. A set of X-ray tube parameters can help understand the experimental conditions during detection and different combinations of tube voltage and tube current, which determine the energy and intensity of the X-rays, and thus affect the excitation effect on the substances in the target area of the food packaging. And a set of detected X-ray fluorescence spectral imaging data can provide information on the elemental composition and content of the substances in the target area under the corresponding X-ray tube parameters, thereby reflecting the substance response of the target area under specific detection conditions.

[0057] Edges can provide key association information for the graph neural network. The difference in tube voltage can help the graph neural network understand the degree of difference in X-ray energy changes under different X-ray tube parameter settings. The energy difference affects the excitation effect on the substances in the target area. Different energy excitations will cause substances to produce different fluorescence signals, thereby reflecting different characteristics of the substance elements. The difference in tube current reflects the difference in X-ray intensity changes. Different intensities mean different strengths of exciting substances to produce fluorescence signals, which in turn affect the accuracy and reliability of the detection data.

[0058] Graph neural networks can fully transmit and integrate information between nodes. First, by learning the node features and edge relationships in the knowledge graph, graph neural networks can capture the complex mapping relationships between different X-ray tube parameters and detection results. Second, graph neural networks are trained based on a large amount of historical data and can learn the optimal parameter selection strategy from the knowledge graph. Finally, graph neural networks can comprehensively consider multiple sets of parameters and corresponding detection data, thereby evaluating the advantages and disadvantages of each parameter combination, and then screening out the target X-ray tube parameters that are most suitable for accurately detecting harmful substances in the target area of food packaging.

[0059] Step S7: Perform harmful substance detection on the target area of the food packaging based on the target X-ray tube parameters.

[0060] When the target X-ray tube parameters are determined, based on the tube voltage and tube current of the parameters of the target X-ray tube, harmful substance detection is performed on the target area of the food packaging through the X-ray fluorescence spectroscopy imaging device.

[0061] Based on the same inventive concept, Figure 3 FIG. is a schematic diagram of a harmful substance detection system in a food packaging material provided by an embodiment of the present invention. The harmful substance detection system in the food packaging material includes: An acquisition module 31, configured to acquire a food packaging image and X-ray fluorescence spectroscopy imaging device parameters; A risk assessment module 32, configured to determine multiple risk areas and the risk value of each risk area based on the food packaging image using a risk value assessment model; A region determination module 33, configured to use the region with the maximum risk value as the target region for detection and acquire an image corresponding to the target region; A parameter generation module 34, configured to generate multiple sets of X-ray tube parameters based on the image corresponding to the target region and the X-ray fluorescence spectroscopy imaging device parameters, where the X-ray tube parameters include tube voltage and tube current; A preliminary detection module 35, configured to perform detection on the target area of the food packaging based on the multiple sets of X-ray tube parameters and obtain multiple sets of detected X-ray fluorescence spectroscopy imaging data; A parameter optimization module 36, configured to determine target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectroscopy imaging data; A detection module 37, configured to perform harmful substance detection on the target area of the food packaging based on the target X-ray tube parameters.

[0062] Moreover, unless clearly stated in the claims, the order of the processing elements and sequences, the use of numerical and alphabetical characters, or the use of other names in this specification are not used to limit the order of the processes and methods in this specification. Although some currently useful embodiments of the invention have been discussed through various examples in the above disclosure, it should be understood that such details are for illustrative purposes only, and the appended claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that conform to the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only through software solutions, such as installing the described system on existing servers or mobile devices.

[0063] Similarly, it should be noted that, in order to simplify the presentation of the disclosure in this specification and thus help the understanding of one or more embodiments of the invention, in the foregoing description of the embodiments of this specification, multiple features are sometimes grouped together into one embodiment, drawing, or description thereof. However, this method of disclosure does not mean that the features required by the subject matter of this specification are more than those mentioned in the claims. In fact, the features of the embodiments are fewer than all the features of the individual embodiments disclosed above.

[0064] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, by way of example and not limitation, alternative configurations of the embodiments of this specification may be regarded as consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments clearly introduced and described in this specification.

Claims

1. A method for detecting harmful substances in food packaging materials, characterized in that: include: Obtain food packaging images and X-ray fluorescence spectroscopic imaging equipment parameters; Determine a plurality of risk areas and a risk value of each risk area using a risk value assessment model based on the food packaging image; The area with the largest risk value is taken as the target area for detection and the image corresponding to the target area is obtained; generating a plurality of sets of X-ray tube parameters based on the image corresponding to the target area and the parameters of the X-ray fluorescence spectrum imaging device, wherein the X-ray tube parameters include tube voltage and tube current; Detecting a target area of ​​the food package based on the multiple sets of X-ray tube parameters and obtaining multiple sets of detected X-ray fluorescence spectrum imaging data; Determining target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectral imaging data; The target area of ​​the food package is inspected for harmful substances based on the target X-ray tube parameters.

2. The method for detecting harmful substances in food packaging materials according to claim 1, characterized in that: Determining the target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectrum imaging data includes: Constructing a knowledge graph, the knowledge graph includes multiple X-ray tube parameter nodes and multiple edges between the multiple nodes, the node features of the X-ray tube parameter nodes include a set of X-ray fluorescence spectrum imaging data after detection and a set of X-ray tube parameters, and the edges between the nodes represent the difference of tube voltage and the difference of tube current; The knowledge graph is processed based on a graph neural network to determine target X-ray tube parameters.

3. The method for detecting harmful substances in food packaging materials according to claim 1, characterized in that: The risk value assessment model is a convolutional neural network model.

4. The method for detecting harmful substances in food packaging materials according to claim 1, characterized in that: The generating of multiple sets of X-ray tube parameters based on the image corresponding to the target area and the parameters of the X-ray fluorescence spectrum imaging device includes: A plurality of sets of X-ray tube parameters are generated using a generative adversarial network based on the image corresponding to the target area and the parameters of the X-ray fluorescence spectroscopy imaging device.

5. A system for detecting harmful substances in food packaging materials, used to implement the method for detecting harmful substances in food packaging materials according to any one of claims 1 to 4, characterized in that: include: An acquisition module, used for acquiring food packaging images and X-ray fluorescence spectrum imaging equipment parameters; A risk assessment module, configured to determine a plurality of risk areas and a risk value of each risk area based on the food packaging image using a risk value assessment model; A region determination module, used to take the region with the largest risk value as the target region for detection and obtain an image corresponding to the target region; A parameter generation module, used to generate multiple sets of X-ray tube parameters based on the image corresponding to the target area and the parameters of the X-ray fluorescence spectrum imaging device, the X-ray tube parameters including tube voltage and tube current; A preliminary detection module, used to detect the target area of ​​the food package based on the multiple sets of X-ray tube parameters and obtain multiple sets of X-ray fluorescence spectrum imaging data after detection; A parameter optimization module, used to determine target X-ray tube parameters based on the multiple sets of detected X-ray fluorescence spectrum imaging data; The detection module is used to detect harmful substances in a target area of ​​the food package based on the target X-ray tube parameters.

6. The harmful substance detection system in food packaging materials according to claim 5, characterized in that: The parameter optimization module is also used for: Constructing a knowledge graph, the knowledge graph includes multiple X-ray tube parameter nodes and multiple edges between the multiple nodes, the node features of the X-ray tube parameter nodes include a set of X-ray fluorescence spectrum imaging data after detection and a set of X-ray tube parameters, and the edges between the nodes represent the difference of tube voltage and the difference of tube current; The knowledge graph is processed based on a graph neural network to determine target X-ray tube parameters.

7. The harmful substance detection system in food packaging materials according to claim 5, characterized in that: The risk value assessment model is a convolutional neural network model.

8. The harmful substance detection system in food packaging materials according to claim 5, characterized in that: The parameter generation module is also used for: A plurality of sets of X-ray tube parameters are generated using a generative adversarial network based on the image corresponding to the target area and the parameters of the X-ray fluorescence spectroscopy imaging device.

9. An electronic device, characterized in that: include: processor; Memory; And a computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the method for detecting harmful substances in food packaging materials as described in any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for detecting harmful substances in food packaging materials as claimed in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • X-ray computed tomography imaging apparatus and photon counting CT apparatus

    US20150063529A1

Cited By

  • Control method and system for ultra-small high-precision servo drive rotary table

    CN120376444A

  • A control method and system for an ultra-small high-precision servo-driven turntable

    CN120376444B