XGBoost model-based teenager suicide self-injury grading early warning system construction
By constructing a suicide and self-harm grading and early warning system based on the XGBoost model, the problem that existing assessment scales are difficult to uniformly assess suicidal and self-harm behaviors in adolescents is solved. This system enables unified assessment and early warning of adolescents' mental state, thereby reducing the risk of suicidal and self-harm behaviors.
Patent Information
- Application Number
- CN202511616009.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-27
AI Technical Summary
Existing technologies lack a unified assessment of suicidal and self-harming behaviors among adolescents due to the difficulty in using different psychological state assessment scales, and there is a lack of an effective graded early warning system.
A suicide and self-harm risk grading and early warning system based on the XGBoost model was constructed, including data acquisition, storage, processing and result output modules. The system analyzes adolescent psychological state data through the XGBoost model, outputs the suicide and self-harm risk level, and uses the natural breakpoint method for grading.
It enables unified assessment and effective early warning of suicidal and self-harming behaviors among adolescents, reduces the probability of such behaviors, and provides a unified standard applicable to management and observation in schools and families.
Smart Images

Figure CN121583519A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of suicide and self-injury grading early warning, more particularly, it relates to a suicide and self-injury grading early warning system based on an XGBoost model. BACKGROUND
[0002] In the prior art, the psychological state of adolescents is usually collected by using a scale, and the adolescents are scored based on the scale, but different scales have different differences, and it is difficult to realize a unified standard for evaluating the self-injury and suicide behavior of adolescents, therefore, it is crucial to construct a suicide and self-injury grading early warning system based on an XGBoost model, which can effectively grade and warn the self-injury and suicide behavior of adolescents based on various psychological state evaluation scales. SUMMARY
[0003] The present application aims to provide a suicide and self-injury grading early warning system for adolescents based on an XGBoost model, which can effectively evaluate the psychological state of adolescents according to existing psychological state evaluation scales and predict individuals or groups with self-injury and suicide behavior.
[0004] The above technical purpose of the present application is achieved by the following technical scheme: a suicide and self-injury grading early warning system based on an XGBoost model, the system comprising a data acquisition module, a data storage module, a data processing module and a result output module;
[0005] The data acquisition module is used to input the relevant data of the psychological state of adolescents collected by various psychological test scales;
[0006] The data storage module stores the relevant data of the psychological state of adolescents collected, and constructs a related database;
[0007] The data processing module analyzes the relevant data of the psychological state of adolescents by the XGBoost model, and analyzes the probability of suicide and self-injury of adolescents;
[0008] The result output module outputs the results of the XGBoost model analysis, and divides the risk level of suicide and self-injury of adolescents into 1-4 levels, in order of low, medium, high and extremely high.
[0009] The present application is further provided as follows: the XGBoost model can output a non-predictive result classification, but output log-odds, as follows:
[0010] pred_y_ = model.predict(origin_data, output_margin=True)
[0011] After output, the probability of the prediction result is further calculated by the formula:
[0012]
[0013] wherein x is the output log-odds; then the frequency of the probability of different segments is counted to obtain the probability distribution of the prediction result; and the natural breakpoint method is used for grading to attempt to divide the sample into four classes, and the probability closer to 1 indicates that it is more likely to be predicted as positive, which means greater risk.
[0014] In summary, the present application has the following beneficial effects: the present application can effectively evaluate the psychological state of adolescents according to the existing psychological state evaluation scale, predict individuals or groups with suicidal or self-injurious behavior, form a relatively unified standard for early warning of suicidal or self-injurious behavior of adolescents, and is conducive to observation and management of the state of adolescents by schools and families, and reduces the probability of suicidal or self-injurious behavior of adolescents. BRIEF DESCRIPTION OF DRAWINGS
[0015] Figure 1 is the confusion matrix of the suicide and self-injury early warning model verification set in the embodiment of the present application;
[0016] Figure 2 is the SHAP-based suicide and self-injury risk prediction force diagram in the embodiment of the present application, Figure 2 A is suicide attempt and B is self-injurious behavior. DETAILED DESCRIPTION
[0017] The following will be described in detail in combination with the accompanying Figures 1-2 The present application will be further described in detail.
[0018] Embodiment: a suicide and self-injury grading early warning system based on an XGBoost model, the system comprising a data acquisition module, a data storage module, a data processing module and a result output module;
[0019] The data acquisition module is used for entering the relevant data of the psychological state of adolescents collected by various psychological test scales;
[0020] The data storage module stores the relevant data of the psychological state of adolescents collected, and constructs a related database;
[0021] The data processing module analyzes the relevant data of the psychological state of adolescents by the XGBoost model, and analyzes the probability of suicide and self-injury of adolescents;
[0022] The result output module outputs the result of the XGBoost model analysis, and divides the risk level of suicide and self-injury of adolescents into 1-4 levels, in turn, low, medium, high and extremely high.
[0023] The XGBoost model can output a classification other than a prediction result, but output log-odds as follows:
[0024] pred_y_ = model.predict(origin_data, output_margin=True)
[0025] After output, the probability of the prediction result is further calculated by the formula:
[0026]
[0027] Where x is the output log-odds; then the frequency of the probability of different segments is counted to obtain the probability distribution of the prediction result; and the natural breakpoint method is used for grading to try to divide the sample into four classes, and the probability closer to 1 indicates a higher possibility of being predicted as positive, which also means a higher risk.
[0028] In this embodiment, the dual verification strategy is used to evaluate the grading early warning system. First, the internal validity test of the XGBoost risk early warning model is carried out based on the 2021 high school student psychological evaluation dataset, and then the external validation is carried out by using the 2022 new suicide and self-injury cases as an independent validation set to comprehensively evaluate the generalization ability and prediction performance of the model.
[0029] The validation results of the internal validity test of the XGBoost risk early warning model based on the 2021 high school student psychological evaluation dataset are shown in Figure 1 , Table 1), which shows that the model has good prediction performance in identifying the risk of suicide and self-injury of adolescents. For the identification of suicide attempt (A in Figure 1 ), the accuracy of the model reaches 87.74%, and the balance between precision (98.52%) and recall (76.63%) is reflected in the F1 score of 86.21%. In terms of self-injury behavior (B in Figure 1 ) early warning, the model maintains similar accuracy level (87.38%), and the coordination between its precision (91.19%) and recall (80.65%) is reflected in the F1 score of 85.59%. The confusion matrix shows that the model has a clear decision boundary in distinguishing the two types of risks, which verifies the clinical discriminant ability of the grading early warning system.
[0030] Table 1 Performance evaluation table of early warning model
[0031]
[0032] In the present application, the risk level output based on the XGBoost model is divided into 1-4 risk levels (low, medium, high, and extremely high).
[0033] Table 2 Suicide and self-injury risk level and coping process table
[0034]
[0035] Based on the new suicide and self-injury cases in 2022 as an independent validation set, the verification results are as shown in Figure 2
[0036] Research object: Figure 2 A is the risk prediction distribution of suicide attempters, Figure 2 B is the risk prediction distribution of self-injury behavior.
[0037] Visualization method: X-axis is the model prediction probability (0-1.0), Y-axis is the sample size.
[0038] Classification logic: natural breakpoint method divides four risk levels, color distinguishes levels (fourth risk level is the highest)
[0039] From Figure 2 It can be seen that most of the data is distributed in the fourth risk level, and the proportions of the second, third and fourth risk levels are small, and the data of the third risk level is more than that of the second and third risk levels. The figure reveals the difference in risk prediction distribution between suicide attempts and self-injury behavior, and the SHAP model provides technical feasibility for accurate classification. In the follow-up continuous use, the system can continuously expand the database, expand the sample library and optimize the classification system through clinical verification, and can more accurately and effectively analyze the suicide and self-injury behavior of adolescents in the future.
[0040] This specific embodiment is only an explanation of the present application, and is not a limitation of the present application. Those skilled in the art can make modifications to this embodiment without creative contribution after reading this specification, but as long as it is within the scope of the claims of the present application, it is protected by the patent law.
Claims
1. A suicide and self-harm grading early warning system based on the XGBoost model, characterized by: The system includes a data acquisition module, a data storage module, a data processing module, and a result output module; The data acquisition module is used to input relevant data on the psychological state of adolescents collected by various psychological test scales; The data storage module stores the collected data on the psychological state of adolescents, and constructs a related database; The data processing module analyzes relevant data on adolescents' psychological state using the XGBoost model, and analyzes the probability of adolescent suicide and self-harm. The result output module outputs the results of the XGBoost model analysis and classifies the risk levels of adolescent suicide and self-harm into 1-4 levels, namely low, medium, high and very high.
2. The suicide and self-harm graded early warning system based on the XGBoost model as described in claim 1, characterized in that: The XGBoost model can output a classification instead of a predicted result, but instead output log-odds, as follows: pred_y_ = model.predict(origin_data, output_margin=True) After outputting the results, the probability of the predicted outcome is further calculated using a formula: Where x is the output log-odds; then the frequency of occurrence of different probabilities is counted to obtain the probability distribution of the prediction results; and the natural breakpoint method is used to classify the samples into four classes. The closer the probability is to 1, the more likely it is to be predicted as positive, which also means that the risk is greater.