Medical image AI model test method and device, equipment and storage medium

By performing image attack processing on medical image sets, generating attack image sets and testing AI models, the problem of limitations of AI model testing methods in the existing technology is solved, a more comprehensive AI model accuracy assessment is achieved, and the accuracy of test results is improved. accuracy and stability.

CN118736356APending Publication Date: 2024-10-01SHENZHEN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410820835.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

AI model testing methods in the existing technology have limitations and cannot effectively evaluate the accuracy and stability of AI models in medical imaging equipment, especially due to noise and clarity degradation caused by acquisition equipment.

Method used

Use the image attack algorithm to process the original medical image set to generate a medical attack image set, and use the original and attack image sets to test the AI ​​model respectively, calculate the first and second prediction accuracy rates, and obtain them through the L1 norm distance and extreme value scores Test results of the AI ​​model.

Benefits of technology

By increasing the types of test images and providing a more comprehensive assessment of the accuracy of the AI ​​model, it can more accurately reflect the safety and stability of the AI ​​model and overcome the limitations of test results in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736356A_ABST
    Figure CN118736356A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of model testing, in particular to a medical image AI model testing method and device, equipment and a storage medium. The method comprises the following steps: firstly, acquiring an original medical image set, applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set, and then testing an AI model by using the original medical image set and the medical attack image set respectively to obtain a first prediction correct rate and a second prediction correct rate of the AI model respectively; and finally, according to the first prediction correct rate and the second prediction correct rate, obtaining a test result of the AI model. According to the analysis, the AI model is tested by using the original medical image, and the AI model is tested by using the attack image, so that the types of the images are increased, and the test result can more comprehensively reflect the accuracy of the AI model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of model testing technology, and specifically to a medical imaging AI model testing method, device, equipment and storage medium. Background Art

[0002] By implanting the AI ​​model into the medical imaging device, the medical imaging device can analyze the patient's medical images to assist doctors in diagnosing diseases. In order to ensure the security of the AI ​​model, that is, to ensure the accuracy and stability of the AI ​​model, the AI ​​model needs to be evaluated and tested for security. The existing technology only uses conventional original images to test the AI ​​model, and during the acquisition process of medical images, the acquisition device will cause noise and reduced clarity on the medical images, that is, the acquisition device will affect the quality of the medical images. Since the existing technology only uses conventional original images to test the AI ​​model, the test results will be limited.

[0003] In summary, the AI ​​model testing methods in the prior art have limitations.

[0004] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a medical imaging AI model testing method, device, equipment and storage medium, which solves the problem that the AI ​​model testing method in the prior art has limitations.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a medical image AI model testing method, which includes:

[0008] Collecting an original medical image set, and applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set;

[0009] Using each original image in the original medical image set to test the AI ​​model to obtain a first prediction accuracy of the AI ​​model; using each image in the medical attack image set to test the AI ​​model to obtain a second prediction accuracy of the AI ​​model;

[0010] The test result of the AI ​​model is obtained based on the first prediction accuracy and the second prediction accuracy.

[0011] In one implementation, applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set includes:

[0012] Determine a perturbation attack algorithm and a confrontation attack algorithm in the image attack algorithm;

[0013] Applying a perturbation attack algorithm to each original image in the original medical image set to obtain a perturbation attack image subset;

[0014] An adversarial attack algorithm is applied to each original image in the original medical image set to obtain an adversarial attack image subset, and the adversarial attack image subset and the perturbation attack image subset are combined to obtain a medical attack image set.

[0015] In one implementation, applying the adversarial attack algorithm to each original image in the original medical image set to obtain an adversarial attack image subset includes:

[0016] Applying a targeted adversarial attack algorithm to each original image to obtain a first subset of adversarial attack images;

[0017] A non-targeted adversarial attack algorithm is applied to each original image to obtain a second subset of adversarial attack images, and the second subset of adversarial attack images and the first subset of adversarial attack images are used as adversarial attack image subsets.

[0018] In one implementation, applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set includes:

[0019] Various intensity values ​​are set for the image attack algorithm, and each attack image sample formed by each original image under the attack of the image attack algorithm with each of the intensity values ​​is determined to obtain each attack image sample subset corresponding to each intensity value, and the set formed by the attack image sample subsets corresponding to all the intensity values ​​is used as the medical attack image set.

[0020] In one implementation, the using each image in the medical attack image set to test the AI ​​model to obtain a second prediction accuracy of the AI ​​model includes:

[0021] Determine the model category of the AI ​​model, and determine the accuracy calculation formula of the AI ​​model based on the model category;

[0022] The AI ​​model is tested using each image of each attack image sample subset corresponding to each intensity value, and the second prediction accuracy of the AI ​​model corresponding to each intensity value is calculated using the accuracy calculation formula.

[0023] In one implementation, obtaining the test result of the AI ​​model according to the first prediction accuracy and the second prediction accuracy includes:

[0024] Calculating an L1 norm distance between the second prediction accuracy and the first prediction accuracy, and determining a flatness score of the AI ​​model for the image attack algorithm based on the L1 norm distance;

[0025] Determining a safety threshold of the AI ​​model according to the first prediction accuracy;

[0026] Compare all the second prediction accuracy rates with the safety threshold, and select a preferred accuracy rate from all the second prediction accuracy rates;

[0027] Counting the number of the intensity values ​​corresponding to the preferred accuracy, and dividing the number by the second prediction accuracy to obtain an extreme value score;

[0028] The test result of the AI ​​model is obtained according to the extreme value score and the flatness score.

[0029] In one implementation, obtaining the test result of the AI ​​model according to the extreme value score and the flatness score includes:

[0030] Adding the extreme value score corresponding to each of the image attack algorithms and the flatness score corresponding to each of the image attack algorithms to obtain a test sub-score corresponding to each of the image attack algorithms;

[0031] The test sub-scores corresponding to all the image attack algorithms are weighted to obtain a total test score, and the total test score is used as the test result of the AI ​​model.

[0032] In a second aspect, an embodiment of the present invention further provides a medical image AI model testing device, wherein the device includes the following components:

[0033] An attack image generation module, used for collecting an original medical image set, and applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set;

[0034] A testing module, configured to test the AI ​​model using each original image in the original medical image set to obtain a first prediction accuracy of the AI ​​model; and test the AI ​​model using each image in the medical attack image set to obtain a second prediction accuracy of the AI ​​model;

[0035] A test result calculation module is used to obtain the test result of the AI ​​model based on the first prediction accuracy and the second prediction accuracy.

[0036] In the third aspect, an embodiment of the present invention further provides a terminal device, wherein the terminal device includes a memory, a processor, and a medical imaging AI model testing program stored in the memory and executable on the processor, and when the processor executes the medical imaging AI model testing program, the steps of the medical imaging AI model testing method described above are implemented.

[0037] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a medical imaging AI model testing program is stored. When the medical imaging AI model testing program is executed by a processor, the steps of the medical imaging AI model testing method described above are implemented.

[0038] Beneficial effect: The present invention first collects the original medical image set, and applies the image attack algorithm to each original image in the original medical image set to obtain the medical attack image set, and then uses the original medical image set and the medical attack image set to test the AI ​​model respectively to obtain the first prediction accuracy and the second prediction accuracy of the AI ​​model respectively, and finally obtains the test result of the AI ​​model according to the first prediction accuracy and the second prediction accuracy. From the above analysis, it can be seen that the present invention not only uses the original medical images to test the AI ​​model, but also uses the attack images to test the AI ​​model, thereby increasing the types of images, so that the test results of the present invention can more comprehensively reflect the accuracy of the AI ​​model. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is the overall flow chart of the present invention;

[0040] Figure 2 A flow chart of a sample generation algorithm for adversarial learning in an embodiment of the present invention;

[0041] Figure 3 Flowchart of attack on a targeted FGSM in an embodiment of the present invention;

[0042] Figure 4 It is a flow chart of a targeted PGD attack in an embodiment of the present invention;

[0043] Figure 5 Flow chart of a targeted MIM attack in an embodiment of the present invention;

[0044] Figure 6 1 is a flow chart of a targeted CW attack in an embodiment of the present invention;

[0045] Figure 7 This is a flow chart of a targeted DDN attack in an embodiment of the present invention;

[0046] Figure 8 It is a framework diagram of a model security score evaluation algorithm in an embodiment of the present invention;

[0047] Fig. 9 is a flow chart of the software platform in an embodiment of the present invention;

[0048] Fig.10 It is the first home page image of the RobustMIA Pro software in the embodiment of the present invention;

[0049] Fig.11 It is the second home page image of the RobustMIA Pro software in the embodiment of the present invention;

[0050] Fig.12 This is a user guide interface diagram in an embodiment of the present invention;

[0051] Fig.13 A schematic diagram of model selection on the test center interface in an embodiment of the present invention;

[0052] Fig.14 A schematic diagram of uploading files on the test center interface in an embodiment of the present invention;

[0053] Fig.15 This is a test progress interface diagram in an embodiment of the present invention;

[0054] Fig.16 is a schematic diagram of a score and a radar chart in an embodiment of the present invention;

[0055] Fig.17 is a scatter plot corresponding to the Gaussian blur in an embodiment of the present invention;

[0056] Fig.18 is a scatter plot corresponding to the motion blur in the embodiment of the present invention;

[0057] Fig.19 is a scatter plot corresponding to JPEG compression in an embodiment of the present invention;

[0058] Fig. 20 is a scatter plot corresponding to the pixelation in the embodiment of the present invention;

[0059] Fig.21 This is a diagram of a viewing result interface in an embodiment of the present invention;

[0060] Fig. 22 This is a structural diagram of the medical imaging AI model testing device provided by the present invention;

[0061] Fig.23 This is a block diagram of the internal structure principle of the terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0062] The following is a clear and complete description of the technical solution of the present invention in combination with the embodiments and the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] Research has found that by implanting AI models into medical imaging equipment, the medical imaging equipment can analyze the patient's medical images to assist doctors in diagnosing diseases. In order to ensure the security of the AI ​​model, that is, to ensure the accuracy and stability of the AI ​​model, the AI ​​model needs to be evaluated and tested for security. The existing technology only uses conventional original images to test the AI ​​model, and during the acquisition process of medical images, the acquisition equipment will cause noise and reduced clarity on the medical images, that is, the acquisition equipment will affect the quality of the medical images. Since the existing technology only uses conventional original images to test the AI ​​model, the test results will be limited.

[0064] In order to solve the above technical problems, the present invention provides a medical imaging AI model testing method, device, equipment and storage medium, which solves the problem that the AI ​​model testing method in the prior art has limitations. In specific implementation, firstly, an original medical image set is collected, and an image attack algorithm is applied to each original image in the original medical image set to obtain a medical attack image set; then, each original image in the original medical image set is used to test the AI ​​model to obtain a first prediction accuracy of the AI ​​model; and each image in the medical attack image set is used to test the AI ​​model to obtain a second prediction accuracy of the AI ​​model; finally, based on the first prediction accuracy and the second prediction accuracy, the test result of the AI ​​model is obtained.

[0065] For example, the original medical image set contains ten original images. The image attack algorithm is used on these ten original images. The image attack algorithm is used to increase or reduce the size of the original image, reduce the clarity of the original image, add noise to the original image, reduce the contrast of the original image, etc. After each original image is attacked, the original medical image set becomes a medical attack image set. If the AI ​​model is an image classification model, then the ten original images are input into the image classification model respectively, and the image classification model outputs ten classification results. If eight of the classification results are correct, then the first prediction accuracy is 80%. Similarly, the ten images in the medical attack image set are also input into the classification model respectively, and the classification model outputs ten classification results. If six of the classification results are correct, then the second prediction accuracy is 60%. Finally, the test results of the classification model are obtained based on 80% and 60%.

[0066] The medical imaging AI model testing method of this embodiment can be applied to a terminal device, which can be a terminal product with image acquisition and analysis functions, such as a computer. Figure 1 As shown in , the medical imaging AI model testing method specifically includes the following steps:

[0067] S100, collecting an original medical image set, and applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set;

[0068] S200, using each original image in the original medical image set to test the AI ​​model to obtain a first prediction accuracy of the AI ​​model; using each image in the medical attack image set to test the AI ​​model to obtain a second prediction accuracy of the AI ​​model;

[0069] S300, obtaining a test result of the AI ​​model based on the first prediction accuracy and the second prediction accuracy.

[0070] In the first embodiment, step S100 includes the following specific steps S101, S102, and S103:

[0071] S101, determining a perturbation attack algorithm and a confrontation attack algorithm in the image attack algorithm.

[0072] The perturbation attack algorithm is implemented by calling the corresponding functions in the Torch and Kornia libraries, mainly to simulate the perturbations that images may encounter in real clinical application environments, thereby testing the security of the model.

[0073] like Figure 2 As shown, the perturbation attack algorithm includes geometric transformation, color transformation, blur, and noise. Among them, geometric transformation includes four geometric transformation methods: translation transformation, rotation transformation, scaling transformation, and distortion transformation. Color transformation includes four color transformations: brightness transformation, contrast transformation, color cast transformation, and saturation transformation. Blur includes four blur methods: Gaussian blur, motion blur, JPEG blur, and pixelation blur. Noise includes three types of noise: Gaussian noise, speckle noise, and ELD noise. That is, one perturbation attack algorithm includes 15 perturbation attack methods. The following describes these 15 perturbation attack methods:

[0074] The translation transformation moves the original image in the horizontal and vertical directions to simulate the situation in which the lesion area of ​​medical images in real environments is not in the center of the image.

[0075] The rotation method is to rotate the original image at different angles with the center of the original image as the rotation center to simulate the situation where the medical image is rotated and deformed in a real environment.

[0076] The scaling method is to adjust the size of the original image to simulate the situation where the medical image is enlarged, reduced and deformed in the real environment.

[0077] Distortion modes include barrel and pincushion to simulate the shape changes of medical images in real environments.

[0078] The brightness change method is to introduce different brightness levels, from bright to dim, to simulate the brightness changes of medical images in real environments.

[0079] Contrast adjustment is to adjust the contrast of the image to simulate the color contrast changes encountered by medical images in real environments.

[0080] Color cast adjustment is to adjust the image to a bluish, greenish, or reddish hue to simulate a medical image with color shift.

[0081] Saturation adjustment means setting different saturations for images to simulate the effect of sensors from different manufacturers on the saturation of the same medical image in a real environment.

[0082] Gaussian blurring is to transform an image into a Gaussian kernel blurred image to simulate medical images that are interfered by noise in real environments.

[0083] Motion blur is the process of blurring the image to a specified degree and angle to simulate the blurring effect of the medical image captured by the image acquisition device due to the movement of the image acquisition device in a real environment.

[0084] The JPEG blur addition method is to perform OpenCV encoding and decoding functions on the image to simulate the distortion caused by the compression and decompression process of medical images.

[0085] Pixel blurring is to reduce the image size and then enlarge it back to its original size, and use the nearest neighbor interpolation method to maintain the pixel block effect, so as to simulate the distortion of medical images after multiple scaling in real environment.

[0086] Gaussian noise is the process of superimposing random Gaussian distribution values ​​onto the pixel values ​​of an image to simulate the situation where a medical image is disturbed by random noise in a real environment.

[0087] Speckle noise is to multiply random noise by the pixel value of the image to simulate the situation where medical images are disturbed by speckles in real environments.

[0088] ELD noise is the sum of different types of noise multiplied by the pixel value of the image and then superimposed on the pixel value of the image to simulate the situation where medical images are disturbed by various noises in a real environment.

[0089] Adversarial attack algorithms (also known as high-order adversarial attack algorithms) include five methods: FGSM (the Fast Gradient Sign Method), PGD (Projected Gradient Descent), MIM (Momentum Iterative Gradient-based Method), DDN (Decoupled Direction and Norm2) and CW (Carlini & Wagner).

[0090] S102, applying a perturbation attack algorithm to each original image in the original medical image set to obtain a perturbation attack image subset.

[0091] That is, the above 15 perturbation attack methods are applied to each original image, one perturbation attack method corresponds to a perturbation attack image subset, and each perturbation attack image subset contains several images attacked by the same perturbation attack method.

[0092] S103, applying an adversarial attack algorithm to each original image in the original medical image set to obtain an adversarial attack image subset, and combining the adversarial attack image subset and the perturbation attack image subset to obtain a medical attack image set.

[0093] That is, a targeted adversarial attack algorithm is applied to each original image to obtain a first subset of adversarial attack images; an untargeted adversarial attack algorithm is applied to each original image to obtain a second subset of adversarial attack images, and the second subset of adversarial attack images and the first subset of adversarial attack images are used as adversarial attack image subsets.

[0094] The adversarial attack algorithm includes five methods. These five targeted adversarial attack methods are applied to each original image to obtain five first subsets of adversarial attack images. All images in each first subset of adversarial attack images are perturbed samples formed after being attacked by the same targeted adversarial attack method.

[0095] By applying these five non-targeted adversarial attack methods to each original image, we obtain five second subsets of adversarial attack images. All images in each second subset of adversarial attack images are perturbed samples formed after being attacked by the same non-targeted adversarial attack method.

[0096] The targeted FGSM attack method is as follows:

[0097] like Figure 3 As shown, the original image is input to the AI ​​model ( Figure 3The prediction result of the AI ​​model output is obtained by using the neural network model in the above example. Set a false target and calculate the prediction result and the false target lab e l, and use the difference as the loss rate of the AI ​​model. Backpropagate through the loss rate to calculate the gradient of the AI ​​model, take the sign of the gradient and multiply it by the step size λ to get the adversarial perturbation. Add the adversarial perturbation to the original image, and you will get an image in the first subset of the adversarial attack images, that is, you will get an adversarial sample for testing the AI ​​model.

[0098] FGSM generates adversarial perturbations based on the maximum direction of gradient change in the deep learning model, simulating the scenario when the AI ​​model is attacked by hackers.

[0099] For example, if the AI ​​model is an image segmentation model, the actual segmentation result corresponding to the original image is the lesion area, and the false target is set as the non-lesion area. The original image is input into the image segmentation model, and the image segmentation model outputs a segmentation result. The segmentation result is compared with the non-lesion area to obtain the loss rate of the image segmentation model.

[0100] Non-targeted FGSM attack method: Calculate the difference between the predicted result and the real target (for example, the real target mentioned above is the lesion area), and use the difference as the loss rate of the AI ​​model. The other steps are the same as the targeted steps.

[0101] Targeted PGD attacks are as follows:

[0102] like Figure 4 As shown in the figure, the adversarial sample is initialized, a target label for attack is obtained, and a loop is entered. In each loop, the loss rate composed of the adversarial sample and the target label is calculated, and the gradient propagated to the adversarial sample is back-propagated and calculated; in each loop, the gradient is signed and multiplied by the learning rate ε to obtain the adversarial perturbation, and the adversarial sample is updated; the adversarial sample is compared with the original image to limit the size of the perturbation; the updated perturbation is superimposed on the original image to obtain the final adversarial sample.

[0103] PGD ​​(Projected Gradient Descent) can be seen as a multi-step variant of FGSM. It performs multiple iterations, and each iteration limits the perturbation to a specified range and generates adversarial samples.

[0104] Targeted MIM attacks are as follows:

[0105] like Figure 5As shown, the adversarial sample and momentum are initialized, a target label for attack is obtained, and a loop is entered. The process of each loop is as follows: the loss rate of the adversarial sample and the target label is calculated, backpropagation is performed and the gradient propagated to the adversarial sample is calculated; the gradient is superimposed on the historical gradient and multiplied by the weight ω for update, and the updated gradient continues to be stored in the historical gradient; in each loop, the gradient is signed and multiplied by the learning rate ε to obtain the adversarial perturbation, and the adversarial sample is updated; the adversarial sample is compared with the original image to limit the perturbation size; the updated perturbation is superimposed on the original image to obtain the final adversarial sample.

[0106] Targeted CW attacks are as follows:

[0107] like Figure 6 As shown in the figure, a target label for attack is obtained, and the target image is superimposed with the optimization function; a loop is entered, and the process of each loop is as follows: the L2 distance and the total loss rate of the forward propagation are calculated; the gradient of the optimization function is calculated by backpropagation; the Adam optimizer is used for optimization to obtain the adversarial perturbation; the adversarial perturbation is superimposed with the original image to obtain the final adversarial sample.

[0108] The targeted DDN attack method is as follows:

[0109] like Figure 7 As shown, the adversarial sample and step size λ are initialized to obtain a target label for attack; the loop is entered, and the process of each loop is as follows: adjust the step size λ using the cosine annealing strategy; calculate the loss rate of the adversarial sample and the target label, backpropagate and calculate the gradient propagated to the adversarial sample; normalize the gradient with the L2 norm; update the perturbation superimposed gradient of each loop multiplied by the step size λ; and clip the perturbation to the valid range.

[0110] In the above-mentioned embodiment 1, 15 disturbance attack modes form 15 disturbance attack image subsets, 5 targeted adversarial attacks form 5 adversarial attack image first subsets, and 5 non-targeted adversarial attacks form 5 adversarial attack image second subsets. Based on embodiment 1, step 200 includes the following specific steps:

[0111] The AI ​​model is tested with 15 perturbation attack image subsets, 5 adversarial attack image first subsets, and 5 adversarial attack image second subsets to obtain the second prediction accuracy of the AI ​​model; the AI ​​model is tested with the original medical image set (that is, images without perturbation attack) to obtain the first prediction accuracy of the AI ​​model. The test result obtained by the first prediction accuracy and the second prediction accuracy is the test result in step S300.

[0112] In the second embodiment, step S100 includes the following specific steps: setting various intensity values ​​for the image attack algorithm, and determining each attack image sample formed by each original image when the image attack algorithm attacks with each of the intensity values, so as to obtain each attack image sample subset corresponding to each intensity value, and the set formed by the attack image sample subsets corresponding to all the intensity values ​​is used as the medical attack image set.

[0113] When the image attack algorithm is translation transformation, the intensity value is the horizontal movement distance and the vertical movement distance. When the image attack algorithm is rotation, the intensity value is the rotation angle. When the image attack algorithm is scaling, the intensity value is the scaling ratio. When the image attack algorithm is distortion, the intensity value is the distortion degree. When the image attack algorithm is brightness change, the intensity value is the brightness value. When the image attack algorithm is contrast adjustment, the intensity value is the contrast value of the image. When the image attack algorithm is color cast adjustment, the intensity value is the number of blue pixels, green pixels, or red pixels. When the image attack algorithm is saturation adjustment, the intensity value is the saturation of the image. When the image attack algorithm is Gaussian blur, the intensity value is the Gaussian kernel blur degree of the image. When the image attack algorithm is motion blur, the intensity value is the running blur degree of the image. When the image attack algorithm is JPEG blur, the intensity value is the distortion degree of the codec. When the image attack algorithm is pixelation blur, the intensity value is the distortion degree of the image after multiple scaling. When the image attack algorithm is Gaussian noise, the intensity value is the size of the Gaussian distribution value. When the image attack algorithm is speckle noise, the intensity value is the size of random noise. When the image attack algorithm is ELD noise, the intensity value is the size of various types of noise. When the image attack algorithm is FGSM, the intensity value is the size of the step size λ. When the image attack algorithm is PGD, the intensity value is the number of different iterative updates. When the image attack algorithm is MIM, the intensity value is the number of different iterative updates. When the image attack algorithm is CW, the intensity value is the number of different iterative updates. When the image attack algorithm is DDN, the intensity value is the number of different iterative updates.

[0114] Based on the second embodiment, step S200 includes the following specific steps S201 and S202:

[0115] S201, determine the model category of the AI ​​model, and determine the accuracy calculation formula of the AI ​​model based on the model category.

[0116] Model categories include classification models, segmentation models, and detection models. The accuracy calculation formula of the classification model is Accuracy:

[0117]

[0118] Wherein, TP (True Positive): the number of times that an example is actually a positive example and is also judged to be a positive example, that is, the number of times it is judged to be a positive example and the judgment is correct; FP (False Positive): the number of times that an example is actually a negative example and is judged to be a positive example, that is, the number of times it is judged to be a positive example but the judgment is wrong; TN (True Negative): the number of times that an example is actually a negative example and is also judged to be a negative example, that is, the number of times it is judged to be a negative example and the judgment is correct; FN (False Negative): the number of times that an example is actually a positive example and is judged to be a negative example, that is, the number of times it is judged to be a negative example but the judgment is wrong.

[0119] The accuracy calculation formula of the segmentation model is Sorenson-Dice coefficient DICE:

[0120]

[0121] Where ture is the gold standard, that is, the image of the theoretical segmentation result; pred is the predicted segmentation result image.

[0122] The accuracy calculation formula of the detection model is the mean average precision mAP:

[0123]

[0124] Where AP i is the average precision of image detection.

[0125] S202, using each image of each attack image sample subset corresponding to each intensity value to test the AI ​​model, and calculating the second prediction accuracy of the AI ​​model corresponding to each intensity value through the accuracy calculation formula.

[0126] For example, the same image attack algorithm has eight intensity values. Use the image attack algorithm with each intensity value to attack each original image in the original medical image set. Then one intensity value will produce an attack image sample subset, and eight intensity values ​​will produce eight attack image sample subsets. Using each attack image sample subset to test the AI ​​model will produce a second prediction accuracy rate, and eight attack image sample subsets will produce eight second prediction accuracy rates.

[0127] In the second embodiment, based on step S201 and step S202, step S300 includes the following specific steps S301 to S307:

[0128] S301, calculating the L1 norm distance between the second prediction accuracy and the first prediction accuracy, and determining the flatness score of the AI ​​model for the image attack algorithm based on the L1 norm distance.

[0129] S302: Determine a safety threshold of the AI ​​model based on the first prediction accuracy.

[0130] In this embodiment, Figure 8 As shown, the first prediction accuracy as a safety threshold.

[0131] S303: compare all the second prediction accuracy rates with the safety threshold, and select a preferred accuracy rate from all the second prediction accuracy rates.

[0132] Continuing with the above example, the same image attack algorithm is used to attack the original medical image set to obtain a medical attack image set. The strength of the image attack algorithm is changed, and each strength corresponds to a medical attack image set. Eight strengths (eight is the total number of strengths) correspond to eight medical attack image sets. Using these eight medical attack image sets to test the AI ​​model, eight second prediction accuracy rates will be obtained. The second prediction accuracy rates with eight second prediction accuracy rates greater than the safety threshold are selected as the preferred accuracy rates.

[0133] S304: Count the number of the intensity values ​​corresponding to the preferred accuracy, and divide the number by the second prediction accuracy to obtain an extreme value score.

[0134] Continuing with the above example, if the number of preferred accuracy rates is six, that is, the number of strength values ​​corresponding to the preferred accuracy rates is six.

[0135] S305 : Add the extreme value score corresponding to each of the image attack algorithms and the flatness score corresponding to each of the image attack algorithms to obtain a test sub-score corresponding to each of the image attack algorithms.

[0136] like Figure 8 As shown, the flatness score plus the extreme value score is the test result. The test result of this embodiment is the test result of the AI ​​model for an image attack algorithm.

[0137] S306: Perform weighted calculation on the test sub-scores corresponding to all the image attack algorithms to obtain a total test score, and use the total test score as the test result of the AI ​​model.

[0138] Image attack algorithms include geometric transformation, color transformation, blur attack, noise attack, targeted adversarial attack, and non-targeted adversarial attack. Geometric transformation includes translation transformation, rotation transformation, scaling transformation, and distortion transformation. Color transformation includes brightness transformation, contrast transformation, color cast transformation, and saturation transformation. Blur attack includes Gaussian blur, motion blur, JPEG blur, and pixel blur. Noise attack includes Gaussian noise, speckle noise, and ELD noise. Targeted adversarial attack includes targeted FGSM, targeted PGD, targeted MIM, targeted DDN, and targeted CW. Non-targeted adversarial attack includes non-targeted FGSM, non-targeted PGD, non-targeted MIM, non-targeted DDN, and non-targeted CW. , rotation transformation, scaling transformation, distortion transformation, brightness transformation, contrast transformation, color cast transformation, saturation transformation, Gaussian blur, motion blur, JPEG blur, pixelation blur, Gaussian noise, speckle noise, ELD noise, FGSM with target, PGD with target, MIM with target, DDN with target, CW with target, FGSM without target, PGD without target, MIM without target, DDN without target, and CW without target have corresponding weights of 1 / 4, 1 / 4, 1 / 4, 1 / 4, 1 / 4, 1 / 4, 1 / 4, 1 / 4, 1 / 4, 1 / 4, 1 / 4, 1 / 3, 1 / 3, 1 / 3, 1 / 5, 1 / 5, 1 / 5, 1 / 5, 1 / 5, 1 / 5, 1 / 5, 1 / 5, 1 / 5, 1 / 5, and 1 / 5 respectively.

[0139] S307: Obtain a test result of the AI ​​model according to the flatness score and the extreme value score.

[0140] In the third embodiment, the medical imaging AI model testing method is applied to the RobustMIA Pro medical imaging AI security testing software, where the testing method is located in the algorithm evaluation section and the result section of the testing software. The algorithm evaluation section is used to generate the data set required for the test, and the result section is used to generate the test results. In addition to the algorithm evaluation section, the testing software Fig. 9 , also includes a test section and a user use section. Among them, the functions of the test section include selecting the model type, obtaining the data set and model, and the IP address of the test device. The software provides three model categories: classification, segmentation, and detection. Users can select the model category to be tested according to their test needs. The test software supports users to upload data sets for user test models. The test software supports users to connect to the server to remotely test the model to increase the test speed. The user use section includes a user guide and viewing results. In the user guide, we provide users with detailed tutorials on model packaging and data packaging. In viewing results, users can view and export the model security test results to compare the performance and progress of the model.

[0141] Embodiment 4, this embodiment provides a method for using the software in embodiment 3, comprising the following steps:

[0142] 1. Double-click the RobustMIA Pro.exe file to enter the software. The software will enter by default. Fig.10 The RobustMIA Pro home page is shown.

[0143] 2. Click Fig.11 The following is the "View User Guide" button on the home page (or the "View Results" button on the far left of the interface), which pops up the following Fig.12 The user guide web page shown.

[0144] 3. Return to the home page and click the "Start Test" or "Login" button (or the "Test Center" button on the far left of the interface) to enter the Test Center interface.

[0145] 4. Select the model type to be tested, such as Fig.13 As shown, currently three types of models, classification, segmentation and detection, are supported for testing.

[0146] 5. If Fig.14 As shown, upload the model file and data file, and click the "Enter Test" button to start the test.

[0147] 6. Wait for the test process, such as Fig.15 As shown, the real-time progress bar above shows the test progress, and the dynamic wheel-style loading animation below shows the test items. After all test processes are completed, the test result interface will jump to display the test report.

[0148] 7. If Fig.16 As shown in the figure, the test result interface displays the total test score, radar chart, and scatter fit chart. The radar chart shows the overall score of the model test and the approximate composition of the extreme value score. When the mouse moves to the radar chart, the specific score of each test item can be viewed. The user can understand the overall security of the model through the radar chart.

[0149] 8. Swipe down in the test result interface to view the scatter point fitting graph ( Figures 17 to 20 is a scatter plot, where Fig.17 The security change of the model under the attack method of Gaussian fuzzy is shown in Figure 2. Fig.18 The security of the model changes under the attack method of motion blur. Fig.19 In order to compress the security changes of the model under this attack method, Fig. 20 The scatter plot shows the changes in model security under 36 attack methods in detail as a supplement to the information. Figures 17 to 20The points in the figure represent the original image, and the vertical axis represents the evaluation index under different disturbance intensities; the broken line is the curve generated by fitting each original data; the shaded area is the original data where the evaluation index drops by more than 50%. Users can understand which attack method has a greater impact on their model through the scatter point fitting graph.

[0150] 9. If Fig.21 Click the "View Results" button on the far left of the interface to enter the View Results interface. Users can view the history of model tests. The software displays the model name, model score, test time, and test ID of the model test by model type (classification, segmentation, detection). Click one of the results and then click the "View Results" button to export the corresponding test result page to view the specific test score, radar chart, and scatter fit chart.

[0151] In summary, the software of the present invention designs the RobustMIA Pro home page, user guide interface, test center interface, test result interface and result viewing interface.

[0152] Among them, the RobustMIA Pro homepage provides information about the software introduction and function introduction. Users can learn about the basic situation of the platform by sliding and browsing; the user guide interface is a separate webpage that introduces the software test file packaging process in detail to users; the test center interface has operation steps at the top to guide users to test, and different sub-interfaces have different buttons for users to set parameters (select model type, upload model files, data files, set remote host IP) and return to the homepage. The test progress sub-interface has a real-time progress bar for the test progress and a dynamic wheel-style loading animation for the test items, waiting for the test progress; the test result interface displays a radar chart and a scatter-fitting chart of the user's test score, objectively displaying the model test results.

[0153] This embodiment also provides a medical imaging AI model testing device, such as Fig. 22 As shown, the device comprises:

[0154] The attack image generation module 01 is used to collect an original medical image set and apply an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set;

[0155] Testing module 02, used to test the AI ​​model using each original image in the original medical image set to obtain a first prediction accuracy of the AI ​​model; and to test the AI ​​model using each image in the medical attack image set to obtain a second prediction accuracy of the AI ​​model;

[0156] The test result calculation module 03 is used to obtain the test result of the AI ​​model according to the first prediction accuracy and the second prediction accuracy.

[0157] Based on the above embodiments, the present invention further provides a terminal device, whose principle block diagram can be shown as follows: Fig.23 As shown. The terminal device includes a processor, a memory, a network interface, and a display screen connected via a system bus. Among them, the processor of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a medical imaging AI model testing method is implemented. The display screen of the terminal device can be a liquid crystal display screen or an electronic ink display screen.

[0158] Those skilled in the art will understand that Fig.23 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal device to which the scheme of the present invention is applied. The specific terminal device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0159] In one embodiment, a terminal device is provided, the terminal device comprising a memory, a processor, and a medical imaging AI model test program stored in the memory and executable on the processor, and when the processor executes the medical imaging AI model test program, the following operation instructions are implemented:

[0160] Collecting an original medical image set, and applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set;

[0161] Using each original image in the original medical image set to test the AI ​​model to obtain a first prediction accuracy of the AI ​​model; using each image in the medical attack image set to test the AI ​​model to obtain a second prediction accuracy of the AI ​​model;

[0162] The test result of the AI ​​model is obtained based on the first prediction accuracy and the second prediction accuracy.

[0163] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A medical imaging AI model testing method, characterized in that: include: Collecting an original medical image set, and applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set; Using each original image in the original medical image set to test the AI ​​model to obtain a first prediction accuracy of the AI ​​model; using each image in the medical attack image set to test the AI ​​model to obtain a second prediction accuracy of the AI ​​model; The test result of the AI ​​model is obtained based on the first prediction accuracy and the second prediction accuracy.

2. The medical imaging AI model testing method according to claim 1, characterized in that: The applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set includes: Determine a perturbation attack algorithm and a confrontation attack algorithm in the image attack algorithm; Applying a perturbation attack algorithm to each original image in the original medical image set to obtain a perturbation attack image subset; An adversarial attack algorithm is applied to each original image in the original medical image set to obtain an adversarial attack image subset, and the adversarial attack image subset and the perturbation attack image subset are combined to obtain a medical attack image set.

3. The medical imaging AI model testing method according to claim 2, characterized in that: The method of applying an adversarial attack algorithm to each original image in the original medical image set to obtain an adversarial attack image subset includes: Applying a targeted adversarial attack algorithm to each original image to obtain a first subset of adversarial attack images; A non-targeted adversarial attack algorithm is applied to each original image to obtain a second subset of adversarial attack images, and the second subset of adversarial attack images and the first subset of adversarial attack images are used as adversarial attack image subsets.

4. The medical imaging AI model testing method according to claim 1, characterized in that: The applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set includes: Various intensity values ​​are set for the image attack algorithm, and each attack image sample formed by each original image under the attack of the image attack algorithm with each of the intensity values ​​is determined to obtain each attack image sample subset corresponding to each intensity value, and the set formed by the attack image sample subsets corresponding to all the intensity values ​​is used as the medical attack image set.

5. The medical image AI model testing method according to claim 4, characterized in that: The using each image in the medical attack image set to test the AI ​​model to obtain a second prediction accuracy of the AI ​​model includes: Determine the model category of the AI ​​model, and determine the accuracy calculation formula of the AI ​​model based on the model category; The AI ​​model is tested using each image of each attack image sample subset corresponding to each intensity value, and the second prediction accuracy of the AI ​​model corresponding to each intensity value is calculated using the accuracy calculation formula.

6. The medical image AI model testing method according to claim 5, characterized in that: The step of obtaining a test result of the AI ​​model according to the first prediction accuracy and the second prediction accuracy includes: Calculating an L1 norm distance between the second prediction accuracy and the first prediction accuracy, and determining a flatness score of the AI ​​model for the image attack algorithm based on the L1 norm distance; Determining a safety threshold of the AI ​​model according to the first prediction accuracy; Compare all the second prediction accuracy rates with the safety threshold, and select a preferred accuracy rate from all the second prediction accuracy rates; Counting the number of the intensity values ​​corresponding to the preferred accuracy, and dividing the number by the second prediction accuracy to obtain an extreme value score; The test result of the AI ​​model is obtained according to the extreme value score and the flatness score.

7. The medical image AI model testing method according to claim 6, characterized in that: The test result of the AI ​​model is obtained according to the extreme value score and the flatness score, including: Adding the extreme value score corresponding to each of the image attack algorithms and the flatness score corresponding to each of the image attack algorithms to obtain a test sub-score corresponding to each of the image attack algorithms; The test sub-scores corresponding to all the image attack algorithms are weighted to obtain a total test score, and the total test score is used as the test result of the AI ​​model.

8. A medical imaging AI model testing device, characterized in that: The device comprises the following components: An attack image generation module, used for collecting an original medical image set, and applying an image attack algorithm to each original image in the original medical image set to obtain a medical attack image set; A testing module, configured to test the AI ​​model using each original image in the original medical image set to obtain a first prediction accuracy of the AI ​​model; Testing the AI ​​model using each image in the medical attack image set to obtain a second prediction accuracy of the AI ​​model; A test result calculation module is used to obtain the test result of the AI ​​model based on the first prediction accuracy and the second prediction accuracy.

9. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a medical imaging AI model testing program stored in the memory and executable on the processor. When the processor executes the medical imaging AI model testing program, the steps of the medical imaging AI model testing method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a medical imaging AI model testing program. When the medical imaging AI model testing program is executed by the processor, the steps of the medical imaging AI model testing method as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Robustness evaluation method and device for deep learning model and storage medium

    CN110222831A

  • Transferable image adversarial sample generation and deep neural network test method and system

    CN114741310A

  • Medical image deep learning model stability test platform and test method

    CN117237762A