X-ray machine sensitivity self-calibration method, system, device and medium
By collecting product images in an X-ray machine and fusing them with images from a standard foreign body test card, and using an adaptive learning model to adjust parameters, the problem of decreased X-ray machine sensitivity is solved, achieving efficient and accurate foreign body detection and ensuring food safety.
Patent Information
- Application Number
- CN202510437655.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-04-09
AI Technical Summary
During long-term use, the sensitivity of X-ray machines decreases due to attenuation and aging of the radiation source and detector, making them unable to effectively detect foreign matter in food, resulting in false alarms or missed alarms.
By collecting product images on the X-ray machine conveyor belt and fusing them with images of standard foreign body test cards, 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, thus achieving sensitivity self-correction.
The sensitivity, detection efficiency and accuracy of X-ray machines are improved, false alarms and missed alarms are reduced, and food safety is ensured.
Smart Images

Figure CN120374531B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of foreign body detection, and in particular to a sensitivity self-calibration method, system, equipment and medium for an X-ray machine. Background Art
[0002] On food production lines, X-ray machines are commonly used to detect possible foreign matter, such as metal, glass, ceramic, and quartz, in food to ensure food safety. The sensitivity of the X-ray machine is tested and calibrated by manually attaching standard foreign matter test cards to normal products. These cards can be made of metal balls, wires, glass balls, ceramic balls, quartz balls, and other types of standard test cards, each containing foreign matter of one or more sizes. Over long-term use, the X-ray machine's radiation source and detector may experience problems such as light source attenuation, unstable radiation beam output, unstable detector temperature drift, detector aging, environmental interference, and insufficient equipment maintenance, resulting in a decrease in the X-ray machine's sensitivity. Therefore, an efficient and accurate X-ray machine sensitivity self-calibration method is urgently needed to address these issues. Summary of the Invention
[0003] In view of the above problems, the present invention is proposed to provide a sensitivity self-calibration method, system, device and medium for an X-ray machine that overcomes the above problems or at least partially solves the above problems.
[0004] To achieve the above-mentioned and other related objectives, the present invention provides a sensitivity self-calibration method for an X-ray machine, which is applied to the X-ray machine, and the method comprises:
[0005] Collect product images of the product to be inspected on the X-ray machine conveyor belt, and insert the image of the standard foreign body test card into the product image to perform image fusion to generate a superimposed image;
[0006] Inputting the superimposed image into a pre-built adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and comparing the sensitivity detection value with a standard sensitivity value of the standard foreign body test card image;
[0007] When the sensitivity detection value is inconsistent with the standard sensitivity value, the model parameters of the adaptive learning model are adjusted 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 product images of the product to be inspected on the X-ray machine conveyor belt, the method further includes:
[0009] Acquire product sample images of a plurality of qualified products, images of different types of standard foreign body test cards, and foreign body labeling information and standard sensitivity values corresponding to each of the standard foreign body test card images;
[0010] The images of the standard foreign body test cards are randomly inserted into any position of each product sample image for image fusion to generate foreign body sample images, and the foreign body annotation information and standard sensitivity value of each foreign body sample image are obtained;
[0011] The product sample image, the foreign body sample image, the foreign body annotation information thereof and the standard sensitivity value are input together into the adaptive learning model for iterative training until the model training stop condition is reached, thereby obtaining the corresponding adaptive learning model.
[0012] Optionally, the product sample image, the foreign body sample image, the foreign body annotation information thereof, and the standard sensitivity value are input together into an adaptive learning model for iterative training until a model training stop condition is reached, thereby obtaining a corresponding adaptive learning model, including:
[0013] Inputting the product sample image, the foreign body sample image, the foreign body annotation information thereof, and the standard sensitivity value into an adaptive learning model, and obtaining predicted annotation information and predicted sensitivity value output by the adaptive learning model;
[0014] Calculating a model loss value according to the foreign object labeling information, the standard sensitivity value, the predicted labeling information, and the predicted sensitivity value;
[0015] The model parameters of the adaptive learning model are adjusted according to the model loss value, and the adaptive learning model is continuously trained until the model converges to obtain a trained adaptive learning model.
[0016] Optionally, when 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, including:
[0017] 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;
[0018] The adaptive learning model after updating the model parameters is set as a pre-built adaptive learning model, and the steps of inputting the superimposed image into the pre-built adaptive learning model to obtain the sensitivity detection value corresponding to the superimposed image and adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value are cyclically executed until the sensitivity detection value output by the iteratively adjusted adaptive learning model is the same as the standard sensitivity value.
[0019] Optionally, when the sensitivity detection value is inconsistent with the standard sensitivity value, 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, the method further includes:
[0020] Record 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 matter test image, the method further includes:
[0022] The sensitivity detection value and the standard sensitivity value are recorded, and the sensitivity detection value and the standard sensitivity value recorded within a preset time period are used to draw change curves of the sensitivity detection value and the standard sensitivity value, respectively.
[0023] Optionally, after the step of comparing the sensitivity detection value with the standard sensitivity value of the foreign matter test image, the method further includes:
[0024] When it is detected that the sensitivity detection value is inconsistent with the standard sensitivity value, the system time corresponding to the sensitivity detection value is recorded and counted by one, and the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within the set time period is counted. If the number exceeds the preset number, an alarm message is issued.
[0025] In a second aspect, the present invention further provides a sensitivity self-calibration system for an X-ray machine, the system comprising:
[0026] An acquisition module is used to acquire a product image of the product to be inspected on the X-ray machine conveyor belt, and insert an image of a standard foreign body test card into the product image to perform image fusion and generate a superimposed image;
[0027] a comparison module, configured to input the superimposed image into a pre-built 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 body test card image;
[0028] An adjustment module is used 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.
[0029] In a third aspect, the present invention provides an electronic device comprising: a memory and a processor; the memory is used to store computer programs; the processor is used to execute the computer programs stored in the memory, so that the electronic device performs 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 having a computer program stored thereon, which, when executed by an electronic device, implements the steps of the sensitivity self-calibration method of the X-ray machine as described above.
[0031] The above one or more technical solutions provided by the present invention may have the following advantages or at least achieve the following technical effects:
[0032] The present invention provides an X-ray machine sensitivity self-calibration method, system, device and medium. The present invention collects product images of products to be inspected on a conveyor belt of an X-ray machine, and inserts foreign body test images into the product images for image fusion to generate a superimposed image; the superimposed image is input into a pre-built adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and the sensitivity detection value is compared with the standard sensitivity value of the standard foreign body test card image; when the sensitivity detection value is inconsistent with the standard sensitivity value, the model parameters of the adaptive learning model are adjusted 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 achieving sensitivity self-calibration 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 Shown is a schematic flow chart of a sensitivity self-calibration method for an X-ray machine according to one embodiment of the present invention;
[0034] Figure 2 Shown is a schematic diagram of a sensitivity adjustment process in one embodiment of the present invention;
[0035] Figure 3 Shown is a schematic diagram of a standard foreign body test card image (metal ball, ceramic ball, quartz ball) in one embodiment of the present invention;
[0036] Figure 4 A schematic diagram showing an image of a product sample of a qualified product according to an embodiment of the present invention;
[0037] Figure 5 (a) is a schematic diagram showing a superimposed image fused with metal balls according to an embodiment of the present invention;
[0038] Figure 5 (b) is a schematic diagram showing an overlaid image of ceramic balls fused therein according to an embodiment of the present invention;
[0039] Figure 5 (c) is a schematic diagram showing a superimposed image fused with a quartz sphere according to an embodiment of the present invention;
[0040] Figure 6 (a) is a schematic diagram showing the detection results of a superimposed image fused with a metal ball according to an embodiment of the present invention;
[0041] Figure 6 (b) is a schematic diagram showing the detection results of a superimposed image fused with ceramic balls according to an embodiment of the present invention;
[0042] Figure 6 (c) is a schematic diagram showing the detection results of a superimposed image fused with a quartz sphere according to an embodiment of the present invention;
[0043] Figure 7 (a) is a schematic diagram showing the detection results of a metal ball with a sensitivity detection value higher than the standard sensitivity value according to an embodiment of the present invention;
[0044] Figure 7 (b) is a schematic diagram showing the detection results of ceramic balls with a sensitivity detection value higher than the standard sensitivity value according to an embodiment of the present invention;
[0045] Figure 7 (c) is a schematic diagram showing the detection results of a quartz ball in which the sensitivity detection value is higher than the standard sensitivity value in one embodiment of the present invention;
[0046] Figure 8 (a) is a schematic diagram showing the detection results of a metal ball with a sensitivity detection value lower than the standard sensitivity value according to an embodiment of the present invention;
[0047] Figure 8 (b) is a schematic diagram showing the detection results of ceramic balls with a sensitivity detection value lower than the standard sensitivity value in one embodiment of the present invention;
[0048] Figure 8 (c) is a schematic diagram showing the detection results of a quartz ball in which the sensitivity detection value is lower than the standard sensitivity value in one embodiment of the present invention;
[0049] Figure 9 Shown is a schematic diagram of the functional modules of a sensitivity self-calibration system for an X-ray machine according to one embodiment of the present invention;
[0050] Figure 10 Shown is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand 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. The 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 the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0052] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.
[0053] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the embodiments of the present invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring the embodiments of the present invention.
[0054] In the description and claims of the embodiments of the present disclosure, as well as in the accompanying drawings, the terms "first," "second," and the like are used to distinguish similar items and are not necessarily used to describe a particular order or precedence. It should be understood that such terms are interchangeable where appropriate for the purposes of describing the embodiments of the present disclosure herein. Furthermore, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions.
[0055] Unless otherwise stated, the term "plurality" means two or more.
[0056] In the embodiments of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B.
[0057] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, "A and / or B" means: A or B, or A and B.
[0058] The technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings in the embodiments of the present invention.
[0059] See also Figure 1-2 An embodiment of the present invention provides a sensitivity self-calibration method for an X-ray machine, which is applied to the X-ray machine. The method may include the following steps S10 to S30:
[0060] Step S10 , collecting a product image of the product to be inspected on the X-ray machine conveyor belt, and inserting the image of the standard foreign body test card into the product image to perform image fusion to generate a superimposed image.
[0061] Among them, the product image is used to represent the image of the product to be inspected on the conveyor belt generated by the imaging device in the X-ray machine; the product to be inspected can be a normal product without foreign matter, that is, the corresponding product image can be an OK image of a normal product without foreign matter.
[0062] Standard foreign body test card images are used to represent the images produced by various types of standard foreign body test cards through the imaging device in the X-ray machine.
[0063] Standard foreign body test cards may include but are not limited to metal balls, metal wires, glass balls, ceramic balls, quartz balls, etc.; a standard test card may contain foreign bodies of one or more sizes.
[0064] The superimposed image can be used to represent the product foreign body image generated by fusing the product image and the standard foreign body test card using image processing technology.
[0065] In a specific implementation, the product image of the product to be inspected on the X-ray machine conveyor belt can be collected at regular intervals (such as every half hour, or 1 hour, or 2 hours), and then a single standard foreign body test card image (such as one of a metal ball, a metal wire, a glass ball, a ceramic ball, and a quartz ball) can be randomly selected and inserted into any position in the product image, and image fusion processing can be performed to generate a corresponding superimposed image.
[0066] Step S20: input the superimposed image into a pre-built 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 body test card image.
[0067] The pre-built adaptive learning model may be a pre-built model for automatically monitoring and calibrating the sensitivity of an X-ray machine.
[0068] The sensitivity detection value may be a sensitivity value output after detecting the superimposed image using an adaptive learning model.
[0069] The standard sensitivity value may be a preset sensitivity value of each type of standard foreign body test card image.
[0070] In a specific implementation, after obtaining the superimposed image, the superimposed image can be input into a pre-built adaptive learning model to process the superimposed image using the adaptive learning model and output a sensitivity detection value corresponding to the superimposed image; the sensitivity detection value can then be compared with the standard sensitivity value of the standard foreign body test card image to determine whether the sensitivity detection value is consistent with the standard sensitivity value, thereby determining the actual detection accuracy of the current X-ray machine.
[0071] Step S30, when 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.
[0072] In a specific implementation, the system can detect inconsistencies between the sensitivity detection value and the standard sensitivity value (e.g., when the sensitivity detection value is greater than or less than the standard sensitivity value), calculate the difference between the two values, and then use this difference to iteratively adjust the model parameters of the adaptive learning model (e.g., adjusting the grayscale value on the software interface) so that the sensitivity detection value output by the adaptive learning model after processing the superimposed image with the adjusted model parameters is consistent with the standard sensitivity value. This approach enables self-detection and correction of the sensitivity of the X-ray machine, improving the efficiency and accuracy of sensitivity detection during operation.
[0073] As an example, see Figure 2-6 , the sensitivity adjustment process can be: Figure 3 The standard foreign body test card images shown (which may include metal balls, ceramic balls, and quartz balls) are respectively Figure 4 The product sample images of the qualified products shown in FIG are fused to obtain the following Figure 5 The metal balls ( Figure 5 (a)), ceramic balls ( Figure 5 (b)) and quartz balls ( Figure 5 (c)) superimposed image; and then the adaptive learning model can be used to process the superimposed image respectively to obtain the following Figure 6 The metal balls ( Figure 6 (a)), ceramic balls ( Figure 6 (b)) and quartz balls ( Figure 6 (c) Detection results of the superimposed image.
[0074] If the sensitivity detection value is higher (or greater) than the standard sensitivity value, the high sensitivity may cause the X-ray machine to react to some non-dangerous or non-abnormal products, which may cause normal products to be misjudged as abnormal products, and the X-ray machine may produce a false alarm. Figure 7 (a), 7(b) and 7(c), Figure 7 (a), 7(b) and 7(c) are schematic diagrams showing the detection results of metal balls, ceramic balls and quartz balls with sensitivity detection values higher than the standard sensitivity values, respectively.
[0075] If the sensitivity detection value is lower (or less than) the standard sensitivity value, the low sensitivity may cause the X-ray machine to react less to some truly abnormal objects, which may lead to the risk of some truly abnormal products being missed, and the X-ray machine may miss an alarm or not alarm. Figure 8 (a), 8(b) and 8(c), Figure 8 (a), 8(b) and 8(c) are schematic diagrams showing the detection results of metal balls, ceramic balls and quartz balls whose sensitivity detection values are lower than the standard sensitivity values, respectively.
[0076] Furthermore, in one embodiment, after step S20, the method may further include step S40:
[0077] Step S40 , recording the sensitivity detection value and the standard sensitivity value, and drawing a change curve 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 value and the standard sensitivity value corresponding to each time point within a preset fixed time period (such as every day, every week, and every month); wherein, 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 a specific implementation, after comparing the sensitivity detection value with the standard sensitivity value of the foreign body test image, the sensitivity detection value and the standard sensitivity value can be recorded in real time; then, according to the sensitivity detection value and the standard sensitivity value recorded within a preset time period, a sensitivity detection value change curve chart and a standard sensitivity value change curve chart are drawn respectively; thereby, the change of the sensitivity detection value and the standard sensitivity value of the X-ray machine over time can be clearly displayed. Through these two change curve charts, subsequent analysis and auditing can be prepared, and intuitive visual support can be provided 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, the system time corresponding to the sensitivity detection value is recorded and counted by one, and the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within the set time period is counted. If the number exceeds the preset number, an alarm message is issued.
[0082] The preset number of times is used to represent a preset threshold value of the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within a preset time period (such as every week, every half month, every month).
[0083] As an example, the preset number of times may be that the sensitivity detection value is inconsistent with the standard sensitivity value no more than 10 times in each month.
[0084] The alarm information is used to notify 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, the system time corresponding to the sensitivity detection value is recorded and counted by one, and the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within the set time period is counted; 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] Furthermore, in one 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, a superimposed image is generated by collecting a product image of the product to be inspected on the conveyor belt of the X-ray machine, and inserting a foreign body test image into the product image for image fusion; the superimposed image is input into a pre-built adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and the sensitivity detection value is compared with the standard sensitivity value of the foreign body test image; when the sensitivity detection value is inconsistent with the standard sensitivity value, the model parameters of the adaptive learning model are adjusted 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 self-correction of the sensitivity of the X-ray machine and improving the efficiency and accuracy of sensitivity detection during the operation of the X-ray machine.
[0090] Based on the above embodiments, a second embodiment of the sensitivity self-calibration method for an 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 a plurality of qualified products, images of different types of standard foreign body test cards, and foreign body labeling information and standard sensitivity values corresponding to each of the standard foreign body test card images.
[0092] Among them, product sample images are used to represent images of qualified products (normal products without foreign matter) of multiple categories (such as canned food, fruits and vegetables, dairy products and baked goods, etc.) generated by the imaging equipment in the X-ray machine.
[0093] Foreign body marking information is used to indicate the marking information of foreign bodies in various types of standard foreign body test card images; specifically, the specific location of the foreign body can be marked in a standard foreign body test card image.
[0094] As an example, a labeling staff uses an image labeling tool to mark the location of foreign matter in each standard foreign matter test card image to obtain foreign matter labeling information.
[0095] As another example, the position of the foreign body in the standard foreign body test card image can be marked by combining image processing methods (such as semantic segmentation and edge detection) with manual interaction to obtain foreign body marking information.
[0096] It should be noted that there are no foreign objects in the product sample image, which means that the foreign object marking information is empty.
[0097] In a specific implementation, product sample images of qualified products of multiple categories, multiple different types of standard foreign body test card images, and foreign body labeling information and standard sensitivity values corresponding to each standard foreign body test card image can be obtained.
[0098] In step A20 , each standard foreign body test card image is randomly inserted into any position of each product sample image for image fusion to generate a foreign body sample image, and foreign body labeling information and standard sensitivity value of each foreign body sample image are obtained.
[0099] The foreign body sample image is used to represent a sample image generated by randomly fusing the foreign body test card image into each product sample image.
[0100] In a specific implementation, after obtaining the product sample image and the standard foreign body test card image, for a single product sample image, one or more standard foreign body test card images can be randomly selected for image fusion with the single product sample image to generate the corresponding foreign body sample image; and then, based on the image fusion technology, the foreign body labeling information and standard sensitivity value of each foreign body sample image can be obtained.
[0101] Step A30: input the product sample image, the foreign body sample image, the foreign body annotation information thereof, and the standard sensitivity value into the adaptive learning model for iterative training until the model training stop condition is reached, thereby obtaining the corresponding adaptive learning model.
[0102] In a specific implementation, after obtaining a sample image of a foreign object, its foreign object annotation information, and a standard sensitivity value, the product sample image, the sample image of the foreign object, 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), thereby obtaining the corresponding adaptive learning model. The trained adaptive learning model can annotate images that are not annotated with foreign object annotation information and output the corresponding sensitivity detection value of the image, so that the adaptive learning model can be used to detect and self-calibrate the sensitivity of the X-ray machine.
[0103] Furthermore, in one embodiment, step A30 may include the following sub-steps A301 to A303:
[0104] Sub-step A301: inputting the product sample image, the foreign object sample image, the foreign object annotation information thereof, and the standard sensitivity value into an adaptive learning model to obtain predicted annotation information and predicted sensitivity value output by the adaptive learning model;
[0105] Sub-step A302, calculating a model loss value based on the foreign object labeling information, the standard sensitivity value, the predicted labeling information, and the predicted sensitivity value;
[0106] Sub-step A303, 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, thereby obtaining a trained adaptive learning model.
[0107] The model loss value represents the difference between the current adaptive learning model's predicted detection result and the actual sample result. It can first calculate the label loss value based on the foreign object label information and the predicted label information, and the sensitivity loss value based on the standard sensitivity value and the predicted sensitivity value. The model loss value is then calculated based on the label loss value and the sensitivity loss value.
[0108] In a specific implementation, the adaptive learning model can be trained through the following steps: Product sample images, foreign body sample images, their foreign body annotation information, and standard sensitivity values are input into the adaptive learning model to obtain the predicted annotation information and predicted sensitivity values output by the adaptive learning model; the model loss value can then be calculated based on the foreign body annotation information, standard sensitivity value, predicted annotation information, and predicted sensitivity value; the model parameters of the adaptive learning model can then be adjusted based on the model loss value, and the adaptive learning model can be continuously trained until the model converges to obtain the final adaptive learning model. This ensures that the predicted detection results are consistent with the actual sample results, further improving the accuracy of the adaptive learning model's predictions.
[0109] In this embodiment, the adaptive learning model is iteratively trained using product sample images, foreign body sample images, their foreign body annotation information, and standard sensitivity values to obtain a corresponding adaptive learning model; thereby providing reliable support for subsequent sensitivity self-detection and correction of the X-ray machine.
[0110] Based on the above embodiments, a third embodiment of the sensitivity self-calibration method for an X-ray machine of 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, 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.
[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 difference can be used to adjust and update the model parameters of the adaptive learning model.
[0113] Sub-step S302 sets the adaptive learning model after updating the model parameters as a pre-built adaptive learning model, and cyclically executes the steps of inputting the superimposed image into the pre-built adaptive learning model to obtain the sensitivity detection value corresponding to the superimposed image, and 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 a specific implementation, after obtaining the adaptive learning model after updating the model parameters, the adaptive learning model after updating the model parameters can be set to a pre-built adaptive learning model, triggering a loop step of the adaptive learning model performing sensitivity detection and self-correction on the superimposed image; then looping the steps of inputting the superimposed image into the pre-built adaptive learning model, obtaining the sensitivity detection value corresponding to the superimposed image, and 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, and then ending the loop step. Through this adaptive learning model self-adjustment method for sensitivity, 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 greatly improved.
[0115] In this embodiment, when it is detected that the sensitivity detection value is inconsistent with the standard sensitivity value, the model parameters of the adaptive learning model are adjusted according to the difference between the sensitivity detection value and the standard sensitivity value to make the sensitivity detection value consistent with the standard sensitivity value; thereby realizing self-correction of the sensitivity of the X-ray machine, and further improving the efficiency and accuracy of the X-ray machine detection.
[0116] Based on the same inventive concept, the fourth embodiment of the present invention also provides an X-ray machine sensitivity self-calibration system corresponding to the sensitivity self-calibration method of the X-ray machine in the aforementioned embodiment. Since the principle of the problem solved by the system in the fourth embodiment of the present invention is similar to the sensitivity self-calibration method of the X-ray machine in the aforementioned 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 repeated. Figure 9 The sensitivity self-calibration system of the X-ray machine of the present invention may include:
[0117] The acquisition module 10 is used to acquire the product image of the product to be inspected on the X-ray machine conveyor belt, and insert the image of the standard foreign body test card into the product image to perform image fusion to generate a superimposed image;
[0118] a comparison module 20 for inputting the superimposed image into a pre-built adaptive learning model, obtaining a sensitivity detection value corresponding to the superimposed image, and comparing the sensitivity detection value with a standard sensitivity value of the standard foreign body test card image;
[0119] The adjustment module 30 is used 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.
[0120] In addition, the present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned sensitivity self-calibration method of the X-ray machine is implemented.
[0121] Figure 10 Schematic block diagram of an electronic device provided in an embodiment of the present application. Figure 10 As shown, the electronic device includes: at least one processor 401, a memory 402, at least one network interface 403 and a user interface 405. The various components in the electronic device are coupled together via a bus system 404. It is understood that the bus system 404 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 404 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 10 Various buses are labeled as bus systems.
[0122] The user interface 405 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.
[0123] It will be appreciated that the memory 402 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM) or a programmable read-only memory (PROM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memories.
[0124] The memory 402 in the embodiment of the present invention is used to store various categories of data to support the operation of the electronic device 400. Examples of such data include: any executable program for operating on the electronic device 400, such as an operating system 4021 and an application 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 4022 may include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The sensitivity self-calibration method of the X-ray machine provided in the embodiment of the present invention may be included in the application 4022.
[0125] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in processor 401. Processor 401 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. Processor 401 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. General-purpose processor 401 may be a microprocessor or any conventional processor. The steps of the sensitivity self-calibration method for an X-ray machine provided in the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium located in a memory. The processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0126] In an exemplary embodiment, the electronic device 400 may be configured to execute the aforementioned method by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs).
[0127] In summary, the present invention collects product images of products to be inspected on the conveyor belt of an X-ray machine, and inserts foreign body test images into the product images for image fusion to generate a superimposed image; the superimposed image is input into a pre-built adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and the sensitivity detection value is compared with the standard sensitivity value of the foreign body test image; when the sensitivity detection value is inconsistent with the standard sensitivity value, the model parameters of the adaptive learning model are adjusted 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 self-correction of the sensitivity of the X-ray machine and improving the efficiency and accuracy of sensitivity detection during the operation of the X-ray machine.
[0128] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.
Claims
1. A method for self-calibrating sensitivity of an X-ray machine, characterized in that: Applied to an X-ray machine, the method comprises: Collect product images of the product to be inspected on the X-ray machine conveyor belt, and insert the image of the standard foreign body test card into the product image to perform image fusion to generate a superimposed image; Inputting the superimposed image into a pre-built adaptive learning model to obtain a sensitivity detection value corresponding to the superimposed image, and comparing the sensitivity detection value with a standard sensitivity value of the standard foreign body 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; Before the step of collecting the product image of the product to be inspected on the X-ray machine conveyor belt, the method further includes: Acquire product sample images of a plurality of qualified products, images of different types of standard foreign body test cards, and foreign body labeling information and standard sensitivity values corresponding to each of the standard foreign body test card images; The images of the standard foreign body test cards are randomly inserted into any position of each product sample image for image fusion to generate foreign body sample images, and the foreign body annotation information and standard sensitivity value of each foreign body sample image are obtained; The product sample image, the foreign body sample image, the foreign body annotation information thereof and the standard sensitivity value are input together into the adaptive learning model for iterative training until the model training stop condition is reached, thereby obtaining the corresponding adaptive learning model.
2. The method according to claim 1, characterized in that The product sample image, the foreign body sample image, the foreign body annotation information thereof, and the standard sensitivity value are input together into the adaptive learning model for iterative training until the model training stop condition is reached, thereby obtaining a corresponding adaptive learning model, including: Inputting the product sample image, the foreign body sample image, the foreign body annotation information thereof, and the standard sensitivity value into an adaptive learning model, and obtaining predicted annotation information and predicted sensitivity value output by the adaptive learning model; Calculating a model loss value according to the foreign object labeling information, the standard sensitivity value, the predicted labeling information, and the predicted sensitivity value; The model parameters of the adaptive learning model are adjusted according to the model loss value, and the adaptive learning model is continuously trained until the model converges to obtain a trained adaptive learning model.
3. The method according to claim 1, characterized in that When 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, including: 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; The adaptive learning model after updating the model parameters is set as a pre-built adaptive learning model, and the steps of inputting the superimposed image into the pre-built adaptive learning model to obtain the sensitivity detection value corresponding to the superimposed image and adjusting the model parameters of the adaptive learning model according to the difference between the sensitivity detection value and the standard sensitivity value are cyclically executed until the sensitivity detection value output by the iteratively adjusted adaptive learning model is the same as the standard sensitivity value.
4. The method according to claim 1 or 3, 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, the method further includes: Record the model parameters of the adaptive learning model when the sensitivity detection value is consistent with the standard sensitivity value.
5. The method according to claim 1, wherein After the step of comparing the sensitivity detection value with the standard sensitivity value of the foreign matter test image, the method further includes: The sensitivity detection value and the standard sensitivity value are recorded, and the sensitivity detection value and the standard sensitivity value recorded within a preset time period are used to draw change curves of the sensitivity detection value and the standard sensitivity value, respectively.
6. The method according to claim 1, characterized in that After the step of comparing the sensitivity detection value with the standard sensitivity value of the foreign matter test image, the method further includes: When it is detected that the sensitivity detection value is inconsistent with the standard sensitivity value, the system time corresponding to the sensitivity detection value is recorded and counted by one, and the number of times the sensitivity detection value is inconsistent with the standard sensitivity value within the set time period is counted. If the number exceeds the preset number, an alarm message is issued.
7. A sensitivity self-calibration system for an X-ray machine, characterized in that: The system comprises: An acquisition module is used to obtain product sample images of multiple qualified products, images of different types of standard foreign body test cards, and foreign body labeling information and standard sensitivity values corresponding to each of the standard foreign body test card images; The images of the standard foreign body test cards are randomly inserted into any position of each product sample image for image fusion to generate foreign body sample images, and the foreign body annotation information and standard sensitivity value of each foreign body sample image are obtained; Inputting the product sample image, the foreign body sample image, the foreign body annotation information thereof, and the standard sensitivity value into an adaptive learning model for iterative training until a model training stop condition is reached, thereby obtaining a corresponding adaptive learning model; The acquisition module is further used to acquire product images of the product to be inspected on the X-ray machine conveyor belt, and insert the image of the standard foreign body test card into the product image to perform image fusion to generate a superimposed image; a comparison module, configured to input the superimposed image into a pre-built 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 foreign body test image; An adjustment module is used 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.
8. An electronic device, characterized in that: The electronic device includes: a memory and a processor, wherein 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 performs the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program, which, when run, is used to implement the steps of the method according to any one of claims 1 to 6.
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