A method and system for correcting CT artifacts of magnesium alloy implants based on paired images

CN122928632APending Publication Date: 2026-10-16JINLIN MEDICAL COLLEGE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611093454.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

与传统钛合金、不锈钢等不可降解金属相比,镁合金植入物的CT伪影相对较低,但在植入早期、残余降解阶段或植入物周围结构观察时,仍可能对局部影像质量造成影响

Benefits of technology

[0010]This invention also provides a system corresponding to the above method, including a paired sample library, a target artifact evidence generation unit, a sample matching unit, a residual prior transfer unit, a consistency weight generation unit, an artifact residual estimation unit, and a corrected image generation unit. The units work collaboratively in the order of paired sample invocation, residual prior transfer, consistency verification, and artifact residual estimation to achieve artifact correction of the CT image to be corrected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928632A_ABST
    Figure CN122928632A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of medical image processing, and discloses a magnesium alloy implant CT artifact correction method and system based on paired images. The method comprises the following steps: a paired sample library composed of CT images before magnesium alloy implant degradation and corresponding CT images after degradation is established, paired residual priors are generated through registration, resampling, CT value difference calculation and artifact influence area screening; target artifact evidence information of a to-be-corrected CT image is generated, and the target artifact evidence information is matched with the CT images before degradation in the sample library to determine a matched sample group; the paired residual priors are migrated to the to-be-corrected image space, consistency checking is performed in combination with the target artifact evidence, and residual consistency weights are generated; and magnesium alloy artifact residual information is estimated and a corrected image is generated according to the residual consistency weights. The scheme can reduce magnesium alloy implant related artifacts, reduce over-correction caused by false reference, and maintain local tissue structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing technology, specifically to a method and system for CT artifact correction of magnesium alloy implants based on paired images. Background Technology

[0002] Computed tomography (CT) imaging can obtain tomographic images of internal human tissues and is widely used in orthopedic implant follow-up, implant evaluation, bone repair observation, and lesion auxiliary analysis. For examination sites containing metal implants, the strong attenuation effect of metal materials on X-rays can easily cause beam hardening, photon starvation, and scattering, resulting in striped, bright, or dark metallic artifacts in CT images. These artifacts can obscure the surrounding bone, soft tissue, and lesion area, causing deviations in local CT values ​​and tissue boundaries, affecting the reliability of image observation and quantitative analysis.

[0003] Currently, CT metal artifact correction methods mainly include projection domain correction, image domain correction, dual-domain correction, iterative reconstruction, and deep learning-based image restoration methods. Projection domain methods typically reduce artifacts by identifying metal trajectories and repairing contaminated projection data, but they are prone to secondary artifacts due to discontinuous or non-accurate data completion. Image domain methods are more flexible, but may result in blurred tissue structures, loss of detail, or over-smoothing in complex artifact areas. While deep learning methods have strong image restoration capabilities, they usually rely on large amounts of high-quality training data, especially paired data between artifact-laden images and low-artifact or artifact-free images, which is difficult to obtain in clinical practice.

[0004] Magnesium alloy implants, due to their biodegradable properties, have been increasingly used in absorbable orthopedic implants and bone repair applications. Compared to traditional non-biodegradable metals such as titanium alloys and stainless steel, magnesium alloy implants exhibit relatively lower CT artifacts. However, they can still affect local image quality in the early stages of implantation, during residual degradation, or when observing structures surrounding the implant. Furthermore, the degradation process of magnesium alloy implants results in changes in residual volume, residual morphology, and the state of surrounding bone tissue, leading to variations in both artifacts and real tissue changes in CT images at different stages. Existing general metal artifact correction methods often do not adequately consider the biodegradable process of magnesium alloy implants and the phased image differences, resulting in issues such as insufficient utilization of reference information, unstable artifact identification, miscorrection of real structures, or insufficient reliability of correction results. Summary of the Invention

[0005] The present invention aims to provide a method and system for CT artifact correction of magnesium alloy implants based on paired images, which is used to improve the CT image quality of magnesium alloy implants or residual magnesium alloy implants and reduce the influence of striped, bright or dark band artifacts around magnesium alloy implants on bone tissue, soft tissue and local observation area.

[0006] This invention leverages the biodegradability of magnesium alloy implants by pre-establishing a paired sample library consisting of pre-degradation CT images and corresponding post-degradation CT images. For each paired sample, instead of simply using the post-degradation CT image as an artifact-free label, the post-degradation CT image is first registered to the coordinate space of the pre-degradation CT image. Then, the CT value difference between the two is calculated, and the artifact-affected areas are used for screening to extract the paired residual prior that reflects the artifact variation characteristics of magnesium alloys.

[0007] When processing new CT images to be corrected, this invention first extracts target artifact evidence information from the images, including information such as the location of magnesium alloy implants or residual magnesium alloy regions, artifact influence locations, artifact directions, and artifact intensities. Subsequently, the CT image to be corrected is matched with pre-degradation CT images in a paired sample library, prioritizing paired sample groups that are similar in anatomical contours, magnesium alloy region locations, and artifact distribution. Through these matched sample groups, the corresponding paired residual priors are transferred to the CT image space to be corrected, forming transferred residual priors.

[0008] Furthermore, this invention does not directly subtract the migration residual prior as an artifact in the image to be corrected. Instead, it performs a consistency check between the migration residual prior and the target artifact evidence information generated by the CT image itself to be corrected. Specifically, a residual consistency weight is generated by combining the consistency between the two in artifact location, artifact direction, and artifact intensity. This residual consistency weight is used to characterize the credibility of the migration residual prior in different local regions of the CT image to be corrected.

[0009] In regions with high residual consistency, the migration residual prior can serve as a strong basis for correction; in regions with low residual consistency, its impact on artifact residual estimation is reduced. For locations with both low consistency and exhibiting characteristics of structures to be preserved, this invention can further suppress the migration residual prior to reduce miscorrection of bony edges, local textures, or non-artifact structures. Finally, based on the CT image to be corrected, target artifact evidence information, migration residual prior, and residual consistency weights, magnesium alloy artifact residual information in the CT image to be corrected is estimated, and the CT image to be corrected is then corrected according to this artifact residual information to obtain the corrected image.

[0010] This invention also provides a system corresponding to the above method, including a paired sample library, a target artifact evidence generation unit, a sample matching unit, a residual prior transfer unit, a consistency weight generation unit, an artifact residual estimation unit, and a corrected image generation unit. The units work collaboratively in the order of paired sample invocation, residual prior transfer, consistency verification, and artifact residual estimation to achieve artifact correction of the CT image to be corrected.

[0011] Compared to existing technologies, this invention utilizes real paired CT images formed before and after the degradation of magnesium alloy implants to extract paired residual priors reflecting artifact changes. This ensures that the correction is based on the actual degradation process, rather than simulated artifacts or ordinary templates. In the application phase, this invention transfers the corresponding residual priors by matching the image to be corrected with pre-degradation images in the paired sample library, and combines this with artifact evidence information from the image to be corrected itself for consistency verification. This improves the specificity of artifact residual estimation and reduces the risk of incorrect references and overcorrection.

[0012] This invention uses artifact residual information to correct the CT image to be corrected, rather than directly replacing the entire image. This helps to preserve the bony structure, soft tissue boundaries, and local texture in non-artifact areas. This method is suitable for CT image processing in the early stages of magnesium alloy implantation, the middle stages of degradation, and when residual magnesium alloy still produces local artifacts. It can be used for postoperative follow-up, implantation evaluation, bone repair observation, and related auxiliary analysis. Attached Figure Description

[0013] Figure 1 This is a flowchart of the CT artifact correction method for magnesium alloy implants in an embodiment of the present invention; Figure 2 This is a schematic diagram of the CT artifact correction system for magnesium alloy implants in an embodiment of the present invention; Figure 3 This is a schematic diagram comparing CT images of the hip and proximal femur magnesium alloy implants before degradation and corresponding CT images after degradation in an embodiment of the present invention, wherein the left side is... Figure 3 a, the right side is Figure 3 b; Figure 4 This is a schematic diagram comparing the CT image to be corrected with the pre-degradation CT image obtained by matching in the paired sample library in an embodiment of the present invention, wherein the left side is... Figure 4 a, the right side is Figure 4 b; Figure 5 This is a schematic diagram comparing the CT image to be corrected and the corrected image in an embodiment of the present invention, wherein the left side is... Figure 5 a, the right side is Figure 5 b. Detailed Implementation

[0014] The technical solution of the present invention will be described below with reference to the embodiments.

[0015] Magnesium alloy implants may exhibit streaks, bright bands, or dark bands in CT images during the early implantation stage or the residual degradation phase. These artifacts can easily obscure surrounding bone, soft tissue, or lesion areas, affecting the visualization of local structures and the interpretation of CT values. Conventional image domain correction methods typically rely on inferences based solely on the image to be corrected, which can lead to insufficient artifact removal or unintended modification of non-artifact structures. Therefore, this invention provides a method for estimating and correcting artifact residuals in CT images to be corrected.

[0016] Example 1 A method for CT artifact correction of magnesium alloy implants based on paired images, such as Figure 1 As shown, the method includes: establishing a paired sample library containing different paired sample groups, each paired sample group including a CT image of the magnesium alloy implant before degradation and a corresponding CT image after degradation; registering and resampling the degraded CT image to the coordinate space of the CT image before degradation, calculating the CT value difference map of the two images, filtering and generating paired residual priors according to the artifact influence area; acquiring the CT image to be corrected and generating target artifact evidence information; matching the CT image to be corrected with the CT image before degradation in the paired sample library to determine the matched sample group; transferring the paired residual prior of the matched sample group to the space of the CT image to be corrected to obtain the transferred residual prior; generating residual consistency weights based on the consistency verification between the transferred residual prior and the target artifact evidence information; estimating the magnesium alloy artifact residual information in the CT image to be corrected based on the transferred residual prior, the target artifact evidence information and the residual consistency weights, and correcting the CT image to be corrected to generate a corrected image.

[0017] In this embodiment, the paired sample library is used to store multiple CT image samples that have formed corresponding relationships. The pre-degradation CT image in each paired sample group refers to an image acquired before the magnesium alloy implant has completely degraded. This image typically includes the magnesium alloy implant itself, the remaining magnesium alloy area, and the local artifacts generated by it. The corresponding post-degradation CT image refers to a CT image acquired after the magnesium alloy implant has completely degraded, or after the artifacts have significantly decreased, for the same object or the same implant sample. This post-degradation CT image is not directly used to replace the image to be corrected, but rather to extract artifact change information.

[0018] For each paired sample group, the degraded CT images are first registered and resampled to the coordinate space of the pre-degradation CT images. Registration refers to aligning the bone, soft tissue, or other stable anatomical structures in the degraded CT images as closely as possible to the corresponding structures in the pre-degradation CT images. Resampling refers to regenerating the degraded CT images in the same pixel or voxel coordinates as the pre-degradation CT images, according to the registered spatial relationships. After this process, corresponding pixels or voxels in the two images are comparable.

[0019] Subsequently, the CT value difference between the pre-degradation CT image and the resampled post-degradation CT image is calculated to form a CT value difference map. This CT value difference map reflects the grayscale changes between the two CT images, but it may contain changes in magnesium alloy artifacts, tissue state changes, or registration errors. Therefore, this embodiment further filters the CT value difference map according to the artifact-affected area, retaining only the difference information related to artifacts around the magnesium alloy implant, forming a paired residual prior. This paired residual prior can be understood as the change pattern before and after artifact disappearance extracted from the paired samples.

[0020] When processing a new CT image to be corrected, target artifact evidence information is first generated from that image. This information indicates which locations, directions, and intensity variations in the image are most likely related to magnesium alloy artifacts. For example, streaks, bright bands, dark bands, and areas with significant deviations in local CT values ​​near magnesium alloy implants or residual magnesium alloy areas in the CT image can all serve as sources of target artifact evidence. This information ensures that the subsequent correction process does not solely rely on external samples but also considers the artifact characteristics displayed by the image itself.

[0021] Next, the CT image to be corrected is matched with pre-degradation CT images in the paired sample library. Matching with pre-degradation CT images is chosen here, rather than directly with post-degradation CT images, because the CT image to be corrected itself also contains magnesium alloy implants or residual magnesium alloy artifacts, making it more comparable to the pre-degradation CT images in terms of implant location, artifact distribution, and image degradation patterns. Through matching, the paired sample group closest to the CT image to be corrected can be determined.

[0022] After determining the matching sample group, the paired residual priors already generated in the matching sample group are transferred to the CT image space to be corrected. Specifically, the pre-degradation CT images in the matching sample group are first aligned with the CT image to be corrected. Then, according to this alignment, the paired residual priors are synchronously transformed into the coordinate space of the CT image to be corrected, resulting in the transferred residual priors. The transferred residual priors represent the possible residual change patterns corresponding to magnesium alloy artifacts in historical paired samples similar to the image to be corrected.

[0023] After obtaining the migration residual prior, it is not directly subtracted from the CT image to be corrected. Instead, it is compared with the target artifact evidence information for consistency verification. Consistency verification can be understood as judging whether the position, direction, and intensity indicated by the migration residual prior match the artifact evidence displayed by the image to be corrected itself. If the migration residual prior in a certain region is highly consistent with the target artifact evidence information, it indicates that the migration residual in that region is more likely to represent the real artifact component in the image to be corrected; if the consistency is low, it indicates that there may be sample mismatch, structural differences, or non-artifact changes in that region, and it is not suitable for forced correction.

[0024] Based on the consistency verification results, residual consistency weights are generated. These weights control the reliability of the transferred residual prior in different regions. Locations with higher residual consistency weights allow for greater use of the transferred residual prior when estimating magnesium alloy artifact residual information; conversely, locations with lower residual consistency weights reduce the impact of the transferred residual prior on artifact residual estimation, thereby minimizing structural misallocations caused by erroneous references.

[0025] Finally, based on the migration residual prior, target artifact evidence information, and residual consistency weights, the magnesium alloy artifact residual information in the CT image to be corrected is estimated. The magnesium alloy artifact residual information represents the artifact components in the CT image to be corrected that should be removed or suppressed. After obtaining this magnesium alloy artifact residual information, the corresponding residuals can be subtracted or suppressed from the CT image to be corrected to obtain the corrected image.

[0026] Therefore, this embodiment uses the residual prior in the paired samples and the artifact evidence of the image to be corrected itself to participate in the artifact residual estimation. This allows the transferred reference information to be verified for consistency before use, which can reduce the risk of incorrect correction caused by sample differences and improve the pertinence and stability of CT artifact correction for magnesium alloy implants.

[0027] Example 2 In the paired residual prior generation stage, each paired sample group in the paired sample library is denoted as Gi=(Bi,Ri), where Bi is the CT image before degradation of the magnesium alloy implant, and Ri is the corresponding CT image after degradation. Bi and Ri can be stored as DICOM sequences, NIfTI volume data, or three-dimensional arrays converted from DICOM sequences. To facilitate pixel-level or voxel-level calculations, the system unifies the two images within the same paired sample group to the same voxel spacing, matrix size, and CT value range. For example, Bi and Ri are both converted into three-dimensional floating-point arrays of size 512×512×N, where N represents the number of slice layers, and the array elements store the HU values ​​of the corresponding voxels.

[0028] When segmenting the magnesium alloy implant region in Bi, a combination of threshold segmentation, region growing, and morphological closing operations can be used. Specifically, the initial threshold interval is first determined based on the high grayscale response of the magnesium alloy implant in CT images to obtain the initial magnesium alloy region Mmetal_i; then, isolated connected regions with excessively small volumes are removed; finally, closing operations and hole filling are performed on the remaining connected regions to obtain a continuous magnesium alloy implant region. For samples with residual fragments in the middle of degradation, multiple spatially separated but consistent grayscale connected regions can be retained and uniformly recorded in Mmetal_i.

[0029] The artifact-affected region Mart_i is determined based on Mmetal_i and its surrounding striped, bright, or dark abnormal regions. In practice, Mmetal_i is first 3D dilated to obtain candidate surrounding regions within a radius of r1 to r2. Then, the local mean μlocal, local standard deviation σlocal, and CT value offset ΔHU relative to the distal stable tissue region are statistically analyzed within this region. If a local region satisfies a grayscale fluctuation exceeding a set threshold, or exhibits a continuous distribution of bright and dark stripes along a certain direction, it is included in Mart_i. To avoid misidentifying normal cortical bone edges as artifacts, the system may require a spatial connection between the abnormal region and Mmetal_i, or that its main extension direction is consistent with the projection direction of the magnesium alloy region.

[0030] During the registration stage, Bi serves as the reference image, and Ri serves as the image to be registered. The system selects bony structures or soft tissue contours in Bi that avoid Mart_i, and selects the region corresponding to the anatomical location in Ri as the registration reference region. In practice, rigid registration can first be used to correct overall translation and rotation, and then local deformation registration can be used to adjust for local differences at bone ends, implantation channels, or soft tissue boundaries. Rigid registration can use mutual information or normalized cross-correlation as a similarity measure, while local deformation registration can use B-spline deformation fields or optical flow-based deformation fields. After registration, Ri is resampled to the coordinate space of Bi to obtain Ri_reg.

[0031] The CT value difference map Ei is obtained by subtracting the corresponding voxels, expressed as: Ei(x) = Bi(x) - Ri_reg(x). Here, x represents the pixel or voxel position in the Bi coordinate space; Bi(x) represents the CT value of the CT image at position x before degradation; Ri_reg(x) represents the CT value of the CT image at position x after registration and degradation. This difference map may simultaneously contain artifact changes, local bone repair changes, and registration errors, therefore it cannot be directly used as a basis for subsequent correction. The system uses Mart_i to filter Ei, obtaining the paired residual prior Di, which can be expressed as: Di(x) = Mart_i(x) × Ei(x). Here, Mart_i(x) represents the mask value or weight value of the artifact-affected area at position x; when Mart_i(x) is 1 or higher, the positional difference information is retained; when Mart_i(x) is 0 or lower, the positional difference information is suppressed.

[0032] like Figure 3 As shown, Figure 3 a. CT image of the magnesium alloy implant in the hip and proximal femur before degradation. High grayscale area of ​​screw-like implant is visible, with striped, bright and dark abnormalities forming around the implant. Figure 3 b shows the degraded CT images at the same scale and observation range. The high-grayscale area of ​​the implant has significantly disappeared or weakened, and only low-contrast image changes related to the implantation channel, bony repair, or local tissue reconstruction are visible. The surrounding striped artifacts have also weakened. Through analysis of... Figure 3 a and Figure 3 b performs registration, resampling, CT value difference calculation, and artifact influence region screening, which can extract the paired residual prior reflecting the changes in magnesium alloy artifacts from the paired sample.

[0033] Table 1 provides an example of the data fields that can be stored in a paired sample library. The sample number is used for retrieval; the Bi and Ri paths are used to locate image data before and after degradation; Mmetal_i stores the magnesium alloy region; Mart_i stores the artifact-affected region; and Di stores the paired residual prior. This data organization allows for direct retrieval of the corresponding paired residual prior after subsequent image matching to be corrected, without needing to recalculate the differences of the entire paired sample group.

[0034] Table 1: Examples of engineering fields for a set of samples in the paired sample library Example 3 The evidence of target artifacts in the CT image to be corrected is generated as follows. The CT image to be corrected is denoted as T, which can be three-dimensional CT volume data obtained from current clinical follow-up, or an image sequence composed of several consecutive two-dimensional slices. After preprocessing T, the system obtains a normalized data form with spatial dimensions consistent with the paired sample library or comparable to it. For example, T is converted into a floating-point HU array, and metadata such as pixel spacing, slice thickness, reconstruction kernel, and scan time from the original DICOM is recorded.

[0035] First, the system identifies the magnesium alloy implant region or residual magnesium alloy region Mmetal_T within T. A common implementation uses threshold segmentation combined with connected component filtering. For intact implants, the system typically obtains a continuous high-grayscale region; for residual magnesium alloy in the mid-to-late stages of degradation, multiple small connected components may be obtained. To avoid misidentifying high-density cortical bone regions, filtering can be performed based on region morphology characteristics, such as retaining elongated, screw-shaped, or connected components close to known implant locations, while excluding large areas continuously connected to normal cortical bone.

[0036] Subsequently, the system determines the candidate artifact region Acand_T centered on Mmetal_T. The candidate artifact region can be obtained by spatially expanding Mmetal_T, for example, by multi-layer expansion in three-dimensional space with a radius of 5 to 30 voxels to form a strong proximal candidate region and a weak distal candidate region; it can also be expanded along the possible propagation direction of the stripes, so that the candidate region covers the bright bands, dark bands, and stripe-like anomalies around the implant. For two-dimensional slicing, annular or fan-shaped candidate regions can be generated around Mmetal_T within each slice.

[0037] Within the candidate artifact region, the system calculates local CT value anomalies, grayscale fluctuation amplitude, stripe distribution, bright band distribution, and dark band distribution. Local CT value anomalies can be determined by the difference between the voxel HU value within the candidate region and the mean value of the distal stable tissue region; grayscale fluctuation amplitude can be represented by the local window standard deviation or local range; stripe distribution can be obtained by directional filters, Hessian matrix principal direction, or linear structure enhancement filtering; bright bands and dark bands can be obtained from continuous regions that are locally higher or lower than the background mean, respectively.

[0038] The target artifact evidence information ET consists of the artifact location PT, artifact direction ΘT, and artifact intensity IT. The artifact location PT can be stored as a binary map or a probability map; the artifact direction ΘT can be stored as the principal orientation angle of each artifact region or as the orientation field of each voxel; the artifact intensity IT can be stored as a normalized intensity map. For example, for a connected artifact region, the system can calculate its major axis direction as the artifact direction for that region, and use the weighted value of the CT value deviation and grayscale fluctuation amplitude within that region as the artifact intensity.

[0039] The target artifact evidence information is not the final correction result, but rather the target-side basis for subsequent sample matching, residual consistency verification, and residual estimation. Its purpose is to indicate the artifact evidence already displayed in the image to be corrected, preventing the system from blindly subtracting artifacts based solely on prior residuals from external paired samples. This information can be stored in a multi-channel array format; for example, the first channel might be the artifact location probability map, the second channel the cosine of the artifact orientation angle, the third channel the sine of the artifact orientation angle, and the fourth channel the artifact intensity map.

[0040] In practical systems, the target artifact evidence generation unit can be deployed as a combination of rule-based algorithms and shallow convolutional networks. The rule-based algorithm is responsible for identifying obvious magnesium alloy regions and high-confidence candidate regions, while the convolutional network is responsible for identifying striped, bright, or dark band anomalies. The output target artifact evidence information has the same spatial dimensions as T, facilitating subsequent pixel-by-pixel or voxel-by-voxel consistency verification with the transfer residual prior.

[0041] Example 4 The CT image to be corrected, T, is matched with pre-degradation CT images, Bi, from the paired sample library using a two-stage process of initial screening and secondary screening. Since T itself contains magnesium alloy implants or residual magnesium alloy artifacts, it is more suitable to compare it with Bi, which is also in a pre-degradation or artifact-containing state, rather than directly with the post-degradation image, Ri.

[0042] Before the initial screening, the system generates sample artifact evidence information Ei_sample for each Bi in the paired sample library, following the method described in Example 3. The sample artifact evidence information also includes the sample artifact location, sample artifact direction, and sample artifact intensity. This calculation can be pre-completed offline, and the results can be saved along with each paired sample group to reduce the computational load during online matching.

[0043] The initial screening stage is mainly used to exclude samples with significant differences in anatomical location or obvious inconsistencies in implant position. The system calculates the bony contour similarity (Sbone), magnesium alloy implant region position similarity (Spos), and magnesium alloy implant region area similarity (Sarea) between T and each Bi region. Bony contour similarity can be calculated using the Dice coefficient of the bone tissue segmentation mask, Hausdorff distance, or contour cross-correlation; position similarity can be calculated using the normalized distance between the centroids of two magnesium alloy regions; and area similarity can be calculated using the relative difference in area or volume between two magnesium alloy regions.

[0044] The initial screening score can be expressed as: Sinitial = α1·Sbone + α2·Spos + α3·Sarea. Where Sinitial represents the initial screening score; Sbone represents the similarity of the bony contour; Spos represents the similarity of the magnesium alloy implant region's location; Sarea represents the similarity of the magnesium alloy implant region's area; and α1, α2, and α3 are weighting coefficients. The system retains samples with Sinitial scores higher than a threshold as candidate sample groups, or retains the top K samples sorted by Sinitial score as candidate sample groups. The purpose of this step is to ensure that the candidate samples have basic transferability with T in terms of anatomical contour and spatial distribution of the magnesium alloy region.

[0045] In the secondary screening stage, the target artifact evidence information ET is compared with the sample artifact evidence information Ei_sample corresponding to the candidate sample group. The system calculates the artifact position overlap degree Sooverlap, artifact orientation consistency degree Sdir, and artifact intensity normalized difference Dint. The artifact position overlap degree can be obtained by using the cross-union ratio of the two artifact position masks; the artifact orientation consistency degree can be determined by the cosine value of the angle between the principal directions; and the artifact intensity normalized difference can be obtained by normalizing the average absolute difference of the two artifact intensity maps in the overlapping region.

[0046] The artifact matching score can be expressed as: Smatch = β1·Soverlap + β2·Sdir + β3·(1-Dint). Where Smatch represents the artifact matching score; Sooverlap represents the artifact position overlap; Sdir represents the artifact orientation consistency; Dint represents the normalized difference in artifact intensity; and β1, β2, and β3 are weighting coefficients. The system identifies the candidate sample group with the highest Smatch that reaches a preset threshold as the matching sample group. If the Smatch of all candidate samples is below the threshold, the system can return a state that no reliable matching sample has been found, and subsequently use the basic artifact residual estimation method or reduce the involvement of residual priors.

[0047] like Figure 4 As shown, Figure 4 'a' represents the CT image to be corrected. Figure 4 b represents a pre-degradation CT image from the paired sample library, determined through matching. Both images use the same hip and proximal femur view, maintaining consistent scale and location to facilitate comparison of bony contours, magnesium alloy implant location, implant area, and artifact extension direction. Figure 4 The paired residual prior of the paired sample group containing b can be used as a subsequent direction. Figure 4 a. The source of spatial migration.

[0048] Example 5 After determining the matching sample group, the system transfers the paired residual prior of the matching sample group to the CT image space to be corrected, and calculates the residual consistency weight based on the target artifact evidence information of the image to be corrected itself.

[0049] First, using the CT image T to be corrected as a baseline, the pre-degradation CT images B in the matched sample group were analyzed. Perform rigid registration and local deformation registration. Rigid registration is used to correct B. Overall translation, rotation, and scalability differences between the system and T; local deformation registration is used to correct for localized bone end curvature, implantation channel misalignment, or differences in slice planes. The registration reference area preferentially selects bony and soft tissue contours within non-artifact areas. After registration, the system will... Align to the coordinate space of T.

[0050] Subsequently, the system will match the paired residual prior D of the sample groups. Follow B Synchronous resampling to the space of T yields the migration residual prior D. _T. Here, synchronous resampling refers to using B... The same coordinate transformation and interpolation method are used in the registration process from D to T. Perform a spatial transformation to ensure D Each position in _T corresponds to a pixel or voxel position in T. For 3D volumetric data, trilinear interpolation can be used; for binary or region-based residual information, nearest neighbor interpolation or boundary-preserving interpolation can be used.

[0051] D After _T, the system determines the migration residual region Rd based on the region where the residual amplitude exceeds a preset threshold. The residual amplitude can be expressed as |D. _T(x)| represents, where x is the pixel or voxel position. When |D When _T(x)| is greater than the threshold τd, the location is marked as part of the migration residual region. This step is used to exclude D. The values ​​in _T are close to zero or are slight fluctuations caused by interpolation.

[0052] Then, the system calculates the positional consistency value Pval between the migrated residual region Rd and the artifact influence location PT in the target artifact evidence information. The positional consistency value can be represented by the intersection-union ratio, i.e., Pval = |Rd∩PT| / |Rd∪PT|. The higher the overlap between the migrated residual region and the target artifact location, the larger Pval is, indicating that the residual information migrated from the external paired samples is more reliable in spatial location.

[0053] The directional consistency value Dval is determined by the angle between the principal extension direction of the migration residual region and the artifact direction in the target artifact evidence information. In engineering implementation, principal component analysis or linear structure direction estimation can be performed on Rd to obtain the principal extension direction θd; the corresponding region in the target artifact evidence information has a direction θt; the directional consistency value can be expressed as Dval=cos(|θd-θt|), or the angle difference can be normalized to a directional consistency value between 0 and 1. The smaller the directional difference, the larger the directional consistency value.

[0054] The intensity consistency value Ival is determined by the normalized difference between the residual amplitude in the migration residual region and the artifact intensity in the target artifact evidence information. For example, it can be calculated within the Rd∩PT region D The average residual amplitude Ad and the target artifact intensity At are used to calculate the normalized difference Ndiff = |Ad-At| / (Ad+At+ε), where ε is a minimal constant to avoid division by zero. The intensity consistency value can be expressed as Ival = 1-Ndiff. The closer the two intensities are, the larger Ival is.

[0055] Finally, the residual consistency weight Wres is obtained by weighted fusion of position consistency value, orientation consistency value, and intensity consistency value, expressed as: Wres = γ1·Pval + γ2·Dval + γ3·Ival. Where Wres represents the residual consistency weight; Pval represents the position consistency value; Dval represents the orientation consistency value; Ival represents the intensity consistency value; and γ1, γ2, and γ3 are non-negative weights. For pixel-by-pixel or voxel-by-voxel implementations, the system can calculate the position, orientation, and intensity consistency values ​​separately within a local window, thereby generating a residual consistency weight map of the same size as T.

[0056] The technical role of residual consistency weighting is to perform credibility gating on the prior of the transfer residual. A high Wres region indicates that the prior of the transfer residual is consistent with the target artifact evidence in terms of location, orientation, and intensity, and can be strongly involved in the estimation of magnesium alloy artifact residual information. A low Wres region indicates that the external residual prior is inconsistent with the current image evidence, and its influence should be reduced to avoid the missubtraction of non-artifact structures.

[0057] Example 6 After obtaining the residual consistency weights, the system can further refine the migration residual prior to avoid incorrect subtraction of bony edges or local structures in low-consistency regions. Input data includes the CT image to be corrected (T), target artifact evidence information (ET), and migration residual prior (D). _T and residual consistency weight Wres.

[0058] The system first identifies pixels or voxels with Wres below a first threshold τw as low-consistency locations (Llow). For these locations, the consistency between the migration residual prior and the target artifact evidence is insufficient, indicating that the D in this region... _T should not be used directly as a basis for strong correction. Llow can be saved as a binary mask or as a low consistency probability map.

[0059] Subsequently, the system calculates the gradient magnitude G(x) in T. The gradient magnitude can be calculated using the Sobel operator, the three-dimensional central difference operator, or a Gaussian-smoothed gradient operator. Locations with high gradient magnitudes typically correspond to bony edges, cortical bone boundaries, implantation channel boundaries, or soft tissue contours.

[0060] The system identifies pixels or voxels with gradient magnitudes higher than the second threshold τg and not marked as artifact-affected locations by target artifact evidence as "Skeep" locations of the structure to be preserved. This constraint uses both gradient information and target artifact evidence: if a location has a strong edge response, but the target artifact evidence does not indicate that it is an artifact, then that location is more likely to be the true structure to be preserved, rather than an artifact residual to be subtracted.

[0061] The system then identifies the locations that simultaneously belong to Llow and Skeep as structure-preserving locations Sprotect. For each location x in Sprotect, the migration residual prior D is... _T(x) is set to zero, i.e., Dcorr(x) = 0. This treatment means that at locations with low consistency and structures to be preserved, external migration residual priors are not allowed to participate in artifact subtraction at those locations.

[0062] For pixels or voxels that belong to low-consistency locations but not to structure-preserving locations, the system does not completely remove the migration residual prior, but instead... Multiplying _T(x) by the corresponding residual consistency weight Wres(x) yields the corrected migration residual prior Decor, expressed as: Decor(x) = D _T(x)×Wres(x). Where, D _T(x) represents the prior value of the migration residual at position x, Wres(x) represents the residual consistency weight at position x, and Decor(x) represents the corrected prior value of the migration residual. This preserves weak residual information that may still have some artifact significance in low consistency regions, but reduces its influence. For non-low consistency locations, Decor can directly retain D _T, or similarly, lightly weighted according to Wres.

[0063] The modified migration residual prior, Dcorr, is obtained through the above processing. Dcorr and D... Compared to _T, it is set to zero at locations suspected to be true structures, reduced at locations with low consistency but no structure preservation, and retains the main residual information at locations with high consistency. This result, as one of the inputs to the subsequent artifact residual estimation model, enables the model to prioritize the preservation of the current image structure when there is a conflict between the external residual prior and the current image structure.

[0064] Example 7 When the paired sample library is large and multiple candidate samples are similar to the CT image to be corrected, the candidate sample group can be rearranged. This step is used to avoid determining the sample solely based on the initial artifact matching score, while ignoring the actual usability after the prior transfer of paired residuals.

[0065] The system selects multiple candidate paired sample groups from the candidate sample groups whose artifact matching scores reach a preset threshold, denoted as G1, G2, ..., Gk. Each candidate paired sample group includes pre-degradation CT images, post-degradation CT images, and paired residual priors. The system performs residual prior transfer on each candidate group to obtain D1_T, D2_T, ..., Dk_T.

[0066] For each migration residual prior Dj_T, the system calculates its residual consistency weight Wj with the target artifact evidence information ET as described in Example 5. Wj can be the entire weight map or a set of weights for several local artifact regions. Subsequently, the average value of Wj is calculated within the region marked by the target artifact evidence information to obtain the candidate residual consistency value Cj, expressed as: Cj=mean(Wj(x),x∈PT), where PT is the artifact influence position in the target artifact evidence information.

[0067] The system rearranges multiple candidate paired sample groups based on Cj. If a single-sample strategy is used, the candidate sample group with the highest Cj is selected as the final matched sample group. If a multi-sample fusion strategy is used, the top m candidate sample groups can be selected, and their transfer residual priors can be fused according to the weights normalized to Cj to obtain the fused transfer residual prior. The single-sample strategy is suitable for scenarios with limited computational resources, while the multi-sample fusion strategy is suitable for scenarios where there are multiple similar samples in the paired sample library and it is desirable to improve robustness.

[0068] In this embodiment, the candidate residual consistency value does not replace the artifact matching score, but rather serves as a secondary verification. The artifact matching score answers whether the pre-degradation image of the candidate sample is similar to the image to be corrected, while the candidate residual consistency value answers whether the residual prior in the candidate sample, after being transferred to the image to be corrected, matches the target artifact evidence. Only when both requirements are met does the candidate sample have high reference value.

[0069] In system applications, the rearrangement module can be implemented as a post-processing step of the sample matching unit. Its inputs are a list of candidate sample groups, target artifact evidence information, and prior migration residuals for each candidate group; the output is the final matched sample group number or multiple fused sample groups and their fusion weights. This output then flows to the artifact residual estimation model.

[0070] Example 8 The specific process of estimating magnesium alloy artifact residual information and generating corrected images based on residual consistency weights. The system integrates the CT image to be corrected (T), target artifact evidence information (ET), and migration residual prior (D). The model input data is organized into T or the modified migration residual prior (Dcorr) and residual consistency weights (Wres) according to the spatial dimension of T. For two-dimensional processing, each input can be organized as a multi-channel array of H×W×C; for three-dimensional processing, it can be organized as multi-channel volumetric data of H×W×N×C.

[0071] A typical example of a model input channel is as follows: The first channel is the normalized HU value of the CT image T to be corrected; the second channel is the artifact location probability map in the target artifact evidence information; the third channel is the artifact intensity map in the target artifact evidence information; the fourth channel is the transfer residual prior or the corrected transfer residual prior; and the fifth channel is the residual consistency weight map. If the target artifact direction is represented by sine and cosine, a direction channel can also be added. All channels are resampled to the same spatial size before being input into the model.

[0072] Artifact residual estimation models can be implemented using common convolutional neural networks, U-Net-type encoder-decoder networks, residual networks, or lightweight attention networks. Taking a U-Net-type network as an example, the encoder extracts local texture, bony edges, and artifact distribution features from the image to be corrected layer by layer; the bottleneck layer fuses the transfer residual prior and residual consistency weights; the decoder restores the spatial resolution layer by layer and outputs a candidate residual map Araw. The Araw output by the model has the same size as the T space, and each pixel or voxel value represents the magnitude of the candidate artifact residual estimated by the model.

[0073] To ensure that the residual estimation does not extend to non-artifact regions, the system sets the pixels or voxels in Araw that are not marked as artifact-affected locations by the target artifact evidence information to zero, resulting in the region-constrained residual map Aroi. This process can be expressed as: Aroi(x) = Araw(x) × PT(x). Here, Araw(x) represents the value of the residual candidate map at position x; PT(x) represents the target artifact location mask or probability value; and Aroi(x) represents the value of the region-constrained residual map at position x. When PT(x) = 0, Aroi(x) is set to zero; when PT(x) is high, Araw(x) is preserved or partially preserved.

[0074] Subsequently, the values ​​of each pixel or voxel in Aroi are multiplied by the corresponding residual consistency weight Wres to obtain the magnesium alloy artifact residual information A, which can be expressed as: A(x) = Aroi(x) × Wres(x). Here, A(x) represents the magnesium alloy artifact residual information ultimately used for correction at position x. If the input uses the corrected migration residual prior (Dcorr), the model has already obtained the reference information after structural protection at the input stage; if the input uses the uncorrected migration residual prior, Wres can still achieve residual subtraction strength control at the output stage.

[0075] The corrected image Tc is obtained based on the difference between the CT image to be corrected T and the magnesium alloy artifact residual information A, expressed as: Tc(x) = T(x) - A(x). Here, T(x) represents the CT value of the CT image to be corrected at position x, A(x) represents the magnesium alloy artifact residual information at the corresponding position, and Tc(x) represents the CT value of the corrected image at the corresponding position. For the case where A(x) represents dark band artifacts, its value can be negative; subtracting the negative residual from T is equivalent to compensating for the dark band. For the case where A(x) represents bright band artifacts, its value can be positive; subtracting the positive residual from T is equivalent to suppressing the bright band. Therefore, A should retain both positive and negative directions to reflect the influence of different types of artifacts on the CT value.

[0076] like Figure 5 As shown, Figure 5 a and Figure 4 a represents the same CT image to be corrected. Figure 5 b represents the corrected image obtained after processing according to this embodiment. Figure 5 Compared to a, Figure 5 In image b, the striations, bright bands, and dark bands around the implant are reduced, while the proximal femoral bony contour, acetabular rim, and local soft tissue grayscale transitions remain identifiable. This contrast effect stems from the combined constraints of migration residual priors, target artifact evidence, and residual consistency weights; that is, magnesium alloy artifact residual estimation is enhanced only in regions where the migration residual is consistent with the artifact evidence of the image to be corrected itself.

[0077] In practical systems, artifact residual estimation models can be deployed on medical imaging workstations, servers, or cloud-based inference platforms. Input data is converted to a standard array by the DICOM parsing module. After the model infers A, Tc is converted back to a DICOM-compatible format or NIfTI format for output. The system can simultaneously save A and Wres for physician review, allowing operators to see which areas are identified as artifact residuals and which areas are weakened due to insufficient consistency.

[0078] Table 2: Example of input data organization for artifact residual estimation model Example 9 The training process of the artifact residual estimation model. The core idea of ​​the training is to simulate the process in real-world applications: "matching training input with other similar paired samples, generating transfer residual priors from other samples, and then using the degraded image of the current sample for supervision." This training method avoids the model only memorizing the degraded image of the current paired sample during the training phase, thus preventing the use of external similar samples during the inference phase.

[0079] During training, a pair of samples Gp=(Bp,Rp) is randomly selected from the paired sample library. The CT image Bp before degradation is used as the training input Ttrain, and the CT image Rp after degradation is used as the supervision image Ysup. Ttrain has the same data state as the actual CT image to be corrected, that is, it contains magnesium alloy implants or residual magnesium alloy artifacts; Ysup is used to provide a low-artifact or implant-free reference state corresponding to the training input.

[0080] During training, the system does not directly use Ysup as model input. Instead, it selects other paired sample groups Gq=(Bq,Rq) similar to Ttrain from the paired sample library. The determination of these similar samples follows the initial and secondary screening process described in Example 4: first, candidate samples are determined based on the bony contour, magnesium alloy region location, and area; then, artifact matching scores are calculated based on artifact evidence information. The reason for selecting other paired samples is to simulate the situation where the actual image to be corrected does not have its own degraded image that can be directly input.

[0081] After determining Gq, the system uses the paired residual prior Dq in Gq to generate a transfer residual prior Dq_train corresponding to Ttrain, and generates residual consistency weights Wq_train based on the target artifact evidence information in Ttrain. If transfer residual correction is enabled, a corrected transfer residual prior Dq_corr can be further generated. The above data together constitute the input conditions for training the model. The training input data can be organized as a multi-channel array Xtrain=[Ttrain,Etrain,Dq_train,Wq_train], where Etrain represents the target artifact evidence information in Ttrain. If the corrected transfer residual prior is used, Dq_corr replaces Dq_train. After this array is input into the artifact residual estimation model, the model outputs training artifact residual information Atrain and training correction image Tcorr_train, where Tcorr_train=Ttrain-Atrain.

[0082] The loss calculation is based on the difference in CT values ​​between the training / corrected image and the supervised image at corresponding pixels or voxels. Specifically, it is expressed as: Limg = mean(|Tcorr_train(x) - Ysup(x)|). Here, Limg represents the image reconstruction loss, Tcorr_train(x) represents the CT value of the training / corrected image at position x, Ysup(x) represents the CT value of the supervised image at the corresponding position, and mean represents the average of the pixels or voxels involved in the training. In one implementation, to avoid excessive modification of non-artifact regions, higher weights can be used in the target artifact evidence information-labeled areas, and lower weights or preservation terms can be added in the unlabeled areas, so that the training / corrected image is as close as possible to the training input in the non-artifact regions.

[0083] To constrain the location of artifact residuals in the model output, a residual region constraint term can be calculated during training. This constraint term ensures that Atrain is primarily distributed within the regions marked by the target artifact evidence information. For example, the absolute mean of Atrain in unmarked regions can be calculated and used as a penalty term to encourage the model to reduce residual output in non-artifact regions. This process aligns with the residual correction concept of this invention, which primarily targets magnesium alloy artifact residuals rather than redrawing the entire CT image.

[0084] Training can be implemented using conventional deep learning frameworks, such as PyTorch or TensorFlow. Training samples are input in batches, with the batch size set to 1 to 8 3D patches or several 2D slices depending on the available GPU memory. The optimizer can be Adam or AdamW. During training, the paired sample library provides both supervised images and externally similar paired samples; the model thus learns how to estimate artifact residuals using both external transfer residual priors and artifact evidence from the current image.

[0085] Example 10 A CT artifact correction system for magnesium alloy implants based on paired images can be deployed on hospital imaging workstations, medical imaging servers, or cloud inference servers. The system inputs include DICOM format CT image sequences, NIfTI format 3D volume data, or preprocessed floating-point image arrays; the outputs include corrected images, magnesium alloy artifact residual information, and necessary intermediate visualization results.

[0086] like Figure 2As shown, the system includes a paired sample library, a target artifact evidence generation unit, a sample matching unit, a residual prior transfer unit, a consistency weight generation unit, an artifact residual estimation unit, and a corrected image generation unit. These units are sequentially connected via a data interface. The paired sample library stores paired sample groups and their paired residual priors; the target artifact evidence generation unit analyzes the CT image to be corrected; the sample matching unit selects matching sample groups from the paired sample library; the residual prior transfer unit transfers the residual priors of the matching sample groups to the space to be corrected; the consistency weight generation unit calculates the consistency between the transferred residuals and the target artifact evidence; the artifact residual estimation unit outputs magnesium alloy artifact residual information; and the corrected image generation unit performs residual subtraction and outputs the corrected image.

[0087] In one engineering implementation, the paired sample library employs a combination of relational database and file storage. The database stores sample numbers, image paths, implant types, acquisition stages, paired residual prior paths, artifact-affected area paths, and sample artifact evidence information paths; the file system stores DICOM sequences, NIfTI files, and multi-channel npy arrays. When the system calls a paired sample group, it first reads the index information from the database, and then loads the images and residual priors from the file system.

[0088] The target artifact evidence generation unit can perform basic thresholding and connected component analysis on a CPU, or run a lightweight convolutional network on a GPU to identify stripe, bright band, and dark band anomalies. Its output is stored as a multi-channel array and passed to the sample matching unit and the consistency weight generation unit. The sample matching unit can use pre-computed feature indexes to accelerate retrieval; for example, it can encode bony contour features, the centroid and area of ​​magnesium alloy regions, and sample artifact evidence information into vectors, and then obtain candidate samples through nearest neighbor retrieval.

[0089] The residual prior transfer unit is responsible for performing rigid registration and local deformation registration between the CT image to be corrected and the pre-degradation CT images in the matching sample group, and synchronously resampling the paired residual prior into the space to be corrected. This unit outputs the transferred residual prior and necessary registration quality information. If the registration quality is lower than the system's preset conditions, the system can return an instruction to the sample matching unit to reselect candidate samples.

[0090] The consistency weight generation unit generates residual consistency weights based on three dimensions: positional consistency, directional consistency, and intensity consistency. The residual consistency weights output by this unit serve as input to the artifact residual estimation unit and can also be used as quality control display results. If the residual consistency weight is low in a certain region, the system reduces the use of migration residual priors in that region, thereby reducing the risk of incorrect references.

[0091] The artifact residual estimation unit is typically deployed on a GPU. Its inputs include the CT image to be corrected, target artifact evidence information, migration residual priors, and residual consistency weights. After the model outputs a candidate residual map, the system applies region constraints based on the target artifact evidence information and combines this with the residual consistency weights to obtain magnesium alloy artifact residual information. The corrected image generation unit subtracts the CT image to be corrected from the magnesium alloy artifact residual information to obtain the corrected image, while maintaining the original DICOM patient information, acquisition parameters, and spatial positioning information unchanged, only updating pixel data or generating new sequence identifiers.

[0092] The system also allows for quality control output settings. It can output migration residual prior maps, residual consistency weight maps, magnesium alloy artifact residual information maps, and before-and-after correction comparison maps for operator review. It can also save matching sample group numbers, artifact matching scores, candidate residual consistency values, registration parameters used, and model version numbers to trace the source of correction results. For regions with excessively low residual consistency, excessive changes in non-artifact areas, or abnormal model output, the system can mark them as low-confidence regions on the interface. This quality control result does not alter the core correction process but facilitates verification and tracking in actual image processing environments.

[0093] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention. It should be understood that the construction method of the paired sample library, the data format of CT images, the method of determining the artifact-affected area, the similarity matching method, the calculation method of residual consistency weight, and the specific structure of the artifact residual estimation model can all be adaptively adjusted according to the actual application scenario, scanning equipment, image data type, and processing accuracy requirements.

[0094] For those skilled in the art, any equivalent substitutions, parameter adjustments, reasonable changes in the order of steps, equivalent substitutions of algorithm modules, or combinations of different implementation methods made to the above embodiments without departing from the core concept of this invention should be considered to fall within the protection scope of this invention. The protection scope of this invention should be determined by the claims.

Claims

1. A method for CT artifact correction of magnesium alloy implants based on paired images, characterized in that, include: A paired sample library is established, containing different paired sample groups. Each paired sample group includes a CT image of the magnesium alloy implant before degradation and a corresponding CT image after degradation. The degraded CT image is registered and resampled to the coordinate space of the pre-degradation CT image. The CT value difference map of the two images is calculated, and paired residual priors are generated by filtering according to the artifact-affected area. The CT image to be corrected is acquired and target artifact evidence information is generated. The CT image to be corrected is matched with the pre-degradation CT image in the paired sample library to determine the matched sample group. The paired residual prior of the matched sample group is transferred to the space of the CT image to be corrected to obtain the transferred residual prior. The consistency of the transferred residual prior and the target artifact evidence information is verified to generate a residual consistency weight. Based on the transferred residual prior, the target artifact evidence information, and the residual consistency weight, the magnesium alloy artifact residual information in the CT image to be corrected is estimated, and the CT image to be corrected is corrected to generate a corrected image.

2. The method for CT artifact correction of magnesium alloy implants based on paired images according to claim 1, characterized in that, The generation of the paired residual prior includes: segmenting the magnesium alloy implant region in the pre-degradation CT image, and determining the artifact-affected region based on the magnesium alloy implant region and its surrounding striped, bright, or dark abnormal regions; selecting a bony structure region or soft tissue contour region in the pre-degradation CT image that avoids the artifact-affected region, and selecting a bony structure region or soft tissue contour region corresponding to its anatomical position in the post-degradation CT image as a registration reference region; performing rigid registration and local deformation registration on the post-degradation CT image based on the registration reference region to obtain a registered post-degradation CT image; calculating the CT value difference of corresponding pixels or voxels in the pre-degradation CT image and the registered post-degradation CT image to form a CT value difference map; retaining the difference information located within the artifact-affected region in the CT value difference map, and suppressing the difference information outside the artifact-affected region to obtain the paired residual prior.

3. The method for CT artifact correction of magnesium alloy implants based on paired images according to claim 1, characterized in that, The generation of the target artifact evidence information includes: identifying a magnesium alloy implant region or a residual magnesium alloy region in the CT image to be corrected; determining candidate artifact regions within a preset range around the magnesium alloy implant region or the residual magnesium alloy region as the center; determining the artifact influence location, artifact direction, and corresponding artifact intensity within the candidate artifact regions based on at least one of local CT value anomalies, grayscale fluctuation amplitude, stripe distribution, bright band distribution, or dark band distribution; and generating the target artifact evidence information based on the artifact influence location, artifact direction, and corresponding artifact intensity.

4. The method for CT artifact correction of magnesium alloy implants based on paired images according to claim 3, characterized in that, The determination of the matching sample group includes: generating sample artifact evidence information from the pre-degradation CT images in the paired sample library; performing preliminary screening based on the similarity of the bony contour, the similarity of the magnesium alloy implant region location, and the similarity of the magnesium alloy implant region area between the CT image to be corrected and each pre-degradation CT image to obtain candidate sample groups; calculating an artifact matching score based on the artifact position overlap, artifact direction consistency, and artifact intensity normalization difference between the target artifact evidence information and the sample artifact evidence information corresponding to the candidate sample group; and determining the candidate sample group with the highest artifact matching score that reaches a preset threshold as the matching sample group.

5. The method for CT artifact correction of magnesium alloy implants based on paired images according to claim 4, characterized in that, The process of generating the residual consistency weight includes: using the CT image to be corrected as a reference, performing rigid registration and local deformation registration on the pre-degradation CT images in the matching sample group, and synchronously resampling the paired residual prior of the matching sample group to the CT image space to be corrected along with the pre-degradation CT images to obtain the migration residual prior; determining the migration residual region based on the region where the residual amplitude in the migration residual prior exceeds a preset threshold; determining the positional consistency value based on the intersection-union ratio (IUU) of the migration residual region and the artifact influence position in the target artifact evidence information; determining the directional consistency value based on the angle between the main extension direction of the migration residual region and the artifact direction in the target artifact evidence information; determining the intensity consistency value based on the normalized difference between the residual amplitude of the migration residual region and the artifact intensity in the target artifact evidence information; and weighting and fusing the positional consistency value, directional consistency value, and intensity consistency value to obtain the residual consistency weight.

6. The method for CT artifact correction of magnesium alloy implants based on paired images according to claim 5, characterized in that, It also includes correcting the migration residual prior: identifying pixels or voxels with residual consistency weights below a first threshold as low-consistency locations; calculating gradient magnitudes in the CT image to be corrected, identifying pixels or voxels with gradient magnitudes above a second threshold and not marked as artifact-affected locations by the target artifact evidence information as structures to be preserved locations; identifying pixels or voxels that simultaneously belong to low-consistency locations and structures to be preserved locations as structures to be preserved locations, and setting the value of the migration residual prior at the structures to be preserved locations to zero; For pixels or voxels that belong to low consistency locations but not to structure-preserving locations, the value of the migration residual prior is multiplied by the corresponding residual consistency weight to obtain the corrected migration residual prior.

7. The method for CT artifact correction of magnesium alloy implants based on paired images according to claim 4, characterized in that, The determination of the matching sample group further includes: selecting multiple candidate paired sample groups from the candidate sample group whose artifact matching scores reach a preset threshold; transferring the pairing residual prior of each candidate paired sample group to the CT image space to be corrected, and generating corresponding residual consistency weights; calculating the average value of the residual consistency weights of each candidate paired sample group in the region marked by the target artifact evidence information to obtain the candidate residual consistency value; rearranging the multiple candidate paired sample groups according to the candidate residual consistency value, and determining the candidate paired sample group with the highest candidate residual consistency value as the final matching sample group.

8. The method for CT artifact correction of magnesium alloy implants based on paired images according to claim 1 or 6, characterized in that, The method of estimating magnesium alloy artifact residual information in the CT image to be corrected based on residual consistency weights includes: organizing the CT image to be corrected, target artifact evidence information, migration residual prior, and residual consistency weights into model input data according to the spatial size of the CT image to be corrected, and inputting them into the artifact residual estimation model; the artifact residual estimation model outputs a residual candidate map; pixels or voxels in the residual candidate map that are not marked as artifact-affected locations by the target artifact evidence information are set to zero to obtain a region-constrained residual map; the value of each pixel or voxel in the region-constrained residual map is multiplied by the residual consistency weight at the corresponding location to obtain the magnesium alloy artifact residual information; and generating the corrected image based on the difference between the CT image to be corrected and the magnesium alloy artifact residual information.

9. The method for CT artifact correction of magnesium alloy implants based on paired images according to claim 8, characterized in that, The training of the artifact residual estimation model includes: using pre-degradation CT images of any paired sample group in the paired sample library as training input, and post-degradation CT images of the paired sample group as supervision images; during training, selecting other paired sample groups similar to the training input from the paired sample library, and using the other paired sample groups to generate transfer residual priors and residual consistency weights corresponding to the training input; inputting the training input, target artifact evidence information, transfer residual priors, and residual consistency weights into the artifact residual estimation model to obtain training correction images; and training the artifact residual estimation model based on the difference in CT values ​​between the training correction images and the supervision images at corresponding pixels or voxels.

10. A CT artifact correction system for magnesium alloy implants based on paired images, characterized in that, include: The paired sample library stores different paired sample groups and the corresponding paired residual priors for each paired sample group. Each paired sample group includes CT images of magnesium alloy implants before degradation and corresponding CT images after degradation. The target artifact evidence generation unit is used to analyze the CT images to be corrected and generate target artifact evidence information. The sample matching unit is used to match the CT image to be corrected with the pre-degradation CT images in the paired sample library to determine the matched sample group; the residual prior transfer unit is used to transfer the paired residual prior of the matched sample group to the CT image space to be corrected to obtain the transferred residual prior; the consistency weight generation unit is used to generate residual consistency weights based on the consistency verification between the transferred residual prior and the target artifact evidence information. The artifact residual estimation unit is used to estimate the magnesium alloy artifact residual information in the CT image to be corrected based on the migration residual prior, the target artifact evidence information, and the residual consistency weight; the corrected image generation unit is used to correct the CT image to be corrected based on the magnesium alloy artifact residual information and generate a corrected image.