Elderly hip bone feature data evaluation method and system based on random forest

By using a random forest-based method for evaluating hip bone characteristics in the elderly, the problem of insufficient utilization of multi-source data was solved. This method enables in-depth mining and risk prediction of bone metabolic indicators and mechanical structures, improves data utilization and visualization, supports rapid integration of new data sources, and meets the needs of research on hip fractures in the elderly.

CN121075627APending Publication Date: 2025-12-05BEIJING JISHUITAN HOSPITAL +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511148351.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-17
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Existing methods for processing hip fracture data in the elderly cannot fully utilize individual bone data from multiple channels and sources, lack in-depth analysis of the relationship between bone metabolism indicators and mechanical structure, and data visualization technology cannot intuitively present the spatial mapping relationship between changes in bone microstructure and fracture risk, thus limiting the development of early warning and precision diagnosis and treatment technologies.

Method used

A random forest-based evaluation method was adopted. By acquiring and preprocessing hip bone feature data of the elderly, dynamic weight sampling and data region division were performed. A random forest module, a sample reweighting module and a hierarchical aggregation module were constructed. Combined with heterogeneous data such as CT images, bone density detection and gene sequences, feature data fusion and model training were performed to achieve intuitive display of bone microstructure changes and fracture risk.

Benefits of technology

It improves data utilization, deeply explores the nonlinear relationship between bone metabolism indicators and mechanical structure, enhances the accuracy and visualization of fracture risk prediction, supports the rapid integration of new data sources and assessment indicators, and meets the needs of hip bone data research in the elderly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121075627A_ABST
    Figure CN121075627A_ABST
Patent Text Reader

Abstract

The invention provides an old-age hip bone characteristic data evaluation method and system based on a random forest, and the method comprises the steps: integrating multi-channel recorded data through a deep optimization random forest algorithm, employing a sampling technology and a data fusion technology, and achieving the deep analysis of the related characteristics of hip fracture; sample data weights are adjusted through iteration, the learning ability for a complex data mode is enhanced, random forest classification is combined, and a tree model is constructed through cooperation of numerous decision trees for data feature analysis. And meanwhile, a feature association mode potentially related to hip fracture is mined through a key feature network. According to the scheme, deep analysis of the hip fracture related data features is realized, the constructed multi-algorithm combined evaluation method can mine the potential relevance of the data features, and the scientificity and accuracy of data analysis are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence, medical data processing and machine learning, in particular to a method and system for evaluating old hip bone feature data based on random forest. BACKGROUND

[0002] With the intensification of global population aging, the problem of mechanical structure change caused by the increase of bone fragility in the elderly group is increasingly prominent. Among various types of old bone problems, hip fracture as a typical brittle fracture type has high disability rate and mortality rate, which poses a severe challenge to minimally invasive treatment and intelligent rehabilitation auxiliary technology.

[0003] With the improvement of people's health consciousness and the progress of medical technology, it is an urgent need in the medical field to objectively and accurately analyze old hip bone data through bone data analysis. However, the existing data processing methods have many shortcomings: the traditional evaluation method based on single data source or simple model cannot fully utilize multi-channel and multi-source individual sample bone data, resulting in insufficient depth of mining complex data relationships. The machine learning-based algorithm focuses on the surface rules of data and lacks deep mining of the correlation between bone metabolism indicators and mechanical structure. At the same time, the data visualization technology still stays at the stage of chart display, which cannot intuitively present the spatial mapping relationship between bone microstructure changes and fracture risk, and is not conducive to researchers to integrate information and use subsequent data information. These technical shortcomings restrict the development of early warning and precise diagnosis and treatment technology for old hip fracture. SUMMARY

[0004] To solve the problems in the prior art, the present application provides a method and system for evaluating old hip bone feature data based on random forest, in particular, the following technical solutions are provided:

[0005] On the one hand, the present application provides a method for evaluating old hip bone feature data based on random forest, the method comprising:

[0006] S1, obtaining original old hip bone feature data and preprocessing to obtain feature data;

[0007] S2, dividing the feature data corresponding to the minority class samples into data regions, and performing dynamic weight sampling based on the data regions, and merging the sampled feature data with the feature data of the majority class samples for model training

[0008] S3, constructing a prediction model and training the prediction model; the prediction model comprises a random forest module, a sample reweighting module and a hierarchical aggregation module;

[0009] S4, based on the trained prediction model, processing the to-be-detected elderly hip bone feature data to obtain an elderly hip bone feature data evaluation result.

[0010] Preferably, the feature data includes six types: basic data, bone density data, bone marker test data, biochemical test data, hemoglobin data, and glycosylated hemoglobin data.

[0011] Preferably, in the data preprocessing process, if the missing value of a certain feature data in the sample individual data is more than 60%, the corresponding feature data in the sample individual data is removed.

[0012] Preferably, in S2, the data region division is as follows:

[0013] S201, for each minority class sample x i , calculate its local density p i in the feature space:

[0014]

[0015] where N k (x i ) represents the set of k-nearest neighbor minority class samples of sample x i , k is the number of neighbors; ‖x i -x j ‖ is the Euclidean distance between sample x i and x j ; V k (x i ) is the volume of the k-nearest neighbor region; and sigma is the kernel function bandwidth.

[0016] S202, calculate the feature complexity H i of the minority class sample:

[0017]

[0018] where F is the total dimension of the feature, and p i,f represents the normalized probability of sample x i on the fth feature.

[0019] S203, calculate the distance d i of the minority class sample to the class boundary: d i =min y∈多数累 ||x i -y||

[0020] where y is a majority class sample.

[0021] S204, set a decision threshold

[0022] The local density median and the feature complexity median of all minority class samples are taken as the local density threshold and the feature complexity threshold respectively; and the one quantile of the boundary distance of all minority class samples is taken as the boundary threshold;

[0023] In S205, the minority class samples are divided into data regions based on the local density threshold, the feature complexity threshold and the boundary threshold.

[0024] Preferably, the divided data regions include a low-density and feature-complex region, a boundary region and other minority class sample regions.

[0025] Preferably, in S2, the dynamic weight sampling method is as follows:

[0026] For the low-density and feature-complex region, weight adaptive ADASYN sampling is adopted: the initial weight of ADASYN in the region is set; and the weight is iteratively updated, and the iterative updating method is as follows:

[0027]

[0028] wherein t is the iteration round; is the number of effective samples generated in the tth round, is the total number of samples generated in the tth round; p min is the minimum local density in all regions, is the average local density after the tth round in the region; b is the weight adjustment coefficient; w ADASYN is the ADASYN sampling weight;

[0029] For the boundary region, weight adaptive Borderline-SMOTE sampling is adopted: the initial weight of Borderline-SMOTE in the region is set; and the weight is iteratively updated, and the iterative updating method is as follows:

[0030]

[0031] wherein, is the classification error rate of the boundary sample in the tth round, is the total error rate of all minority class samples; is the average boundary distance after the tth round in the region; h is the adjustment coefficient; d th is the boundary threshold; w Borderline is the Borderline-SMOTE sampling weight;

[0032] For the other minority class sample regions, weight adaptive SMOTE sampling is adopted: the reference weight of SMOTE in the region is set; and after each iteration, the weight is fine-tuned according to the feature distribution difference between the generated samples and the original samples:

[0033]

[0034] in, Generate sample distribution for round t Compared with the original sample distribution P orig The KL divergence; λ is the fine-tuning coefficient; w SMOTE The sampling weights for SMOTE.

[0035] Preferably, for dynamic weight sampling of minority class sample regions, the sampling weights of each class are normalized after each iteration.

[0036] Preferably, in step S3, the random forest module contains multiple decision trees, and the gain formula for feature selection during the splitting of each decision tree is:

[0037]

[0038] Where S is the sample set of the current node, A is the candidate feature, and S v Let V be a subset of the values ​​v of feature A, Gain represents the Gini gain obtained by partitioning the sample set S using feature A, Gini represents the Gini index of the sample set S, and Values(A) represents all possible values ​​of feature A.

[0039] Preferably, the sample reweighting module performs weight updates in the random forest module in the following manner:

[0040] Initialization phase: for the training set Distribute uniform initial weights Where N represents the number of samples, x i ,y i These represent the input feature vector (or feature representation) of the i-th sample and the label (or target value) of the i-th sample, respectively.

[0041] Iteration phase: S301, train the random forest according to the current sample weights. After the current training round is completed, proceed to S302;

[0042] S302. Calculate the weighted error rate:

[0043]

[0044] Among them, f t (x i ) represents the t-th base model f t For the i-th sample x i The predicted output, w (t) Indicates the current sample weight;

[0045] S303, if ∈ tIf the value of the iteration counter is greater than 0.5, the iteration is terminated, otherwise, step S304 is performed;

[0046] S304, updating the sample weight by the following way:

[0047]

[0048] wherein, Z t is a normalization factor, after updating the sample weight, returning to S301 to continue iteration.

[0049] Preferably, in the S3, the hierarchical aggregation module is used to calculate the final prediction result of each layer decision number, in a specific way:

[0050] The prediction results of each decision tree of each layer are weighted and voted.

[0051] The final prediction probability is calculated:

[0052]

[0053] wherein, K represents the index of the layer, H (k) (x) represents the prediction result of the decision tree to the input sample x in the kth layer.

[0054] Preferably, the method further comprises:

[0055] S5, determining the risk level according to the evaluation result of the old hip bone feature data, and determining the risk factors in the risk assessment.

[0056] Preferably, the determination of the risk factor is:

[0057] The degree centrality and the betweenness centrality of each node in the prediction model are calculated.

[0058] The core subnet V core is determined:

[0059] V core ={v i |D(v i )≥D thres ∧B(v i )≥B thres}

[0060] wherein, v i represents a node, D(v i ) represents the degree centrality of the node v i , B(v i ) represents the betweenness centrality of the node v i , D thres represents the degree centrality threshold, and B thres represents the betweenness centrality threshold.

[0061] Based on the core subnetwork, the nodes are screened by frequency of occurrence and synergistic coefficient, and the core subnetwork is simplified; the nodes in the simplified core subnetwork are used as risk factors.

[0062] Preferably, the normalization factor is calculated in the following manner:

[0063]

[0064] In a second aspect, the present application provides a random forest-based evaluation system for hip bone characteristics of the elderly, which is used to perform the method as described above, and the system comprises:

[0065] A data preprocessing module is configured to obtain original hip bone characteristic data of the elderly and perform preprocessing to obtain feature data.

[0066] A data sampling module is configured to divide the feature data corresponding to the minority class samples into data regions, and perform dynamic weight sampling based on the data regions, and combine the sampled feature data with the feature data of the majority class samples for model training.

[0067] A prediction model module is configured to construct a prediction model and train the prediction model; the prediction model comprises a random forest module, a sample reweighting module and a hierarchical aggregation module.

[0068] A data evaluation module is configured to receive the prediction result of the prediction model module for the hip bone characteristic data of the elderly to be detected, and output an evaluation result of the hip bone characteristic data of the elderly.

[0069] In a third aspect, the present application also provides a random forest-based evaluation device for hip bone characteristics of the elderly, which comprises a processor and a memory, and the processor invokes a program in the memory to perform the random forest-based evaluation method for hip bone characteristics of the elderly as described above.

[0070] Compared with the prior art, the technical scheme of the present application has at least the following beneficial effects:

[0071] In view of the defect that the traditional method cannot integrate multi-source data, the present application converts heterogeneous data such as CT images, bone density detection and gene sequences into a unified feature vector through adaptive sampling and feature-level data fusion, breaks through the dimension limitation of a single data source, and improves the data utilization rate by more than 40%.

[0072] At the algorithm optimization level, a deep optimized random forest model is adopted, the sample weight is adjusted through iteration, the capture ability for low probability but key data patterns is strengthened, compared with the traditional machine learning algorithm, the mining depth of the nonlinear relationship between bone metabolism indicators and mechanical structure is improved, and the problem that the existing algorithm stays on the surface of the data is effectively solved.

[0073] In terms of data visualization, the scheme intuitively displays the spatial relationship between the changes in bone microstructure and the risk of fracture that cannot be presented by traditional charts through spatial mapping and dynamic correlation analysis of key features. In addition, the scheme adopts a modular algorithm architecture design, supports the rapid integration of new data source types and evaluation indicators, and can meet the iterative needs of the elderly hip bone data research scenario, providing a technical solution for bone data deep analysis with accuracy and flexibility. BRIEF DESCRIPTION OF DRAWINGS

[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0075] Figure 1 The system architecture schematic diagram of the scheme of the embodiments of the present application is shown in the figure.

[0076] Figure 2 The step flow chart of the scheme of the embodiments of the present application is shown in the figure.

[0077] Figure 3 The framework schematic diagram of the random forest model of the embodiments of the present application is shown in the figure.

[0078] Figure 4 The factor analysis network construction flow chart of the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION

[0079] The embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be clear that the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0080] Those skilled in the art should know that the following specific embodiments or specific embodiments are a series of optimized settings listed by the present application to further explain the specific invention content, and these settings can be used together or in association with each other, unless the present application explicitly states that some or a specific embodiment or embodiment cannot be associated with other embodiments or embodiments. Set or used together. At the same time, the following specific embodiments or embodiments are only the most optimized setting, and not as an understanding of the protection scope of the present application.

[0081] To achieve the above purpose, the scheme provided by the embodiments mainly includes the following four parts:

[0082] Data preprocessing and sampling: integrate medical data from different historical records, detection devices, and different time nodes, preprocess the integrated data, including filling or deleting missing values, and sampling, to provide high-quality data for subsequent model training.

[0083] Model training: automatically read the preprocessed sample data by integrating various classic machine learning algorithms (such as support vector machine, decision tree, random forest, XGBoost, etc.) and improved random forest model, and train the model based on these data. The improved random forest model combines iterative optimization algorithm and random forest classifier algorithm, continuously adjusts sample weight through iterative training, improves the learning ability of the model to difficult samples, and a large number of decision trees cooperate to form a classifier, which deeply excavates the potential information in the multi-data source sample data records, and improves the generalization ability and data analysis accuracy of the model.

[0084] Hip bone characteristic data evaluation: select technical data in the same format as the training data, use the trained model to process the data to be evaluated, and output the evaluation results, including hip bone characteristic data (such as output corresponding categories) and risk probability (such as corresponding confidence).

[0085] Result display and data analysis: display the output results and interactively analyze the factors using network diagrams.

[0086] The following describes the optional or preferred embodiments of each step of the present embodiment in conjunction with the accompanying drawings.

[0087] Figure 1 A system architecture diagram of an old-age hip bone characteristic data evaluation method for improving the random forest algorithm provided by the embodiments of the present specification, Figure 2 A flowchart of the present scheme, the implementation process of the method of the present application includes:

[0088] Step one: data preprocessing

[0089] Integrate medical data from different historical records, detection devices, and different time nodes, preprocess the integrated data, including filling or deleting missing values, and ensure data format uniformity, to provide high-quality data for subsequent model training.

[0090] In the present embodiment, each data record generally collects the following information completely or partially, and in the present embodiment, the following six types of data are also used as six characteristic data:

[0091] Basic data, such as gender, age, history of fracture, smoking history, drinking history, etc.

[0092] Bone density data, such as: femoral neck density, femoral neck density t value, total hip density, total hip density t value, L total bone density t value, mechanical index, curvature ratio, cross-sectional modulus, etc.

[0093] Bone marker test data, such as: total segment parathyroid hormone, 25-hydroxy vitamin D, total type I procollagen amino-terminal extension peptide, type I collagen carboxy-terminal peptide beta special sequence, N-terminal osteocalcin index data, etc.

[0094] Biochemical test data, such as: total cholesterol, low-density lipoprotein cholesterol, high-density lipoprotein cholesterol, triglycerides, etc.

[0095] Hemoglobin data, and glycosylated hemoglobin data, etc.

[0096] After collecting the above data, the original data needs to be cleaned: for the feature dimension of the sample, if the missing value of a certain feature accounts for more than 60%, the feature is removed; for the missing values in the remaining features, the average value of the sample on the feature is used to fill in.

[0097] In the preprocessing process: for classification features (i.e. discrete features used to represent categories, such as gender, history of fracture, etc.), encoding processing (such as one-hot encoding, label encoding, etc.) is required, rather than directly using the original text or symbol value; for continuous features, normalization processing (such as mapping the data to the [0, 1] interval) is required to eliminate the influence of the dimension difference between different features, so as to facilitate the fusion and learning of the subsequent model to the data.

[0098] The preprocessing of the data further includes: dividing the individual sample data into 80% training set and 20% test set (the ratio of the training set to the test set can be adjusted based on actual demand and data volume, etc.); marking the samples with hip fracture in the past five years in the individual sample data as positive, and setting the corresponding label value to, for example, 1, and marking the remaining samples as negative, and setting the corresponding label to, for example, 0.

[0099] Step two: data sampling

[0100] In this embodiment, for the data after preliminary preprocessing, before model training, the dynamic weight adaptive sampling method is used to solve the possible class imbalance problem in the sample, to obtain a high-quality data set with balanced positive and negative samples, and to prevent model training bias caused by sample imbalance. In this embodiment, due to the multi-source nature of the data and the need to ensure sufficient data volume, the dynamic weight adaptive sampling in this embodiment is set as follows:

[0101] First, feature analysis is performed on the original data, dividing the data regions based on the distribution density and feature complexity of minority class samples. Second, in low-density and feature-complex regions, the weight of ADASYN is increased, leveraging its density-based adaptive sampling characteristics to generate more representative samples. In boundary regions, the weight of Borderline-SMOTE is increased to focus on boundary samples and avoid overfitting. In regular regions, SMOTE is used for basic sampling. By establishing a dynamic weight update formula based on sample feature distance and class separation, the weights of each algorithm are adjusted after each iteration based on the sampling effect, achieving accurate oversampling of minority class samples in multi-source heterogeneous data. This effectively solves the problems of sample overlap and boundary ambiguity inherent in single oversampling methods, significantly improving the model's ability to learn rare data features. After sampling the minority class samples, the results are merged with the majority class sample data and used together as training data for subsequent models.

[0102] In this scheme, the data region division for minority class samples is carried out in the following specific way:

[0103] 1) Calculate the probability density of the minority class samples.

[0104] For each minority class sample x i Calculate its local density ρ in the feature space. i The formula is as follows:

[0105]

[0106] Where, N k (x i ) represents sample x i The set of k-nearest neighbors of the minority class, where k is the number of nearest neighbors. The value of k can be set according to the total number of samples, for example, 10; ||x i -x j || is the sample x i With x j Euclidean distance; V k (x i ρ is the volume of the k-nearest neighbor region, which can be simplified to the average distance between nearest neighbors for high-dimensional feature spaces; σ is the kernel bandwidth, used to control the weight of the distance's influence on density. i The larger the value, the stronger the sample x. i The denser the distribution of minority groups in a region.

[0107] 2) Calculate the complexity of features

[0108] The formula for calculating the feature complexity of a sample is as follows:

[0109]

[0110] Where F is the total dimension of the features, pi,f The sample x i The normalized probability on the f-th feature, for continuous features, the normalized probability can be calculated by kernel density estimation, for discrete features, the normalized probability can be directly taken as the proportion of the category. i The greater the value, the more complex the feature distribution of the region where the sample x i is located, such as scattered feature values and weak correlation.

[0111] 3) Threshold determination for dividing data regions

[0112] Set the density threshold ρ th : take the median of the local density of all minority class samples as the reference

[0113] ρ th = median(ρ i )

[0114] When the density of the minority class sample is greater than or equal to the density threshold, the region is a high-density region, otherwise it is a low-density region.

[0115] Set the feature complexity threshold H th : take the median of the local feature complexity of all minority class samples as the reference

[0116] H th = median(H i )

[0117] When the feature complexity of the minority class sample is greater than or equal to the feature complexity threshold, the region is a feature complex region, otherwise it is a feature simple region (or not complex region).

[0118] Calculate the distance d i of the sample to the category boundary: for each minority class sample x i , the boundary distance is the distance to the nearest majority class sample, the formula is d i = min y∈多数类 ||x i -y||.

[0119] Set the boundary threshold d th : take the 1 / 4 quantile of the boundary distance of all minority class samples, d th = Q 1 / 4 (d i ), when the minority class sample is within the boundary distance threshold (i.e. greater than or equal to the boundary distance threshold), it is considered that the sample is within the region division range of the minority class sample, otherwise it is outside the range of the data region division.

[0120] Based on the above local density threshold, feature complexity threshold and boundary threshold, the minority class sample is divided into data regions. For example, a certain minority class sample region satisfies the local density less than the local density threshold, the feature complexity greater than or equal to the feature complexity threshold, and the boundary within the boundary threshold, then the region is a low density and feature complex region in the minority class sample, and then we use the ADASYN sampling method for sampling. The division method of other regions is similar, and those skilled in the art can reasonably deduce it according to the above description, which will not be described here.

[0121] Further, for the low density and feature complex region, the ADASYN sampling method is used, and the adaptive adjustment of the weight is carried out, and the specific weight adjustment method is as follows:

[0122] 1. Weight adaptive adjustment method of ADASYN in low density and feature complex region

[0123] In the low density and feature complex region (i.e. the minority class sample region with feature density less than the threshold and complexity greater than or equal to the threshold), the weight adjustment of ADASYN is based on the sample distribution density and feature complexity, and by dynamically improving the sampling weight of the sparse and complex region, the generation priority of the representative sample is enhanced.

[0124] 1) Initial weight setting

[0125] Let the initial weight of ADASYN in the region be Based on the proportion of minority class samples in the region and the feature complexity initialization:

[0126]

[0127] Where, n low-complex is the number of minority class samples in the region, N minority is the total number of minority class samples, H region is the average value of local feature entropy in the region, H max is the maximum value of feature entropy in all regions, and α ∈ [0, 1] is a balance coefficient (0.6 is taken, and the feature complexity is emphasized).

[0128] 2) Iterative weight update formula

[0129] After each sampling, the weight is adjusted according to the "effectiveness" (the feature similarity with the real minority class sample) of the generated sample, and the formula is:

[0130]

[0131] Where, t is the iteration round; is the number of effective samples generated in the tth round, is the total number of samples generated in the tth round; and ρmin is the minimum local density in all regions, is the average local density after the t-th round in this region; β ∈ (0, 1] is the weight adjustment coefficient, which can be taken as 0.3, for example, to avoid the weight from growing too fast.

[0132] 3) Adjustment logic

[0133] When the region density is lower (smaller), and the effective sample proportion is higher (larger), the weight is promoted more significantly, and more samples are generated in sparse regions. If the effective sample proportion is lower than 50% for three consecutive rounds, the weight is attenuated by 10% to avoid generating redundant samples.

[0134] 2. Weight self-adaptive adjustment method of Borderline-SMOTE in boundary region

[0135] The weight adjustment of the boundary region focuses on the distance of the sample to the class boundary and the classification uncertainty. By strengthening the sampling weight of the "difficult-to-classify sample", the boundary division accuracy is optimized. In this embodiment, the boundary region refers to the range in which the distance from the sample to the majority class sample is less than or equal to the boundary distance threshold in the minority class sample data region. Since this part of the sample is close to the majority class sample and is near the class boundary, the classification task is heavy and misclassification is prone to occur, so this embodiment is sampled in a specific way.

[0136] 1) Initial weight setting

[0137] The initial weight of Borderline-SMOTE is initialized based on the "fuzziness" of the boundary sample (the prediction probability entropy of the sample by the classifier):

[0138]

[0139] where d region is the average distance of the samples in this region to the boundary, d th is the boundary threshold; is the classification prediction entropy (C is the number of classes, P(c|x) is the probability that sample x is predicted to be class c), and the higher the entropy value, the more fuzzy the classification; γ ∈ [0, 1] is a balance coefficient (usually taken as 0.7, focusing on the boundary distance).

[0140] 2) Iterative weight update formula

[0141] After each iteration, the weight is adjusted according to the classification error rate of the boundary sample:

[0142]

[0143] where e is the classification error rate of the boundary sample in the t-th round, The total error rate for all samples; η is the average boundary distance of the region after the t-th round; η∈(0,1] is the adjustment coefficient, for example, it can be 0.4.

[0144] 3) Adjust the logic

[0145] When the boundary sample error rate is higher ( Larger sample size, closer to the boundary ( When the weighting is more significant (smaller), priority is given to oversampling boundary samples that are "easily misclassified"

[0146] In a more preferred case, if the standard deviation of the boundary distance Greater than d th If the weight is increased by 20%, the processing of areas with ambiguous boundaries will be strengthened.

[0147] 3. Method for determining the weight of SMOTE in the regular area

[0148] The weights for regular regions are based on the stability of sample distribution and sampling efficiency, using relatively fixed baseline weights that are only fine-tuned according to the overall sampling effect to avoid disrupting the core feature distribution. In this embodiment, regular regions refer to minority class sample regions other than the aforementioned boundary regions and low-density, feature-complex regions.

[0149] 1) Setting the benchmark weight

[0150] SMOTE's baseline weights are set based on the density uniformity of minority class samples within the region:

[0151]

[0152] Where, ρ region ρ is the average local density of this region. avg N represents the average local density across all regions. regular θ represents the number of minority class samples in the regular region; θ∈[0,1] is the balance coefficient (taken as 0.5). The baseline weight ranges from [0.3,0.5] to ensure that it does not exceed the upper limit of the weights in other regions.

[0153] 2) Fine-tuning formula

[0154] After each iteration, the weights are fine-tuned based on the difference in feature distribution between the generated samples and the original samples (the difference in feature distribution can be measured by KL divergence):

[0155]

[0156] in, Generate sample distribution for round t Compared with the original sample distribution Porig KL divergence, the larger the divergence, the greater the difference between the distributions; λ∈(0, 1] is a fine-tuning coefficient, for example, it can be 0.2.

[0157] 3) Adjustment logic

[0158] If the generated sample is consistent with the original sample distribution (KL divergence is less than 0.1), the weight remains the baseline value; if the divergence exceeds 0.3, the weight is reduced by 15%, avoiding over-sampling leading to feature deviation.

[0159] The conventional area weight is always not higher than the weight of ADASYN and Borderline-SMOTE, ensuring that resources are preferentially allocated to more critical areas.

[0160] 4, Weight normalization

[0161] To ensure that the sum of the weights of each area is 1 (for easy overall sampling ratio control), the weights are normalized after each iteration:

[0162]

[0163] The normalized weight is directly used to allocate the sampling quantity of each area, for example, if the total sampling quantity is M, then the sampling quantity of ADASYN is denotes the normalized ADASYN weight after the tth iteration, denotes the normalized Borderline-SMOTE weight after the tth iteration, denotes the normalized SMOTE weight after the tth iteration.

[0164] Further, in the present embodiment, the different sampling methods of different areas, i.e. minority oversampling (SMOTE), Borderline-SMOTE and ADASYN (adaptive synthetic sampling method), have the following sampling algorithm:

[0165] a) SMOTE: linear interpolation between minority class samples to generate new samples

[0166] x new = x i + λ·(x j -x i )

[0167] where x i is the selected minority class sample, x j is one of the k-nearest neighbors of x i , and λ is a random number between 0 and 1.

[0168] b) Borderline-SMOTE: an improved version of SMOTE, focusing on oversampling the minority class samples in the border region

[0169] For each minority class sample x i , compute the proportion p i of majority class samples in its k-neighbors:

[0170] If p i satisfies a threshold condition (e.g., 0.5 < p i < 0.9), then x i is determined to be a border sample.

[0171] For a border sample x i , randomly select a sample x j from its minority class neighbors, and generate a new sample

[0172] x new : x new = x i + d - (x j - x i ), where d is a random number in the interval [0, 1].

[0173] c) ADASYN: estimate the distribution density of minority class samples, and adaptively assign different sampling weights to each minority class sample, generating more samples in areas with lower density, thereby balancing the data distribution.

[0174] For each minority class sample x i , compute the number k i of minority class samples in its k-neighbors, and define the density

[0175] The total number of minority class samples to be generated is G = N major - N minor

[0176] The number of generated samples for each sample x i is: g i = round(w i · G)

[0177] For each minority class sample x i , generate g i new samples x new : x new = x i + d - (x j - x i )

[0178] where x j is xi the minority class in k-nearest neighbors, and δ is a random number in the interval [0, 1].

[0179] Step three: prediction model construction and training

[0180] In this embodiment, a boosted random forest model is constructed, and a grid search method is used to optimize the hyperparameters, so as to achieve better hip bone data analysis results.

[0181] Further preferably, the construction process of the boosted random forest model in this embodiment is as follows:

[0182] 1) Use bootstrap sampling method to extract n sample subsets from the training set;

[0183] 2) Construct a random forest for each sample subset, and randomly select part of the features for evaluation by Gini index when node splitting;

[0184] 3) Weighted combination of random forests;

[0185] 4) Iterative optimization of the boosted model performance.

[0186] Figure 3 The framework diagram of the boosted random forest model provided for the preferred solution is shown in FIG. 1. As shown in FIG. 1, the model realizes performance improvement through an improved hybrid strategy, which specifically includes: Figure 3

[0187] 1) Basic random forest layer

[0188] Contains multiple decision trees (tree 1-tree N shown in the figure), and each tree is generated by Bootstrap sampling to generate a training subset. The feature selection when a single decision tree splits uses the following gain formula:

[0189]

[0190] Where S is the current node sample set, A is the candidate feature, S v is the subset of feature A taking value v, Gain represents the Gini gain obtained by dividing the sample set S using feature A, Gini represents the Gini index of the sample set S, and Values(A) represents all possible values of feature A.

[0191] 2) Sample reweighting module

[0192] Initialization stage: assign uniform initial weights to the training set Where N represents the number of samples, x i , y i ​​respectively represent the input feature vector (or feature representation) of the i-th sample and the label (or target value) of the i-th sample.

[0193] Iteration process:

[0194] a. According to the current sample weight w (t) Train the random forest, and after one round of training, go to step b;

[0195] b. Calculate the weighted error rate

[0196]

[0197] where f t (x i ) represents the prediction output of the t-th base model f t (i.e. the t-th random forest) on the i-th sample x i .

[0198] c. If ∈ t > 0.5, terminate the iteration, otherwise go to step d;

[0199] d. Update the sample weight

[0200]

[0201] where Z t is a normalization factor, and after updating the sample weight, return to step a to continue iteration.

[0202] 3) Hierarchical aggregation

[0203] Prediction output of the j-th tree in the k-th layer:

[0204]

[0205] Hierarchical weighted voting

[0206]

[0207] Final prediction probability:

[0208]

[0209] where K represents the index of the layer, represents the weight coefficient of the j-th decision tree in the k-th layer, N represents the total number of decision trees contained in the k-th layer, and sign() represents the sign function, which is used to convert the "weighted voting sum" into a binary classification decision.

[0210] So far, we can complete the establishment of the prediction model and train the model.

[0211] Step four: risk assessment and network factor analysis

[0212] Based on the trained model, the medical data of a new patient can be input to predict the probability of hip fracture. If the predicted probability is greater than 0.5, it is high risk, otherwise it is low risk.

[0213] Based on the trained model, the feature analysis is performed to output the results such as the correlation strength of each feature and hip fracture, feature interaction network and risk assessment probability.

[0214] In this embodiment, further based on the prediction model, the risk factors in risk assessment can be further determined.

[0215] The prediction model proposed in this embodiment can be regarded as a graph structure composed of multiple decision trees as an integrated learning method:

[0216] G=(V,E)

[0217] Wherein, the vertex set V={v i} represents all the internal nodes (including split nodes and leaf nodes) of the decision trees, and the edge set E={e ij} describes the parent-child relationship between nodes, which satisfies that v j is a direct child node of v i , then e ij =1, otherwise 0.

[0218] For a forest containing T trees, the joint graph structure can be represented by the graph union of all decision trees in the forest:

[0219]

[0220] After obtaining the model network, the network nodes and connections need to be screened to obtain the key network, and a multi-index joint screening strategy is adopted:

[0221] a) degree centrality

[0222]

[0223] The nodes with degree centrality value higher than the threshold D thres =μ D +ασ D , wherein μD represents the mean (average) of the degree centrality values of all nodes in the network, σ represents the standard deviation of the degree centrality values of all nodes in the network, and α represents a self-defined adjustment coefficient, which is set to 1 here.

[0224] b) betweenness centrality

[0225]

[0226] Where, σ st Let σ be the total number of shortest paths from node s to t. st (v i ) is after v i The number of paths.

[0227] Final core subnet V core The node set satisfies:

[0228] V core ={v i |D(v i )≥D thres ∧B(v i )≥B thres}

[0229] B thres This represents the betweenness centrality threshold.

[0230] The core subnetwork can be used to explain the risk factors for hip fractures and the correlations between these factors. For example... Figure 4 As shown, the size and color of the nodes represent the frequency and importance of the features, respectively, while the color depth and thickness of the lines connecting the nodes represent the strength of the synergistic effect between the features, that is, the likelihood that these features together lead to risk.

[0231] After obtaining the core subnet, risk factors are determined using the following methods:

[0232] 1) Node filtering: Only retain "occurrence frequency ( The node of ")"; The formula for calculating the frequency of occurrence of a corresponding feature in the training dataset is as follows:

[0233]

[0234] 2) Collaborative Relationship Filtering: Only retain |S ij | The number of connections between nodes is ≥0.2, which simplifies the core subnet structure and highlights the closely related characteristics of risk.

[0235] S ij It is the synergy coefficient, which quantifies the "color depth" and "thickness" of the lines connecting nodes.

[0236] The calculation formula is:

[0237]

[0238] The core subnet is simplified by filtering nodes whose frequency of occurrence exceeds a certain threshold and by filtering nodes whose cooperative relationship exceeds a certain threshold. The nodes and their connections that remain after simplification are identified as risk factors.

[0239] The effect of the present scheme and the existing commonly used model is compared through actual data test. In the present embodiment, the baseline model is six binary classification machine learning models: logistic regression model, support vector machine, decision tree, random forest, XGBoost and AdaBoost. The specific implementation details are as follows:

[0240] The logistic regression model uses sklearn.linear_model.LogisticRegression with default parameters;

[0241] The support vector machine uses sklearn.svm.SVC with a polynomial kernel function configured by kernel='poly';

[0242] The decision tree uses sklearn.tree.DecisionTreeClassifier with default parameters;

[0243] The random forest uses sklearn.ensemble.RandomForestClassifier with the number of trees set to 100 and the remaining parameters as default values;

[0244] The XGBoost model uses xgboost.XGBClassifier with a learning rate (learning_rate) set to 0.1 and the number of trees (n_estimators) set to 100;

[0245] The AdaBoost model uses sklearn.ensemble.AdaBoostClassifier with a default decision tree as the base classifier and the number of iterations (n_estimators) set to 50.

[0246] All models are evaluated by 5-fold cross-validation, and the grid search is used to optimize the hyperparameters. The experimental comparison results are shown in Table 1.

[0247] Table 1

[0248]

[0249] As can be seen from a large number of measured data, the scheme provided by the present application is significantly better than the existing commonly used model in terms of accuracy and the like.

[0250] In another embodiment, the scheme of the present application can also be implemented by a random forest-based elderly hip bone feature data evaluation system, which can perform the random forest-based elderly hip bone feature data evaluation method as described in the above embodiment. The system comprises:

[0251] a data preprocessing module configured to obtain original old hip bone feature data and perform preprocessing to obtain feature data;

[0252] a data sampling module configured to divide the feature data into data regions and perform dynamic weight sampling based on the data regions to obtain sampled feature data; the sampled feature data is used for training of a prediction model;

[0253] a prediction model module configured to construct a prediction model and train the prediction model; the prediction model comprises a random forest module, a sample reweighting module and a hierarchical aggregation module;

[0254] a data evaluation module configured to receive a prediction result of the prediction model module for old hip bone feature data to be detected to output an old hip bone feature data evaluation result.

[0255] The system can further comprise input and output devices for interaction and control with a user.

[0256] In addition, the system can also perform result display and analysis: the software displays statistical information of the analysis result (such as feature correlation degree ranking, model evaluation index, etc.), and provides data visualization analysis function, and the user can understand the data distribution characteristics and the mutual relationship between factors in a network diagram intuitive way. In addition, the user can export the analysis result as an Excel or CSV file, to provide multi-dimensional data reference for doctors to formulate personalized diagnosis and treatment schemes, such as assisting in judging high-risk feature combinations, optimizing bone density monitoring frequency, formulating targeted nutrition intervention plans, etc.

[0257] It should be noted that the part of the module structure not specifically defined in the present application shall be subject to the content described in the prior art. The prior art mentioned in the foregoing background section and the specific embodiment section of the present application can be used as a part of the present application to understand the meaning of some technical features or parameters. The protection scope of the present application shall be subject to the content actually described in the claims.

[0258] In another embodiment, the present application can be implemented by a device, which can include corresponding modules for performing one or more steps in each of the above embodiments. Therefore, each step or several steps of each of the above embodiments can be performed by corresponding modules, and the device can include one or more of these modules. The modules can be one or more hardware modules specially configured to perform the corresponding steps, or implemented by a processor configured to perform the corresponding steps, or stored in a computer readable medium for implementation by a processor, or implemented by some combination.

[0259] Logic and / or steps represented in flow diagrams or otherwise described herein can be embodied in any readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, processor- based system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions, or a combination of the above.

[0260] The above description is only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for evaluating hip bone characteristics data of the elderly based on a random forest, characterized by, The method comprises: S1, obtaining original old hip bone feature data and preprocessing to obtain feature data; S2, dividing the feature data corresponding to the minority class samples into data regions, and performing dynamic weight sampling based on the data regions, and merging the sampled feature data with the feature data of the majority class samples for prediction model training; S3, constructing a prediction model and training the prediction model; the prediction model comprises a random forest module, a sample reweighting module, and a hierarchical aggregation module; S4, based on the trained prediction model, processing the old hip bone feature data to be detected to obtain an old hip bone feature data evaluation result.

2. The method of claim 1, wherein, In S2, the data region division method is: S201、For each minority class sample x i , compute its local density p i in the feature space: where N k (x i ) denotes the set of k-nearest minority samples of sample x i ; ‖x i -x j ‖ is the Euclidean distance between sample x i and x j ; V k (x i ) is the volume of the k-nearest neighbor region; and σ is the kernel function bandwidth. S202, calculating the feature complexity H of the minority class sample i : where F is the total dimensionality of the features, p i,f denotes the sample x i the normalized probability on the f-th feature; S203, calculate the distance d of the minority class sample to the class boundary i : d i = min y∈多数类 ||x i -y|| Wherein, y is the majority class sample; S204, setting a judgment threshold Taking the local density median and the feature complexity median of all minority class samples as the local density threshold and the feature complexity threshold respectively; taking the quantile of the boundary distance of all minority class samples as the boundary threshold; S205, dividing the minority class samples into data regions based on the local density threshold, the feature complexity threshold, and the boundary threshold.

3. The method of claim 1, wherein, In S2, the dynamic weight sampling method is: For low-density and feature complex regions, weight adaptive ADASYN sampling is used: set the initial weight of ADASYN in this region; perform iterative updating of the weight, and the iterative updating method is where t is the iteration round; the effective sample number generated for the tth round, the total sample number generated for the round; p min the minimum local density in all regions, the average local density of the region after the tth round; β is a weight adjustment coefficient; w ADASYN the ADASYN sampling weight; For the boundary region, weight adaptive Borderline-SMOTE sampling is used: set the initial weight of Borderline-SMOTE in this region; perform iterative updating of the weight, and the iterative updating method is where, is the classification error rate of the boundary samples in the tth round, is the total error rate of all minority class samples; is the average boundary distance after the tth round in the region; η is the adjustment coefficient; d th is the boundary threshold; w Borderline is the Borderline-SMOTE sampling weight; For other minority class sample regions, weight adaptive SMOTE sampling is used: set the reference weight of SMOTE in this region; after each iteration, the weight is fine-tuned according to the feature distribution difference between the generated samples and the original samples: wherein, Generating sample distribution for the t-th round KL divergence with the original sample distribution P orig ; λ is a fine-tuning coefficient; w SMOTE is the SMOTE sampling weight.

4. The method of claim 1, wherein, In S3, the random forest module contains multiple decision trees, and the gain formula for feature selection when each decision tree is split is: where S is the current node sample set, A is a candidate feature, S v is the subset of feature A taking value v, Gain represents the Gini gain obtained by dividing the sample set S using feature A, Gini represents the Gini index of the sample set S, and Values(A) represents all possible values of feature A.

5. The method of claim 1, wherein, The sample reweighting module updates the weight in the random forest module, and the specific method is: Initialization phase: for training set Assign uniform initial weights where N represents the number of samples, x i , y i respectively represent the input feature vector of the i-th sample and the label of the i-th sample; Iteration stage: S301, training the random forest according to the current sample weight, and when the current training is completed, entering S302; S302, calculating the weighted error rate: wherein f t (x i ) represents the t-th base model f t for the i-th sample x i , w (t) represents the current sample weight; S303, if ∈ t > 0.5 then terminate iteration, otherwise perform step S304; S304, updating the sample weight by the following method: where Z t is a normalization factor, and after updating the sample weights, the process continues with S301.

6. The method of claim 1, wherein, In S3, the hierarchical aggregation module is used to calculate the final prediction result of each layer of decision trees, and the specific method is: Weighted voting is performed on the prediction results of each decision tree in each layer; Calculate the final prediction probability: where K denotes the index of the level, H (k) represents the prediction result of the decision tree in the kth level for the input sample x.

7. The method of claim 1, wherein, The method further comprises: S5, determining the risk level according to the old hip bone feature data evaluation result, and determining the risk factors in the risk assessment.

8. The method of claim 7, wherein, The determination method of the risk factors is: Calculate the degree centrality and betweenness centrality of each node in the prediction model; Determining core subnets V core : V core = {v i | D(v i ) ≥ D thres ∧ B(v i ) ≥ B thres} wherein v i represents a node, D(v i ) represents the degree centrality of the node v i , B(v i ) represents the betweenness centrality of the node v i , D thres represents a degree centrality threshold value, and B thres represents a betweenness centrality threshold value. Based on the core subnetwork, simplify the core subnetwork through the appearance frequency screening and the synergistic coefficient screening of each node; the nodes in the simplified core subnetwork are used as the risk factors.

9. The method of claim 5, wherein, The calculation method of the normalization factor is:

10. A random forest-based geriatric hip bone feature data evaluation system, characterized by, The system is used to execute the method of any one of claims 1-9, and the system comprises: The data preprocessing module is configured to acquire original old hip bone feature data and perform preprocessing to obtain feature data. The data sampling module is configured to perform data region division on feature data corresponding to a minority class sample, perform dynamic weight sampling based on the data region, and combine the sampled feature data with feature data of a majority class sample for training of a prediction model. The prediction model module is configured to construct a prediction model and train the prediction model. The data evaluation module is configured to receive a prediction result of the prediction model module on old hip bone feature data to be detected, and output an evaluation result of the old hip bone feature data.