Semen quality prediction method and system based on random forest
Through a random forest-based method, combined with multi-dimensional screening criteria and feature screening algorithms, differential features related to semen quality are screened out, a core feature subset is constructed and a model is trained. This solves the problems of inaccurate feature selection and insufficient model generalization ability in existing technologies, and achieves high accuracy and stability in semen quality prediction.
Patent Information
- Application Number
- CN202510334650.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-03-20
AI Technical Summary
Existing semen quality prediction methods suffer from inaccurate feature selection and insufficient model generalization capabilities, resulting in unstable prediction results and poor accuracy.
A random forest-based method was used to screen out differential features related to abnormal semen quality through multi-dimensional screening criteria and feature screening algorithms, construct a core feature subset, and train a random forest model for prediction. The model performance was optimized by combining Lasso regression and support vector machine recursive feature elimination methods.
The accuracy of semen quality prediction and the generalization ability of the model have been improved. It can more accurately screen out key features, effectively process complex data relationships, and construct a semen quality prediction model with high prediction accuracy and good generalization ability.
Smart Images

Figure CN119889726B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a semen quality prediction method and system based on random forest. Background Art
[0002] Existing solutions for semen quality prediction primarily rely on traditional statistical methods and machine learning models. Traditional statistical methods, such as linear regression and logistic regression, analyze parameters such as semen concentration, motility, and morphology to develop prediction equations to assess semen quality. These methods assume linear relationships between variables and impose strict requirements on data distribution, resulting in limited prediction accuracy in practical applications. With the advancement of computing power and the increase in data volumes, machine learning models have gradually replaced traditional statistical methods and become the mainstream technology. Machine learning models (such as support vector machines and gradient boosting machines) can handle nonlinear relationships and have low requirements on data distribution, making them excellent for complex semen quality data. However, despite the advantages of machine learning models in semen quality prediction, existing solutions still face the following challenges: 1. Inaccurate feature selection: Metabolite data for semen quality prediction is typically high-dimensional and contains a large number of features (such as metabolite concentration and motility). Existing solutions often rely on simple statistical methods or empirical rules for feature selection, which can result in inaccurate features. For example, certain features that contribute significantly to the prediction of semen quality may be ignored, while some irrelevant or redundant features are retained. This inaccurate feature selection will directly affect the predictive performance of the model, resulting in unstable prediction results. 2. Insufficient model generalization ability: Existing machine learning models may perform well on training data, but often show poor generalization ability when faced with new, unseen clinical data. This is because existing technical solutions fail to fully consider the diversity and complexity of clinical data during the model training process. For example, semen samples from different patients may be affected by a variety of factors (such as lifestyle habits, genetic factors, etc.), and existing models find it difficult to adapt to this diversity, resulting in poor prediction results in practical applications.
[0003] Therefore, the existing semen quality prediction algorithms have problems with inaccurate feature selection and insufficient type generalization ability, which affects the accuracy of semen quality prediction. Summary of the Invention
[0004] The embodiments of the present invention provide a semen quality prediction method and system based on random forest, which can improve the accuracy of semen quality prediction.
[0005] An embodiment of the present invention provides a method for predicting semen quality based on random forest, comprising the following steps:
[0006] Obtaining metabolite data samples of different semens, and preprocessing the metabolite data samples to obtain preprocessed metabolite data samples; the metabolite data samples are obtained by pre-testing and analyzing the different semens;
[0007] The pre-processed metabolite data samples were analyzed based on the preset multi-dimensional screening criteria to identify differential features associated with abnormal semen quality;
[0008] A preset feature screening algorithm is used to screen and evaluate differential features, and a core feature subset that meets the requirements for semen quality prediction is determined based on preset optimization indicators;
[0009] Based on the core feature subset, a pre-built semen quality prediction model based on a random forest algorithm is trained;
[0010] The trained semen quality prediction model is used to predict the quality of the metabolite data of the semen to be tested, and the semen quality prediction result is obtained.
[0011] As an improvement to the above scheme, the pre-processed metabolite data samples are analyzed based on preset multi-dimensional screening criteria to determine differential features associated with abnormal semen quality, including:
[0012] The OPLS-DA method was used to screen metabolites with variable importance projection values greater than 1;
[0013] The Wilcoxon signed-rank test was used to screen metabolites with an FDR-corrected P value less than 0.05;
[0014] Fold difference analysis was used to screen metabolites with fold differences greater than 2 or less than 0.5;
[0015] The metabolites that met the above three screening criteria were regarded as significant differential metabolites, and the significant differential metabolites were regarded as differential features associated with abnormal semen quality.
[0016] As an improvement to the above scheme, the preset feature screening algorithm is used to screen and evaluate the differential features, and a core feature subset that meets the semen quality prediction requirements is determined based on the preset optimization index, including:
[0017] Using the Lasso regression method, by introducing the L1 regularization term in the loss function, the regression coefficient is dynamically adjusted so that the coefficients of irrelevant difference features shrink to zero, retaining the difference features that have predictive power for the response variable;
[0018] Using the support vector machine recursive feature elimination method, the support vector machine classifier is trained based on the current differential feature set, the importance of the differential features is calculated, and the differential feature with the smallest weight is removed. The above steps are repeated until the remaining differential features reach the predetermined number, thereby obtaining the core feature subset that meets the requirements for semen quality prediction.
[0019] As an improvement to the above solution, the Lasso regression method introduces an L1 regularization term into the loss function to dynamically adjust the regression coefficients so that the coefficients of irrelevant difference features shrink to zero, retaining the difference features that have predictive power for the response variable, including:
[0020] Construct a loss function that minimizes the prediction error and the L1 regularization term: , is the sample size; is the number of features; is the intercept; is the regression coefficient of the jth feature; is the value of the jth feature in the i-th sample; is the response variable of the i-th sample; is a regularization hyperparameter that controls The intensity of the penalty; among them, minimizing the prediction error is used to measure the quality of the model fit, and the L1 regularization term shrinks the coefficients of unimportant difference features to zero by weighted penalty on the absolute value of the regression coefficient;
[0021] During the training process, the regression coefficients are dynamically adjusted so that the coefficients of irrelevant differential features shrink to zero, while the coefficients of relevant features maintain a larger absolute value. Ultimately, only differential features that have predictive power for the response variable are retained, and the optimal regularization parameter is selected through cross-validation to achieve a balance between model sparsity and predictive power.
[0022] As an improvement to the above scheme, the support vector machine recursive feature elimination method is used to train a support vector machine classifier based on the current differential feature set, calculate the importance of the differential features, remove the differential features with the smallest weight, and repeat the above steps until the remaining differential features reach a predetermined number, thereby obtaining a core feature subset that meets the requirements for semen quality prediction, including:
[0023] Input the differential feature set and response variable, wherein the differential feature set includes significantly differential metabolites screened by OPLS-DA, Wilcoxon signed rank test, and fold difference analysis; the response variable is the classification label of semen quality prediction model;
[0024] Using a support vector machine algorithm, a classifier is trained based on the current differential feature set and the response variable to construct an optimal classification decision surface, wherein the classification decision surface is used to distinguish different categories of semen quality samples;
[0025] The support vector machine model is used to calculate the weight vector of each difference feature. The weight vector represents the contribution of each difference feature to the classification decision surface. The larger the absolute value of the weight, the greater the contribution of the feature to the classification.
[0026] According to the weight vector, the importance of each difference feature is evaluated, and the importance is measured by the absolute value of the weight vector, and the difference feature with the smallest weight is removed;
[0027] The set of differential features is updated, and the process of training the support vector machine classifier, calculating feature importance, and removing the differential features with the smallest weight is repeated until the number of remaining differential features reaches a predetermined number;
[0028] The final core feature subset is output, which includes the differential features that contribute most to the prediction of semen quality.
[0029] As an improvement to the above solution, the pre-built semen quality prediction model based on the random forest algorithm is trained based on the core feature subset, including:
[0030] Constructing new training and test sets from the core feature subset;
[0031] The newly constructed training set is used to train a random forest model, which serves as a semen quality prediction model. During the training process, samples are randomly sampled from the training set with replacement to construct multiple different training subsets to increase sample diversity. Feature random sampling is also used to randomly select some features for training each time a decision tree is constructed to reduce model complexity. Furthermore, model performance is optimized by adjusting specific hyperparameters of the model, including the number of decision trees and the maximum depth of the random forest model.
[0032] The sample data in the test set is input into the trained random forest model. The random forest model predicts the semen quality of each test sample based on the learned correlation pattern between core features and semen quality, and outputs the corresponding prediction results.
[0033] The 10-fold cross-validation method was used to evaluate the performance of the random forest model on the training set, and to evaluate the sensitivity, specificity, and AUC value of the random forest model.
[0034] Another embodiment of the present invention provides a semen quality prediction system based on random forest, including:
[0035] An acquisition module is used to acquire metabolite data samples of different semens and pre-process the metabolite data samples to obtain pre-processed metabolite data samples; the metabolite data samples are obtained by pre-testing and analyzing different semens;
[0036] An analysis module is used to analyze the pre-processed metabolite data samples based on preset multi-dimensional screening criteria to determine the differential features related to abnormal semen quality;
[0037] The screening module is used to screen and evaluate differential features using a preset feature screening algorithm, and determine the core feature subset that meets the semen quality prediction requirements based on preset optimization indicators;
[0038] A training module, configured to train a pre-built semen quality prediction model based on a random forest algorithm based on the core feature subset;
[0039] The prediction module is used to use the trained semen quality prediction model to predict the quality of the metabolite data of the semen to be tested to obtain the semen quality prediction result.
[0040] As an improvement to the above solution, the analysis module is specifically used to:
[0041] The OPLS-DA method was used to screen metabolites with variable importance projection values greater than 1;
[0042] The Wilcoxon signed-rank test was used to screen metabolites with an FDR-corrected P value less than 0.05;
[0043] Fold difference analysis was used to screen metabolites with fold differences greater than 2 or less than 0.5;
[0044] The metabolites that met the above three screening criteria were regarded as significant differential metabolites, and the significant differential metabolites were regarded as differential features associated with abnormal semen quality.
[0045] As an improvement to the above solution, the screening module is specifically used for:
[0046] Using the Lasso regression method, by introducing the L1 regularization term in the loss function, the regression coefficient is dynamically adjusted so that the coefficients of irrelevant difference features shrink to zero, retaining the difference features that have predictive power for the response variable;
[0047] Using the support vector machine recursive feature elimination method, the support vector machine classifier is trained based on the current differential feature set, the importance of the differential features is calculated, and the differential feature with the smallest weight is removed. The above steps are repeated until the remaining differential features reach the predetermined number, thereby obtaining the core feature subset that meets the requirements for semen quality prediction.
[0048] As an improvement to the above solution, the training module is specifically used to:
[0049] Constructing new training and test sets from the core feature subset;
[0050] The newly constructed training set is used to train a random forest model, which serves as a semen quality prediction model. During the training process, samples are randomly sampled from the training set with replacement to construct multiple different training subsets to increase sample diversity. Feature random sampling is also used to randomly select some features for training each time a decision tree is constructed to reduce model complexity. Furthermore, model performance is optimized by adjusting specific hyperparameters of the model, including the number of decision trees and the maximum depth of the random forest model.
[0051] The sample data in the test set is input into the trained random forest model. The random forest model predicts the semen quality of each test sample based on the learned correlation pattern between core features and semen quality, and outputs the corresponding prediction results.
[0052] The 10-fold cross-validation method was used to evaluate the performance of the random forest model on the training set, and to evaluate the sensitivity, specificity, and AUC value of the random forest model.
[0053] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0054] First, metabolite data samples of different semen obtained by detection and analysis are obtained and preprocessed to provide reliable basic data. Then, the preprocessed data is deeply analyzed according to the preset multidimensional screening criteria, and the differential features related to abnormal semen quality are accurately located, providing a key basis for subsequent accurate prediction. Then, a preset feature screening algorithm is used to screen and evaluate these differential features, and a core feature subset is determined according to the optimization index, effectively reducing the data dimension and highlighting key information. Based on this core feature subset, a semen quality prediction model of a pre-constructed random forest algorithm is trained, and the generalization ability and efficiency of the random forest algorithm are utilized and the advantages of random forest in processing high-dimensional data, evaluating feature importance, and resisting overfitting are fully utilized. Finally, the trained model is used to predict the semen metabolite data to be tested, and the semen quality prediction result is obtained. Therefore, the embodiment of the present invention can more accurately screen out key features, effectively process complex data relationships, and construct a semen quality prediction model with high prediction accuracy and good generalization ability through the combination of multidimensional screening criteria, efficient feature screening algorithm and random forest model with strong generalization ability, thereby effectively improving the accuracy of semen quality prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 1 is a flow chart of a method for predicting semen quality based on random forests provided by one embodiment of the present invention;
[0056] Figure 2 This is a comparison diagram of differential metabolites between a semen quality abnormality case group and a control group provided by one embodiment of the present invention;
[0057] Figure 3 This is a graph showing the analysis results of the Lasso regression provided by one embodiment of the present invention;
[0058] Figure 4 1 is a diagram showing analysis results of support vector machine recursive feature elimination (SVM-RFE) provided by one embodiment of the present invention;
[0059] Figure 5 1 is a diagram showing the prediction results of four machine learning models provided in one embodiment of the present invention;
[0060] Figure 6 This is a structural diagram of a semen quality prediction system based on random forest provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0062] See also Figure 1 , is a flow chart of a method for predicting semen quality based on a random forest, provided by one embodiment of the present invention. The method for predicting semen quality based on a random forest comprises the following steps:
[0063] S10, obtaining metabolite data samples of different semens, and preprocessing the metabolite data samples to obtain preprocessed metabolite data samples; the metabolite data samples are obtained by pre-testing and analyzing the different semens;
[0064] S11, analyze the pre-processed metabolite data samples based on the preset multi-dimensional screening criteria to determine the differential features associated with semen quality abnormalities;
[0065] S12, using a preset feature screening algorithm to screen and evaluate the differential features, and determining a core feature subset that meets the semen quality prediction requirements based on a preset optimization index;
[0066] S13, training a pre-built semen quality prediction model based on a random forest algorithm based on the core feature subset;
[0067] S14, using the trained semen quality prediction model to perform quality prediction on the metabolite data of the semen to be tested, to obtain a semen quality prediction result.
[0068] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0069] First, metabolite data samples of different semen obtained by detection and analysis are obtained and preprocessed to provide reliable basic data. Then, the preprocessed data is deeply analyzed according to the preset multidimensional screening criteria, and the differential features related to abnormal semen quality are accurately located, providing a key basis for subsequent accurate prediction. Then, a preset feature screening algorithm is used to screen and evaluate these differential features, and a core feature subset is determined according to the optimization index, effectively reducing the data dimension and highlighting key information. Based on this core feature subset, a semen quality prediction model of a pre-constructed random forest algorithm is trained, and the generalization ability and efficiency of the random forest algorithm are utilized and the advantages of random forest in processing high-dimensional data, evaluating feature importance, and resisting overfitting are fully utilized. Finally, the trained model is used to predict the semen metabolite data to be tested, and the semen quality prediction result is obtained. Therefore, the embodiment of the present invention can more accurately screen out key features, effectively process complex data relationships, and construct a semen quality prediction model with high prediction accuracy and good generalization ability through the combination of multidimensional screening criteria, efficient feature screening algorithm and random forest model with strong generalization ability, thereby effectively improving the accuracy of semen quality prediction.
[0070] Understandably, semen quality prediction models hold broad promise in clinical applications, particularly in assisted reproductive technologies. Using these models, physicians can more accurately assess a patient's fertility potential and optimize treatment plans, thereby improving success rates. For example, during in vitro fertilization (IVF), semen quality prediction models can help physicians select the embryos most likely to be successful for transfer, reducing the risks and costs of multiple attempts. Furthermore, semen quality prediction models can be used to monitor a patient's hormone levels and follicular development, enabling timely adjustments to treatment plans to ensure optimal fertility outcomes. Predictive models also play a crucial role in the early diagnosis of male infertility. By analyzing a man's semen parameters, genetic factors, and lifestyle data, predictive models can identify potential infertility risks and assist physicians in early intervention. For example, some predictive models can predict the risk of sperm DNA damage, which is crucial for assessing male fertility and developing treatment strategies. Early diagnosis not only improves treatment outcomes but also reduces unnecessary consumption of medical resources and improves patients' quality of life. Developing personalized treatment plans is another important area for the clinical application of semen quality prediction models. By integrating multiple dimensions of patient information, including genetic information, clinical data, and lifestyle, predictive models can tailor the most appropriate treatment plan for each patient. For example, in cancer treatment, predictive models can recommend the most effective drug combinations and treatment strategies based on the patient's genetic mutation profile and the molecular characteristics of the tumor. This personalized treatment plan not only improves treatment efficacy but also reduces side effects and enhances patients' quality of life. Based on a matched case-control population of oligospermia and asthenospermia, this study will screen and analyze non-targeted metabolites in seminal plasma, combined with questionnaire survey results on factors affecting semen quality, and using machine learning models to construct a predictive model for male semen quality. This will provide stronger support for clinical practice and male reproductive health management.
[0071] As an example, the semen sample analysis and pretreatment process is as follows: First, the semen sample is centrifuged at 15,000 rpm at 4°C for 10 minutes. After separating the seminal plasma, methanol is added for protein precipitation, followed by overnight incubation at -20°C. The next day, the sample is centrifuged at 14,000 g at 4°C for 20 minutes. The supernatant is collected and vacuum centrifuged to dryness. The sample is then reconstituted in a 1:9 methanol / water mixture, vortexed, and centrifuged again to obtain the supernatant for analysis. Quality control (QC) samples are prepared by mixing 5 µL of each sample, and blank samples are prepared with ultrapure water. Liquid chromatography analysis uses a mobile phase of 0.1% formic acid in ultrapure water and methanol with a gradient elution, with a run time of 25 minutes per sample. Metabolite qualitative analysis utilizes a multi-layered qualitative analysis system, including the OSI / SMMS system developed by the Chinese Academy of Sciences, widely used online databases, and computational mass spectrometry structure prediction libraries. A total of 259 metabolites were identified, as detailed in Table 1. During data analysis, a series of algorithms were used to standardize and process the data, including global parameter settings, data normalization (sample and feature-wise), 80% rule-based feature removal (features are retained if the proportion of non-zero values in any category is greater than or equal to 80%; otherwise, they are removed), peak table data filtering based on the RSD values of QC samples, and missing value filling (using variable minimum value processing). Before machine learning modeling, all metabolomics data were normalized. This normalization method ensured that each feature had a mean of zero and a standard deviation of one, thereby eliminating the influence of different feature scales and ensuring that each feature contributed equally to model training.
[0072] Table 1 259 metabolites
[0073] Metabolites VIP value <![CDATA[P FDR Value]]> FC value (±)13-HDoHE 1.24 0.00 0.86 (1S,2R,4aR,8aR)-1-Acetoxy-7-isopropylidene-1,4a-dimethyl-6-oxodecahydro-2-naphthalenyl 2,3-dimethyl-2-oxiranecarboxylate 0.95 0.01 1.18 (1S,Z)-3-((2R,E)-7-hydroxy-2,5-dimethyloct-4-en-1-ylidene)-1-methyloctahydro-2H-quinolizin-1-ol 1.87 0.00 0.78 (2E,6E,12E)-19-(2-amino-2-oxoethyl)-9,11-dihydroxy-8-methoxy-10,12,14-trimethyl-15-oxohenicosa-2,6,12-trienedioicacid 0.94 0.00 0.77 (2S)-3-(1H-indol-3-yl)-2-[[2-(2-oxo-4-propylchromen-7-yl)oxyacetyl]amino]propanoicacid 0.95 0.01 1.18 (3S,8aS)-3-[(1R)-1-Hydroxyethyl]hexahydropyrrolo[1,2-a]pyrazine-1,4-dione 0.79 0.01 0.84 (4a'R,5'S,6'R,6a'S,7'R,10a'R,10b'R)-6'-Acetoxy-4a',6a',10b'-trimethyl-5-oxododecahydro-2'H-dispiro[furan-3,3'-benzo[f]chromene-7',2''-oxiran]-5'-yl 2-methylpropanoate 1.19 0.00 1.15 (6R)-vitamin D2 6,19-sulfurdioxide adduct / (6R)-ergocalciferol 6,19-sulfurdioxide adduct 0.75 0.02 1.16 (R)-4'-Deoxyindenestrol 1.05 0.01 1.43 1-[3-(4-methyl-2-oxo-6,7,8,9-tetrahydro-[1]benzofuro[3,2-g]chromen-3-yl)propanoyl]-4-phenylpiperidine-4-carboxylicacid 0.41 0.00 1.35 11-deoxy-16,16-dimethyl-PGE2 0.40 0.04 1.18 11Z-6s-trans-fixed bicyclicretinal 0.86 0.00 1.69 16(R)-HETE 0.92 0.01 1.18 17R,18S-Epoxy-5Z,8Z,11Z,14Z-icosatetraenoicacid 0.55 0.03 1.17 17-α-Methyltestosterone 0.95 0.02 4.06 1-Methoxy-2-hydroxyanthracene 0.93 0.00 0.76 2-(3,5-dihydroxyphenyl)-5,7-dihydroxy-6,8-bis(3-methylbut-2-enyl)-2,3-dihydrochromen-4-one 0.70 0.03 1.31 2-(4-Ethoxyphenyl)-5,6,7,8-tetramethoxy-4H-1-benzopyran-4-one 0.68 0.04 0.84 20-HETE 0.96 0.01 1.17 2-Amino-3,7-dideoxy-D-threo-hept-6-ulosonicacid 0.87 0.04 0.84 2-butyl-6-heptylpiperidine 0.61 0.04 1.23 3,5-Dihydroxy-1,4-naphthoquinone 0.11 0.01 1.17 3,6-Dimethoxyestra-1,3,5(10),6,8-pentaene-17β-carboxylic acidmethyl ester 0.65 0.04 1.22 3,7-Diethyl-11-methyltrideca-1,3,6,10-tetraene 0.18 0.00 1.22 3,8a-Dimethyl-5-methylene-2-oxo-2,4,4a,5,6,7,8,8a,9,9a-decahydronaphtho[2,3-b]furan-8-yl acetate 0.07 0.05 1.21 3-Hydroxyisovalerylcarnitine 1.49 0.00 0.83 3-Methyluridine 1.23 0.00 1.40 3β-(3-methyl-butanoyloxy)-villanovane-13α,17-diol 0.80 0.00 1.34 4-[[2-(3,4,7-trimethyl-2-oxochromen-5-yl)oxypropanoylamino]methyl]cyclohexane-1-carboxylic acid 0.65 0.01 1.34 4-hydroxy-3-[(E)-7-hydroxy-3,7-dimethyl-4-oxooct-5-enyl]-5-(3-methylbut-2-enyl)benzoicacid 0.85 0.00 1.23 5a-Androstan-17β-ol-3-one 0.97 0.01 1.20 5-Hydroxytryptophol 1.09 0.00 1.51 5-Phosphooxy-L-lysine 0.84 0.03 1.27 6,7-Dimethoxy-1-[2-(2,3,4-trimethoxy-phenyl)-vinyl]-3,4-dihydro-isoquinoline 0.71 0.03 1.44 6-[3-[(3,4-dimethoxyphenyl)methyl]-4-methoxy-2-(methoxymethyl)butyl]-4-methoxy-1,3-benzodioxole 1.36 0.00 0.82 7,11-Methano-2H,4H-oxireno[1,8]cycloocta[1,2-f][2]benzopyran-8-acetic acid, 4-(3-furanyl)dodecahydro-alpha,11-dihydroxy-4a,7,9,9-tetramethyl-10-(2-methyl-1-oxopropoxy)-2,13-dioxo-,methyl ester,(alphaR,4R,4aR,7S,8S,10S,11S,11aR,12aS)- 0.70 0.03 1.20 9-Phenanthrol 0.67 0.04 0.72 9α-Fluoro-11β,16α,17α,21-tetrahydroxypregn-4-ene-3,20-dione 0.28 0.03 1.16 Acetaminophen 1.33 0.00 1.48 Acetylsulfamethoxazole 0.59 0.03 0.81 Acetyl-T2 Toxin 0.14 0.00 0.87 Adrenosterone 0.74 0.04 1.31 Alibendol 0.81 0.01 1.22 Aminopentol 0.42 0.00 1.36 Artocarpin 1.09 0.00 0.86 Asp Glu 1.22 0.00 1.66 Asp Trp 1.46 0.00 1.61 Asp-glu 1.27 0.00 1.33 Benzoic acid, 2,4,5-trimethoxy- 1.51 0.00 0.80 Benzoic acid, 4-hydroxy-, (1aS,2aR,3S,5R,6S,7aR)-3-(acetyloxy)decahydro-5-hydroxy-2a,7a-dimethyl-5-(1-methylethyl)azuleno[5,6-b]oxiren-6-ylester 0.43 0.02 1.18 beta-D-Glucopyranose,O-6-deoxy-alpha-L-mannopyranosyl-(1->4)-O-beta-D-glucopyranosyl-(1->6)-1-O-[(2alpha,3beta,5xi,6beta,9xi)-2,3,6,23-tetrahydroxy-28-oxoolean-12-en-28-yl]- 0.44 0.00 0.86 Bifenazate 0.50 0.00 1.22 Brefeldin A 0.75 0.01 1.16 Butein 1.16 0.00 0.75 Calycanthidine 0.78 0.01 1.23 Carnosol 0.65 0.04 0.83 CARβPENTANE 0.63 0.04 0.85 Cetyltrimethylammonium bromide 0.79 0.00 1.16 Chlorophorin 0.64 0.01 1.17 Chol-11-EnicAcid 0.49 0.00 2.20 Cinmethylin 0.51 0.02 1.15 cis-5-Tetradecenoylcarnitine 1.12 0.00 0.79 cis-6,7-epoxy-9Z-heptadecene 0.20 0.02 1.95 Cisapride 0.18 0.04 1.16 cis-Hinokiresinol 0.53 0.01 5.65 Clemastinefumarate14976-57-9 0.82 0.01 1.17 CYCLOPENTOLATEHYDROCHLORIDE 1.59 0.00 0.52 D-(+)-Octopine 0.66 0.00 0.62 Denatoniumbenzoate3734-33-6 1.32 0.00 0.69 DGDG 19:0 0.18 0.04 1.26 Dienestrol 1.02 0.00 14.97 Difluprednate 0.32 0.01 1.31 Dihomomethionine 0.55 0.00 1.35 Dihydroabieticacid 1.01 0.01 1.24 DiphenhydramineHCl (Benadryl) 1.10 0.00 1.38 Exemestane 0.70 0.02 1.16 Ferrioxamine H 1.09 0.00 1.19 Furanogermenone 1.06 0.00 1.25 Glaucarubin 0.68 0.01 1.20 Gln Leu 1.14 0.00 1.20 Glu Glu 0.84 0.02 1.41 Glu Met 0.51 0.04 1.17 Glu Trp 0.92 0.03 1.22 Glu Tyr 1.73 0.00 1.36 Glutaminylthreonine 0.93 0.00 0.49 Glu-Val-Phe 1.41 0.00 2.08 Gly Phe 0.51 0.00 1.31 Glycidylstearate 0.89 0.05 1.16 Guazatine 0.80 0.00 1.19 Heterodendrin 1.01 0.01 0.85 Hirsuteine 1.05 0.00 0.86 Hydroxyprolyl-Proline 1.62 0.00 1.39 Ichangin 0.75 0.00 1.20 Iminostilbene 0.53 0.02 1.59 Kinetin 0.93 0.00 1.20 L-165,04179558-09-1 1.37 0.00 1.98 L-Carnitine 1.78 0.00 0.75 Leu-Gly-Pro 0.75 0.00 0.80 Linoleoylethanolamide 0.92 0.00 0.85 L-Palmitoylcarnitine 0.55 0.00 0.84 Lysyl-Isoleucine 1.27 0.00 1.54 METHACHOLINE 2.02 0.00 0.69 MG 17:0 0.61 0.00 1.25 MG(0:0 / 22:6(4Z,7Z,10Z,13Z,16Z,19Z) / 0:0) 1.49 0.00 0.65 ML-236C 0.57 0.03 1.21 N-(3-morpholin-4-ylpropyl)-3-(2,3,5,9-tetramethyl-7-oxofuro[3,2-g]chromen-6-yl)propanamide 1.00 0.00 0.79 N,2,3-Trimethyl-2-(1-methylethyl)butanamide 0.54 0.02 1.18 N,N-Dimethyldodecylamine N-oxide 0.90 0.00 1.39 N1,N12-Diacetylspermine 0.62 0.01 1.51 N2-Acetyl-L-lysine 1.18 0.00 1.44 N-3-oxo-hexadec-11(Z)-enoyl-L-Homoserinelactone 0.44 0.03 1.20 N-Acetyl-L-histidine 1.20 0.00 3.55 N-Acetylputrescine 0.71 0.02 1.26 NAGly 0.13 0.00 0.75 Nigakilactone N 0.71 0.03 1.42 N-Oleyl-Leucine 1.50 0.00 0.81 N-γ-L-Glutamyl-L-phenylalanine 0.67 0.00 1.27 OleoylEthanolamide-d2 1.05 0.00 0.84 Oleoylcarnitine 0.60 0.00 0.81 Olopatadine 1.27 0.01 1.27 Oxymetazolinehydrochloride 1.16 0.01 0.85 Paclobutrazol 0.44 0.00 1.17 Paliperidone 0.97 0.00 1.19 Palmitoylethanolamide 1.80 0.00 0.83 Phenylgalactoside 1.37 0.00 1.62 Pivmecillinamhydrochloride32887-03-9 1.02 0.00 1.64 Prednisone 0.67 0.00 1.24 Pregabalin (JAN / USAN / INN) 1.50 0.00 0.74 Pristimerin 1.13 0.00 1.27 Promecarb 1.08 0.01 2.14 Pteroside A 0.78 0.01 1.58 Quinidine 0.35 0.04 1.43 R-4-benzyl-3-((R)-3-hydroxy-2,2-dimethyloct-7-ynoyl)-5,5-dimethyloxazolidin-2-one 0.33 0.05 1.49 Retapamulin(USAN / INN) 0.75 0.00 1.46 Retinal 1.10 0.01 1.19 Rifamycin W 0.27 0.01 0.81 Ser Lys 1.07 0.01 1.23 SKF-95282dimaleate salt 1.41 0.00 1.45 Sphinganine 1.02 0.00 0.84 Stearidonic acid 0.81 0.04 1.26 Steryl sulfate 0.79 0.01 1.16 Succinylmonocholine 1.23 0.00 1.50 Sulprostone(USAN / INN) 0.94 0.01 1.32 Taurohyocholate 0.45 0.04 1.17 Tebuthiuron 1.35 0.00 1.44 Tepraloxydim 0.48 0.01 1.17 Tetrahomomethionine 0.80 0.02 1.26 TG003 1.05 0.00 0.83 Threoninyl-Proline 0.68 0.01 0.79 trans-1,2-Diphenylcyclobutane 0.94 0.01 1.68 trans-Hexadec-2-enoyl carnitine 0.53 0.00 0.84 Trp His 0.17 0.04 1.18 Trp Thr 0.62 0.04 1.27 Tyr Glu 0.83 0.00 1.19 Val Lys 0.15 0.03 1.18 Vanillylamine 0.87 0.03 1.19 Vernoflexin 0.79 0.02 1.22 Volemitol 2.39 0.00 0.30 Yohimbinic acidmonohydrate522-87-2 1.41 0.00 0.59 (+)-threo-2-Amino-3,4-dihydroxybutanoic acid 1.13 0.00 0.82 (±)-Jasmonicacid 0.73 0.02 1.16 (1R)-Hydroxy-(2R)-glutathionyl-1,2-dihydronaphthalene 1.30 0.00 0.83 (2R,2'R,4a'S,6'S,8a'S)-4,6'-Dihydroxy-2',5',5',8a'-tetramethyl-6-oxo-3,3',4',4a',5',6,6',7,7',8,8',8a'-dodecahydro-2'H-spiro[furo[2,3-e]isoindole-2,1'-naphthalen]-7'-yl acetate 0.49 0.00 1.34 11-Oxo-androsteroneglucuronide 1.67 0.00 0.40 16-Glucuronide-estriol 1.10 0.00 1.64 17(S)-HpDoHE 0.36 0.00 0.78 1a,1b-dihomoPGF2α 0.01 0.04 1.17 2,6-DiaminooimelicAcid 1.43 0.00 0.86 20-ethyl-PGE2 0.77 0.01 1.36 20-hydroxylipoxinA4 0.38 0.00 1.15 2'-Deoxyinosine 0.72 0.02 2.85 2-Hydroxyquinoline 0.66 0.04 1.22 2-Methoxy-3-(4-methoxyphenyl)propanoic acid 0.94 0.00 0.86 3-Cyano-L-alanine 1.53 0.00 1.41 3-Dehydroshikimate 0.69 0.05 1.38 3-Nitrobenzoicacid 0.77 0.04 1.31 3-Oxoadipate 0.77 0.02 1.17 4-Methylene-2-oxoglutarate 0.70 0.01 5.20 5-(6-hydroxy-6-methyloctyl)furan-2(5H)-one 0.69 0.02 0.83 5,10-Methylenetetrahydrofolate 1.49 0.00 1.38 5,6-Dihydrouracil 1.18 0.00 1.22 5-Hydroxypentanoate 2.14 0.00 0.76 7(S),17(S)-dihydroxy-8(E),10(Z),13(Z),15(E),19(Z)-DocosapentaenoicAcid 0.79 0.04 1.24 8-Hexanoylneosolaniol 0.59 0.00 0.85 Aciclovir 0.91 0.01 1.25 Aspartyl-Isoleucine 1.61 0.00 1.52 Aspartyl-Leucine 1.31 0.00 1.24 Aspartyl-Proline 0.70 0.00 0.85 Aspartyl-Tryptophan 1.37 0.00 1.43 Aspartyl-Valine 1.34 0.00 1.59 Asp-Glu 0.77 0.00 1.25 Asp-phe 1.47 0.00 2.45 bonactin 0.80 0.03 1.21 Butylidenephthalide 0.46 0.00 1.77 Caffeic acid 1.45 0.00 0.74 Chamazulene 1.05 0.02 1.32 Ciprostene 0.75 0.00 1.48 D-Galactono-1,4-lactone 0.54 0.04 1.20 diethyl 2,6-dimethyl-4-oxo-4h-pyran-3,5-dicarboxylate 1.95 0.00 1.54 Dihydrocoumarin 1.40 0.00 0.67 DIMBOA 0.37 0.04 1.20 Dl-P-Hydroxyphenyllactic acid 1.57 0.00 0.78 D-Norvaline 0.26 0.04 0.59 ETF 0.51 0.01 1.82 Ethopabate 1.00 0.00 1.32 Flacourtin 0.21 0.02 0.83 Genistein 0.65 0.00 1.47 Gluconate 0.71 0.03 0.84 Glutamate, γ-methyl ester 1.42 0.00 1.80 Glycerophosphoric acid 1.35 0.00 1.32 Glycyl-Phenylalanine 1.04 0.01 1.36 Hovenitin I 0.87 0.01 1.16 Hypoglycin 1.06 0.00 1.33 Hypotaurine 1.01 0.00 1.38 Imiquimod (JAN / USAN / INN) 0.86 0.01 1.33 Kanzonol P 0.18 0.05 1.23 L-(-)-3-Phenyllacticacid 2.22 0.00 0.64 L-Argininephosphate 0.99 0.00 1.40 Leucyl-Alanine 0.61 0.00 1.16 Leucyl-Tryptophan 0.47 0.01 1.18 Leukotriene B4 0.26 0.03 1.24 Leukotriene C4 0.55 0.00 1.25 LPC 22:6 1.25 0.00 0.46 LPS 22:6 0.49 0.00 0.83 Lys-Leu-OH 1.27 0.00 1.60 lysoPC 16:0 0.31 0.00 1.15 L-β-aspartyl-L-glutamic acid 1.42 0.00 1.65 Magnolol 0.75 0.01 11.33 m-Cresol 1.29 0.00 0.84 Methacycline 1.34 0.00 2.15 Methyl (3R,4R,5R)-3,4-dihydroxy-5-({2-O-[(2E)-3-phenyl-2-propenoyl]-β-D-glucopyranosyl}oxy)-1-cyclohexene-1-carboxylate 0.46 0.00 0.85 Methyldopaanhydrous 0.81 0.03 1.16 Methylmalonate 0.82 0.00 1.87 Morphine 0.72 0.00 1.30 N-(1-Deoxy-1-fructosyl)tyrosine 0.84 0.03 1.30 N(γ)-Acetyldiaminobutyrate 0.54 0.02 1.58 N-Acetyl-Dl-glutamic acid 1.13 0.01 1.20 N-Acetyl-D-phenylalanine 1.72 0.00 0.86 N-Acetyl-L-leucine 1.06 0.02 1.16 N-Acetyl-L-methionine 1.31 0.00 1.38 Naringin 0.58 0.00 0.87 Neuraminic acid 0.85 0.00 0.83 N-Methylschinifoline 1.26 0.00 1.24 o-Cresol 1.22 0.00 0.82 O-Desmethylvenlafaxine glucuronide 1.99 0.00 0.45 Oleoyl glycine 0.51 0.04 1.25 Phe-Phe 0.68 0.03 1.26 SM d34:2 1.04 0.01 0.87 Succinic acid 0.84 0.00 2.19 Succinicanhydride 0.49 0.03 2.06 Threoninyl-Phenylalanine 0.74 0.02 1.21 Tiglylglycine 0.79 0.01 0.87 trans-Cinnamate 1.85 0.00 0.71 trans-p-Hydroxycinnamicacid 1.33 0.00 0.66 Triamcinolone16,21-diacetate 0.89 0.00 1.60 Tryptophyl-Aspartate 0.56 0.01 1.83 Valyl-Aspartate 0.86 0.00 1.35 Zedoarol 0.31 0.01 0.73 α-CYANO-3-HYDROXYCINNAMICACID 1.40 0.00 1.39
[0074] As an improvement to the above embodiment, the pre-processed metabolite data samples are analyzed based on preset multi-dimensional screening criteria to determine differential features related to abnormal semen quality, including:
[0075] The OPLS-DA method was used to screen metabolites with variable importance projection values greater than 1;
[0076] The Wilcoxon signed-rank test was used to screen metabolites with an FDR-corrected P value less than 0.05;
[0077] Fold difference analysis was used to screen metabolites with fold differences greater than 2 or less than 0.5;
[0078] The metabolites that met the above three screening criteria were regarded as significant differential metabolites, and the significant differential metabolites were regarded as differential features associated with abnormal semen quality.
[0079] In this example, preprocessed metabolite data samples were deeply mined using multiple analytical methods to comprehensively and accurately identify differential features associated with abnormal semen quality. First, the OPLS-DA method was used to decompose the data matrix into multiple components and calculate variable importance projections (VIPs). Metabolites with VIP values greater than 1 were screened. This method effectively extracts the predictive components related to the response variable, enhancing model interpretability and preliminarily identifying metabolites with significant impact on semen quality. Next, the Wilcoxon signed-rank test was used. This nonparametric test compares the distribution differences between the two sample groups and, without relying on the assumption of normal distribution, screens for metabolites with an FDR-corrected P value less than 0.05. This effectively avoids false positives caused by inconsistent data distribution assumptions and further explores potential metabolites associated with semen quality. Finally, fold difference analysis was used to calculate the ratio of metabolite expression levels between the two sample groups. A fold difference greater than 2 or less than 0.5 was used as the criterion for screening, identifying significantly altered metabolites based on the degree of change. Combining the screening results of these three methods, the metabolites that meet the three screening criteria at the same time are determined as significant differential metabolites, which are used as differential features closely related to abnormal semen quality, providing a key feature data basis for the subsequent construction of an accurate semen quality prediction model. Therefore, this embodiment combines three different principles of OPLS-DA, Wilcoxon signed rank test and differential fold analysis to screen differential features. OPLS-DA analyzes metabolite data from multiple dimensions from the perspective of variable importance, Wilcoxon signed rank test from the perspective of distribution differences, and differential fold analysis from the perspective of expression level changes, avoiding the limitations of a single method. In terms of technical effects, the accuracy and reliability of the correlation between the screened differential features and abnormal semen quality are improved, and it can focus more accurately on the metabolite features that really affect semen quality, providing high-quality input data for subsequent model construction, thereby improving the performance of the entire semen quality prediction model, so that it can more effectively assist doctors in evaluating patients' fertility potential, optimizing treatment plans, etc. in scenarios such as clinical practice.
[0080] For example, in clinical assisted reproductive technology scenarios, for male patients undergoing semen testing, semen metabolite data samples are obtained and preprocessed using this technical step, and then the three methods mentioned above are used to screen for differential features. For example, when analyzing a patient's semen metabolite data, the OPLS-DA method may find that certain metabolites are highly important for predicting semen quality (VIP>1). These metabolites may be involved in key physiological processes such as sperm energy metabolism or cellular structure composition. The Wilcoxon signed rank test can identify metabolites with significant differences in distribution between abnormal and normal semen quality samples (Pfdr<0.05), which may be involved in metabolic pathways related to reproductive hormone regulation or inflammatory response. The difference fold analysis highlights metabolites with significant changes in expression levels between the two groups of samples (FC>2 or FC<0.5), such as certain metabolites closely related to sperm motility or morphology maintenance. The differential characteristics determined by these screening results are used to construct a semen quality prediction model. Doctors can use this to more accurately judge the patient's semen quality status and predict his or her fertility potential, thereby providing an important basis for formulating personalized treatment plans. For example, for patients with poor semen quality predictions, intervention measures can be taken in advance, such as improving lifestyle habits, providing nutritional supplements, or targeted treatments.
[0081] For ease of understanding, this embodiment is described in detail below:
[0082] To identify differential metabolites between the semen quality abnormality case group and the control group, this example combined three methods: OPLS-DA, Wilcoxon signed rank test, and fold difference analysis. The screening criteria were as follows:
[0083] VIP>1: selected based on the variable importance value of the OPLS-DA model;
[0084] Pfdr<0.05: P value selected based on FDR adjustment for multiple hypothesis testing;
[0085] FC>2 or FC<0.5: The fold change is greater than 2 or less than 0.5.
[0086] Based on the above criteria, the final significantly different metabolites were the intersection of the three criteria. Ten metabolites with significant differences were screened out from 259 seminal plasma metabolites ( Figure 2 , Table 2, Table 3). These metabolites will serve as core variables for subsequent analysis.
[0087] 2.1 OPLS-DA method screening
[0088] Orthogonal Projections to Latent Structures Discriminant Analysis (OPLS-DA) is a supervised learning method based on multivariate statistics for classification and explanation of inter-group differences. It is an extension of Partial Least Squares Discriminant Analysis (PLS-DA) and enhances model interpretability by separating the predictive component of variable X (correlated with the response variable Y) from the orthogonal component (uncorrelated with Y).
[0089] 2.1.1 Core Algorithm: Decompose the data matrix X into three parts: prediction part, orthogonal part and residual:
[0090] ,
[0091] : The prediction score matrix associated with Y; : predicted loading matrix; : an orthogonal fractional matrix independent of Y; : orthogonal loading matrix; : residual matrix.
[0092] 2.1.2 Utilization Information exclusion The orthogonal variation part that is not related to YYY is used to obtain the prediction matrix after removing the orthogonal components: ,
[0093] 2.1.3 Based on the prediction matrix Calculate the response variable The predicted value of Variable Importance in Projection (VIP) is used to assess the importance of each variable to the model's predictive ability.
[0094] VIP value formula: ,
[0095] : total number of variables; : Principal component number; : No. The scores of the principal components; : No. The variable in The weights on the principal components; : No. The sum of squares of the response variable explained by the principal components; : The sum of squares of the total response variable. The screening criterion is VIP>1, indicating that the variable contributes significantly to the classification.
[0096] 2.2 Wilcoxon Signed-Rank Test
[0097] The Wilcoxon Rank Sum Test (also known as the Mann-Whitney U test) is a nonparametric test used to compare the distributional differences between two independent groups of samples. Unlike the t-test, the Wilcoxon Rank Sum Test does not assume that the data come from a normal distribution. Therefore, it is particularly useful when the sample size is small and the data distribution is uncertain. The FDR correction is used to control the false positive rate in multiple hypothesis testing, with a Pfdr < 0.05 as the screening criterion.
[0098] 2.2.1 Hypothesis:
[0099] Null hypothesis (H0): The two groups of samples come from the same distribution.
[0100] Alternative hypothesis (H1): The two groups of samples come from different distributions.
[0101] 2.2.2 Data merging and sorting:
[0102] After merging the two sets of sample data, all the data are sorted and assigned ranks in ascending order. If there are identical values in the data (i.e., repeated ranks), the average rank is used for processing.
[0103] 2.2.3 Calculate the rank sum:
[0104] Assign a rank to each data point , and calculate the rank sum of the two groups of samples separately:
[0105] ,
[0106] Select the rank of the smaller sample group: .
[0107] 2.2.4 Calculating the test statistic
[0108] For small samples, the U statistic is used to calculate the test statistic: ;
[0109] and : The size of the two sample groups; : rank sum of smaller samples;
[0110] Use the pre-calculated Wilcoxon U test table to find the p-value corresponding to U.
[0111] For large samples, the normal distribution is used for approximation value: ;
[0112] (Expectation of rank sum): ; (Standard deviation of the sum of ranks): ;
[0113] According to the calculated Value, look up the standard normal distribution table to obtain value.
[0114] 2.3. Fold Difference Analysis
[0115] Fold Change (FC) is a statistical method used to compare the differences in a variable (such as metabolite expression or gene expression) between two groups of samples (e.g., experimental and control groups). Its core concept is to calculate the ratio of the expression levels of each variable in the two groups to measure the degree of change in the variable.
[0116] Basic formula: ;X 实验组 : the value of the individual variable of the experimental group; X 对照组 : The value of the individual variable of the control group; to facilitate symmetric analysis and visualization, the logarithm of FC is usually taken: ; Standards are:
[0117] log2(FC)>1: indicates significant upregulation (FC>2);
[0118] log2(FC)<-1: indicates significant downregulation (FC<0.5).
[0119] For example, see Figure 2 The final screened differential metabolites are shown in Table 2:
[0120] Table 2. Differential metabolites in the screened semen quality abnormality case group and control group
[0121]
[0122] As an improvement to the above embodiment, the differential features are screened and evaluated using a preset feature screening algorithm, and a core feature subset that meets the semen quality prediction requirements is determined based on a preset optimization index, including:
[0123] Using the Lasso regression method, by introducing the L1 regularization term in the loss function, the regression coefficient is dynamically adjusted so that the coefficients of irrelevant difference features shrink to zero, retaining the difference features that have predictive power for the response variable;
[0124] Using the support vector machine recursive feature elimination method, the support vector machine classifier is trained based on the current differential feature set, the importance of the differential features is calculated, and the differential feature with the smallest weight is removed. The above steps are repeated until the remaining differential features reach the predetermined number, thereby obtaining the core feature subset that meets the requirements for semen quality prediction.
[0125] In the present embodiment, the determined differential features are further processed by two complementary feature screening algorithms to obtain the core feature subset with the greatest predictive value. First, the Lasso regression method is adopted, the core of which is to construct a loss function that includes prediction error minimization and an L1 regularization term. During the training process, the L1 regularization term performs a weighted penalty on the absolute value of the regression coefficient based on the set regularization hyperparameter, prompting the coefficients of irrelevant differential features to gradually approach zero and eventually shrink to zero, while the coefficients of differential features that are highly correlated with the response variable and have predictive power are retained, thereby achieving the purpose of screening out the key parts from numerous differential features. Then, a support vector machine recursive feature elimination method is used to train a support vector machine classifier based on the current differential feature set. The classifier calculates the contribution weight of each differential feature to the classification decision surface to measure the importance of the differential feature, and then removes the differential feature with the smallest weight. This training, calculation, and removal process is repeated until the remaining differential features reach a predetermined number. Through the synergistic effect of these two algorithms, the differential features are comprehensively evaluated and screened, and the core feature subset that meets the requirements for semen quality prediction is finally determined, providing core data support for building an accurate and efficient semen quality prediction model. Therefore, this embodiment comprehensively utilizes two different feature screening algorithms, namely, Lasso regression and support vector machine recursive feature elimination. Lasso regression performs feature selection in high-dimensional data based on the regularization principle, and has the advantages of automatic screening and model simplification; support vector machine recursive feature elimination uses the powerful classification ability of the support vector machine to recursively screen based on feature importance. The combination of the two overcomes the limitations that may exist in a single algorithm. In terms of technical effects, it can effectively remove redundant and irrelevant difference features, reduce data dimensions, highlight features that have important contributions to semen quality prediction, improve the representativeness and predictive ability of the core feature subset, and thus improve the accuracy and efficiency of the entire semen quality prediction model. In clinical diagnosis and research, semen quality can be predicted more accurately, assisting doctors in making more scientific decisions, such as early diagnosis of male infertility and providing a basis for personalized treatment.
[0126] For example, in male infertility research, after pre-processing large amounts of semen sample data to identify differential features, this technique is used to perform feature screening. For example, when studying the differential metabolite profiles of a group of patients with oligospermia and asthenospermia, Lasso regression is employed. By continuously adjusting the regularization parameter, the coefficients corresponding to differential metabolite profiles that contribute little to semen quality prediction (such as small molecule metabolite profiles with weak associations within complex metabolic networks) are gradually reduced to zero, while retaining features that are significantly impacting semen quality, such as differential metabolite profiles associated with key enzymes in sperm energy metabolism. Subsequently, a support vector machine (SVM) recursive feature elimination method is employed to construct a SVM classifier based on these initially screened differential features, calculating the importance weight of each feature. Suppose, during this process, certain differential metabolite profiles related to inflammation but with relatively low weight in overall semen quality prediction are identified and gradually removed. After multiple iterations, a core feature subset is ultimately identified, such as those containing specific metabolite profiles closely related to sperm production and motility. Based on the semen quality prediction model constructed based on this core feature subset, researchers can more accurately analyze the mechanism of semen quality abnormalities in this group of patients, and doctors can also more accurately predict the semen quality status of other similar patients.
[0127] In the above embodiment, specifically, the Lasso regression method is used to dynamically adjust the regression coefficient by introducing an L1 regularization term in the loss function, so that the coefficients of irrelevant difference features are shrunk to zero, and the difference features that have predictive power for the response variable are retained, including:
[0128] Construct a loss function that minimizes the prediction error and the L1 regularization term: , is the sample size; is the number of features; is the intercept; is the regression coefficient of the jth feature; is the value of the jth feature in the i-th sample; is the response variable of the i-th sample; is a regularization hyperparameter that controls The intensity of the penalty; among them, minimizing the prediction error is used to measure the quality of the model fit, and the L1 regularization term shrinks the coefficients of unimportant difference features to zero by weighted penalty on the absolute value of the regression coefficient;
[0129] During the training process, the regression coefficients are dynamically adjusted so that the coefficients of irrelevant differential features shrink to zero, while the coefficients of relevant features maintain a larger absolute value. Ultimately, only differential features that have predictive power for the response variable are retained, and the optimal regularization parameter is selected through cross-validation to achieve a balance between model sparsity and predictive power.
[0130] For ease of understanding, this embodiment is described in detail below:
[0131] Lasso regression (Least Absolute Shrinkage and Selection Operator) is a linear regression method that introduces Regularization term, to achieve the purpose of feature selection and model simplification. It is particularly effective in high-dimensional data analysis because Regularization shrinks some regression coefficients to 0, thereby automatically screening out the most predictive features.
[0132] 3.1.1 Loss Function Definition
[0133] The loss function of Lasso regression consists of two parts:
[0134] Minimize the prediction error (sum of squared residuals): a measure of how well the model fits.
[0135] Add to Regularization term: Limits model complexity by penalizing the regression coefficients.
[0136] The loss function formula is: ,
[0137] in: : sample size; : number of features; :intercept; : The regression coefficient of the jth feature; : The value of the jth feature in the i-th sample; : The response variable of the i-th sample; : Regularization hyperparameter, control The intensity of the punishment.
[0138] 3.1.2 Core Mechanism of Feature Selection
[0139] 3.1.2.1 The role of regularization
[0140] Regularization makes the coefficients of unimportant features approach zero or even exactly zero by weighting the absolute value of the regression coefficient. When it is larger, the penalty effect is stronger, a large number of features will be eliminated, and the model will be more sparse. When , Lasso regression degenerates into ordinary linear regression.
[0141] 3.1.2.2 Key Features
[0142] The regularization constraint of Lasso enables feature selection to be completed by solving a constrained optimization problem: ,
[0143] in is a Determined constant. Through geometric interpretation, The regularized constraint is a diamond-shaped constraint region whose sharp corners tend to force the regression coefficient to zero.
[0144] 3.1.2.3 Screening process
[0145] During the training process, Lasso regression dynamically adjusts the regression coefficients so that the coefficients of irrelevant features shrink to zero and the coefficients of relevant features maintain a larger absolute value, and finally only retains the coefficients of the response variable. Features with predictive power.
[0146] 3.1.3 Lasso Regression Optimization Algorithm
[0147] The optimal regularization parameter is selected through cross-validation (CV) to achieve a balance between model sparsity and predictive ability. The analysis effect of the optimized Lasso regression is shown in Figure 3 .
[0148] In the above embodiment, specifically, the support vector machine recursive feature elimination method is used to train a support vector machine classifier based on the current differential feature set, calculate the importance of the differential features, remove the differential features with the smallest weight, and repeat the above steps until the remaining differential features reach a predetermined number, thereby obtaining a core feature subset that meets the semen quality prediction requirements, including:
[0149] Input the differential feature set and response variable, wherein the differential feature set includes significantly differential metabolites screened by OPLS-DA, Wilcoxon signed rank test, and fold difference analysis; the response variable is the classification label of semen quality prediction model;
[0150] Using a support vector machine algorithm, a classifier is trained based on the current differential feature set and the response variable to construct an optimal classification decision surface, wherein the classification decision surface is used to distinguish different categories of semen quality samples;
[0151] The support vector machine model is used to calculate the weight vector of each difference feature. The weight vector represents the contribution of each difference feature to the classification decision surface. The larger the absolute value of the weight, the greater the contribution of the feature to the classification.
[0152] According to the weight vector, the importance of each difference feature is evaluated, and the importance is measured by the absolute value of the weight vector, and the difference feature with the smallest weight is removed;
[0153] The set of differential features is updated, and the process of training the support vector machine classifier, calculating feature importance, and removing the differential features with the smallest weight is repeated until the number of remaining differential features reaches a predetermined number;
[0154] The final core feature subset is output, which includes the differential features that contribute most to the prediction of semen quality.
[0155] For ease of understanding, this embodiment is described in detail below:
[0156] The core concept of SVM-RFE is to leverage the classification capabilities of support vector machines (SVMs) to recursively remove the least important features based on their contribution to the classification decision surface, thereby achieving feature selection. The support vector machine (SVM) constructs an optimal hyperplane to distinguish data from different categories. The influence of a feature on the position of the hyperplane is measured by its corresponding weight vector. Features with large weights (large absolute values) contribute more to classification; features with small weights (small absolute values) contribute less to classification.
[0157] Recursive feature elimination (RFE) achieves feature selection by training a model based on the current feature set, calculating the importance (weight) of the features, removing the features with the smallest weights, and repeating the above steps until the target number of features is reached.
[0158] 3.2.1 Initial feature set: input feature matrix and the response variable ,in is the number of samples, is the initial feature number.
[0159] 3.2.2 Training SVM model: Use the current feature set to train a support vector machine classifier and obtain the weight vector For linear kernel SVM, the weight vector directly represents the importance of the feature. For nonlinear kernel SVM, the feature importance can be calculated by explicitly mapping the input features.
[0160] 3.2.3 Calculate feature importance:
[0161] Feature importance is defined by the following formula: ; It is The weight of a feature.
[0162] 3.2.4 Recursive feature elimination: remove features with minimum Update the feature set , and retrain the SVM.
[0163] 3.4.5 Repeat steps 3.2.2-3.2.4 until the remaining features reach the predetermined number.
[0164] 3.4.6 Output the final feature set: Sort the features by importance from high to low and select the final target features.
[0165] The analysis effect of SVM-RFE algorithm can be found in Figure 4 .
[0166] Ultimately, the top 10 features selected by both methods constitute the core feature subset of this example (as shown in Table 3). The feature selection process uses regression coefficients and AUC values as optimization metrics. By screening for non-zero features and comparing the AUC values of different feature subsets, the two models were combined to select the nine most predictive feature subsets (see Table 3). This removed variables with minimal contributions to the model, ensuring model simplicity and efficiency.
[0167] Table 3. Feature selection and optimization results
[0168]
[0169] In summary, participating Figure 3 and Figure 4 , by combining two different feature screening algorithms: Lasso regression and support vector machine recursive feature elimination. Lasso regression performs feature selection in high-dimensional data based on the principle of regularization, and has the advantages of automatic screening and model simplification; support vector machine recursive feature elimination leverages the powerful classification capabilities of support vector machines to recursively screen based on feature importance. The combination of the two overcomes the limitations that may exist in a single algorithm. In terms of technical effect, it can effectively remove redundant and irrelevant differential features, reduce data dimensions, highlight features that contribute significantly to semen quality prediction, improve the representativeness and predictive power of the core feature subset, and thus enhance the accuracy and efficiency of the entire semen quality prediction model. In clinical diagnosis and research, it can more accurately predict semen quality and assist doctors in making more scientific decisions, such as early diagnosis of male infertility and providing a basis for personalized treatment.
[0170] As an improvement to the above embodiment, the training of the pre-built semen quality prediction model based on the random forest algorithm based on the core feature subset includes:
[0171] Constructing new training and test sets from the core feature subset;
[0172] The newly constructed training set is used to train a random forest model, which serves as a semen quality prediction model. During the training process, samples are randomly sampled from the training set with replacement to construct multiple different training subsets to increase sample diversity. Feature random sampling is also used to randomly select some features for training each time a decision tree is constructed to reduce model complexity. Furthermore, model performance is optimized by adjusting specific hyperparameters of the model, including the number of decision trees and the maximum depth of the random forest model.
[0173] The sample data in the test set is input into the trained random forest model. The random forest model predicts the semen quality of each test sample based on the learned correlation pattern between core features and semen quality, and outputs the corresponding prediction results.
[0174] The 10-fold cross-validation method was used to evaluate the performance of the random forest model on the training set, and to evaluate the sensitivity, specificity, and AUC value of the random forest model.
[0175] In this embodiment, a new training set and test set are first constructed from a subset of core features, ensuring that the dataset contains only key features highly correlated with semen quality, providing an accurate data foundation for model training. A random forest model is then trained using this new training set. During training, random sampling of samples with replacement generates multiple different training subsets, allowing the model to be exposed to diverse sample distributions and enhancing its adaptability to different sample conditions. Feature random sampling randomly selects some features each time a decision tree is constructed, preventing the model from over-reliance on specific features and effectively reducing model complexity. Simultaneously, model performance is optimized by adjusting specific hyperparameters such as the number of decision trees and maximum depth, enabling the model to better learn the association pattern between core features and semen quality. The test set samples are then input into the trained model for prediction, and the results are output. Finally, a 10-fold cross-validation is used to comprehensively evaluate the model's performance on the training set. Indicators such as sensitivity, specificity, and AUC are calculated to measure model performance from different perspectives and ensure the model's effectiveness and reliability. Therefore, this embodiment trains a random forest model by combining random sampling of samples, random sampling of features, and hyperparameter optimization. Random sampling of samples and features increases the model's robustness and generalization capabilities, preventing overfitting, while hyperparameter optimization optimizes model performance. Technically, this improves the model's accuracy in predicting semen quality, enabling more precise identification of semen quality conditions. This helps physicians make more informed decisions in clinical applications. For example, in assisted reproductive technology, it helps select more suitable embryos for transplantation, increasing success rates. In the diagnosis of male infertility, it can identify potential problems earlier, allowing for timely intervention and treatment, reducing unnecessary waste of medical resources and improving patient reproductive health management.
[0176] For example, in the daily work scenarios of reproductive medicine centers, for patients who come for semen examinations, after preliminary processing to obtain a core feature subset, the following technical steps are followed. For example, when constructing training and test sets, relevant data is selected from the semen data of many patients based on core features. When training a random forest model, random sampling allows the model to learn from different combinations of patient samples. For example, different proportions of samples of young healthy men and older infertile men are extracted, allowing the model to adapt to the characteristics of samples of different ages and fertility statuses. Random feature sampling allows the model to focus on different combinations of core features when constructing decision trees. For example, suppose features related to sperm motility and morphology are randomly selected for training. The model is optimized by adjusting hyperparameters such as the number of decision trees to 100 and the maximum depth to 8. When testing semen samples from new patients, the model can accurately predict their semen quality. For example, for a patient with fertility problems, the model predicts that there may be problems with his semen quality based on the core characteristics of his semen. The doctor can then conduct further examinations and develop personalized treatment plans based on this, such as recommending improved lifestyle habits or targeted treatments to increase the patient's chances of fertility. At the same time, through 10-fold cross-validation, it ensures that the model also has good predictive performance for other similar patients, ensuring the reliability of the model in practical applications.
[0177] For ease of understanding, this embodiment is described in detail below:
[0178] To ensure the model's generalization ability, the research data was divided into a 70% training set and a 30% test set. The training set was used for model construction and tuning, while the test set was used to evaluate the model's performance on unseen data. 10-fold cross-validation was used to further evaluate the model's performance on the training set. Through multiple rounds of training and validation, the model's stability was ensured and its performance was further optimized.
[0179] This example builds several common machine learning models and compares their performance. These models include:
[0180] Random Forest (RF), XGBoost (Extended Gradient Boosting), Neural Network (NeuralNetwork), and Lightweight Gradient Boosting Machine (LightGBM) were trained on cohort study data to compare their predictive performance and select the best performing model.
[0181] 5. Model Performance Evaluation
[0182] During model evaluation, multiple performance metrics were used, including:
[0183] Sensitivity: reflects the model's ability to identify positive samples;
[0184] Specificity: reflects the model's ability to identify negative samples;
[0185] AUC (Area Under Curve): Measures the overall classification ability of the model, especially in the case of class imbalance.
[0186] Based on the above evaluation indicators, the optimal model combination was determined. As shown in Table 4, among the four commonly used machine learning models, the random forest (RF) model performed better. Figure 5 As shown in the figure, among the four commonly used machine learning models, the random forest (RF) model performed best, with an AUC value of 0.823, a sensitivity of 0.821, and a specificity of 0.679.
[0187] Table 4. Prediction results of four machine learning models
[0188]
[0189] Random Forest is an ensemble learning-based algorithm that improves the model's predictive performance and robustness by building multiple decision trees. Its core concept is to reduce the variance and overfitting risk of a single decision tree through bootstrap sampling and feature sampling, while simultaneously achieving higher classification or regression accuracy through ensemble prediction. The Random Forest model has the following notable features:
[0190] Efficient processing of high-dimensional data: Randomly selected feature subsets reduce computational complexity, making it suitable for high-dimensional data.
[0191] Feature importance evaluation: The model calculates the importance of each feature by its contribution to the split purity, providing a basis for subsequent feature screening.
[0192] Robustness and resistance to overfitting: Enhance the generalization ability of the model through sub-sampling and feature randomness.
[0193] The application process of the random forest model after Lasso regression and support vector machine recursive feature elimination (SVM-RFE) screening features:
[0194] The filtered feature subset Applied to build a more efficient random forest model, including the following steps:
[0195] 1. Data Preparation
[0196] Only the selected feature subset is retained in the original dataset , build a new training set and test set .
[0197] 2. Random Forest Model Training and Prediction
[0198] Train a random forest model using the filtered data: ,
[0199] The training process is still based on random sampling of samples and features, and optimizes model performance through specific hyperparameters (such as the number of decision trees and the maximum depth).
[0200] For the test set samples Make a prediction: .
[0201] 3. Model Validation and Performance Evaluation
[0202] Model performance was evaluated using 10-fold cross-validation and compared with the original model to verify the effectiveness of the selected features. Performance indicators include sensitivity, specificity, and AUC. AUC was calculated by constructing a ROC curve: .
[0203] See also Figure 6 , is a schematic diagram of a semen quality prediction system based on random forests according to an embodiment of the present invention. The semen quality prediction system based on random forests comprises:
[0204] An acquisition module 10 is used to acquire metabolite data samples of different semens and pre-process the metabolite data samples to obtain pre-processed metabolite data samples; the metabolite data samples are obtained by pre-testing and analyzing different semens;
[0205] An analysis module 11 is used to analyze the pre-processed metabolite data samples based on preset multi-dimensional screening criteria to determine differential features related to abnormal semen quality;
[0206] A screening module 12 is used to screen and evaluate the differential features using a preset feature screening algorithm, and determine a core feature subset that meets the semen quality prediction requirements based on a preset optimization index;
[0207] A training module 13 is used to train a pre-built semen quality prediction model based on a random forest algorithm based on the core feature subset;
[0208] The prediction module 14 is used to use the trained semen quality prediction model to perform quality prediction on the metabolite data of the semen to be tested to obtain a semen quality prediction result.
[0209] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0210] First, metabolite data samples of different semen obtained by detection and analysis are obtained and preprocessed to provide reliable basic data. Then, the preprocessed data is deeply analyzed according to the preset multidimensional screening criteria, and the differential features related to abnormal semen quality are accurately located, providing a key basis for subsequent accurate prediction. Then, a preset feature screening algorithm is used to screen and evaluate these differential features, and a core feature subset is determined according to the optimization index, effectively reducing the data dimension and highlighting key information. Based on this core feature subset, a semen quality prediction model of a pre-constructed random forest algorithm is trained, and the generalization ability and efficiency of the random forest algorithm are utilized and the advantages of random forest in processing high-dimensional data, evaluating feature importance, and resisting overfitting are fully utilized. Finally, the trained model is used to predict the semen metabolite data to be tested, and the semen quality prediction result is obtained. Therefore, the embodiment of the present invention can more accurately screen out key features, effectively process complex data relationships, and construct a semen quality prediction model with high prediction accuracy and good generalization ability through the combination of multidimensional screening criteria, efficient feature screening algorithm and random forest model with strong generalization ability, thereby effectively improving the accuracy of semen quality prediction.
[0211] As an improvement to the above embodiment, the analysis module is specifically configured to:
[0212] The OPLS-DA method was used to screen metabolites with variable importance projection values greater than 1;
[0213] The Wilcoxon signed-rank test was used to screen metabolites with an FDR-corrected P value less than 0.05;
[0214] Fold difference analysis was used to screen metabolites with fold differences greater than 2 or less than 0.5;
[0215] The metabolites that met the above three screening criteria were regarded as significant differential metabolites, and the significant differential metabolites were regarded as differential features associated with abnormal semen quality.
[0216] As an improvement to the above embodiment, the screening module is specifically used for:
[0217] Using the Lasso regression method, by introducing the L1 regularization term in the loss function, the regression coefficient is dynamically adjusted so that the coefficients of irrelevant difference features shrink to zero, retaining the difference features that have predictive power for the response variable;
[0218] Using the support vector machine recursive feature elimination method, the support vector machine classifier is trained based on the current differential feature set, the importance of the differential features is calculated, and the differential feature with the smallest weight is removed. The above steps are repeated until the remaining differential features reach the predetermined number, thereby obtaining the core feature subset that meets the requirements for semen quality prediction.
[0219] As an improvement to the above embodiment, the training module is specifically used for:
[0220] Constructing new training and test sets from the core feature subset;
[0221] The newly constructed training set is used to train a random forest model, which serves as a semen quality prediction model. During the training process, samples are randomly sampled from the training set with replacement to construct multiple different training subsets to increase sample diversity. Feature random sampling is also used to randomly select some features for training each time a decision tree is constructed to reduce model complexity. Furthermore, model performance is optimized by adjusting specific hyperparameters of the model, including the number of decision trees and the maximum depth of the random forest model.
[0222] The sample data in the test set is input into the trained random forest model. The random forest model predicts the semen quality of each test sample based on the learned correlation pattern between core features and semen quality, and outputs the corresponding prediction results.
[0223] The 10-fold cross-validation method was used to evaluate the performance of the random forest model on the training set, and to evaluate the sensitivity, specificity, and AUC value of the random forest model.
[0224] It is understandable that the various embodiments of the semen quality prediction system based on random forest can refer to the contents of the relevant embodiments of the semen quality prediction method based on random forest mentioned above, and will not be described in detail here.
[0225] If the modules / units integrated into the random forest-based semen quality prediction system are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the process steps in the above-mentioned method embodiments by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0226] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement the present invention without inventive effort.
[0227] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A semen quality prediction method based on random forest, characterized in that: The following steps are involved: Obtaining metabolite data samples of different semens, and preprocessing the metabolite data samples to obtain preprocessed metabolite data samples; the metabolite data samples are obtained by pre-detecting and analyzing the different semens; The pre-processed metabolite data samples were analyzed based on the preset multi-dimensional screening criteria to identify differential features associated with abnormal semen quality; A preset feature screening algorithm is used to screen and evaluate differential features, and a core feature subset that meets the requirements for semen quality prediction is determined based on preset optimization indicators; Based on the core feature subset, a pre-built semen quality prediction model based on a random forest algorithm is trained; Use the trained semen quality prediction model to predict the quality of the metabolite data of the semen to be tested, and obtain the semen quality prediction result; The method uses a preset feature screening algorithm to screen and evaluate the differential features, and determines a core feature subset that meets the semen quality prediction requirements based on preset optimization indicators, including: Construct a loss function that minimizes the prediction error and the L1 regularization term: , is the sample size; is the number of features; is the intercept; is the regression coefficient of the jth feature; is the value of the jth feature in the i-th sample; is the response variable of the i-th sample; is a regularization hyperparameter that controls The intensity of the penalty; among them, minimizing the prediction error is used to measure the quality of the model fit, Regularization makes the coefficients of unimportant features approach zero or even exactly zero by weighting the absolute value of the regression coefficient. When it is larger, the penalty effect is stronger, a large number of features will be eliminated, and the model will be sparser; when = 0, Lasso regression degenerates into ordinary linear regression; Lasso regularization constraint enables feature selection to be completed by solving a constrained optimization problem: ; in is a Determined constant; explained geometrically, The regularized constraint is a diamond-shaped constraint region whose sharp corners tend to make the regression coefficient equal to 0; During the training process, the regression coefficients are dynamically adjusted so that the coefficients of irrelevant differential features shrink to zero, while the coefficients of relevant features maintain a larger absolute value. Ultimately, only differential features that have the ability to predict the response variable are retained. The differential features that ultimately retain only those that have the ability to predict the corresponding variable are formed into a differential feature set, and the optimal regularization parameter is selected through cross-validation to achieve a balance between model sparsity and predictive ability. Input the differential feature set and response variable, wherein the differential feature set includes significantly differential metabolites screened by OPLS-DA, Wilcoxon signed rank test, and fold difference analysis; the response variable is the classification label of semen quality prediction model; Using a support vector machine algorithm, a classifier is trained based on the current differential feature set and the response variable to construct an optimal classification decision surface, wherein the classification decision surface is used to distinguish different categories of semen quality samples; The support vector machine model is used to calculate the weight vector of each difference feature. The weight vector represents the contribution of each difference feature to the classification decision surface. The larger the absolute value of the weight, the greater the contribution of the feature to the classification. According to the weight vector, the importance of each difference feature is evaluated. The importance is measured by the absolute value of the weight vector, and the difference feature with the smallest weight is removed. The feature importance is defined by the following formula: ; It is The weight of each feature; The set of differential features is updated, and the process of training the support vector machine classifier, calculating feature importance, and removing the differential features with the smallest weight is repeated until the number of remaining differential features reaches a predetermined number; Outputting a final core feature subset, wherein the core feature subset includes the difference features that contribute most to semen quality prediction; The method of training a pre-built semen quality prediction model based on a random forest algorithm based on the core feature subset includes: Constructing new training and test sets from the core feature subset; The newly constructed training set is used to train a random forest model, which serves as a semen quality prediction model. During the training process, samples are randomly sampled from the training set with replacement to construct multiple different training subsets to increase sample diversity. Feature random sampling is also used to randomly select some features for training each time a decision tree is constructed to reduce model complexity. Furthermore, model performance is optimized by adjusting specific hyperparameters of the model, including the number of decision trees and the maximum depth of the random forest model. The sample data in the test set is input into the trained random forest model. The random forest model predicts the semen quality of each test sample based on the learned correlation pattern between core features and semen quality, and outputs the corresponding prediction results. The 10-fold cross-validation method was used to evaluate the performance of the random forest model on the training set, and to evaluate the sensitivity, specificity, and AUC value of the random forest model; the AUC value was calculated by constructing the ROC curve: .
2. The semen quality prediction method based on random forest according to claim 1, characterized in that: The pre-processed metabolite data samples are analyzed based on the preset multi-dimensional screening criteria to determine the differential characteristics related to abnormal semen quality, including: The OPLS-DA method was used to screen metabolites with variable importance projection values greater than 1; The Wilcoxon signed-rank test was used to screen metabolites with an FDR-corrected P value less than 0.05; Fold difference analysis was used to screen metabolites with fold differences greater than 2 or less than 0.5; The metabolites that met the above three screening criteria were regarded as significant differential metabolites, and the significant differential metabolites were regarded as differential features associated with abnormal semen quality.
3. A semen quality prediction system based on random forest, characterized in that: include: an acquisition module, configured to acquire metabolite data samples of different semens, and preprocess the metabolite data samples to obtain preprocessed metabolite data samples; The metabolite data samples are obtained by pre-testing and analyzing different semens; An analysis module is used to analyze the pre-processed metabolite data samples based on preset multi-dimensional screening criteria to determine the differential features related to abnormal semen quality; The screening module is used to screen and evaluate differential features using a preset feature screening algorithm, and determine the core feature subset that meets the semen quality prediction requirements based on preset optimization indicators; A training module, configured to train a pre-built semen quality prediction model based on a random forest algorithm based on the core feature subset; A prediction module is used to use the trained semen quality prediction model to perform quality prediction on the metabolite data of the semen to be tested, and obtain a semen quality prediction result; The screening module is specifically used for: Construct a loss function that minimizes the prediction error and the L1 regularization term: , is the sample size; is the number of features; is the intercept; is the regression coefficient of the jth feature; is the value of the jth feature in the i-th sample; is the response variable of the i-th sample; is a regularization hyperparameter that controls The intensity of the penalty; among them, minimizing the prediction error is used to measure the quality of the model fit, Regularization makes the coefficients of unimportant features approach zero or even exactly zero by weighting the absolute value of the regression coefficient. When it is larger, the penalty effect is stronger, a large number of features will be eliminated, and the model will be sparser; when = 0, Lasso regression degenerates into ordinary linear regression; Lasso regularization constraint enables feature selection to be completed by solving a constrained optimization problem: ; in is a Determined constant; explained geometrically, The regularized constraint is a diamond-shaped constraint region whose sharp corners tend to make the regression coefficient equal to 0; During the training process, the regression coefficients are dynamically adjusted so that the coefficients of irrelevant differential features shrink to zero, while the coefficients of relevant features maintain a larger absolute value. Ultimately, only differential features that have the ability to predict the response variable are retained. The differential features that ultimately retain only those that have the ability to predict the corresponding variable are formed into a differential feature set, and the optimal regularization parameter is selected through cross-validation to achieve a balance between model sparsity and predictive ability. Input the differential feature set and response variable, wherein the differential feature set includes significantly differential metabolites screened by OPLS-DA, Wilcoxon signed rank test, and fold difference analysis; the response variable is the classification label of semen quality prediction model; Using a support vector machine algorithm, a classifier is trained based on the current differential feature set and the response variable to construct an optimal classification decision surface, wherein the classification decision surface is used to distinguish different categories of semen quality samples; The support vector machine model is used to calculate the weight vector of each difference feature. The weight vector represents the contribution of each difference feature to the classification decision surface. The larger the absolute value of the weight, the greater the contribution of the feature to the classification. According to the weight vector, the importance of each difference feature is evaluated. The importance is measured by the absolute value of the weight vector, and the difference feature with the smallest weight is removed. The feature importance is defined by the following formula: ; It is The weight of each feature; The set of differential features is updated, and the process of training the support vector machine classifier, calculating feature importance, and removing the differential features with the smallest weight is repeated until the number of remaining differential features reaches a predetermined number; Outputting a final core feature subset, wherein the core feature subset includes the difference features that contribute most to semen quality prediction; The training module is specifically used for: Constructing new training and test sets from the core feature subset; The newly constructed training set is used to train a random forest model, which serves as a semen quality prediction model. During the training process, samples are randomly sampled from the training set with replacement to construct multiple different training subsets to increase sample diversity. Feature random sampling is also used to randomly select some features for training each time a decision tree is constructed to reduce model complexity. Furthermore, model performance is optimized by adjusting specific hyperparameters of the model, including the number of decision trees and the maximum depth of the random forest model. The sample data in the test set is input into the trained random forest model. The random forest model predicts the semen quality of each test sample based on the learned correlation pattern between core features and semen quality, and outputs the corresponding prediction results. The 10-fold cross-validation method was used to evaluate the performance of the random forest model on the training set, and to evaluate the sensitivity, specificity, and AUC value of the random forest model; the AUC value was calculated by constructing the ROC curve: .
4. The semen quality prediction system based on random forest according to claim 3, characterized in that: The analysis module is specifically used for: The OPLS-DA method was used to screen metabolites with variable importance projection values greater than 1; The Wilcoxon signed-rank test was used to screen metabolites with an FDR-corrected P value less than 0.05; Fold difference analysis was used to screen metabolites with fold differences greater than 2 or less than 0.5; The metabolites that met the above three screening criteria were regarded as significant differential metabolites, and the significant differential metabolites were regarded as differential features associated with abnormal semen quality.
Citation Information
Patent Citations
Pulmonary nodule malignant risk assessment model construction method and related device
CN118380156A
Diagnostic model training method and device, medium and electronic equipment
CN119338025A
Esophageal cancer marker screening method based on enzyme transfer methylation sequencing
CN119479812A