Image detection model training method, image detection method, device and medium

By combining the detection results of energy images and pseudo-color images to conduct supervised training of the image detection model, the problem of low detection accuracy caused by training with X-ray pseudo-color images in existing technologies is solved, and the detection accuracy and applicability of the model in complex scenes are improved.

CN116051954BActive Publication Date: 2026-07-07ZHEJIANG DAHUA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2022-12-21
Publication Date
2026-07-07

Smart Images

  • Figure CN116051954B_ABST
    Figure CN116051954B_ABST
Patent Text Reader

Abstract

The application relates to an image detection model training method, an image detection method, an image detection device, an electronic device and a storage medium. The image detection model training method comprises the following steps: acquiring an energy image of a target object and a pseudo-color image of the target object; inputting the energy image into a trained energy image detection model to obtain an energy image detection result; inputting the pseudo-color image into a to-be-trained pseudo-color image detection model to obtain a pseudo-color image detection result; and training the to-be-trained pseudo-color image detection model based on the energy image detection result and the pseudo-color image detection result. Through the application, the problem of low detection result accuracy of an image detection model is solved, the precision of image detection model training is improved, and the accuracy of an image detection result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image detection technology, and in particular to an image detection model training method, an image detection method, an apparatus, an electronic device, and a storage medium. Background Technology

[0002] Security checks are an indispensable part of people's daily lives. In densely populated areas such as urban rail transit, airports, logistics and express delivery centers, and large event venues, security checks are an effective means of preventing emergencies.

[0003] Existing security inspection machines typically use X-rays to pass through objects and create an image on a detection plate, thus obtaining a pseudo-color X-ray image of the object. This pseudo-color image is then used as training images to train a neural network model, resulting in a trained image detection model. However, pseudo-color X-ray images cannot accurately represent the feature information of objects, leading to a loss of object feature information. Using these loss-inducing pseudo-color X-ray images as training images for the neural network model results in lower accuracy when used for security inspection, especially when detecting multiple stacked objects. This further reduces the accuracy of the detection results and negatively impacts the effectiveness of security inspections.

[0004] There is currently no effective solution to the problem of low accuracy in image detection models in related technologies. Summary of the Invention

[0005] This embodiment provides an image detection model training method, an image detection method, an apparatus, an electronic device, and a storage medium to address the problem of low accuracy of image detection model detection results in related technologies.

[0006] Firstly, this embodiment provides an image detection model training method, including:

[0007] Acquire the energy image of the target object, and the pseudo-color image of the target object;

[0008] The energy image is input into the trained energy map detection model to obtain the energy map detection result;

[0009] The pseudo-color image is input into the pseudo-color image detection model to be trained to obtain the pseudo-color image detection result;

[0010] Based on the energy map detection results and the pseudo-color map detection results, the pseudo-color map detection model to be trained is trained.

[0011] In some embodiments, the energy map detection result includes first location information of the target object, the pseudo-color image detection result includes second location information of the target object, and the step of training the pseudo-color image detection model based on the energy map detection result and the pseudo-color image detection result includes:

[0012] Determine the offset between the first location information and the second location information;

[0013] The loss value of the pseudo-color image detection model to be trained is determined based on the offset.

[0014] The model parameters of the pseudo-color image detection model to be trained are adjusted based on the loss value to obtain the target pseudo-color image detection model.

[0015] In some embodiments, the pseudo-color image detection result further includes the detection category of the target object, and determining the loss value of the pseudo-color image detection model to be trained based on the offset includes:

[0016] Obtain the reference location information and reference category of the target object;

[0017] The position loss value of the second position information is determined based on the reference position information;

[0018] The category loss value of the detection category is determined based on the reference category;

[0019] Based on the offset, the positional loss value, and the category loss value, the loss value of the pseudo-color image detection model to be trained is determined.

[0020] In some embodiments, the first location information includes the first center position of a first detection box corresponding to the target object and N first boundary positions of the first detection box; the second location information includes the second center position of a second detection box corresponding to the target object and N second boundary positions of the second detection box; and determining the offset between the first location information and the second location information includes:

[0021] Based on the first distance from the first center position to the first target boundary position, a first probability distribution function for the first target boundary position is determined, wherein the first target boundary position is any one of N first boundary positions, and N is a positive integer greater than or equal to 3;

[0022] Based on the second distance from the second center position to the second target boundary position, a second probability distribution function is determined for the second target boundary position, and the second target boundary position corresponds to the first target boundary position.

[0023] Based on the divergence between the first probability distribution function and the second probability distribution function, the offset between the first target boundary position and the second target boundary position is determined;

[0024] Based on the offsets of all first boundary positions and their corresponding second boundary positions, the offset between the first position information and the second position information is determined.

[0025] In some embodiments, acquiring the energy image of the target object includes:

[0026] A first energy map is determined based on the energy transmitted from the first energy source through the target object;

[0027] A second energy map is determined based on the energy transmitted through the target object from the second energy source, wherein the energy value of the first energy source is higher than the energy value of the second energy source;

[0028] The energy image of the target object is determined based on the first energy map and the second energy map.

[0029] In some embodiments, determining the energy image of the target object based on the first energy map and the second energy map includes:

[0030] Determine the equivalent atomic number map of the target object based on the first energy map and the second energy map;

[0031] The first energy map, the second energy map, and the equivalent atomic number map are stitched together along the channel dimension to obtain the energy image of the target object.

[0032] In some embodiments, before stitching the first energy map, the second energy map, and the equivalent atomic number map along the channel dimension to obtain the energy image of the target object, the method further includes:

[0033] The first energy map, the second energy map, and the equivalent atomic number map are all normalized.

[0034] Secondly, this embodiment provides an image detection method, including:

[0035] Obtain the pseudo-color image to be detected;

[0036] The pseudo-color image to be detected is input into the target pseudo-color image detection model to obtain the detection result of the pseudo-color image to be detected, wherein the target pseudo-color image detection model is obtained by the image detection model training method described in any of the first aspects above.

[0037] Thirdly, this embodiment provides an image detection model training device, including:

[0038] An acquisition module is used to acquire the energy image of the target object and the pseudo-color image of the target object;

[0039] The first detection module is used to input the energy image into the trained energy map detection model to obtain the energy map detection result;

[0040] The second detection module is used to input the pseudo-color image into the pseudo-color image detection model to be trained, and obtain the pseudo-color image detection result;

[0041] The training module is used to train the pseudo-color image detection model to be trained based on the energy map detection results and the pseudo-color image detection results.

[0042] Fourthly, this embodiment provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any of the first or second aspects above.

[0043] Fifthly, in this embodiment, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method described in any of the first or second aspects above.

[0044] Compared with related technologies, the image detection model training method provided in this embodiment obtains the energy image and pseudo-color image of the target object. The energy image is input into the trained energy image detection model to obtain accurate energy image detection results, and the pseudo-color image is input into the pseudo-color image detection model to be trained to obtain pseudo-color image detection results. Furthermore, the pseudo-color image detection model to be trained is trained based on both the energy image detection results and the pseudo-color image detection results. This allows the accurate energy image detection results to supervise the pseudo-color image detection results, facilitating training of the pseudo-color image detection model based on the supervision results. This supervised training not only enables the pseudo-color image detection model to learn the feature information in the pseudo-color image but also transfers the detailed information learned from the energy image by the trained energy image detection model to the pseudo-color image detection model. This enriches the detailed information learned by the pseudo-color image detection model during training, improving the training accuracy of the pseudo-color image detection model. Furthermore, when the target pseudo-color image detection model obtained in this way performs image detection, it can effectively improve the accuracy of the image detection results.

[0045] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0046] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0047] Figure 1 This is a schematic diagram illustrating an application scenario of an image detection model training method provided in an embodiment of this application;

[0048] Figure 2 This is a flowchart of an image detection model training method provided in an embodiment of this application;

[0049] Figure 3 This is an embodiment diagram of image detection model training provided in this application;

[0050] Figure 4 This is a schematic diagram illustrating the generation of loss values ​​for a pseudo-color image detection model to be trained, provided in an embodiment of this application.

[0051] Figure 5 This is a structural block diagram of an image detection model training device provided in an embodiment of this application;

[0052] Figure 6 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0053] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0054] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0055] The image detection model training method provided in this application embodiment can be applied to, for example... Figure 1 In the application scenarios shown, Figure 1 This is a schematic diagram illustrating an application scenario of an image detection model training method provided in this application embodiment. The terminal 102 communicates with the server 104 via a network. A data storage system can store the data that the server 104 needs to process. The data storage system can be integrated onto the server 104 or placed on a cloud or other network server. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0056] Security checks are an indispensable part of people's daily lives. In densely populated areas such as urban rail transit, airports, logistics and express delivery centers, and large event venues, security checks are an effective means of preventing emergencies.

[0057] X-rays are commonly used in security checks to inspect bags, luggage, and other items. X-rays are penetrating and have varying degrees of penetration ability into materials of different densities and thicknesses. As X-rays penetrate an object, the degree to which the material absorbs the X-rays varies, resulting in different levels of X-ray energy. By processing the penetrated energy into a pseudo-color image visible to the naked eye using a computer, the structure of the object being penetrated can be revealed.

[0058] Most existing security detection methods based on neural network models use X-ray pseudo-color images as training images to train the neural network and obtain a trained image detection model. However, X-ray pseudo-color images approximate the energy of X-rays and cannot accurately represent the feature information of objects, resulting in a loss of object feature information. This is especially true in complex scenes with multiple objects stacked on top of each other, where the structures between objects cannot be accurately distinguished, and the loss of object feature information is even more severe. When using X-ray pseudo-color images with lost object feature information as training images to train a neural network model, the resulting image detection model is prone to low accuracy in object detection, particularly when detecting X-ray pseudo-color images obtained from stacked objects, where the accuracy of the image detection model is even lower, thus affecting the effectiveness of security detection.

[0059] Therefore, improving the accuracy of image detection model detection results is a problem that needs to be solved.

[0060] This embodiment provides a method for training an image detection model. Figure 2 This is a flowchart of an image detection model training method provided in an embodiment of this application. The execution subject of this method can be an electronic device. Optionally, the electronic device can be a server or a terminal, but this application is not limited thereto. Specifically, as shown... Figure 2 As shown, the process includes the following steps:

[0061] Step S201: Obtain the energy image of the target object and the pseudo-color image of the target object.

[0062] For example, in a security inspection scenario, the X-ray security inspection machine image acquisition device acquires the energy of X-rays passing through the target object, and obtains an energy image based on the energy passing through the target object. Furthermore, the energy image is rendered using an X-ray imaging rendering algorithm to obtain a pseudo-color image of the target object, thereby enabling the electronic device to acquire the energy image and pseudo-color image of the target object.

[0063] It should be noted that the target object can be items such as packages or luggage in a security check scenario. Furthermore, the energy image described in this application is only an example of obtaining the energy of X-rays passing through the target object in a security check scenario. In practical applications, the energy image can also be generated by the energy passing through the target object received by the detection unit in a CT scanning device, or by the energy passing through the target object received by the detection unit in other devices; no limitation is made here.

[0064] Step S202: Input the energy image into the trained energy map detection model to obtain the energy map detection result.

[0065] Step S203: Input the pseudo-color image into the pseudo-color image detection model to be trained to obtain the pseudo-color image detection result.

[0066] Step S204: Based on the energy map detection results and the pseudo-color map detection results, train the pseudo-color map detection model to be trained.

[0067] For example, an energy image is input into a trained energy map detection model to obtain an energy map detection result, and a pseudo-color image is input into a pseudo-color image detection model to be trained to obtain a pseudo-color image detection result.

[0068] Furthermore, the pseudo-color image detection model to be trained is trained based on the energy map detection results and the pseudo-color image detection results. Specifically, the pseudo-color image detection results are supervised based on the energy map detection results, and the pseudo-color image detection model to be trained is trained based on the supervision results. The above steps S201 to S204 are repeated until the pseudo-color image detection model to be trained converges, thereby obtaining the target pseudo-color image detection model.

[0069] It should be noted that, in the process of repeating steps S201 to S204 in this embodiment of the application, the target objects may be the same or different, and no restriction is imposed here.

[0070] In the above implementation process, the energy image is input into the trained energy map detection model to obtain the energy map detection result, thus ensuring the accuracy of the energy map detection result. Furthermore, the pseudo-color image detection result is supervised based on the energy map detection result, and the pseudo-color image detection model to be trained is trained based on the supervision result. This not only enables the pseudo-color image detection model to be trained to learn the feature information in the pseudo-color image, but also transmits the detailed information learned from the energy image by the trained energy map detection model to the pseudo-color image detection model to be trained. This enriches the detailed information learned by the pseudo-color image detection model to be trained during the training process, improves the training accuracy and robustness of the pseudo-color image detection model, and thus, when the target pseudo-color image detection model obtained in this way is used for image detection, especially for object detection in complex scenes with multiple stacked objects, it can effectively improve the accuracy of object detection. This invention avoids the shortcomings of existing technologies that rely solely on X-ray pseudo-color images for training. In practical applications, the resulting image detection model suffers from inconsistent visual effects due to variations in X-ray imaging rendering algorithms within security inspection equipment. Instead, it employs a method of supervising pseudo-color image detection with energy map detection results, thereby improving the adaptability of the target pseudo-color image detection model to various security inspection devices.

[0071] In some embodiments, the energy map detection result includes first location information of the target object, and the pseudo-color image detection result includes second location information of the target object. Training the pseudo-color image detection model based on the energy map detection result and the pseudo-color image detection result may include the following steps:

[0072] Step 1: Determine the offset between the first position information and the second position information.

[0073] Step 2: Determine the loss value of the pseudo-color image detection model to be trained based on the offset.

[0074] Step 3: Adjust the model parameters of the pseudo-color image detection model to be trained based on the loss value to obtain the target pseudo-color image detection model.

[0075] For example, the energy map detection result includes the first position information of the target object in the energy image, and the pseudo-color image detection result includes the second position information of the target object in the pseudo-color image. Further, the offset between the first position information and the second position information is determined with reference to the first position information.

[0076] Furthermore, the loss value of the pseudo-color image detection model to be trained is determined based on the offset between the first position information and the second position information. Specifically, the offset can be determined as the loss value of the pseudo-color image detection model to be trained.

[0077] Furthermore, based on the loss value of the pseudo-color image detection model to be trained, the model parameters of the pseudo-color image detection model to be trained are iteratively updated through the backpropagation algorithm until the pseudo-color image detection model to be trained converges, thereby obtaining the target pseudo-color image detection model.

[0078] In the above implementation process, since the first position information is obtained based on the trained energy map detection model, the offset between the first position information and the second position information can be determined by using the first position information as a reference. Thus, the loss value of the pseudo-color image detection model to be trained in the position detection process can be determined based on the offset. Furthermore, the model parameters of the pseudo-color image detection model to be trained can be adjusted based on the loss value to obtain the target pseudo-color image detection model, thereby improving the accuracy of the target pseudo-color image detection model in image position detection.

[0079] In some embodiments, the pseudo-color image detection result also includes the detection category of the target object. Determining the loss value of the pseudo-color image detection model to be trained based on the offset may include the following steps:

[0080] Step 1: Obtain the reference location information and reference category of the target object.

[0081] Step 2: Determine the position loss value of the second position information based on the reference position information.

[0082] Step 3: Determine the category loss value for the detected category based on the reference category.

[0083] Step 4: Determine the loss value of the pseudo-color image detection model to be trained based on the offset, position loss value, and category loss value.

[0084] For example, before inputting the pseudo-color image into the pseudo-color image detection model to be trained, the pseudo-color image can be labeled to obtain the reference position and reference category of the target object in the pseudo-color image, thereby enabling the electronic device to obtain the reference position information and reference category of the target object.

[0085] Furthermore, the position loss value of the second position information is determined based on the reference position information, and the category loss value of the detection category is determined based on the reference category.

[0086] Furthermore, the loss value of the pseudo-color image detection model to be trained is determined based on the offset, position loss value, and category loss value. Specifically, the total loss value of the pseudo-color image detection model to be trained can be determined by the weighted sum of the offset, position loss value, and category loss value, or by the average of the offset, position loss value, and category loss value, or by the weighted average of the offset, position loss value, and category loss value.

[0087] Furthermore, based on the determined total loss value, the model parameters of the pseudo-color image detection model to be trained are iteratively updated using the backpropagation algorithm to obtain the target pseudo-color image detection model.

[0088] It should be noted that, in the embodiments of this application, when it is necessary to determine the total loss value based on the weight parameters corresponding to the offset, position loss value and category loss value, the weight parameters corresponding to the offset, position loss value and category loss value can be preset or adjusted according to the number of iterations, and there is no limitation here.

[0089] In the above implementation process, the total loss value of the pseudo-color image detection model to be trained is determined together based on the offset between the first position information and the second position information, the position loss value and the category loss value of the pseudo-color image detection model to be trained. This not only transfers the position feature information learned from the energy image by the trained energy image detection model to the pseudo-color image detection model to be trained, but also enables it to learn the feature information in the pseudo-color image, thereby improving the training accuracy of the pseudo-color image detection model to be trained.

[0090] As another embodiment, the energy map detection result may include the target category of the target object and the target location of the target object in the energy image. The pseudo-color image detection result may include the detection category of the target object and the detection location of the target object in the pseudo-color image.

[0091] The detection category is supervised according to the target category to obtain the category loss value, and the detection position is supervised according to the target position to obtain the position loss value. Furthermore, the total loss value of the pseudo-color image detection model to be trained is obtained by weighted summing the category loss value and the position loss value. Furthermore, the model parameters of the pseudo-color image detection model to be trained are iteratively updated by backpropagation algorithm based on the total loss value to obtain the target pseudo-color image detection model.

[0092] In another embodiment, the detection category is supervised according to the target category to obtain a first category loss value, and the detection category is supervised according to the reference category to obtain a second category loss value; the second location information is supervised according to the first location information to obtain a first location loss value, and the second location information is supervised according to the reference location information to obtain a second location loss value. Further, the weighted sum of the first category loss value, the second category loss value, the first location loss value, and the second location loss value is determined as the total loss value of the pseudo-color image detection model to be trained. Further, based on this total loss value, the model parameters of the pseudo-color image detection model to be trained are iteratively updated using the backpropagation algorithm to obtain the target pseudo-color image detection model.

[0093] In some embodiments, the first location information includes the first center position of the first detection box corresponding to the target object and N first boundary positions of the first detection box; the second location information includes the second center position of the second detection box corresponding to the target object and N second boundary positions of the second detection box. Determining the offset between the first location information and the second location information may include the following steps:

[0094] Step 1: Based on the first distance from the first center position to the first target boundary position, determine the first probability distribution function of the first target boundary position. The first target boundary position is any one of N first boundary positions, where N is a positive integer greater than or equal to 3.

[0095] Step 2: Based on the second distance from the second center position to the second target boundary position, determine the second probability distribution function of the second target boundary position, and the second target boundary position corresponds to the first target boundary position.

[0096] Step 3: Based on the divergence between the first probability distribution functions, determine the offset between the first target boundary position and the second target boundary position.

[0097] Step 4: Based on the offsets of all first boundary positions and their corresponding second boundary positions, determine the offset between the first position information and the second position information.

[0098] For example, the first location information may include the first center position of the first detection box corresponding to the target object and N first boundary positions of the first detection box, and the second location information may include the second center position of the second detection box corresponding to the target object and N second boundary positions of the second detection box.

[0099] Specifically, the first detection box can be the first minimum bounding rectangle of the target object in the energy image, and the first center position is the center point of the first minimum bounding rectangle. When the first detection box is a rectangle, N=4, and the N first boundary positions of the first detection box can refer to the four boundaries of the first minimum bounding rectangle. The second detection box can be the second minimum bounding rectangle of the target object in the pseudo-color image, and the second center position is the center point of the second minimum bounding rectangle. The N second boundary positions of the second detection box can refer to the four boundaries of the second minimum bounding rectangle.

[0100] If the first target boundary position is the upper boundary of the first minimum bounding rectangle, then the first distance is the distance from the center point of the first minimum bounding rectangle to its upper boundary. The second target boundary position corresponding to the first target position can refer to the upper boundary of the second minimum bounding rectangle.

[0101] Furthermore, the distance from the center point of the minimum bounding rectangle to the boundary of the minimum bounding rectangle can be expressed as:

[0102] B={t,b,l,r} (1)

[0103] Where t is the distance from the center point to the upper boundary, b is the distance from the center point to the lower boundary, l is the distance from the center point to the left boundary, and r is the distance from the center point to the right boundary.

[0104] Furthermore, the distance y∈B from the center point to any boundary is modeled as a probability distribution function P(x). Specifically, this probability distribution function can be a general distribution function, which can then be expressed in the following integral form:

[0105]

[0106] Taking the distance t from the center point to the upper boundary as an example, during the training process of the pseudo-color image detection model, based on the t obtained in the current training iteration and the t obtained in all previous training iterations, the average and variance of the distance from the center point to the upper boundary are determined, thereby constructing the probability distribution function P(x) of the distance from the center point to the upper boundary. t ).

[0107] Therefore, the probability distribution function of the distance from the center point of the first minimum bounding rectangle to the upper boundary of the first minimum bounding rectangle can be determined by the above method as P1(x t The probability distribution function of the distance from the center point of the second minimum bounding rectangle to the upper boundary of the second minimum bounding rectangle is P2(x). t The probability distribution function of the distance from the center point of the first minimum bounding rectangle to the lower boundary of the first minimum bounding rectangle is P1(x). bThe probability distribution function of the distance from the center point of the second minimum bounding rectangle to the lower boundary of the second minimum bounding rectangle is P2(x). b The probability distribution function of the distance from the center point of the first minimum bounding rectangle to the left boundary of the first minimum bounding rectangle is P1(x). l The probability distribution function of the distance from the center point of the second minimum bounding rectangle to the left boundary of the second minimum bounding rectangle is P2(x). l The probability distribution function of the distance from the center point of the first minimum bounding rectangle to the right boundary of the first minimum bounding rectangle is P1(x). r The probability distribution function of the distance from the center point of the second minimum bounding rectangle to the right boundary of the second minimum bounding rectangle is P2(x). r ).

[0108] It should be noted that the embodiments of this application only use a rectangle as an example for illustration. In practical applications, the detection box can also be a triangle, a pentagon, a hexagon, or other polygons, and there are no restrictions here.

[0109] Furthermore, based on the relative entropy of the first probability distribution function with respect to the second probability distribution function, the divergence between the two probability distribution functions is determined. The divergence between the two probability distribution functions can then be determined by the following expression:

[0110] L KL (P1(x),P2(x))=D KL (P1(x)||P2(x)) (3)

[0111] Where P1(x) represents the first probability distribution function, P2(x) represents the second probability distribution function, and L KL (P1(x),2(x)) represents the divergence between the two probability distribution functions, D KL (P1(x)||2(x)) represents the relative entropy of the first probability distribution function with respect to the second probability distribution function.

[0112] Furthermore, the smaller the divergence between the two probability distribution functions, the closer the probability distributions of P1(x) and P2(x) are. This can further indicate that the offset between the first target boundary position and the second target boundary position is lower. Therefore, the divergence between the two probability distribution functions can be determined as the offset between the first target boundary position and the second target boundary position.

[0113] Furthermore, the divergence between all boundaries of the first minimum bounding rectangle and all corresponding boundaries of the second minimum bounding rectangle can be determined: the divergence between the probability distribution function corresponding to the first upper boundary and the probability distribution function corresponding to the second upper boundary is L. KL (P1(x t ),P2(x t The divergence between the probability distribution function corresponding to the first lower boundary and the probability distribution function corresponding to the second lower boundary is L. KL (P1(x b ),P2(x b The divergence between the probability distribution function corresponding to the first left boundary and the probability distribution function corresponding to the second left boundary is L. KL (P1(x l ),P2(x l The divergence between the probability distribution function corresponding to the first right boundary and the probability distribution function corresponding to the second right boundary is L. KL (P1(x r ),P2(x r )).

[0114] Furthermore, the sum of the divergences between all boundaries is determined as the offset between the first and second position information. Therefore, the offset between the first and second position information can be expressed as:

[0115] L KL (Total) = KL (P1(x t ),P2(x t ))+ KL (P1(x b ),P2(x b ))+ KL (P1(x l ),P2(x l ))+L KL (P1(x r ), P2(x r (4)

[0116] Among them, L KL (Total) represents the offset between the first position information and the second position information.

[0117] As another embodiment, the average value of the divergence between the four boundaries can also be determined as the offset between the first position information and the second position information. That is, the offset between the first position information and the second position information can also be expressed as:

[0118] L KL (Total) = [L] KL (P1(xt ), P2(x t ))+L KL (P1(x b ), P2(x b ))+L KL (P1(x l ), P2(x l ))+L KL (P1(x r ), P2(x r ))] / 4 (5)

[0119] In the above implementation process, a probability distribution function is constructed based on the distance between the center position and the boundary position of the detection box. Furthermore, the offset between the first position information and the second position information is determined based on the divergence between the first probability distribution function and the second probability distribution function, thereby improving the accuracy of determining the offset between the first position information and the second position information.

[0120] In some embodiments, acquiring an energy image of the target object may include the following steps:

[0121] Step 1: Determine the first energy map based on the energy transmitted from the first energy source to the target object.

[0122] Step 2: Determine the second energy map based on the energy transmitted through the target object from the second energy source. The energy value of the first energy source is higher than that of the second energy source.

[0123] Step 3: Determine the energy image of the target object based on the first energy map and the second energy map.

[0124] For example, an X-ray security inspection machine may include dual energy sources with different energy levels, which may result in different energy levels of X-rays transmitted through the target object when the X-ray security inspection machine's image acquisition device acquires them.

[0125] If the first energy source is a high-level energy source, its energy value is E = E H The second energy source is a low-level energy source with an energy value E = E L E H >E L The energy map obtained from the energy of the first energy source through the target object is the first energy map, which is a high energy map. The energy map obtained from the energy of the second energy source through the target object is the second energy map, which is a low energy map.

[0126] Furthermore, based on the first energy map and the second energy map, the energy image of the target object is determined.

[0127] Specifically, the average energy value of the first energy map and the second energy map can be determined as the energy value of the target object's energy image, thereby determining the target object's energy image.

[0128] As another embodiment, the first energy map and the second energy map can be stitched together in the channel dimension to obtain the energy image of the target object.

[0129] In the above implementation process, the energy levels of the energy sources are different, and the energy passing through the target object is also different. Two different energy maps are obtained by passing through the target object with energy sources of two different energy levels. Further, the energy map used for training is determined based on the different energy maps, which enriches the feature information of the energy map used for training. Furthermore, the energy map used for training is used as the input of the trained energy map detection model to obtain the energy map detection result, which improves the accuracy of the energy map detection result. Furthermore, the energy map detection result is used for supervised training of the pseudo-color image detection model to be trained, which improves the accuracy and robustness of the model training.

[0130] In some embodiments, determining the energy image of the target object based on the first energy image and the second energy image may include the following steps:

[0131] Step 1: Determine the equivalent atomic number map of the target object based on the first energy map and the second energy map.

[0132] Step 2: Segment the first energy map, the second energy map, and the equivalent atomic number map along the channel dimension to obtain the energy image of the target object.

[0133] For example, typically in X-ray security inspection machine image acquisition equipment, the penetration energy I(E) of X-rays through a material can be calculated using the following formula:

[0134] I(E)=I0e -μt (6)

[0135] μ=α(Z,E)ρ (7)

[0136] Where I0 is the X-ray emission intensity, t is the material thickness, μ is the material absorption coefficient, α(Z,E) is the mass attenuation coefficient under the material atomic coefficient Z and the incident ray energy E, and ρ is the material density.

[0137] Therefore, the mass decay coefficients α(Z,E) corresponding to the first and second energy maps can be determined according to the above formulas (6) and (7). Furthermore, based on the variation law of the decay coefficient α(Z,E) of materials with different atomic numbers at high and low energies, the high-energy data of the first energy map and the low-energy data of the second energy map are decomposed into equivalent Compton scattering coefficients μ. p and photoelectric absorption coefficient μc The equivalent atomic number Z can be calculated using the following formula. eff :

[0138]

[0139] Among them, K ′ And n are constants.

[0140] Furthermore, the equivalent atomic number map of the target object can be determined based on the above formula (8) and the first energy map and the second energy map.

[0141] Furthermore, the first energy map, the second energy map, and the equivalent atomic number map are stitched together along the channel dimension to obtain the energy image of the target object.

[0142] Specifically, the first energy map, the second energy map, and the equivalent atomic number map are all single-channel images. Furthermore, the single-channel first energy map, the second energy map, and the equivalent atomic number map are stitched together along the channel dimension to obtain a three-channel energy image of the target object.

[0143] In the above implementation process, the equivalent atomic number map of the target object is determined based on the first energy map and the second energy map. Furthermore, the first energy map, the second energy map, and the equivalent atomic number map are stitched together in the channel dimension to obtain the energy image of the target object. This ensures that the energy image of the target object fully retains the detailed information of the energy passing through the target object. Furthermore, the energy map detection result obtained from the energy image of the target object is used to supervise the training process of the pseudo-color image detection model to be trained, which can effectively improve the accuracy of model training. Furthermore, the target pseudo-color image detection model is used for image detection, which can effectively improve the accuracy of image detection results.

[0144] In some embodiments, before stitching the first energy map, the second energy map, and the equivalent atomic number map along the channel dimension to obtain the energy image of the target object, the method may further include: normalizing the first energy map, the second energy map, and the equivalent atomic number map respectively.

[0145] For example, in order to facilitate the convergence of the training process of the pseudo-color image detection model to be trained, before stitching the first energy map, the second energy map, and the equivalent atomic number map in the channel dimension to obtain the energy image of the target object, the first energy map, the second energy map, and the equivalent atomic number map can be normalized respectively. The normalized first energy map, the normalized second energy map, and the normalized equivalent atomic number map are then stitched together in the channel dimension to obtain the energy image of the target object.

[0146] As another example, due to systematic errors between hardware such as the detector plate in the X-ray security inspection machine image acquisition equipment, the obtained first energy map and second energy map may have non-uniform bright and dark stripes. Therefore, in order to eliminate the non-uniform bright and dark stripes in the energy map, non-uniformity correction can be performed on the first energy map and the second energy map.

[0147] Specifically, the first and second energy maps acquired by the X-ray security inspection machine image acquisition equipment can be subjected to non-uniformity correction and normalization processing to obtain processed first and second energy maps. Furthermore, based on the first and second energy maps before non-uniformity correction and normalization processing, an equivalent atomic number map of the target object is obtained, and this equivalent atomic number map is then normalized to obtain a normalized equivalent atomic number map. Finally, the processed first energy map, the processed second energy map, and the normalized equivalent atomic number map are stitched together along the channel dimension to obtain the energy image of the target object.

[0148] In the above implementation process, normalization is performed on the first energy map, the second energy map, and the equivalent atomic number map, which can effectively improve the convergence speed of the training of the pseudo-color image detection model and thus improve the training efficiency of the model.

[0149] Figure 3 This is an example diagram of an image detection model training embodiment provided in this application, as shown below. Figure 3 As shown, the X-ray penetration energy through the package is acquired by the X-ray security inspection machine image acquisition module 301. Further, the X-ray penetration energy is input into the X-ray energy processing module 302 to obtain the X-ray energy map. The X-ray penetration energy is input into the X-ray pseudo-color image rendering module 303 to obtain the X-ray pseudo-color image.

[0150] Specifically, the X-ray energy processing module 302 obtains a first energy map based on the energy transmitted through the package by the high-energy source, where the energy value of the high-energy source is E = E H And based on the energy transmitted through the package from the low-energy source, a second energy map is obtained, where the energy value of the low-energy source is E = E L E H >E L Using the above formulas (6), (7) and (8), the equivalent atomic number diagram is obtained based on the first energy diagram and the second energy diagram.

[0151] Furthermore, the X-ray energy processing module 302 performs non-uniformity correction and normalization processing on the first energy map and the second energy map respectively to obtain the X-ray high-energy map and the X-ray low-energy map, and performs normalization processing on the equivalent atomic number map to obtain the material response map, which is the normalized equivalent atomic number map.

[0152] Furthermore, the X-ray energy processing module 302 splices the X-ray high-energy image, X-ray low-energy image, and matter response image in the channel dimension to obtain a three-channel X-ray energy image.

[0153] The X-ray pseudo-color rendering module 303 renders the X-ray penetration energy to obtain an X-ray pseudo-color image.

[0154] Furthermore, the X-ray energy map is input into the trained energy map detection model 304 to obtain the X-ray energy map detection result, and the X-ray pseudo-color image is input into the pseudo-color image detection model 305 to obtain the X-ray pseudo-color image detection result.

[0155] Furthermore, the X-ray energy map detection results and the X-ray pseudocolor map detection results are input into the X-ray energy pseudocolor supervision module 306 to obtain the supervision loss.

[0156] Furthermore, the supervision loss, the category loss of the pseudo-color image detection model to be trained, and the position loss of the pseudo-color image detection model to be trained are input into the loss function 307 to obtain the total loss of the pseudo-color image detection model to be trained. Further, the model parameters of the pseudo-color image detection model to be trained are iteratively updated according to the total loss through the backpropagation algorithm until the pseudo-color image detection model to be trained converges, thus obtaining the target pseudo-color image detection model.

[0157] Figure 4 This is a schematic diagram illustrating the generation of loss values ​​for a pseudo-color image detection model to be trained, as provided in an embodiment of this application. Figure 4 As shown, the X-ray energy map detection result includes a first category and first position information, wherein the first position information can be represented as B1 = {t1, b1, l1, r1}. The X-ray pseudocolor map detection result includes a second category and second position information, wherein the second position information can be represented as B2 = {t2, b2, l2, r2}.

[0158] Furthermore, the supervision loss is determined based on the first and second location information. Specifically, the distance from the center of the detection rectangle corresponding to each location information to the four boundaries (top, bottom, left, and right) is determined. A general distribution function P(x) is constructed for the distance from the center to any boundary, thus obtaining the general distribution function P1(x) corresponding to the upper boundary of the first detection rectangle. t The general distribution function P1(x) corresponding to the lower boundary of the first detection rectangle. b The general distribution function P1(x) corresponding to the left boundary of the first detection rectangle. l The general distribution function P1(x) corresponding to the right boundary of the first detection rectangle. r The general distribution function P2(x) corresponding to the upper boundary of the second detection rectangle. t The general distribution function P2(x) corresponding to the lower boundary of the second detection rectangle.b The general distribution function P2(x) corresponding to the left boundary of the second detection rectangle. l ) and the general distribution function P2(x) corresponding to the right boundary of the second detection rectangle. r ).

[0159] Furthermore, based on the above formula (3), the divergence KL corresponding to the four boundaries (upper, lower, left, and right) is calculated, resulting in: the divergence between the general distribution function corresponding to the first upper boundary and the general distribution function corresponding to the second upper boundary is L. KL (P1(x t ),P2(x t The divergence between the general distribution function corresponding to the first lower boundary and the general distribution function corresponding to the second lower boundary is L. KL (P1(x b ),P2(x b The divergence between the general distribution function corresponding to the first left boundary and the general distribution function corresponding to the second left boundary is L. KL (P1(x l ),P2(x l The divergence between the general distribution function corresponding to the first right boundary and the general distribution function corresponding to the second right boundary is L. KL (P1(x r ),P2(x r The sum of the four divergences is determined as the supervision loss, which can be expressed as the above expression (4).

[0160] Furthermore, the location loss of the second location information is determined based on the labeled positions of the pseudo-color image, and the category loss of the second location information is determined based on the labeled categories of the pseudo-color image. Further, the supervision loss, location loss, and category loss are weighted and summed to obtain the total loss, which can be determined by the following expression:

[0161] L total =σ1L cls +σ2L reg +σ3L KL (Total) (9)

[0162] Among them, L total L represents the total loss. cls L represents the category loss. reg L represents position loss. KL (Total) represents the monitoring loss, and σ1, σ2 and σ3 are preset weight parameters.

[0163] Furthermore, the model parameters of the pseudo-color image detection model 305 to be trained are adjusted using the backpropagation algorithm through the total loss until the pseudo-color image detection model 305 to be trained converges, thus obtaining the target pseudo-color image detection model.

[0164] This embodiment also provides an image detection method, including:

[0165] Step 1: Obtain the pseudo-color image to be detected.

[0166] Step 2: Input the pseudo-color image to be detected into the target pseudo-color image detection model to obtain the detection result of the pseudo-color image to be detected. The target pseudo-color image detection model is obtained by the image detection model training method provided in any of the above embodiments.

[0167] In the above implementation process, the energy image detection results and pseudo-color image detection results are used to supervise the training of the pseudo-color image detection model to be trained. The resulting target pseudo-color image detection model can improve the training accuracy of the pseudo-color image detection model. Furthermore, inputting the pseudo-color image to be detected into the target pseudo-color image detection model can effectively improve the accuracy of the detection results.

[0168] It should be noted that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0169] This embodiment also provides an image detection model training device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below refer to combinations of software and / or hardware that perform a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0170] Figure 5 This is a structural block diagram of an image detection model training device provided in an embodiment of this application, such as... Figure 5 As shown, the device includes:

[0171] The acquisition module 501 is used to acquire the energy image of the target object and the pseudo-color image of the target object;

[0172] The first detection module 502 is used to input the energy image into the trained energy map detection model to obtain the energy map detection result;

[0173] The second detection module 503 is used to input the pseudo-color image into the pseudo-color image detection model to be trained, and obtain the pseudo-color image detection result;

[0174] Training module 504 is used to train the pseudo-color image detection model to be trained based on the energy map detection results and the pseudo-color image detection results.

[0175] In some embodiments, the energy map detection result includes first location information of the target object, the pseudo-color image detection result includes second location information of the target object, and the training module 504 is specifically used for:

[0176] Determine the offset between the first position information and the second position information;

[0177] The loss value of the pseudo-color image detection model to be trained is determined based on the offset.

[0178] The model parameters of the pseudo-color image detection model to be trained are adjusted based on the loss value to obtain the target pseudo-color image detection model.

[0179] In some embodiments, the pseudo-color image detection result also includes the detection category of the target object, and the training module 504 is specifically used for:

[0180] Obtain the reference location information and reference category of the target object;

[0181] The position loss value of the second position information is determined based on the reference position information;

[0182] The category loss value for the detection category is determined based on the reference category;

[0183] The loss value of the pseudo-color image detection model to be trained is determined based on the offset, position loss value, and category loss value.

[0184] In some embodiments, the first location information includes the first center position of the first detection box corresponding to the target object and N first boundary positions of the first detection box; the second location information includes the second center position of the second detection box corresponding to the target object and N second boundary positions of the second detection box; the training module 504 is specifically used for:

[0185] Based on the first distance from the first center position to the first target boundary position, the first probability distribution function of the first target boundary position is determined. The first target boundary position is any one of N first boundary positions, where N is a positive integer greater than or equal to 3.

[0186] Based on the second distance from the second center position to the second target boundary position, a second probability distribution function is determined for the second target boundary position, and the second target boundary position corresponds to the first target boundary position.

[0187] Based on the divergence between the first probability distribution functions, the offset between the first target boundary position and the second target boundary position is determined;

[0188] Based on the offsets of all first boundary positions and their corresponding second boundary positions, the offset between the first position information and the second position information is determined.

[0189] In some embodiments, the acquisition module 501 is specifically used for:

[0190] The first energy map is determined based on the energy transmitted from the first energy source to the target object;

[0191] Based on the energy transmitted through the target object from the second energy source, a second energy map is determined, and the energy value of the first energy source is higher than that of the second energy source.

[0192] The energy image of the target object is determined based on the first energy map and the second energy map.

[0193] In some embodiments, the acquisition module 501 is specifically used for:

[0194] Determine the equivalent atomic number map of the target object based on the first energy map and the second energy map;

[0195] The first energy map, the second energy map, and the equivalent atomic number map are stitched together along the channel dimension to obtain the energy image of the target object.

[0196] In some embodiments, the acquisition module 501 is further configured to:

[0197] The first energy diagram, the second energy diagram, and the equivalent atomic number diagram are normalized respectively.

[0198] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0199] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, Figure 6 This is a schematic diagram of the internal structure of a computer device according to an embodiment of this application. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores training data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements an image detection model training method or an image detection method.

[0200] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0201] In one embodiment, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0202] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0203] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0204] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0205] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0206] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A method for training an image detection model, characterized in that, include: Acquire the energy image of the target object, and the pseudo-color image of the target object; The energy image of the target object is determined by stitching together a first energy image, a second energy image, and an equivalent atomic number image in the channel dimension; the first energy image is determined based on the energy transmitted through the target object from the first energy source. The second energy map is determined based on the energy transmitted through the target object from the second energy source; The energy value of the first energy source is higher than the energy value of the second energy source; The energy image is input into the trained energy map detection model to obtain the energy map detection result; the energy map detection result includes the first location information of the target object. The pseudo-color image is input into the pseudo-color image detection model to be trained to obtain the pseudo-color image detection result; the pseudo-color image detection result includes the second position information of the target object; Based on the energy map detection results and the pseudo-color map detection results, the pseudo-color map detection model to be trained is trained. The total loss of the pseudo-color image detection model to be trained includes the supervision loss; Determining the supervision loss includes: determining the distance from the center position of the detection rectangle corresponding to each location information to the four boundaries (up, down, left, and right); constructing a general distribution function for the distance from the center position to any one boundary; calculating the divergence between the general distribution functions corresponding to the four boundaries; and determining the sum of the four divergences as the supervision loss.

2. The image detection model training method according to claim 1, characterized in that, The energy map detection result includes the first location information of the target object, and the pseudo-color image detection result includes the second location information of the target object. Training the pseudo-color image detection model based on the energy map detection result and the pseudo-color image detection result includes: Determine the offset between the first location information and the second location information; The loss value of the pseudo-color image detection model to be trained is determined based on the offset. The model parameters of the pseudo-color image detection model to be trained are adjusted based on the loss value to obtain the target pseudo-color image detection model.

3. The image detection model training method according to claim 2, characterized in that, The pseudo-color image detection result also includes the detection category of the target object, and determining the loss value of the pseudo-color image detection model to be trained based on the offset includes: Obtain the reference location information and reference category of the target object; The position loss value of the second position information is determined based on the reference position information; The category loss value of the detection category is determined based on the reference category; Based on the offset, the positional loss value, and the category loss value, the loss value of the pseudo-color image detection model to be trained is determined.

4. The image detection model training method according to claim 2, characterized in that, The first location information includes the first center position of the first detection box corresponding to the target object, and N first boundary positions of the first detection box. The second location information includes the second center position of the second detection box corresponding to the target object, and N second boundary positions of the second detection box. Determining the offset between the first location information and the second location information includes: Based on the first distance from the first center position to the first target boundary position, a first probability distribution function for the first target boundary position is determined, wherein the first target boundary position is any one of N first boundary positions, and N is a positive integer greater than or equal to 3; Based on the second distance from the second center position to the second target boundary position, a second probability distribution function is determined for the second target boundary position, and the second target boundary position corresponds to the first target boundary position. Based on the divergence between the first probability distribution function and the second probability distribution function, the offset between the first target boundary position and the second target boundary position is determined; Based on the offsets of all first boundary positions and their corresponding second boundary positions, the offset between the first position information and the second position information is determined.

5. The image detection model training method according to claim 1, characterized in that, The process of acquiring the energy image of the target object includes: A first energy map is determined based on the energy transmitted from the first energy source through the target object; A second energy map is determined based on the energy transmitted through the target object from the second energy source, wherein the energy value of the first energy source is higher than the energy value of the second energy source; The energy image of the target object is determined based on the first energy map and the second energy map.

6. The image detection model training method according to claim 5, characterized in that, Determining the energy image of the target object based on the first energy image and the second energy image includes: Determine the equivalent atomic number map of the target object based on the first energy map and the second energy map; The first energy map, the second energy map, and the equivalent atomic number map are stitched together along the channel dimension to obtain the energy image of the target object.

7. The image detection model training method according to claim 6, characterized in that, Before stitching the first energy map, the second energy map, and the equivalent atomic number map together along the channel dimension to obtain the energy image of the target object, the method further includes: The first energy map, the second energy map, and the equivalent atomic number map are all normalized.

8. An image detection method, characterized in that, include: Obtain the pseudo-color image to be detected; The pseudo-color image to be detected is input into the target pseudo-color image detection model to obtain the detection result of the pseudo-color image to be detected, wherein the target pseudo-color image detection model is obtained by the image detection model training method according to any one of claims 1 to 7.

9. An image detection model training device, characterized in that, include: An acquisition module is used to acquire the energy image of the target object and the pseudo-color image of the target object; The energy image of the target object is determined by stitching together a first energy image, a second energy image, and an equivalent atomic number image in the channel dimension; the first energy image is determined based on the energy transmitted through the target object from the first energy source. The second energy map is determined based on the energy transmitted through the target object from the second energy source; The energy value of the first energy source is higher than the energy value of the second energy source; The first detection module is used to input the energy image into a trained energy map detection model to obtain an energy map detection result; the energy map detection result includes first location information. The second detection module is used to input the pseudo-color image into the pseudo-color image detection model to be trained, and obtain the pseudo-color image detection result; the pseudo-color image detection result includes second position information; The training module is used to train the pseudo-color image detection model to be trained based on the energy map detection results and the pseudo-color image detection results. The total loss of the pseudo-color image detection model to be trained includes the supervision loss; Determining the supervision loss includes: determining the distance from the center position of the detection rectangle corresponding to each location information to the four boundaries (up, down, left, and right); constructing a general distribution function for the distance from the center position to any one boundary; calculating the divergence between the general distribution functions corresponding to the four boundaries; and determining the sum of the four divergences as the supervision loss.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method of any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.