Bone age prediction method based on custom attention matrix and lightweight network
Through custom attention matrix and lightweight network architecture, the problem of complex data processing and computing resource dependence in bone age prediction is solved, and efficient bone age prediction and early abnormal detection is achieved, which is suitable for a variety of medical environments.
Patent Information
- Application Number
- CN202410849330.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing deep learning methods have problems in bone age prediction, such as complex data processing, insufficient feature extraction, and poor generalization ability of prediction models, and have a large dependence on computing resources, which limits the effectiveness and application scope of the model.
Using a bone age prediction method based on custom attention matrix and lightweight network, the lightweight network architecture is used to group bone age prediction data sets, preprocess, build custom attention matrix, weighted feature extraction and deep feature extraction. For example, the Xception module combines deep separable convolution and global average pooling technology to optimize feature extraction and reduce computing resource requirements.
It significantly improves the accuracy of bone age prediction and model sensitivity, reduces the demand for computing resources, makes the method feasible in an environment with limited computing power, and improves the prediction efficiency and model applicability.
Smart Images

Figure CN119028597A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical image processing technology, and in particular to a bone age prediction method based on a custom attention matrix and a lightweight network. Background Art
[0002] In the medical field, accurate prediction of bone age is crucial for diagnosing children's developmental status, evaluating growth abnormalities, and formulating corresponding treatment plans. Traditional bone age prediction methods mainly rely on doctors' visual comparison of hand X-rays, using classic methods such as the Glitsch-Pyle (G&P) method or the Tana-Whitehouse (TW) method. These methods require highly professional medical knowledge, and the results are greatly affected by subjective judgment, resulting in certain limitations in the accuracy and repeatability of the predictions. With the development of technology, machine learning and deep learning technologies have been introduced into bone age prediction, especially the use of convolutional neural networks (CNN) to process X-ray images, which has demonstrated the potential to process large amounts of data and improve prediction accuracy. However, existing deep learning methods still face technical challenges in their specific implementation, such as complex data processing, insufficient feature extraction, and weak generalization of prediction models.
[0003] Although the existing deep learning-based bone age prediction methods have improved in accuracy, most methods still require a large amount of manually annotated data and fail to fully utilize the key area information in medical images during the feature extraction process, which limits the effectiveness and application scope of the model. In addition, existing methods mostly rely on complex network structures, resulting in high consumption of computing resources, which is not conducive to promotion and application in resource-constrained medical facilities.
[0004] Therefore, developing a bone age prediction method that can automatically emphasize key growth area features, optimize feature extraction and mapping processes, and reduce dependence on complex computing resources becomes the key to improving the accuracy and practicality of bone age prediction. Summary of the invention
[0005] Based on the above objectives, the present invention provides a bone age prediction method based on a custom attention matrix and a lightweight network.
[0006] The bone age prediction method based on custom attention matrix and lightweight network includes the following steps:
[0007] S1: The bone age prediction dataset is grouped according to age groups, with each age group having an interval of 6 months;
[0008] S2: Preprocess the bone age prediction dataset;
[0009] S3: Build a custom attention matrix based on expert-annotated growth regions;
[0010] S4: extract features from the preprocessed bone age image and generate a preliminary weighted feature map;
[0011] S5: The weighted feature map is used to extract deep features through a lightweight network, and the bone age prediction result is output through the prediction layer;
[0012] S6: Post-process the bone age prediction results to generate a detailed bone age prediction report.
[0013] Furthermore, the S1 specifically includes:
[0014] S11: The data in the bone age prediction dataset are grouped by age groups, with each age group separated by 6 months. Specifically, the dataset is sorted by the patient's date of birth and the data in adjacent time periods are divided into one group to ensure that the amount of data in each age group is balanced to accommodate the differences in the speed of bone age development at different stages.
[0015] Furthermore, the S2 specifically includes:
[0016] S21: Gamma transformation, which performs gamma transformation on the bone age dataset image to adjust the image contrast and enhance the dark details of the image;
[0017] S22: Gaussian blur, applies Gaussian blur to the gamma transformed image to remove noise from the image;
[0018] S23: Binarization processing, binarization processing of the blurred image;
[0019] S24: removing noise, performing an opening operation on the binarized image to remove noise in the image;
[0020] S25: Determine the background area, the foreground area and the unknown area: perform a dilation operation on the image after the opening operation to determine the background area; calculate the Euclidean distance transform of the image after the opening operation, and then perform threshold processing on the distance transform image to determine the foreground area; subtract the foreground area from the background area to obtain the unknown area;
[0021] S26: Obtain the segmented foreground image. First, mark the connected components of the foreground area to obtain a marked image. Then, create a mask based on the marked image, find the contour on the mask, find the largest contour, and calculate the bounding box of the largest contour. Finally, crop the original grayscale image based on the bounding box to obtain the final foreground image.
[0022] S27: Adjust the size of the preprocessed bone age image to a fixed size predetermined by the network input layer to ensure the consistency of the input image.
[0023] Furthermore, the S3 specifically includes:
[0024] S31: According to the annotations of the doctor expert, a growth area is selected in the image to be predicted for bone age, and a rectangular frame is drawn in the selected growth area to ensure that the growth area covers the information required for bone age prediction;
[0025] S32: Calculate the Euclidean distance from each pixel in the bone age prediction image to the center of each rectangular frame. Calculate the center point of each rectangular box The distance is: Among them, d ij Represents pixel To the center of the rectangle The distance between the pixels and the rectangle is represented by i and j respectively;
[0026] S33: Find the shortest distance d from each pixel to the center of each rectangular frame i,min , and record the shortest distance to generate a distance matrix, the formula is: i,min =min(d ij ), where d i,min Represents pixel The shortest distance to the center of all rectangular boxes;
[0027] S34: According to the distance matrix in S23, a distance threshold T is set, and the distance greater than T is assigned a value of 0 in the custom attention matrix; for the pixel point whose distance is equal to the center position of the rectangular box, a value of 1 is assigned in the custom attention matrix; the remaining distance values are normalized, and the normalization formula is: Among them, D i Represents pixel The normalized distance value of , T is the set distance threshold;
[0028] S35: The normalized matrix is used as a custom attention matrix. The areas with higher values in the matrix represent growth areas that are more important for model training and prediction.
[0029] Furthermore, the S4 specifically includes:
[0030] S41: weighted input feature 1, image after preprocessing of bone age prediction dataset;
[0031] S42: weighted input feature 2, the feature result after the image of the bone age prediction dataset is preprocessed and convolved with a 1*1 convolution kernel;
[0032] S43: weighted input feature 3, the result of multiplying the image after preprocessing of the bone age prediction dataset with the custom attention matrix;
[0033] S44: weighted fusion, weighted fusion of the features mentioned in S41, S42 and S43 to obtain a weighted feature map G;
[0034] S45: normalize the weighted feature map G to ensure that the range of the feature value is within a certain interval to prevent the subsequent feature extraction and prediction from being affected by excessively large or small values; the formula for normalization is: Among them, G i,j,c ′ represents the normalized weighted feature map at position and the value of channel c, min(G) and max(G) represent the minimum and maximum values in the weighted feature map, respectively.
[0035] Furthermore, the S5 specifically includes:
[0036] S51: Input the weighted feature map obtained in S4 into the lightweight network, namely the Xception module, to extract deep information in the feature map;
[0037] S52: In the Xception module, multi-layer convolution operations are used to capture fine-grained features and high-level semantic information in the weighted feature map. The convolution layers include standard convolution, depth-wise separable convolution, and nonlinear operations with activation functions to enhance the network’s expressiveness.
[0038] S53: After the Xception module, the high-dimensional feature map is further reduced to a low-dimensional feature vector through the global average pooling layer. The global average pooling layer generates a low-dimensional vector with global features by averaging the feature maps of each channel to reduce the number of parameters and prevent overfitting.
[0039] S54: The low-dimensional feature vector output by the global average pooling layer is input into the fully connected layer to extract and combine the information in the feature vector. The fully connected layer maps the input feature vector through linear transformation and activation function to generate the final bone age prediction result.
[0040] Furthermore, the S6 specifically includes:
[0041] S61: receiving the bone age prediction result output by the fully connected layer;
[0042] S62: performing error correction on the bone age prediction result, by comparing the actual age with the predicted age and applying a preset correction algorithm to correct the error, so as to ensure the accuracy of the prediction result;
[0043] S63: Comprehensively analyzing the corrected bone age prediction results and other clinical information of the patient to generate a multi-dimensional assessment report, wherein the other clinical information includes height, weight, and growth rate;
[0044] S64: Visualize the prediction results and display the bone age prediction results and their changing trends in the form of charts and curves, so that doctors and researchers can quickly understand and apply them. The visualization includes generating age-bone age comparison charts and bone age growth curve charts;
[0045] S65: Prepare a bone age prediction report, including numerical analysis of the prediction results, corrected precise age assessment, conclusions of the comprehensive analysis, and visual charts.
[0046] Beneficial effects of the present invention:
[0047] The present invention, by introducing a custom attention matrix, significantly optimizes the feature extraction process. By accurately calibrating key growth areas in X-ray images and using a custom attention matrix to emphasize the features of these areas, the present invention can more effectively identify details that are critical to bone age assessment. This method not only improves the accuracy of bone age prediction, but also enhances the model's sensitivity to subtle changes in the image, thereby detecting abnormalities in growth and development at an early stage.
[0048] The present invention, by adopting a lightweight network architecture, significantly reduces the demand for computing resources, so that the bone age prediction method can run quickly in an environment with limited computing power. By combining deep separable convolution and global average pooling technology, the number of model parameters is greatly reduced, thereby accelerating the training speed and improving the prediction efficiency. This makes the present invention not only suitable for high-end medical equipment, but also can be widely used in primary medical institutions, providing economical and efficient bone age assessment services. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic diagram of a bone age prediction method according to an embodiment of the present invention;
[0051] Figure 2 Schematic diagram of the preprocessing process of the bone age prediction data set according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.
[0053] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0054] like Figure 1-Figure 2 As shown in the figure, the bone age prediction method based on the custom attention matrix and the lightweight network includes the following steps:
[0055] S1: The bone age prediction dataset is grouped according to age groups, with each age group having an interval of 6 months;
[0056] S2: Preprocess the bone age prediction dataset;
[0057] S3: Build a custom attention matrix based on expert-annotated growth regions;
[0058] S4: extract features from the preprocessed bone age image and generate a preliminary weighted feature map;
[0059] S5: The weighted feature map is used to extract deep features through a lightweight network, and the bone age prediction result is output through the prediction layer;
[0060] S6: Post-process the bone age prediction results to generate a detailed bone age prediction report.
[0061] S1 specifically includes:
[0062] S11: The data in the bone age prediction dataset are grouped by age groups, with each age group separated by 6 months. Specifically, the dataset is sorted by the patient's date of birth and the data in adjacent time periods are divided into one group to ensure that the amount of data in each age group is balanced to accommodate the differences in the speed of bone age development at different stages.
[0063] S2 specifically includes:
[0064] S21: Gamma transformation, which performs gamma transformation on the bone age dataset image to adjust the image contrast and enhance the dark details of the image;
[0065] S22: Gaussian blur, applies Gaussian blur to the gamma transformed image to remove noise from the image;
[0066] S23: Binarization processing, binarization processing of the blurred image;
[0067] S24: removing noise, performing an opening operation on the binarized image to remove noise in the image;
[0068] S25: Determine the background area, the foreground area and the unknown area: perform a dilation operation on the image after the opening operation to determine the background area; calculate the Euclidean distance transform of the image after the opening operation, and then perform threshold processing on the distance transform image to determine the foreground area; subtract the foreground area from the background area to obtain the unknown area;
[0069] S26: Obtain the segmented foreground image. First, mark the connected components of the foreground area to obtain a marked image. Then, create a mask based on the marked image, find the contour on the mask, find the largest contour, and calculate the bounding box of the largest contour. Finally, crop the original grayscale image based on the bounding box to obtain the final foreground image.
[0070] S27: Adjust the size of the preprocessed bone age image to a fixed size predetermined by the network input layer to ensure the consistency of the input image.
[0071] S3 specifically includes:
[0072] S31: According to the annotations of the doctor expert, a growth area is selected in the image to be predicted for bone age, and a rectangular frame is drawn in the selected growth area to ensure that the growth area covers the information required for bone age prediction;
[0073] S32: Calculate the Euclidean distance from each pixel in the bone age prediction image to the center of each rectangular frame. Calculate the center point of each rectangular box The distance is: Among them, d ij Represents pixel To the center of the rectangle The distance between the pixels and the rectangle is represented by i and j respectively;
[0074] S33: Find the shortest distance d from each pixel to the center of each rectangular frame i,min , and record the shortest distance to generate a distance matrix, the formula is: i,min =min(d ij ), where d i,min Represents pixel The shortest distance to the center of all rectangular boxes;
[0075] S34: According to the distance matrix in S23, a distance threshold T is set, and the distance greater than T is assigned a value of 0 in the custom attention matrix; for the pixel point whose distance is equal to the center position of the rectangular box, a value of 1 is assigned in the custom attention matrix; the remaining distance values are normalized, and the normalization formula is: Among them, D i Represents pixel The normalized distance value of , T is the set distance threshold;
[0076] S35: The normalized matrix is used as a custom attention matrix. The areas with higher values in the matrix represent growth areas that are more important for model training and prediction.
[0077] S4 specifically includes:
[0078] S41: weighted input feature 1, image after preprocessing of bone age prediction dataset;
[0079] S42: weighted input feature 2, the feature result after the image of the bone age prediction dataset is preprocessed and convolved with a 1*1 convolution kernel;
[0080] S43: weighted input feature 3, the result of multiplying the image after preprocessing of the bone age prediction dataset with the custom attention matrix;
[0081] S44: weighted fusion: weighted fusion of the features mentioned in S41, S42 and S43 to obtain a weighted feature map G;
[0082] S45: normalize the weighted feature map G to ensure that the range of the feature value is within a certain interval to prevent the subsequent feature extraction and prediction from being affected by excessively large or small values; the formula for normalization is: Among them, G i,j,c ′ represents the normalized weighted feature map at position and the value of channel c, min(G) and max(G) represent the minimum and maximum values in the weighted feature map, respectively.
[0083] S5 specifically includes:
[0084] S51: Input the weighted feature map obtained in S4 into the lightweight network, namely the Xception module, to extract deep information in the feature map;
[0085] S52: In the Xception module, multi-layer convolution operations are used to capture fine-grained features and high-level semantic information in the weighted feature map. The convolution layers include standard convolution, depth-wise separable convolution, and nonlinear operations with activation functions to enhance the network’s expressiveness.
[0086] S53: After the Xception module, the high-dimensional feature map is further reduced to a low-dimensional feature vector through the global average pooling layer. The global average pooling layer generates a low-dimensional vector with global features by averaging the feature maps of each channel to reduce the number of parameters and prevent overfitting.
[0087] S54: The low-dimensional feature vector output by the global average pooling layer is input into the fully connected layer to extract and combine the information in the feature vector. The fully connected layer maps the input feature vector through linear transformation and activation function to generate the final bone age prediction result.
[0088] S6 specifically includes:
[0089] S61: receiving the bone age prediction result output by the fully connected layer, which is a preliminary prediction value generated by the network model after feature extraction and mapping;
[0090] S62: performing error correction on the bone age prediction result, by comparing the actual age with the predicted age, applying a preset correction algorithm to correct the error, and ensuring the accuracy of the prediction result. The correction algorithm can be optimized based on statistical analysis and historical data;
[0091] S63: Comprehensively analyze the corrected bone age prediction results with other clinical information of the patient to generate a multi-dimensional assessment report. Other clinical information includes height, weight, and growth rate. This step improves the comprehensiveness and reference value of the report by combining multiple data sources.
[0092] S64: Visualize the prediction results and display the bone age prediction results and their changing trends in the form of charts and curves, so that doctors and researchers can quickly understand and apply them. The visualization includes generating age-bone age comparison charts and bone age growth curve charts;
[0093] S65: Write a bone age prediction report, which includes numerical analysis of the prediction results, accurate age assessment after correction, conclusions of comprehensive analysis, and visual charts. The report must clearly explain the significance of the prediction results and their application value in clinical diagnosis. Through the above steps S61 to S66, the bone age prediction results are systematically post-processed, including error correction, comprehensive analysis, visualization processing and report generation, to ensure the accuracy and practicality of the prediction results. The generated detailed bone age prediction report provides reliable data support for clinical diagnosis and research, and improves the scientificity and effectiveness of bone age assessment.
[0094] The present invention is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A bone age prediction method based on a custom attention matrix and a lightweight network, characterized in that: The following steps are involved: S1: The bone age prediction dataset is grouped according to age groups, with each age group having an interval of 6 months; S2: Preprocess the bone age prediction dataset; S3: Build a custom attention matrix based on expert-annotated growth regions; S4: extract features from the preprocessed bone age image and generate a preliminary weighted feature map; S5: The weighted feature map is used to perform deep feature extraction through a lightweight network, and the bone age prediction result is output through the prediction layer; S6: Post-process the bone age prediction results to generate a detailed bone age prediction report.
2. The bone age prediction method based on a custom attention matrix and a lightweight network according to claim 1, characterized in that: The S1 specifically includes: S11: The data in the bone age prediction dataset are grouped by age groups, with each age group separated by 6 months. Specifically, the dataset is sorted by the patient's date of birth and the data in adjacent time periods are divided into one group to ensure that the amount of data in each age group is balanced to accommodate the differences in the speed of bone age development at different stages.
3. The bone age prediction method based on a custom attention matrix and a lightweight network according to claim 1, characterized in that: The S2 specifically includes: S21: Gamma transformation, which performs gamma transformation on the bone age dataset image to adjust the image contrast and enhance the dark details of the image; S22: Gaussian blur, applies Gaussian blur to the gamma transformed image to remove noise from the image; S23: Binarization processing, binarization processing of the blurred image; S24: removing noise, performing an opening operation on the binarized image to remove noise in the image; S25: Determine the background area, the foreground area and the unknown area: perform a dilation operation on the image after the opening operation to determine the background area; calculate the Euclidean distance transform of the image after the opening operation, and then perform threshold processing on the distance transform image to determine the foreground area; subtract the foreground area from the background area to obtain the unknown area; S26: Obtain the segmented foreground image. First, mark the connected components of the foreground area to obtain a marked image. Then, create a mask based on the marked image, find the contour on the mask, find the largest contour, and calculate the bounding box of the largest contour. Finally, crop the original grayscale image based on the bounding box to obtain the final foreground image. S27: Adjust the size of the preprocessed bone age image to a fixed size predetermined by the network input layer to ensure the consistency of the input image.
4. The bone age prediction method based on a custom attention matrix and a lightweight network according to claim 1, characterized in that: The S3 specifically includes: S31: According to the annotation of the doctor expert, a growth area is selected in the image to be predicted for bone age, and a rectangular frame is drawn in the selected growth area to ensure that the growth area covers the information required for bone age prediction; S32: Calculate the Euclidean distance from each pixel in the image to be predicted for bone age to the center of each rectangular frame. i , y i ), calculate its distance to the center point of each rectangular box The distance is: Among them, d ij Represents a pixel (x i , y i ) to the center of the rectangular frame The distance between the pixels and the rectangle is represented by i and j respectively; S33: Find the shortest distance d from each pixel to the center of each rectangular frame i,min , and record the shortest distance to generate a distance matrix, the formula is: i,min =min(d ij ), where d i,min Represents a pixel (x i , y i ) to the shortest distance from the center of all rectangular boxes; S34: According to the distance matrix in S23, a distance threshold T is set, and the distance greater than T is assigned a value of 0 in the custom attention matrix; for the pixel point whose distance is equal to the center position of the rectangular box, a value of 1 is assigned in the custom attention matrix; the remaining distance values are normalized, and the normalization formula is: Among them, D i Represents a pixel (x i , y i ), T is the set distance threshold; S35: The normalized matrix is used as a custom attention matrix. The areas with higher values in the matrix represent growth areas that are more important for model training and prediction.
5. The bone age prediction method based on a custom attention matrix and a lightweight network according to claim 1, characterized in that: The S4 specifically includes: S41: weighted input feature 1, image after preprocessing of bone age prediction dataset; S42: weighted input feature 2, the feature result after the image of the bone age prediction dataset is preprocessed and convolved with a 1*1 convolution kernel; S43: weighted input feature 3, the result of multiplying the image after preprocessing of the bone age prediction dataset with the custom attention matrix; S44: weighted fusion, weighted fusion of the features mentioned in S41, S42 and S43 to obtain a weighted feature map G; S45: normalize the weighted feature map G to ensure that the range of the feature value is within a certain interval to prevent the subsequent feature extraction and prediction from being affected by excessively large or small values; the formula for normalization is: Among them, G i,j,c ′ represents the value of the normalized weighted feature map at position (i, j) and channel c, min(G) and max(G) represent the minimum and maximum values in the weighted feature map, respectively.
6. The bone age prediction method based on a custom attention matrix and a lightweight network according to claim 1, characterized in that: The S5 specifically includes: S51: Input the weighted feature map obtained in S4 into the lightweight network, namely the Xception module, to extract deep information in the feature map; S52: In the Xception module, multi-layer convolution operations are used to capture fine-grained features and high-level semantic information in the weighted feature map. The convolution layers include standard convolution, depth-wise separable convolution, and nonlinear operations with activation functions to enhance the network’s expressiveness. S53: After the Xception module, the high-dimensional feature map is further reduced to a low-dimensional feature vector through the global average pooling layer. The global average pooling layer generates a low-dimensional vector with global features by averaging the feature maps of each channel to reduce the number of parameters and prevent overfitting. S54: The low-dimensional feature vector output by the global average pooling layer is input into the fully connected layer to extract and combine the information in the feature vector. The fully connected layer maps the input feature vector through linear transformation and activation function to generate the final bone age prediction result.
7. The bone age prediction method based on a custom attention matrix and a lightweight network according to claim 1, characterized in that: The S6 specifically includes: S61: receiving the bone age prediction result output by the fully connected layer; S62: performing error correction on the bone age prediction result, by comparing the actual age with the predicted age and applying a preset correction algorithm to correct the error, so as to ensure the accuracy of the prediction result; S63: Comprehensively analyzing the corrected bone age prediction results and other clinical information of the patient to generate a multi-dimensional assessment report, wherein the other clinical information includes height, weight, and growth rate; S64: Visualize the prediction results and display the bone age prediction results and their changing trends in the form of charts and curves, so that doctors and researchers can quickly understand and apply them. The visualization includes generating age-bone age comparison charts and bone age growth curve charts; S65: Prepare a bone age prediction report, including numerical analysis of the prediction results, corrected precise age assessment, conclusions of the comprehensive analysis, and visual charts.
