A deep learning-based hip joint image enhancement processing method
By adopting deep learning technology in hip image enhancement, combining the bidirectional cyclic mechanism and token shift mechanism, multi-stage feature fusion is carried out, and the problem of global and local feature extraction imbalance in the existing technology is solved, and efficient detail enhancement and automated processing of hip image is achieved.
Patent Information
- Application Number
- CN202510352320.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-25
AI Technical Summary
The prior art is difficult to balance the extraction of global and local features in hip image enhancement, resulting in excessive enhancement of normal tissue or loss of lesion details when contrast is improved, and lack of automated processing capabilities.
A hip image enhancement processing method based on deep learning is adopted, and a feature extraction module is constructed in combination with a two-way cycle mechanism and a token shift mechanism, which captures the global and local dependencies of the image, and performs multi-stage feature fusion through the iterative feature enhancement module to dynamically adjust the fusion ratio of new and old features.
It significantly improves the detail clarity of hip joint images and the visibility of the lesion area, enhances the ability to express features of complex anatomical structures and lesion areas, avoids overfitting, and meets the clinical efficient and automated processing needs.
Smart Images

Figure CN119863387B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image enhancement, and particularly relates to a hip joint image enhancement processing method based on deep learning. Background Art
[0002] The accurate diagnosis of hip joint diseases highly depends on high-quality medical images. However, affected by the resolution of imaging equipment, patient posture, and the complexity of diseased tissues, hip joint images often have problems such as low contrast, blurred edges, and noise interference, resulting in difficulty in identifying subtle lesions. Although traditional image enhancement methods can improve the global contrast, they lack pertinence to local anatomical structures, are prone to over-enhancement of normal tissues or loss of details in diseased areas, and rely on manual parameter adjustment, making it difficult to meet the requirements of clinical efficient and automated processing.
[0003] In recent years, deep learning technologies, especially methods such as convolutional neural networks and generative adversarial networks, have made remarkable progress in the field of medical image enhancement. However, their application in the hip joint field still faces significant challenges. Most existing models are designed based on general convolutional neural networks, with insufficient modeling ability for the unique complex structures of the hip joint, making it difficult to balance the extraction of global dependencies and local details. In addition, most image enhancement methods adopt static feature fusion strategies, lacking a dynamic mechanism for progressive optimization of multi-stage features, resulting in limited generalization ability of the model, especially unstable enhancement effects on diseased areas with large morphological differences.
[0004] To address the above problems, a hip joint image enhancement processing method based on deep learning is proposed. By combining multi-scale adaptive contrast enhancement with a bidirectional cycle mechanism to integrate gradient information and multi-scale context, it accurately enhances bone edges and lesion textures while suppressing noise interference. An iterative incremental fusion module is designed to introduce learnable parameters to dynamically adjust the weights of new and old features, achieving progressive enhancement of multi-level features and significantly improving the adaptability to complex lesions. Summary of the Invention
[0005] The present invention provides a hip joint image enhancement processing method based on deep learning, aiming to propose a hip joint image enhancement model. A feature extraction module is constructed by combining a bidirectional cycle mechanism and a token shift mechanism to capture the global and local dependencies of hip joint images. An incremental fusion strategy is introduced to construct an iterative feature enhancement module, which gradually fuses features at different levels through multi-stage iteration, and design learnable parameters to dynamically adjust the fusion ratio of new and old features. The hip joint image enhancement model is trained through a staged training strategy, enabling the model to not only learn low-level pixel information but also capture high-level structural and semantic features, enhancing the adaptability to different diseased areas of the hip joint.
[0006] The present invention aims to propose a hip joint image enhancement model and provide a deep learning-based hip joint image enhancement processing method, including the following steps.
[0007] S1. Construct a hip joint image dataset, collect normal and diseased hip joint images, annotate the region of interest for each hip joint image, and make a hip joint image dataset.
[0008] S2. Preprocess the hip joint image dataset, including multi-scale adaptive local contrast enhancement operation and image registration operation based on translation-invariant features, and divide the preprocessed hip joint image dataset into a training set and a test set.
[0009] S3. Construct a feature extraction module by combining a bidirectional recurrent mechanism and a token shifting mechanism. The bidirectional recurrent mechanism captures the global dependencies of hip joint images, and the token shifting mechanism is used to enhance the local dependencies of hip joint images.
[0010] S4. Introduce an incremental fusion strategy to construct an iterative feature enhancement module. The incremental fusion strategy gradually fuses hip joint image features at different levels through multi-stage iteration. In each stage, the output features of the previous stage are weighted and fused with the attention features of the current stage, and learnable parameters are designed to adjust the fusion ratio of the old and new features of hip joint images, and gradually optimize the global and local dependencies of hip joint images.
[0011] S5. Construct a hip joint image enhancement model, which includes an input, a feature extraction module, an iterative feature enhancement module, and an output.
[0012] S6. Train and test the hip joint image enhancement model. Use the preprocessed hip joint image training set to train the model in stages. After training, input the preprocessed hip joint image test set into the model to obtain the enhanced hip joint images.
[0013] Preferably, in step S1, construct a hip joint image dataset, collect normal and diseased hip joint images, where the diseased hip joints include hip arthritis, hip fractures, and hip dysplasia, annotate the region of interest for each hip joint image, and the region of interest includes the acetabulum, femoral head, and joint space, and make a hip joint image dataset, including the constructed hip joint images with annotations and the corresponding annotation files.
[0014] Preferably, in step S2, preprocess the hip joint image dataset, and the specific steps are as follows:
[0015] S21. For the multi-scale adaptive local contrast enhancement operation, enhance the local contrast of hip joint images through multi-scale feature extraction and an adaptive mechanism. The specific formula is:
[0016] ;
[0017] Wherein, is the pixel value at position in the hip joint input image, is the feature of the local image patch calculated at scale , and are the local mean and standard deviation at scale , is the weight corresponding to scale , used to control the importance of different scales, is dynamically adjusted according to the difference in pixel values within the local window, is the gradient of the hip joint input image, and are adjustment factors, respectively controlling the intensity of local contrast enhancement and edge enhancement, is a multi-scale set, containing different local window sizes;
[0018] The weight has the following mathematical model:
[0019] ;
[0020] Wherein, is the pixel value within the local window, is the pixel value at position in the hip joint input image;
[0021] S22. For the image registration operation based on transformation-invariant features, extract the features in the hip joint image that are invariant to various geometric transformations to accurately match the joint regions in the hip joint image, especially for the lesion regions with large morphological differences. The specific formula is:
[0022] ;
[0023] Wherein, is the transformation function, representing the geometric transformation relationship from the hip joint image to the hip joint image , and are the hip joint images to be matched, is the position of the th feature point in the hip joint image, is the total number of feature points extracted in the hip joint image, is the Euclidean distance, is among all possible transformation functions Among them, select a transformation function that minimizes the expression.
[0024] Preferably, in step S2, in the multi-scale adaptive local contrast enhancement operation, the multi-scale mechanism can capture local features of different sizes in the hip joint image, ensuring the clarity of the key areas of the hip joint image. By adaptively and dynamically adjusting the contrast and edge enhancement intensity, over-enhancement or under-enhancement can be effectively avoided; the image registration operation based on transformation-invariant features ensures the alignment of the joint areas between different hip joint images by minimizing the feature point matching error, reducing the error accumulation in subsequent processing. The registration operation reduces the geometric differences between hip joint images, making the hip joint image enhancement model perform more stably when processing hip joint images at different angles or resolutions.
[0025] Preferably, in step S3, the construction method of the feature extraction module is as follows:
[0026] S31. Input the preprocessed hip joint image , , , and 1 are respectively the height, width, and channels of the preprocessed hip joint image. Through a 3×3 convolution operation, project onto the shallow feature , , is the channel of . Flatten into a one-dimensional sequence , , is the total number of tokens in the hip joint image. Through the multi-directional token shift layer, extract the local features of the hip joint image and expand the context range of each token to obtain the feature , Through the linear projection layer, obtain the receive matrix , the key matrix , the value matrix , , , , , and are respectively the weights of the linear projection layer;
[0027] S32. Calculate the global attention through the bidirectional cyclic mechanism, where the calculation formula for bidirectional attention is:
[0028] ;
[0029] Among them, the calculation formula for cyclic attention is:
[0030] ;
[0031] Wherein, is a cyclic shift operation;
[0032] The results of bidirectional and cyclic attention are fused by weighted summation to obtain global attention , and the specific calculation formula is:
[0033] ;
[0034] Wherein, is a weight hyperparameter used to balance bidirectional and cyclic attention;
[0035] The received matrix is processed through gated attention to adjust the reception intensity of each token, and the weighted feature is obtained. The specific calculation formula is:
[0036] ;
[0037] Wherein, is a weight matrix, is an element-wise multiplication operation.
[0038] Preferably, in step S3, for the feature extraction module, the bidirectional cyclic mechanism captures the global dependencies between different regions in the hip joint image by calculating the global attention, enabling the hip joint image enhancement model to simultaneously consider the relationship between each position in the hip joint image and all other positions, enhancing the understanding of the global structure and performing more stably when dealing with complex lesion regions; the token shift mechanism expands the context range of each token, i.e., the image patch, through multi-directional token shifting, enhancing the local features of the hip joint image; the feature extraction module extracts features step by step from low-level features to high-level features through shallow convolution and token shifting operations, ensuring the comprehensiveness and hierarchy of the hip joint image features. Through the bidirectional cyclic mechanism and gated attention, the model can dynamically adjust the reception intensity of each token to ensure that the features of key regions are fully enhanced.
[0039] Preferably, in step S4, the construction method of the iterative feature enhancement module is as follows:
[0040] S41. Multi-stage feature initialization. The feature , output by the input feature extraction module is used to generate an initial query , key , and value through a linear projection layer. , , , , and is the weight matrix;
[0041] S42. Calculate and fuse the iterative attention. Define the number of iterations as , for each iteration , the calculation formula for the attention weight is:
[0042] ;
[0043] S43. Design the learnable parameter , , adjust the fusion ratio of the old and new features of the hip joint image, The specific formula is:
[0044] ;
[0045] In the formula, is the learnable scale factor, which controls the coupling strength of curvature and entropy, is updated by the gradient descent method, is the local curvature intensity of the hip joint input image, is the local information entropy, is the adaptive threshold, According to the local curvature intensity and the local information entropy The median of is dynamically adjusted;
[0046] The mathematical model of the learnable scale factor is:
[0047] ;
[0048] In the formula, is the learning rate, is the total loss of the hip joint image enhancement model, is the gradient value;
[0049] The mathematical model of the local curvature intensity is:
[0050] ;
[0051] In the formula, is the curvature of the hip joint input image, is the gradient amplitude of the hip joint input image;
[0052] The mathematical model of the local information entropy is:
[0053] ;
[0054] In the formula, is a sliding window centered on and is the grayscale probability distribution of the pixels within the window.
[0055] The mathematical model of the adaptive threshold is as follows:
[0056] ;
[0057] In the formula, is the learning rate, which controls the step size of threshold adjustment, is the median calculation;
[0058] S44. Weightedly fuse the output features of the previous stage with the attention features of the current stage, and use to dynamically adjust the fusion ratio. The specific calculation formula is:
[0059] ;
[0060] Perform a non-linear transformation on the fused features. The specific calculation formula is:
[0061] ;
[0062] In the formula, is the projection weight matrix;
[0063] S45. After each iteration, add the initial feature to the current fused feature through a skip connection, , and after iterations, obtain the final fused feature . Generate the enhanced hip joint image through a 3×3 convolution operation. The specific calculation formula is:
[0064] ;
[0065] In the formula, is the convolution operation with a 3×3 convolution kernel, is the preprocessed hip joint input image.
[0066] Preferably, in step S4, for the iterative feature enhancement module, different levels of hip joint image features are gradually fused through multi-stage iteration, and the fusion ratio of new and old features is dynamically adjusted in combination with learnable parameters, which can significantly improve the detail clarity of hip joint images and the visibility of lesion areas. Dynamically adjusting the fusion ratio reduces the over-reliance of the hip joint image enhancement model on specific features. Through progressive optimization and dynamic fusion strategies, the expression ability and generalization performance of the hip joint image enhancement model are significantly enhanced, while overfitting is avoided, providing higher-quality hip joint enhanced images for clinical diagnosis.
[0067] Preferably, in step S5, for the hip joint image enhancement model, the input layer receives the preprocessed hip joint image training set, enters the feature extraction module, uses a bidirectional cyclic mechanism and a multi-directional token shifting mechanism to capture the global and local dependencies of hip joint images, enters the iterative feature enhancement module, adopts an incremental fusion strategy, and continuously fuses different levels of hip joint image features through multi-stage iteration. The output layer outputs the enhanced hip joint images.
[0068] Preferably, in step S6, the specific steps for training and testing the hip joint image enhancement model are as follows:
[0069] S61. In the first stage, use pixel loss to train the hip joint image enhancement model, and the calculation formula of the pixel loss is:
[0070] ;
[0071] where N is the total number of pixels in the hip joint image;
[0072] S62. In the second stage, use perceptual loss to train the hip joint image enhancement model, and the calculation formula of the perceptual loss is:
[0073] ;
[0074] where is the feature of the th iteration, is the weight coefficient, is the square of the L2 norm in the feature space;
[0075] The total loss of the hip joint image enhancement model is , , and are balance weight factors, , ;
[0076] S63. Calculate the quality of the enhanced hip joint image, and use the structural similarity index to evaluate the performance of the model. The calculation formula of the structural similarity index is as follows:
[0077] ;
[0078] In the formula, is the preprocessed hip joint image , is the enhanced hip joint image , is the average value of pixels, is the average value of pixels, is the covariance of the image and , is the variance of is the variance of and are constants to avoid the denominator being zero.
[0079] Preferably, in step S6, for the hip joint image enhancement model, by using a staged training strategy through the joint optimization of pixel loss and perceptual loss, the performance of the hip joint image model can be significantly improved. In the first stage, through pixel loss, it is ensured that the enhanced hip joint image is highly consistent with the true label at the pixel level, improving the overall clarity. In the second stage, through perceptual loss, high-level semantic features are optimized, enhancing the ability to retain details and avoiding over-smoothing or distortion. This method not only improves the training efficiency and stability of the hip joint image enhancement model, but also significantly improves the visual quality and diagnostic value of the enhanced hip joint image, especially suitable for precise enhancement of complex lesion areas.
[0080] Compared with the prior art, the present invention has the following technical effects:
[0081] The technical solution provided by the present invention proposes a hip joint image enhancement model, which constructs a feature extraction module by combining a bidirectional cyclic mechanism and a token shift mechanism to capture the global and local dependencies of hip joint images, significantly improving the model's feature expression ability for complex anatomical structures and lesion areas; introducing an incremental fusion strategy to construct an iterative feature enhancement module, gradually fusing features at different levels through multi-stage iteration, and designing learnable parameters to dynamically adjust the fusion ratio of new and old features, enhancing the flexibility and adaptability of the model and avoiding overfitting; training the model through a staged training strategy, enabling the model to not only learn low-level pixel information, but also capture high-level structural and semantic features, significantly improving the detail clarity and diagnostic value of the enhanced hip joint image, and enhancing the adaptability to different lesion areas of the hip joint. Brief Description of the Drawings
[0082] Figure 1 is the flowchart of hip joint image data processing provided by the present invention.
[0083] Figure 2 is the structural diagram of the feature extraction module provided by the present invention.
[0084] Figure 3 is the structural diagram of the iterative feature enhancement module provided by the present invention.
[0085] Figure 4 is the effect diagram of the hip joint image before enhancement provided by the present invention.
[0086] Figure 5 is the effect diagram of the hip joint image after enhancement provided by the present invention. Detailed Embodiment
[0087] The present invention aims to propose a hip joint image enhancement processing method based on deep learning, propose a hip joint image enhancement model, construct a feature extraction module by combining a bidirectional cyclic mechanism and a token shifting mechanism to capture the global and local dependencies of hip joint images, and significantly improve the feature expression ability of the model for complex anatomical structures and lesion regions; introduce an incremental fusion strategy to construct an iterative feature enhancement module, gradually fuse features at different levels through multi-stage iteration, and design learnable parameters to dynamically adjust the fusion ratio of new and old features, enhancing the flexibility and adaptability of the model and avoiding overfitting; train the model through a phased training strategy, enabling the model to not only learn low-level pixel information but also capture high-level structural and semantic features, significantly improving the detail clarity and diagnostic value of the hip joint enhanced image, and enhancing the adaptability to different lesion regions of the hip joint.
[0088] Please refer to Figure 1 shown, a hip joint image enhancement processing method based on deep learning in an embodiment of the present application.
[0089] S1. Construct a hip joint image data set, collect normal and pathological hip joint images, annotate the region of interest for each hip joint image, and make a hip joint image data set.
[0090] Further, in step S1, a hip joint image dataset is constructed by collecting normal and diseased hip joint images from hospitals, medical imaging databases, and public datasets. The diseased hip joints include hip arthritis, hip fractures, and hip dysplasia. Each hip joint image is labeled with regions of interest using a professional medical image annotation tool, LabelMe, specifically including the acetabulum, femoral head, and joint space. The annotation results are saved in the XML standard format and corresponding to the original hip joint images to create a hip joint image dataset, which contains the labeled hip joint images and the corresponding annotation files.
[0091] S2. Preprocess the hip joint image dataset, including multi-scale adaptive local contrast enhancement operation and image registration operation based on translation-invariant features, and divide the preprocessed hip joint image dataset into a training set and a test set.
[0092] Further, in step S2, the specific steps for preprocessing the hip joint image dataset are as follows.
[0093] S21. For the multi-scale adaptive local contrast enhancement operation, enhance the local contrast of the hip joint image through multi-scale feature extraction and an adaptive mechanism. The specific formula is:
[0094] ;
[0095] In the formula, is the pixel value at position in the input hip joint image, is the feature of the local image patch calculated at scale , is the local mean at scale , with an initial value of 0 in the implementation process and a value range of 0 to 1, is the standard deviation at scale , with an initial value of 2 in the implementation process and a value range of 0.5 to 5, is the weight corresponding to scale , used to control the importance of different scales, with an initial value of 0.5 in the implementation process and a value range of 0 to 1, is the gradient of the input hip joint image, is a regulation factor to control local contrast enhancement, with a value of 0.5 in the implementation process, is a regulation factor to control the intensity of edge enhancement, with a value of 1 in the implementation process, is a multi-scale set containing different local window sizes. In the implementation process, ;
[0096] The mathematical model of the weight is:
[0097] ;
[0098] In the formula, is the pixel value within the local window, is the pixel value at position in the hip joint input image;
[0099] During the implementation process, the formula for calculating the local mean is:
[0100] ;
[0101] In the formula, M is the total number of pixels within the local window;
[0102] During the implementation process, the formula for calculating the standard deviation is:
[0103] ;
[0104] S22. For the image registration operation based on transformation-invariant features, extract the features in the hip joint image that are invariant to various geometric transformations to accurately match the joint region in the hip joint image, especially for the lesion regions with large morphological differences. The specific formula is:
[0105] ;
[0106] In the formula, is the transformation function, representing the geometric transformation relationship from the hip joint image to the hip joint image , including translation, rotation, and scaling, and are the hip joint images to be matched, is the position of the th feature point in the hip joint image. The feature points and are extracted from the images , is the total number of feature points extracted from the hip joint image, is the Euclidean distance, is to select a transformation function that minimizes the expression among all possible transformation functions .
[0107] S3. Construct a feature extraction module by combining the bidirectional cyclic mechanism and the token shifting mechanism. The bidirectional cyclic mechanism captures the global dependencies of the hip joint image, and the token shifting mechanism is used to enhance the local dependencies of the hip joint image.
[0108] Furthermore, in step S3, asFigure 2 As shown, the specific steps of the feature extraction module are as follows.
[0109] S31. Input the preprocessed hip joint image , , where 512, 512, and 1 are the height, width, and channels of the preprocessed hip joint image respectively. Through a 3×3 convolution operation, project onto the shallow features , , where 64 is the channels. Flatten into a one-dimensional sequence , , is the total number of tokens of the hip joint image. Through the multi-directional token shift layer, extract the local features of the hip joint image and expand the context range of each token to obtain the feature , Through the linear projection layer, obtain the receive matrix , the key matrix , the value matrix , , , , , and are the weights of the linear projection layer respectively. During the implementation process, the dimension is set to ;
[0110] S32. Calculate the global attention through a bidirectional cyclic mechanism. The calculation formula for bidirectional attention is:
[0111] ;
[0112] The calculation formula for cyclic attention is:
[0113] ;
[0114] In the formula, is the cyclic shift operation;
[0115] Fuse the results of bidirectional and cyclic attention through weighted summation to obtain the global attention . The specific calculation formula is:
[0116] ;
[0117] In the formula, is the weight hyperparameter used to balance bidirectional and cyclic attention. It is set to 0.7 during the implementation process;
[0118] Process the received matrix through gated attention to adjust the reception intensity of each token and obtain the weighted features Specifically, the calculation formula is: ;
[0119]
[0120] In the formula, is the weight matrix, and its value range during implementation is from 0 to 1, is the element-wise multiplication operation.
[0121] S4. Introduce an incremental fusion strategy to construct an iterative feature enhancement module. The incremental fusion strategy gradually fuses hip joint image features at different levels through multi-stage iteration. In each stage, the output features of the previous stage are weighted and fused with the attention features of the current stage, and a learnable parameter is designed to adjust the fusion ratio of the old and new features of the hip joint image, and gradually optimize the global and local dependencies of the hip joint image.
[0122] Furthermore, in step S4, as Figure 3 shown, the specific steps of the iterative feature enhancement module are as follows.
[0123] S41. Initialize multi-stage features. Input the features , output by the feature extraction module, and generate an initial query , key , and value through a linear projection layer. , , , , , and are weight matrices, and their dimensions are set to during implementation;
[0124] S42. Calculate and fuse iterative attention. Define the number of iterations as . For each iteration , the calculation formula for the attention weight is:
[0125] ;
[0126] S43. Design a learnable parameter to adjust the fusion ratio of the old and new features of the hip joint image. The initial value is set to 0.5 during implementation, and its value range is from 0 to 1. The specific formula for is:
[0127] ;
[0128] In the formula, is a learnable scale factor that controls the coupling strength between curvature and entropy. Its initial value is set to 1 during the implementation process. is the local curvature intensity of the hip joint input image. is the local information entropy. is the adaptive threshold, and its initial value is set to 0 during the implementation process.
[0129] Learnable scale factor has the following mathematical model:
[0130] ;
[0131] In the formula, is the learning rate, and its initial value is set to 0.001 during the implementation process. is the total loss of the hip joint image enhancement model. is the gradient value.
[0132] Local curvature intensity has the following mathematical model:
[0133] ;
[0134] In the formula, is the curvature of the hip joint input image. is the gradient amplitude of the hip joint input image.
[0135] Local information entropy has the following mathematical model:
[0136] ;
[0137] In the formula, is a sliding window centered on , and is the gray-scale probability distribution of the pixels within the window.
[0138] Adaptive threshold has the following mathematical model:
[0139] ;
[0140] In the formula, is the learning rate that controls the threshold adjustment step size, and its initial value is set to 0.001 during the implementation process. is the median calculation.
[0141] S44. Weightedly fuse the output features of the previous stage and the attention features of the current stage, and use to dynamically adjust the fusion ratio. The specific calculation formula is:
[0142] ;
[0143] Perform a non - linear transformation on the fused features. The specific calculation formula is:
[0144] ;
[0145] In the formula, is the projection weight matrix, and its value range during implementation is from 0 to 1;
[0146] S45. After each iteration, add the initial feature to the current fused feature through a skip connection, , after iterations, obtain the final fused feature , and generate an enhanced hip joint image through a 3×3 convolution operation . The specific calculation formula is:
[0147] ;
[0148] In the formula, is a convolution operation with a 3×3 convolution kernel, is the pre - processed hip joint input image.
[0149] S5. Construct a hip joint image enhancement model. The hip joint image enhancement model includes an input, a feature extraction module, an iterative feature enhancement module, and an output.
[0150] Furthermore, in step S5, for the hip joint image enhancement model, the input layer receives the pre - processed hip joint image training set, enters the feature extraction module, uses a bidirectional recurrent mechanism and a multi - direction token shift mechanism to capture the global and local dependencies of the hip joint image, enters the iterative feature enhancement module, adopts an incremental fusion strategy, and continuously fuses hip joint image features at different levels through multi - stage iterations. The output layer outputs the enhanced hip joint image.
[0151] Even further, in step S5, for the hip joint image enhancement model, it is written based on the Python language, adopts the Pytorch framework, the optimizer uses SGD, the initial learning rate is set to 0.01, the momentum is set to 0.9, the weight decay is set to 0.0001, the training batch is set to 32, the initial number of training epochs is set to 50, and the structural similarity index is used to evaluate the performance of the model after training.
[0152] S6. Train and test the hip joint image enhancement model. Use the pre - processed hip joint image training set to train the model in stages. After training, input the pre - processed hip joint image test set into the model to obtain the enhanced hip joint image.
[0153] Further, in step S6, the specific steps for training and testing the hip joint image enhancement model are as follows.
[0154] S61. In the first stage, use pixel loss to train the hip joint image enhancement model. The calculation formula of the pixel loss is:
[0155] ;
[0156] where N is the total number of pixels of the hip joint image;
[0157] S62. In the second stage, use perceptual loss to train the hip joint image enhancement model. The calculation formula of the perceptual loss is:
[0158] ;
[0159] where is the feature at the th iteration, is the weight coefficient, and its value range during implementation is from 0 to 1, is the square of the L2 norm in the feature space;
[0160] The total loss of the hip joint image enhancement model is , , and are balance weight factors. During implementation, the initial value is set to 1, and its value range is from 0.5 to 1.5, the initial value is set to 0.1, and its value range is from 0.1 to 0.5;
[0161] S63. Calculate the quality of the enhanced hip joint image, and use the structural similarity index to evaluate the performance of the model. The calculation formula of the structural similarity index is:
[0162] ;
[0163] where is the preprocessed hip joint image , is the enhanced hip joint image , is the average value of pixels, is the average value of pixels. During implementation, and the value ranges of is the image and is the covariance of is the variance of is the variance of and are constants to avoid a zero denominator. During the implementation process, and take values of .
[0164] Furthermore, in step S6, as Figure 4 shown, Figure 4 shows the effect diagram before hip joint image enhancement, as Figure 5 shown, Figure 5 shows the effect diagram of the hip joint image after enhancement processed by the hip joint image enhancement model.
[0165] The above is only the preferred implementation manner of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the inventive concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention.
Claims
1. A hip joint image enhancement processing method based on deep learning, characterized in that: The following steps are involved: S1. Construct a hip joint image dataset, collect normal and pathological hip joint images, annotate the region of interest for each hip joint image, and create a hip joint image dataset; S2, preprocessing the hip joint image dataset, including a multi-scale adaptive local contrast enhancement operation and an image registration operation based on transformation invariant features, and dividing the preprocessed hip joint image dataset into a training set and a test set; S3, combining the bidirectional loop mechanism and the token shift mechanism to build a feature extraction module, the bidirectional loop mechanism captures the global dependency of the hip joint image, and the token shift mechanism is used to enhance the local dependency of the hip joint image; S4. Introduce an incremental fusion strategy to construct an iterative feature enhancement module. The incremental fusion strategy gradually fuses hip joint image features at different levels through multi-stage iterations. In each stage, the output features of the previous stage are weightedly fused with the attention features of the current stage, and learnable parameters are designed. Adjust the fusion ratio of new and old features of hip joint images and gradually optimize the global and local dependencies of hip joint images; S5, constructing a hip joint image enhancement model, wherein the hip joint image enhancement model comprises an input, a feature extraction module, an iterative feature enhancement module and an output; S6. Training and testing of hip joint image enhancement model. The model is trained in stages using the preprocessed hip joint image training set. After the training is completed, the preprocessed hip joint image test set is input into the model to obtain enhanced hip joint images.
2. According to the method for hip joint image enhancement based on deep learning in claim 1, it is characterized in that: In step S2, the hip joint image dataset is preprocessed, and the specific steps are as follows: S21. For the multi-scale adaptive local contrast enhancement operation, the local contrast of the hip joint image is enhanced by multi-scale feature extraction and adaptive mechanism. The specific formula is: ; In the formula, is the position of the hip joint in the input image The pixel value of is in scale The features of the local image block calculated below, and It is a scale The local mean and standard deviation under It is a scale The corresponding weights are used to control the importance of different scales. is the gradient of the input image at the hip joint, and are adjustment factors that control the intensity of local contrast enhancement and edge enhancement, is a multi-scale set containing different local window sizes; Weight The mathematical model is: ; In the formula, is the pixel value in the local window, is the position of the hip joint in the input image The pixel value of S22. For the image registration operation based on transformation invariant features, the features in the hip joint image that are invariant to various geometric transformations are extracted to accurately match the joint area in the hip joint image, especially for the lesion area with large morphological differences. The specific formula is: ; In the formula, is the transformation function, which represents the transformation from the hip joint image To hip image The geometric transformation relationship of and is the hip joint image to be matched, The hip joint image The feature point locations, is the total number of feature points extracted from the hip joint image, is the Euclidean distance, Among all possible transformation functions , select a transformation function that minimizes the expression.
3. According to the hip joint image enhancement processing method based on deep learning as described in claim 2, it is characterized in that: In the step S3, the method for constructing the feature extraction module is as follows: S31. Input preprocessed hip joint image , , , and 1 are the height, width and channel of the preprocessed hip joint image, respectively. Through a 3×3 convolution operation, Projection to shallow features , , yes The channel will Flatten to a one-dimensional sequence , , is the total number of tokens for hip joint images, Through the multi-directional token shift layer, the local features of the hip joint image are extracted and the context range of each token is expanded to obtain the feature , Through the linear projection layer, we get the receiving matrix , the bond matrix , value matrix , , , , , and are the weights of the linear projection layer; S32. Calculate the global attention through a bidirectional loop mechanism, where the calculation formula of the bidirectional attention is: ; The calculation formula of the cyclic attention is: ; In the formula, is a circular offset operation; The results of bidirectional and recurrent attention are fused by weighted summation to obtain global attention. , the specific calculation formula is: ; In the formula, is a weight hyperparameter used to balance bidirectional and recurrent attention; By gated attention to the receiving matrix Processing is performed to adjust the receiving strength of each token to obtain the weighted features , the specific calculation formula is: ; In the formula, is the weight matrix, is an element-wise multiplication operation.
4. A hip joint image enhancement processing method based on deep learning according to claim 3, characterized in that: In the step S4, the method for constructing the iterative feature enhancement module is: S41, multi-stage feature initialization, input feature extraction module output features , , generating the initial query through a linear projection layer ,key ,value , , , , , and is the weight matrix; S42, iterative attention calculation and fusion, define the number of iterations as , for each iteration , the calculation formula of attention weight is: ; S43. Design of learnable parameters , , adjust the fusion ratio of new and old features of hip joint images, The specific formula is: ; In the formula, is a learnable scale factor that controls the coupling strength of curvature and entropy, is the local curvature strength of the hip joint input image, is the local information entropy, is the adaptive threshold; Learnable Scale Factor The mathematical model is: ; In the formula, is the learning rate, is the total loss of the hip image enhancement model, is the gradient value; Local curvature strength The mathematical model is: ; In the formula, is the curvature of the hip joint input image, is the gradient magnitude of the hip joint input image; Local information entropy The mathematical model is: ; In the formula, So The sliding window centered on is the pixel in the window Grayscale probability distribution of ; Adaptive Threshold The mathematical model is: ; In the formula, is the learning rate, which controls the threshold adjustment step size, is the median calculation; S44, weighted fusion of the output features of the previous stage and the attention features of the current stage, and use Dynamically adjust the fusion ratio. The specific calculation formula is: ; The fused features are transformed nonlinearly. The specific calculation formula is: ; In the formula, is the projection weight matrix; S45. After each iteration, the initial features are connected through skip connections. Add it to the current fusion feature. ,go through After iterations, the final fusion feature is obtained , after a 3×3 convolution operation, the enhanced hip joint image is generated , the specific calculation formula is: ; In the formula, is a convolution operation with a convolution kernel of 3×3. is the preprocessed hip joint input image.
5. A hip joint image enhancement processing method based on deep learning according to claim 4, characterized in that: In the S5 step, for the hip joint image enhancement model, the input layer receives the preprocessed hip joint image training set, enters the feature extraction module, uses a bidirectional loop mechanism and a multi-directional token shift mechanism to capture the global and local dependencies of the hip joint image, enters the iterative feature enhancement module, adopts an incremental fusion strategy, and continuously fuses hip joint image features at different levels through multi-stage iterations. The output layer outputs the enhanced hip joint image.
6. A hip joint image enhancement processing method based on deep learning according to claim 5, characterized in that: In step S6, the specific steps of training and testing the hip joint image enhancement model are as follows: S61, the first stage uses pixel loss Training the hip joint image enhancement model, the pixel loss The calculation formula is: ; Where N is the total number of pixels in the hip joint image; S62, the second stage uses perceptual loss Training the hip image enhancement model, the perceptual loss The calculation formula is: ; In the formula, It is The characteristics of the iteration, is the weight coefficient, is the square of the L2 norm in the feature space; The total loss of the hip joint image enhancement model is , , and is the balance weight factor, , ; S63, calculating the quality of the enhanced hip joint image, and using the structural similarity index to evaluate the performance of the model, wherein the calculation formula of the structural similarity index is: ; In the formula, is the preprocessed hip joint image , This is the enhanced hip joint image , yes The average value of pixels, yes The average value of pixels, is an image and The covariance of yes The variance of yes The variance of and is a constant to avoid the denominator being zero.
Citation Information
Patent Citations
Visual odometer method and system based on geometric and luminosity consistency
CN118570613A
Tumor analysis method based on pathological tissue image
CN119480151A