Sensitivity self-correction method, system and equipment of X-ray machine and medium
By collecting product images in the X-ray machine and fusing them with the standard foreign object test card images, and adjusting parameters using the adaptive learning model, the problem of reduced sensitivity of the X-ray machine is solved, and the detection efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510437655.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-09
AI Technical Summary
During long-term use of X-ray machines, due to attenuation, instability, and insufficient equipment maintenance of the radiation source and detector, the sensitivity decreases, and it is impossible to detect foreign matter in food efficiently and accurately.
By collecting product images on the X-ray conveyor belt and fusing them with the standard foreign object test card images, the sensitivity value is detected using an adaptive learning model, and the model parameters are adjusted according to the difference until the detection value is consistent with the standard value.
It realizes self-correction of X-ray machine sensitivity, improves detection efficiency and accuracy, and reduces false alarms and omissions.
Smart Images

Figure CN120374531A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of foreign object detection, and particularly to a method, system, device and medium for self-calibrating the sensitivity of an X-ray machine. Background Art
[0002] On a food production line, an X-ray machine is usually used to detect foreign objects such as metal, glass, ceramics, quartz, etc. that may exist in food to ensure food safety. The sensitivity of the X-ray machine is detected and calibrated by manually attaching a standard foreign object test card to a normal product. The standard test card can be of types such as metal balls, metal wires, glass balls, ceramic balls, quartz balls, etc. A standard test card contains one or more foreign objects of different sizes. During long-term use, problems such as light source attenuation, unstable X-ray beam output, unstable detector temperature drift, detector aging, environmental interference, and insufficient equipment maintenance may occur in the ray source and detector of the X-ray machine, resulting in a decrease in the sensitivity of the X-ray machine. Therefore, there is an urgent need for an efficient and accurate method for self-calibrating the sensitivity of an X-ray machine to solve the above problems. Summary of the Invention
[0003] In view of the above problems, the present invention is proposed to provide a method, system, device and medium for self-calibrating the sensitivity of an X-ray machine that overcomes or at least partially solves the above problems.
[0004] To achieve the above object and other related objects, the present invention provides a method for self-calibrating the sensitivity of an X-ray machine, which is applied to an X-ray machine. The method includes:
[0005] Collect a product image of a product to be detected on the conveyor belt of the X-ray machine, and insert a standard foreign object test card image into the product image for image fusion to generate a superimposed image;
[0006] Input the superimposed image into a pre-constructed adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and compare the sensitivity detection value with the standard sensitivity value of the standard foreign object test card image;
[0007] In the case where the sensitivity detection value is inconsistent with the standard sensitivity value, adjust the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value.
[0008] Optionally, before the step of collecting a product image of a product to be detected on the conveyor belt of the X-ray machine, the method further includes:
[0009] Obtain product sample images of multiple qualified products, standard foreign object test card images of different types, and foreign object annotation information and standard sensitivity values corresponding to each of the standard foreign object test card images;
[0010] Randomly insert each standard foreign object test card image into an arbitrary position in each product sample image for image fusion to generate foreign object sample images, and obtain the foreign object annotation information and standard sensitivity values of each foreign object sample image;
[0011] Input the product sample images, the foreign object sample images, their foreign object annotation information, and the standard sensitivity values into an adaptive learning model for iterative training until the model training stop condition is reached, and obtain the corresponding adaptive learning model.
[0012] Optionally, the step of inputting the product sample images, the foreign object sample images, their foreign object annotation information, and the standard sensitivity values into an adaptive learning model for iterative training until the model training stop condition is reached, and obtaining the corresponding adaptive learning model includes:
[0013] Input the product sample images, the foreign object sample images, their foreign object annotation information, and the standard sensitivity values into an adaptive learning model to obtain the predicted annotation information and predicted sensitivity values output by the adaptive learning model;
[0014] Calculate the model loss value according to the foreign object annotation information, the standard sensitivity value, the predicted annotation information, and the predicted sensitivity value;
[0015] Adjust the model parameters of the adaptive learning model according to the model loss value, and continue to train the adaptive learning model until the model converges to obtain the trained adaptive learning model.
[0016] Optionally, in the case where the sensitivity detection value is inconsistent with the standard sensitivity value, adjust the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value, including:
[0017] When the sensitivity detection value is greater than or less than the standard sensitivity value, adjust and update the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value;
[0018] Set the adaptive learning model with updated model parameters as the pre-constructed adaptive learning model, and loop through the steps of inputting the superimposed image into the pre-constructed adaptive learning model to obtain the sensitivity detection value corresponding to the superimposed image to the step of adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value output by the iteratively adjusted adaptive learning model is the same as the standard sensitivity value.
[0019] Optionally, after the step of adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value when the sensitivity detection value is inconsistent with the standard sensitivity value, the method further includes:
[0020] Recording the model parameters of the adaptive learning model when the sensitivity detection value is consistent with the standard sensitivity value.
[0021] Optionally, after the step of comparing the sensitivity detection value with the standard sensitivity value of the foreign object test image, the method further includes:
[0022] Recording the sensitivity detection value and the standard sensitivity value, and respectively plotting change curves of the sensitivity detection value and the standard sensitivity value by using the sensitivity detection values and the standard sensitivity values recorded within a preset time period.
[0023] Optionally, after the step of comparing the sensitivity detection value with the standard sensitivity value of the foreign object test image, the method further includes:
[0024] When it is detected that the sensitivity detection value is inconsistent with the standard sensitivity value, recording the system time corresponding to the obtained sensitivity detection value and incrementing the count, and counting the number of times that the sensitivity detection value is inconsistent with the standard sensitivity value within a set time period. If it exceeds a preset number of times, an alarm message is sent.
[0025] In a second aspect, the present invention further provides a sensitivity self - calibration system for an X - ray machine, the system includes:
[0026] An acquisition module, configured to acquire a product image of a product to be detected on the conveyor belt of the X - ray machine, and insert a standard foreign object test card image into the product image to generate a superimposed image through image fusion;
[0027] A comparison module, configured to input the superimposed image into a pre - constructed adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and compare the sensitivity detection value with the standard sensitivity value of the standard foreign object test card image;
[0028] An adjustment module, configured to adjust the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value when the sensitivity detection value is inconsistent with the standard sensitivity value.
[0029] In a third aspect, the present invention provides an electronic device, which includes: a memory and a processor; the memory is used for storing a computer program; the processor is used for executing the computer program stored in the memory, so that the electronic device executes the steps of the sensitivity self-calibration method of the X-ray machine as described above.
[0030] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by an electronic device, it implements the steps of the sensitivity self-calibration method of the X-ray machine as described above.
[0031] One or more of the above technical solutions provided by the present invention may have the following advantages or at least achieve the following technical effects:
[0032] For the sensitivity self-calibration method, system, device and medium of the X-ray machine of the present invention, the present invention collects product images of products to be detected on the conveyor belt of the X-ray machine, and inserts a foreign object test image into the product image to generate a superimposed image through image fusion; inputs the superimposed image into a pre-constructed adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and compares the sensitivity detection value with the standard sensitivity value of the standard foreign object test card image; in the case where the sensitivity detection value is inconsistent with the standard sensitivity value, according to the difference between the sensitivity detection value and the standard sensitivity value, adjust the model parameters of the adaptive learning model until the sensitivity detection value is consistent with the standard sensitivity value; thereby realizing the self-calibration of the sensitivity of the X-ray machine, and improving the sensitivity detection efficiency and accuracy during the operation of the X-ray machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It shows a schematic flow chart of the sensitivity self-calibration method of the X-ray machine in an embodiment of the present invention;
[0034] Figure 2 It shows a schematic flow chart of sensitivity adjustment in an embodiment of the present invention;
[0035] Figure 3 It shows a schematic diagram of a standard foreign object test card image (metal ball, ceramic ball, quartz ball) in an embodiment of the present invention;
[0036] Figure 4 It shows a schematic diagram of a product sample image of a qualified product in an embodiment of the present invention;
[0037] Figure 5 (a) It shows a schematic diagram of a superimposed image fused with a metal ball in an embodiment of the present invention;
[0038] Figure 5 (b) It shows a schematic diagram of a superimposed image fused with a ceramic ball in an embodiment of the present invention;
[0039] Figure 5 (c) Schematic diagram of the superimposed image integrated with quartz spheres in an embodiment of the present invention;
[0040] Figure 6 (a) Schematic diagram of the detection result of the superimposed image integrated with metal spheres in an embodiment of the present invention;
[0041] Figure 6 (b) Schematic diagram of the detection result of the superimposed image integrated with ceramic spheres in an embodiment of the present invention;
[0042] Figure 6 (c) Schematic diagram of the detection result of the superimposed image integrated with quartz spheres in an embodiment of the present invention;
[0043] Figure 7 (a) Schematic diagram of the detection result of metal spheres with a sensitivity detection value higher than the standard sensitivity value in an embodiment of the present invention;
[0044] Figure 7 (b) Schematic diagram of the detection result of ceramic spheres with a sensitivity detection value higher than the standard sensitivity value in an embodiment of the present invention;
[0045] Figure 7 (c) Schematic diagram of the detection result of quartz spheres with a sensitivity detection value higher than the standard sensitivity value in an embodiment of the present invention;
[0046] Figure 8 (a) Schematic diagram of the detection result of metal spheres with a sensitivity detection value lower than the standard sensitivity value in an embodiment of the present invention;
[0047] Figure 8 (b) Schematic diagram of the detection result of ceramic spheres with a sensitivity detection value lower than the standard sensitivity value in an embodiment of the present invention;
[0048] Figure 8 (c) Schematic diagram of the detection result of quartz spheres with a sensitivity detection value lower than the standard sensitivity value in an embodiment of the present invention;
[0049] Figure 9 Schematic diagram of the functional modules of the sensitivity self - calibration system of the X - ray machine in an embodiment of the present invention;
[0050] Figure 10 Schematic diagram of an electronic device in an embodiment of the present invention. Detailed implementation manners
[0051] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand the other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0052] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Therefore, only the components related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and proportion of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0053] In the following description, a large number of details are explored to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0054] The terms "first", "second", etc. in the specification, claims, and above-mentioned drawings of the embodiments of the present disclosure are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so as to implement the embodiments of the present disclosure described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion.
[0055] Unless otherwise specified, the term "plural" means two or more.
[0056] In the embodiments of the present disclosure, the character " / " indicates that the objects before and after are in an "or" relationship. For example, A / B means: A or B.
[0057] The term "and / or" is an associative relationship describing objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, the three relationships of A and B.
[0058] Next, the technical solutions in the embodiments of the present invention will be described in detail with reference to the accompanying drawings in the embodiments of the present invention.
[0059] Please refer to Figure 1-2 , an embodiment of the present invention provides a sensitivity self-calibration method for an X-ray machine, which is applied to an X-ray machine. The method may include the following steps S10 to S30:
[0060] Step S10, collect the product image of the product to be detected on the conveyor belt of the X-ray machine, and insert the standard foreign object test card image into the product image for image fusion to generate a superimposed image.
[0061] Among them, the product image is used to represent the image generated by the imaging device in the X-ray machine for the product to be detected on the conveyor belt; the product to be detected can be a normal product without foreign objects, that is, the corresponding product image can be a normal product OK image without foreign objects.
[0062] The standard foreign object test card image is used to represent the image generated by the imaging device in the X-ray machine for various types of standard foreign object test cards.
[0063] The standard foreign object test card can include but is not limited to types such as metal balls, metal wires, glass balls, ceramic balls, and quartz balls; one standard test card can contain foreign objects of one or more sizes.
[0064] The superimposed image can be used to represent the product foreign object image generated by fusing the product image and the standard foreign object test card using image processing technology.
[0065] In a specific implementation, the product image of the product to be detected on the conveyor belt of the X-ray machine can be collected regularly (such as every half hour, or 1 hour, or 2 hours), and then a single standard foreign object test card image (such as one of metal balls, metal wires, glass balls, ceramic balls, and quartz balls) can be randomly selected and inserted into any position in the product image, and image fusion processing is performed to generate the corresponding superimposed image.
[0066] Step S20, input the superimposed image into a pre-constructed adaptive learning model, obtain the sensitivity detection value corresponding to the superimposed image, and compare the sensitivity detection value with the standard sensitivity value of the standard foreign object test card image.
[0067] Among them, the pre-constructed adaptive learning model can be a pre-constructed model for automatically monitoring and calibrating the sensitivity of the X-ray machine.
[0068] The sensitivity detection value can be the sensitivity value output after detecting the superimposed image using the adaptive learning model.
[0069] The standard sensitivity value can be the sensitivity value of each type of standard foreign object test card image set in advance.
[0070] In a specific implementation, after obtaining the superimposed image, the superimposed image can be input into a pre-constructed adaptive learning model to process the superimposed image using the adaptive learning model and output a sensitivity detection value corresponding to the superimposed image. Furthermore, the sensitivity detection value can be compared with the standard sensitivity value of the standard foreign object test card image, so as to determine the actual detection accuracy of the current X-ray machine by detecting whether the sensitivity detection value is consistent with the standard sensitivity value.
[0071] Step S30, in the case where the sensitivity detection value is inconsistent with the standard sensitivity value, according to the difference between the sensitivity detection value and the standard sensitivity value, adjust the model parameters of the adaptive learning model until the sensitivity detection value is consistent with the standard sensitivity value.
[0072] In a specific implementation, when it is detected that the sensitivity detection value is inconsistent with the standard sensitivity value (for example, the sensitivity detection value is greater than or less than the standard sensitivity value), the difference between the sensitivity detection value and the standard sensitivity value can be calculated. Furthermore, the difference is used to iteratively adjust the model parameters of the adaptive learning model (such as adjusting the gray value on the software interface), so that the sensitivity detection value output after the adaptive learning model with adjusted model parameters processes the superimposed image is consistent with the standard sensitivity value. By adopting this method, the self-detection and correction of the sensitivity of the X-ray machine are realized, and the sensitivity detection efficiency and accuracy during the operation of the X-ray machine are improved.
[0073] As an example, please refer to Figure 2-6 , the process of sensitivity adjustment can be: the standard foreign object test card image shown in Figure 3 (which can include metal balls, ceramic balls, and quartz balls) can be respectively image-fused with the product sample image of the qualified product shown in Figure 4 to obtain the superimposed images shown in Figure 5 that are respectively fused with metal balls ( Figure 5 (a)), ceramic balls ( Figure 5 (b)), and quartz balls ( Figure 5 (c)); furthermore, the adaptive learning model can be used to process the superimposed image respectively to obtain the detection results of the superimposed images shown in Figure 6 that are respectively fused with metal balls ( Figure 6 (a)), ceramic balls ( Figure 6 (b)), and quartz balls ( Figure 6 (c)).
[0074] Among them, if the sensitivity detection value is higher than (or greater than) the standard sensitivity value, high sensitivity may cause the X-ray machine to react to some non-dangerous or non-abnormal products, resulting in normal products being misjudged as abnormal products, and then the X-ray machine will have an abnormal situation of false alarm. Please refer toFigure 7 (a), 7(b) and 7(c), Figure 7 (a), 7(b) and 7(c) respectively show schematic diagrams of the detection results of a metal ball, a ceramic ball and a quartz ball with a sensitivity detection value higher than the standard sensitivity value.
[0075] If the sensitivity detection value is lower than (or less than) the standard sensitivity value, the low sensitivity may cause the X-ray machine to respond less to some truly abnormal objects, resulting in the risk that some truly abnormal products may be missed. Then, the X-ray machine will show abnormal situations such as missed alarms or no alarms. Please refer to Figure 8 (a), 8(b) and 8(c), Figure 8 (a), 8(b) and 8(c) respectively show schematic diagrams of the detection results of a metal ball, a ceramic ball and a quartz ball with a sensitivity detection value lower than the standard sensitivity value.
[0076] Furthermore, in one embodiment, after step S20, the method may further include step S40:
[0077] Step S40, record the sensitivity detection value and the standard sensitivity value, and draw a change curve graph of the sensitivity detection value and the standard sensitivity value.
[0078] Among them, the change curve graph is used to represent the change curve formed by connecting the sensitivity detection values and the standard sensitivity values corresponding to each time point within a preset fixed time period (such as every day, every week, every month); among them, the time (such as date or timestamp) is set as the horizontal axis, and the sensitivity value is set as the vertical axis; different line segments can be used in the change curve graph to distinguish the sensitivity detection value and the standard sensitivity value.
[0079] In specific implementation, after comparing the sensitivity detection value with the standard sensitivity value of the foreign object test image, the sensitivity detection value and the standard sensitivity value can be recorded in real time; then, according to the sensitivity detection values and the standard sensitivity values recorded within the preset time period, a change curve graph of the sensitivity detection value and a change curve graph of the standard sensitivity value are respectively drawn; thus, it can clearly show the change situation of the sensitivity detection value and the standard sensitivity value of the X-ray machine over time. Through these two change curve graphs, it is prepared for subsequent analysis and auditing, and provides intuitive visual support for equipment maintenance and performance analysis.
[0080] Furthermore, in one embodiment, after step S20, the method may further include S50:
[0081] Step S50: When it is detected that the sensitivity detection value is inconsistent with the standard sensitivity value, record the system time corresponding to the obtained sensitivity detection value and increment the count by one, and count the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within a set time period. If the number exceeds a preset number, an alarm message is issued.
[0082] Among them, the preset number is used to represent the threshold of the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within a preset time period (such as weekly, every half - month, monthly).
[0083] As an example, the preset number can be that the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within a month does not exceed 10 times.
[0084] The alarm message is used to indicate the information for notifying the staff that the X - ray machine needs to be repaired or remotely diagnosed, or the adaptive model needs to be readjusted.
[0085] In a specific implementation, when it is detected that the sensitivity detection value is inconsistent with the standard sensitivity value, record the system time corresponding to the obtained sensitivity detection value and increment the count by one, and count the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within a set time period. If the number of inconsistencies exceeds the preset number, an alarm message is issued to remind or notify the staff to repair or remotely diagnose the X - ray machine, or readjust the adaptive learning model.
[0086] Further, in an embodiment, after step S30, the method may further include S60:
[0087] Step S60: Record the model parameters of the adaptive learning model when the sensitivity detection value is consistent with the standard sensitivity value.
[0088] In a specific implementation, after adjusting the model parameters of the adaptive learning model to make the sensitivity detection value consistent with the standard sensitivity value, the model parameters of the adaptive learning model when the sensitivity detection value is consistent with the standard sensitivity value can be recorded for subsequent analysis and adjustment of the adaptive learning model, which is also helpful for debugging and optimizing the adaptive learning model.
[0089] In this embodiment, by collecting product images of products to be detected on the conveyor belt of the X-ray machine, and inserting foreign object test images into the product images for image fusion to generate superimposed images; inputting the superimposed images into a pre-constructed adaptive learning model to obtain sensitivity detection values corresponding to the superimposed images, and comparing the sensitivity detection values with the standard sensitivity values of the foreign object test images; in the case where the sensitivity detection values are inconsistent with the standard sensitivity values, adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection values and the standard sensitivity values until the sensitivity detection values are consistent with the standard sensitivity values; thereby realizing the self-calibration of the sensitivity of the X-ray machine, and improving the sensitivity detection efficiency and accuracy during the operation of the X-ray machine.
[0090] Based on the foregoing embodiment, a second embodiment of the sensitivity self-calibration method of the X-ray machine of the present invention is proposed. In this embodiment, before step S10, the method may further include the following steps A10 to A30:
[0091] Step A10, obtaining product sample images of multiple qualified products, standard foreign object test card images of different types, and foreign object annotation information and standard sensitivity values corresponding to each of the standard foreign object test card images.
[0092] Among them, the product sample images are used to represent images generated by imaging devices in the X-ray machine for qualified products (normal products without foreign objects) of multiple categories (such as canned foods, fruits and vegetables, dairy products, and baked foods, etc.).
[0093] The foreign object annotation information is used to represent the annotation information of foreign objects in each type of standard foreign object test card image; specifically, the specific position of the foreign object can be marked in a standard foreign object test card image.
[0094] As an example, the annotator marks the positions of foreign objects in each standard foreign object test card image through an image annotation tool to obtain foreign object annotation information.
[0095] As another example, the position of the foreign object in the standard foreign object test card image can be marked by combining image processing methods (such as semantic segmentation, edge detection) and manual interaction methods to obtain foreign object annotation information.
[0096] It should be noted that there are no foreign objects in the product sample images, indicating that the foreign object annotation information is empty.
[0097] In a specific implementation, product sample images of multiple categories of qualified products, standard foreign object test card images of multiple different types, and foreign object annotation information and standard sensitivity values corresponding to each standard foreign object test card image can be obtained.
[0098] Step A20: Randomly insert each standard foreign object test card image into an arbitrary position in each product sample image for image fusion to generate foreign object sample images, and obtain the foreign object annotation information and standard sensitivity values of each foreign object sample image.
[0099] Among them, the foreign object sample image is used to represent the sample image generated after randomly fusing the foreign object test card image in each product sample image.
[0100] In a specific implementation, after obtaining the product sample image and the standard foreign object test card image, for a single product sample image, one or more standard foreign object test card images can be randomly selected for image fusion with the single product sample image to generate the corresponding foreign object sample image; furthermore, according to the image fusion technology, the foreign object annotation information and standard sensitivity values of each foreign object sample image are obtained.
[0101] Step A30: Input the product sample image, the foreign object sample image, its foreign object annotation information, and the standard sensitivity value into the adaptive learning model for iterative training until the model training stop condition is reached, and obtain the corresponding adaptive learning model.
[0102] In a specific implementation, after obtaining the foreign object sample image, its foreign object annotation information, and the standard sensitivity value, the product sample image, the foreign object sample image, its foreign object annotation information, and the standard sensitivity value can be input into the initial adaptive learning model for iterative training until the model training stop condition is reached (such as a preset number of iterations or model convergence), and the corresponding adaptive learning model is obtained. The trained adaptive learning model can annotate the image without foreign object annotation information and output the sensitivity detection value corresponding to the image, so as to subsequently use the adaptive learning model to detect and self-correct the sensitivity of the X-ray machine.
[0103] Furthermore, in an embodiment, step A30 may include the following sub-steps A301 to A303:
[0104] Sub-step A301: Input the product sample image, the foreign object sample image, its foreign object annotation information, and the standard sensitivity value into the adaptive learning model, and obtain the predicted annotation information and predicted sensitivity value output by the adaptive learning model;
[0105] Sub-step A302: Calculate the model loss value according to the foreign object annotation information, the standard sensitivity value, the predicted annotation information, and the predicted sensitivity value;
[0106] Sub-step A303: Adjust the model parameters of the adaptive learning model according to the model loss value, and continue to train the adaptive learning model until the model converges to obtain the trained adaptive learning model.
[0107] Among them, the model loss value is used to represent the difference value between the predicted detection result of the current adaptive learning model and the true result of the sample. It can first calculate the annotation loss value according to the foreign object annotation information and the predicted annotation information, and the sensitivity loss value according to the standard sensitivity value and the predicted sensitivity value; and then calculate the model loss value according to the annotation loss value and the sensitivity loss value.
[0108] In a specific implementation, the adaptive learning model can be obtained through the following steps: input the product sample image, the foreign object sample image, their foreign object annotation information, and the standard sensitivity value into the adaptive learning model to obtain the predicted annotation information and the predicted sensitivity value output by the adaptive learning model; and then calculate the model loss value according to the foreign object annotation information, the standard sensitivity value, the predicted annotation information, and the predicted sensitivity value; then adjust the model parameters of the adaptive learning model according to the model loss value, and continue to train the adaptive learning model until the model converges to obtain the final adaptive learning model. Thus, the predicted detection result is made consistent with the true result of the sample, and the prediction accuracy of the adaptive learning model is further improved.
[0109] In this embodiment, the adaptive learning model is iteratively trained with the product sample image, the foreign object sample image, their foreign object annotation information, and the standard sensitivity value to obtain the corresponding adaptive learning model; thus providing reliable support for the subsequent sensitivity self-detection and correction of the X-ray machine.
[0110] Based on the foregoing embodiment, the third embodiment of the sensitivity self-correction method of the X-ray machine according to the present invention is proposed. In this embodiment, step S30 may further include the following sub-steps S301 to S302:
[0111] Sub-step S301, when the sensitivity detection value is greater than or less than the standard sensitivity value, adjust and update the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value.
[0112] In a specific implementation, when the sensitivity detection value is greater than or less than the standard sensitivity value, the difference between the sensitivity detection value and the standard sensitivity value can be calculated; and then the model parameters of the adaptive learning model are adjusted and updated using this difference.
[0113] Sub-step S302: Set the adaptive learning model with updated model parameters as the pre-constructed adaptive learning model, and loop through the steps of inputting the superimposed image into the pre-constructed adaptive learning model to obtain the sensitivity detection value corresponding to the superimposed image to the step of adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value output by the iteratively adjusted adaptive learning model is the same as the standard sensitivity value.
[0114] In specific implementation, after obtaining the adaptive learning model with updated model parameters, the adaptive learning model with updated model parameters can be set as the pre-constructed adaptive learning model, triggering the loop steps of the adaptive learning model for sensitivity detection and self-correction of the superimposed image; and then loop through the steps of inputting the superimposed image into the pre-constructed adaptive learning model to obtain the sensitivity detection value corresponding to the superimposed image to the step of adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value output by the iteratively adjusted adaptive learning model is the same as the standard sensitivity value, then end the loop steps. Through this self-adjustment method of the sensitivity of the adaptive learning model, the detection efficiency and detection accuracy of the X-ray machine can be greatly improved, and the stability of the performance of the X-ray machine equipment can be significantly enhanced.
[0115] In this embodiment, in the case where the sensitivity detection value is detected to be inconsistent with the standard sensitivity value, according to the difference between the sensitivity detection value and the standard sensitivity value, the model parameters of the adaptive learning model are adjusted to make the sensitivity detection value consistent with the standard sensitivity value; thereby realizing the self-correction of the sensitivity of the X-ray machine and further improving the detection efficiency and accuracy of the X-ray machine.
[0116] Based on the same inventive concept, in the fourth embodiment of the present invention, there is also provided an X-ray machine sensitivity self-correction system corresponding to the X-ray machine sensitivity self-correction method of the foregoing embodiment. Since the principle of solving problems in the system in the fourth embodiment of the present invention is similar to the X-ray machine sensitivity self-correction method of the foregoing embodiment of the present invention, the implementation of the system can refer to the implementation of the method, and the repeated parts will not be described again. Please refer to Figure 9 , the X-ray machine sensitivity self-correction system of the present invention may include:
[0117] An acquisition module 10, configured to acquire a product image of a product to be detected on the conveyor belt of the X-ray machine, and insert a standard foreign object test card image into the product image to generate a superimposed image by image fusion;
[0118] A comparison module 20 is configured to input the superimposed image into a pre-constructed adaptive learning model, obtain a sensitivity detection value corresponding to the superimposed image, and compare the sensitivity detection value with a standard sensitivity value of the standard foreign object test card image;
[0119] An adjustment module 30 is configured to, when the sensitivity detection value is inconsistent with the standard sensitivity value, adjust model parameters of the adaptive learning model according to a difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value.
[0120] In addition, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the sensitivity self-calibration method of the X-ray machine described above is implemented.
[0121] Figure 10 is a schematic block diagram of an electronic device provided by an embodiment of the present application. As Figure 10 shown, the electronic device includes: at least one processor 401, a memory 402, at least one network interface 403, and a user interface 405. Each component in the electronic device is coupled together through a bus system 404. It can be understood that the bus system 404 is used to implement connection communication between these components. The bus system 404 includes, in addition to a data bus, a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 10 all kinds of buses are labeled as the bus system.
[0122] Among them, the user interface 405 may include a display, a keyboard, a mouse, a trackball, a click gun, a button, a button, a touchpad, or a touch screen, etc.
[0123] It can be understood that the memory 402 may be a volatile memory or a non-volatile memory, and may also include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM, Static Random Access Memory), synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory). The memory described in the embodiments of the present invention is intended to include but not be limited to these and any other suitable types of memory.
[0124] The memory 402 in the embodiments of the present invention is used to store various types of data to support the operation of the electronic device 400. Examples of such data include: any executable programs for operating on the electronic device 400, such as the operating system 4021 and application programs 4022; the operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application programs 4022 may include various application programs, such as a Media Player, a Browser, etc., for implementing various application services. The method for self-calibrating the sensitivity of the X-ray machine provided by the embodiments of the present invention may be included in the application programs 4022.
[0125] The method disclosed in the above embodiments of the present invention may be applied to the processor 401 or implemented by the processor 401. The processor 401 may be an integrated circuit chip with signal processing capabilities. During implementation, the steps of the above method may be completed by the integrated logic circuit in the hardware of the processor 401 or instructions in software form. The above-mentioned processor 401 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 401 may implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor 401 may be a microprocessor or any conventional processor, etc. Combining the steps of the method for self-calibrating the sensitivity of the X-ray machine provided by the embodiments of the present invention, it may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, and this storage medium is located in the memory. The processor reads the information in the memory and combines its hardware to complete the steps of the foregoing method.
[0126] In an exemplary embodiment, the electronic device 400 may be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs) for executing the foregoing method.
[0127] In summary, the present invention collects product images of products to be detected on the conveyor belt of an X-ray machine, inserts a foreign object test image into the product image for image fusion to generate a superimposed image; inputs the superimposed image into a pre-constructed adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and compares the sensitivity detection value with the standard sensitivity value of the foreign object test image; in the case where the sensitivity detection value is inconsistent with the standard sensitivity value, adjusts the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value; thereby realizing the self-calibration of the sensitivity of the X-ray machine, and improving the sensitivity detection efficiency and accuracy during the operation of the X-ray machine.
[0128] The above embodiments are only illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.
Claims
1. A method for self-calibrating the sensitivity of an X-ray machine, characterized in that, Applied to an X-ray machine, the method includes: Collecting a product image of a product to be detected on the conveyor belt of the X-ray machine, and inserting a standard foreign object test card image into the product image for image fusion to generate a superimposed image; Inputting the superimposed image into a pre-constructed adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and comparing the sensitivity detection value with the standard sensitivity value of the standard foreign object test card image; In the case where the sensitivity detection value is inconsistent with the standard sensitivity value, adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value.
2. The method according to claim 1, characterized in that, Before the step of collecting a product image of a product to be detected on the conveyor belt of the X-ray machine, it further includes: Obtaining product sample images of a plurality of qualified products, standard foreign object test card images of different types, and foreign object annotation information and standard sensitivity values corresponding to each of the standard foreign object test card images; Randomly inserting each standard foreign object test card image into an arbitrary position in each product sample image for image fusion to generate a foreign object sample image, and obtaining the foreign object annotation information and standard sensitivity value of each foreign object sample image; Inputting the product sample images, the foreign object sample images, their foreign object annotation information, and the standard sensitivity values into an adaptive learning model for iterative training until a model training stop condition is reached, to obtain a corresponding adaptive learning model.
3. The method according to claim 2, wherein The step of inputting the product sample images, the foreign object sample images, their foreign object annotation information, and the standard sensitivity values into an adaptive learning model for iterative training until a model training stop condition is reached, to obtain a corresponding adaptive learning model, includes: Inputting the product sample images, the foreign object sample images, their foreign object annotation information, and the standard sensitivity values into an adaptive learning model to obtain predicted annotation information and a predicted sensitivity value output by the adaptive learning model; Calculating a model loss value according to the foreign object annotation information, the standard sensitivity value, the predicted annotation information, and the predicted sensitivity value; Adjusting the model parameters of the adaptive learning model according to the model loss value, and continuing to train the adaptive learning model until the model converges, to obtain a trained adaptive learning model.
4. The method according to claim 1, wherein The step of, in the case where the sensitivity detection value is inconsistent with the standard sensitivity value, adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value, includes: When the sensitivity detection value is greater than or less than the standard sensitivity value, adjusting and updating the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value; Set the adaptive learning model after updating the model parameters as the pre - constructed adaptive learning model, and loop through the steps of inputting the superimposed image into the pre - constructed adaptive learning model to obtain the sensitivity detection value corresponding to the superimposed image to the step of adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value output by the iteratively adjusted adaptive learning model is the same as the standard sensitivity value.
5. The method according to claim 1 or 4, characterized in that, After the step of adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value when the sensitivity detection value is inconsistent with the standard sensitivity value, it further includes: Record the model parameters of the adaptive learning model when the sensitivity detection value is consistent with the standard sensitivity value.
6. The method according to claim 1, wherein After the step of comparing the sensitivity detection value with the standard sensitivity value of the foreign object test image, it further includes: Record the sensitivity detection value and the standard sensitivity value, and use the sensitivity detection values and the standard sensitivity values recorded within a preset time period to respectively plot the change curves of the sensitivity detection value and the standard sensitivity value.
7. The method according to claim 1, wherein After the step of comparing the sensitivity detection value with the standard sensitivity value of the foreign object test image, it further includes: When it is detected that the sensitivity detection value is inconsistent with the standard sensitivity value, record the system time corresponding to the obtained sensitivity detection value and increment the count by one, and count the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within a set time period. If it exceeds the preset number of times, send an alarm message.
8. A sensitivity self-calibration system for an X-ray machine, characterized in that, The system includes: An acquisition module, configured to acquire the product image of the product to be detected on the conveyor belt of the X - ray machine, and insert the standard foreign object test card image into the product image to generate a superimposed image by image fusion; A comparison module, configured to input the superimposed image into the pre - constructed adaptive learning model, obtain the sensitivity detection value corresponding to the superimposed image, and compare the sensitivity detection value with the standard sensitivity value of the foreign object test image; An adjustment module, configured to adjust the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value when the sensitivity detection value is inconsistent with the standard sensitivity value until the sensitivity detection value is consistent with the standard sensitivity value.
9. An electronic device, characterized in that, The electronic device includes: a memory and a processor. Among them, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the electronic device executes the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A program is stored on the computer - readable storage medium. When the program runs, it is used to execute the steps of the method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Image difference detection method, model training method, system, equipment and medium
CN116030036A
Carrier roller anomaly detection method, computing device and computer readable storage medium
CN119370549A
GIS switch foreign matter detection method based on multispectral image fusion and related equipment
CN119478543A