Satellite attitude fault detection method based on XGBoost and FocalLoss under data imbalance
Through the combination of XGBoost algorithm and FocalLoss loss function and SMOTE sampling, the problem of data imbalance in satellite attitude failure detection is solved, and higher detection accuracy and reliability are achieved. It is suitable for complex and diverse satellite systems.
Patent Information
- Application Number
- CN202210414580.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-20
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-04-20
AI Technical Summary
Existing satellite attitude fault detection methods are difficult to apply when facing complex and diverse satellite systems, especially due to data imbalance and lack of universality, resulting in insufficient accuracy and reliability of fault detection.
The XGBoost algorithm combined with FocalLoss loss function is used to detect faults by telemetry of the satellite attitude control system, and the data balance processing is performed using SMOTE sampling method to enhance the model's attention to fault data and improve the classification algorithm to adapt to the characteristics of data imbalance.
It effectively improves the accuracy and reliability of satellite attitude fault detection, especially in the case of data imbalance, which significantly improves the detection effect of fault data and solves the shortcomings of purely relying on accuracy.
Smart Images

Figure CN115048976B_ABST
Abstract
Description
Technical Field
[0001] The present invention detects attitude faults in satellites, and specifically relates to a satellite attitude fault detection method combining XGBoost with FocalLoss under data imbalance. Background Art
[0002] With the rapid development of the aerospace industry in recent years, the number of satellites in orbit is constantly increasing, and the data generated by satellite operations is becoming increasingly large, making it increasingly difficult for ground control centers to detect faults in real time using traditional methods. At the same time, the advancement of big data technology and artificial intelligence, through data mining combined with machine learning methods for fault detection, can better solve the problem of large amounts of data and fault detection.
[0003] Satellite fault detection methods based on expert experience and analytical models are the main methods at this stage. Among them, the detection method based on expert experience mainly refers to the establishment of an expert system for satellite fault detection. Reference 1 (Zheng Wei, Yang Xuemeng, Ge Ning. Design and implementation of satellite fault diagnosis system based on expert system and neural network [J]. Journal of Yanshan University. 2016, 40 (01), 74-80.) discloses that the expert system fault diagnosis method is to find the fault by comprehensively applying various rules after the computer collects the information of the diagnosed object. In the field of aerospace satellites, expert knowledge includes a series of prior knowledge such as the fault mode and fault symptoms of the satellite, and fault diagnosis and fault solution are carried out according to experts in the field. Reference 2 (Zou Lei, Wang Xiaoqiang, Li Junyao, Wang Jun, Zang Quanjie. Research on knowledge acquisition method of measurement and control equipment fault diagnosis expert system [J]. Microprocessor. 2016, 37 (05), 92-96.) uses a rule-based expert system, in which the knowledge of the expert system comes from the fault tree in the operation manual and the experience of aerospace experts, and the fault is detected by setting thresholds and conditional judgment. Although these expert systems are relatively simple, use direct knowledge, and have a fast reasoning speed, the shortcomings of expert experience are also obvious. They are too dependent on historical failure experience, have limited diagnostic capabilities, and are difficult to achieve system autonomy. It is also difficult to ensure consistency when adding or modifying the rule base.
[0004] The next is the satellite fault detection method based on analytical model. From the research on satellite fault detection, analytical models are the most numerous and also the most explanatory. This method mainly constructs a mathematical model of the target spacecraft, and judges whether the real system has a fault by analyzing the residual of the output of the model and the real system. There are many ways to calculate the residual, including parameter estimation method, state estimation method and equivalent space method. Document 3 (Yu Baisheng, Huang Wenhu, Jiang Xingsheng, Xu Shichang, Zhu Ping. Equivalent space diagnosis method for satellite attitude sensor fault [C]. The Sixth Mechanical Equipment Fault Diagnosis Academic Seminar. 1998.) applies the equivalent space method to the construction of the redundant model of the attitude control component, and designs a fault diagnosis model for the satellite attitude sensor. The main reason for selecting satellite attitude fault in this application is that the health of the satellite attitude is an important representation of the healthy operation of the satellite in orbit. Usually, normal attitude is also the basis for the normal operation of each subsystem of the satellite. There are many telemetry data related to the satellite attitude, and the rich features are convenient for model establishment. Also for satellite attitude control systems, Reference 4 (He Xiawei, Cai Yunze, Yan Lingling. A synthetic residual reaction wheel fault detection method [J]. Journal of Shanghai Jiaotong University. 2021, 55, (06), 716-728.) proposed an adaptive residual estimation modeling for actuator fault detection in satellite attitude control systems. Reference 5 combines the satellite reaction wheel fault diagnosis method based on geometry and neural networks and the diagnosis and active fault-tolerant control of satellite attitude control systems in Reference 6 to design a set of adaptive estimation filters and a set of residual filters to realize the fault detection model of the reaction wheel of the satellite attitude control system. Reference 7 Satellite attitude control system reaction wheel fault detection and diagnosis based on Kalman filter group designs an attitude control system fault diagnosis model based on Kalman filter.
[0005] Although expert experience and analytical models have played a major role in the past and present, facing increasingly complex satellite systems and satellites with different payloads and functions, the telemetry data generated are different in terms of quantity and feature dimensions. Therefore, it is difficult to apply the previously established expert system to some satellites with frequent maneuvers and complex attitude pointing. When analytical models and expert systems are used for ground control, many of them are established for special satellites, so the algorithms cannot be universal and cannot cover most satellites. Summary of the invention
[0006] In view of the problems existing in the prior art, the present invention provides a satellite attitude fault detection method combining Xgboost with FocalLoss under data imbalance, which mainly transmits the data of star sensors, gyroscopes and reaction wheels in the attitude control system on the satellite to the ground station through telemetry for fault detection. The extremely unbalanced distribution of normal data and fault data in the telemetry data is processed, and Xgboost combined with the Focalloss loss function is used to classify and detect fault data. This method has a good effect in dealing with data imbalance classification problems such as fault detection, and also solves the unreliability of simply using accuracy as the detection result.
[0007] The technical solution of the present invention is: a satellite attitude fault detection method combining Xgboost with FocalLoss under data imbalance, and the specific steps are as follows:
[0008] Step 1: The satellite ground station receives data from the star sensor, gyroscope and reaction wheel in the attitude control system on the satellite through telemetry, and encodes, decodes and stores the received data;
[0009] Step 2: preprocessing the extremely unbalanced distribution of normal data and fault data in the satellite attitude telemetry data stored in step 1;
[0010] Step 3: Model training based on XGBoost combined with FocalLoss loss function. XGBoost supports custom objective functions and loss functions. Aiming at the unbalanced characteristics of satellite attitude fault data, the FocalLoss loss function is used to detect satellite attitude faults.
[0011] Step 4: Use the training model in step 3 to perform fault detection on the satellite attitude telemetry data preprocessed in step 2.
[0012] Furthermore, the model training based on XGBoost combined with FocalLoss loss function described in step 3 is as follows: The idea of the XGBoost algorithm is to continuously add CART trees during the training process, and then continuously split the features to generate a tree. In this process, each time a tree is added, the essence is to learn a new function, so that the previous error can be fitted by this function; when the model training is completed, k trees will be obtained. When the model needs to predict the score of a sample, the essence is to fall into a corresponding leaf node in each trained tree according to the characteristics of the sample, and each leaf node will correspond to a score. The final goal is to add up the scores corresponding to each tree to get the predicted value required for this sample;
[0013] The original objective function of the XGBoost model is:
[0014]
[0015] in, is the loss function, ∑ k Ω(f k ) is a regular term to prevent the model from overfitting;
[0016]
[0017] in, is the predicted output; y i is the label value; is the model of the kth tree; T is the number of leaf nodes; ω is the leaf weight value; γ is the penalty regularization term of each subtree, and its function is to prune; λ is the leaf weight penalty regularization term, which aims to prevent the model from overfitting;
[0018] Combined with FocalLoss loss function:
[0019]
[0020] Among them, y' is the probability of output, between [0,1]. The larger the output probability, the smaller the loss. For negative samples, the smaller the output probability, the smaller the loss.
[0021] By adding α to balance the importance of positive and negative samples, and adding γ to solve the problem of simple and difficult to classify samples, the FocalLoss loss function is regulated by the two parameters α and γ; when γ = 0, the FocalLoss loss function formula is the cross entropy loss function. When γ increases, the modulation coefficient will also increase, which is used to control the proportion of easy-to-classify samples and difficult-to-classify samples. α is used to control the weights of the two categories. In the case of unbalanced data, the faulty data in the data is much smaller than the normal data, so α will take [0,0.5] to increase the sample weight of the faulty data, so that the model pays more attention to the faulty data.
[0022] Furthermore, in step 2, the extremely unbalanced distribution of normal data and fault data in the satellite attitude telemetry data stored in step 1 is preprocessed; specifically, a restricted sampling of the SMOTE sampling method is used:
[0023] The principle of SMOTE sampling algorithm is as follows: SMOTE is an oversampling technology for synthesizing minority classes. It achieves data balance by synthesizing samples in minority classes and increasing the data in minority classes. It finds two samples in minority classes through linear interpolation and synthesizes new samples between them, thereby alleviating and avoiding overfitting problems caused by random sampling.
[0024] x new,attr=x i,attr +(x ij,attr -x i,attr )×γ(3.1)
[0025] Among them, x represents the generated sample, the subscript new of x represents the newly generated, attr represents the features of the newly generated sample x, and x i,attr The meaning of is the feature attr of the i-th original sample;
[0026] The sampling algorithm process of SMOTE is:
[0027] Input: sample set T of minority category, upsampling factor α, number of sample neighbors k;
[0028] process:
[0029]
[0030] Output: synthetic minority class sample set S;
[0031] The original SMOTE samples the minority samples at a ratio of 1:1, thus limiting the sampling rate so that the data is sampled at a ratio of 4:1.
[0032] The beneficial effects of the present invention are: mainly based on the data of star sensors, gyroscopes and reaction wheels in the attitude control system on the satellite, the data are transmitted to the ground station through telemetry for fault detection. The extremely unbalanced distribution of normal data and fault data in the telemetry data is processed, and the fault data is classified and detected by using XGBoost combined with the Focalloss loss function. This application improves XGBoost by using the Focalloss loss function proposed in the image to target the unbalanced characteristics of satellite fault data at the data level and the model level, and has a good effect on classifying structured data such as telemetry. In the case of such unbalanced telemetry fault data, the fault can be detected very well. At the same time, it also solves the unreliability of using accuracy alone as the detection result.
[0033] This application mainly targets the actual telemetry data of multiple satellites in orbit, and first cleans and organizes the data. This mainly includes the interpolation of missing values in the telemetry data, the unification of the dimensional features of multiple satellite data, and the selection of correlation analysis features. At the same time, this application takes into account the impact of data imbalance on the classification algorithm model in the field of fault detection. During the operation of satellites in orbit, failures are very rare, so the number of fault samples is much smaller than that of normal samples. The distribution of data is biased towards normal data, and the model learned by the algorithm is basically based on normal data. At this time, if the accuracy is used to judge the diagnosis results, there will be a large deviation, resulting in insufficient reliability of the results. A method based on the XGBoost model and the FocalLoss loss function is designed for this kind of unbalanced data to classify the fault data. In the open paper [Huang Jin, Liu Yang, Zhong Maiying, Yang Rui, Li Wenbo, Liu Chengrui. Satellite control system fault detection using random forest algorithm [J]. Journal of Astronautics. 2021, 42(04), 513-521.], the random forest algorithm is used to diagnose actuator and sensor faults in satellite control systems. Due to the characteristics of random forest, although it does not require complex optimization parameters, the accuracy rate cannot be very high. In the competitions on various data platforms, the XGBoost model has occupied the top few places in the list. It has been applied in fault diagnosis in various industries. [Wang Wenbo, Zeng Xiaomei, Zhao Yinchuan, Zhang Yunyun, Liu Da. Transformer defect prediction based on SMOTE-XGBoost [J]. Journal of North China Electric Power University. 2021, 48(05), 54-60+71.] In this paper, SMOTE is combined with XGBoost to be used in transformer fault diagnosis. The SMOTE algorithm is used to deal with the imbalance of the data set. When the algorithm model is used for detection, it is also compared with SVM, Logistic and other algorithms, and the effect is significantly improved.
【Chen Hailong, Yang Chang, Du Mei, Zhang Yingyu. Credit risk prediction model based on boundary adaptive SMOTE and Focal Loss function LightGBM[J / OL]. Computer Applications: 1-11[2022-02-22].http: / / kns.cnki.net / kcms / detail / 51.1307.TP.2021102
[0034] 2.1421.012.html.】The paper also applies the FocalLoss function proposed in the image to structured data, solving problems such as the imbalance of sample proportions in credit rating defaults, and obtains better diagnostic capabilities than previous sampling.
[0035] Experiments show that this method has better and more accurate results for such unbalanced satellite fault data and can be applied to ground satellite attitude fault detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 For comparison of experimental results. DETAILED DESCRIPTION
[0037] The present invention will be further described below in conjunction with the accompanying drawings.
[0038] 1. Imbalanced processing of satellite attitude fault data
[0039] 1.1 Data Imbalance
[0040] The class imbalance problem of data refers to the fact that the number of one class of data is far greater than that of other classes. Especially for the binary classification problem, one class of data is a large sample of data, and the other class of data has only a few samples. At the same time, the class imbalance problem can be seen everywhere in real life, such as medical diagnosis, machine fault detection, information security and computer vision. In traditional classification algorithms, in order to maximize the overall prediction accuracy of the training model, the classifier will give priority to the accuracy of the majority class samples, causing the classification decision to be biased towards the majority class samples, resulting in a high misclassification rate of the model for the minority class samples. However, in some applications, the cost of misclassification of minority classes is huge. For example, in medical diagnosis and fault diagnosis, the cost of misclassifying patient or fault data as normal is immeasurable.
[0041] Generally, this type of data imbalance problem is solved mainly from two aspects: data and algorithm. One aspect is to consider preprocessing the data itself through data sampling or data enhancement methods to fundamentally solve the data distribution problem, which can be used in other classification schemes. Among them, the literature proposes SMOTE: Synthetic Minority Oversampling Technique, which proposes the classic oversampling technology SMOTE (Synthetic Minority Oversampling Technique) by generating the number of new minority samples from minority samples. This method is prone to excessive sample redundancy. The undersampling technology in the literature first clusters the majority class, and then removes a certain number of samples from each cluster after clustering. Oversampling technology can cause redundancy problems while reducing data imbalance, while undersampling technology may cause some important data loss. Furthermore, GAN (Generative Adversarial Nets) is used for data enhancement [Meng Zong, Guan Yang, Pan Zuozhou, Sun Dengyun, Fan Fengjie, Cao Lixiao. Research on rolling bearing fault diagnosis based on secondary data enhancement and deep convolution [J / OL]. Journal of Mechanical Engineering: 1-10 [2022-02-22]. http: / / kns.cnki.net / kcms / detail / 11.2187.TH.20211102.1604.024.html.], which uses deep neural networks to learn the distribution of minority class data and increase the amount of data in the distribution.
[0042] 1.2 Distribution of satellite attitude fault data
[0043] According to the analysis of the faults in this application, the fault data is processed and analyzed here. The fault data type and fault proportion are shown in Table 1.
[0044] Table 1
[0045]
[0046]
[0047] According to Table 1, among the 7 existing faults, except for the relatively balanced data distribution of the gyro noise increase, the data of the other faults have different distribution imbalances. In particular, the abnormal acquisition of the reaction wheel accounts for only 0.24% of the abnormalities. For this kind of data imbalance fault, the diagnostic effect cannot be evaluated by a simple accuracy rate. Next, a more reasonable and scientific evaluation scheme for data imbalance is introduced.
[0048] 1.3 Evaluation of Fault Detection
[0049] When evaluating the classification of imbalanced data, only the accuracy is used to measure, and only the correct ones are classified as correct and the wrong ones are classified as wrong. Although the accuracy is very high, the negative samples are not accurately found, that is, the fault data is not detected, and its significance in the field of fault detection is not very large in practice. When evaluating the algorithm of imbalanced data, precision, recall and F1 value are often used to measure. Precision refers to the prediction result, which indicates the proportion of correct predictions as positive; while recall refers to the original sample, which indicates the proportion of correct predictions as positive to all actual positives. F1 can combine the precision and recall of a class in the same indicator, so the F1 value is finally used for evaluation. The confusion matrix is shown in Table 2.
[0050] Table 2
[0051]
[0052] Accuracy: It is the most primitive evaluation indicator in classification problems. The definition of accuracy is the percentage of correct prediction results in the total samples. The formula is
[0053]
[0054] However, for 100 samples, 99 are positive and 1 is negative. If the model predicts all the other samples as positive, the accuracy is 0.99. From the accuracy point of view, the value is still very good. But the fact is that this model has no predictive ability and cannot be measured by accuracy.
[0055] Precision:
[0056]
[0057] Although precision and accuracy seem similar, they are two completely different concepts. Precision represents the accuracy of the prediction of the positive sample results, while accuracy represents the overall prediction accuracy, that is, including both positive and negative samples.
[0058] Recall:
[0059]
[0060] F1-Score: Taking into account both precision and recall
[0061]
[0062] True Positive Rate (TPR)
[0063]
[0064] False Negative Rate (FNR):
[0065]
[0066] False Positive Rate (FPR):
[0067]
[0068] True Negative Rate (TNR):
[0069]
[0070] The above four indicators are all for the prediction results of a single category and are not sensitive to whether the overall sample is balanced.
[0071] ROC (Receiver Operating Characteristic) curve, also known as the receiver operating characteristic curve. This curve was first used in the field of radar signal detection to distinguish between signals and noise. It is now used to evaluate the predictive ability of the model. The main indicators in the ROC curve are TPR and FPR, where the horizontal axis is TRP and the vertical axis is FPR.
[0072] AUC (Area Under Curve): The area under the curve is the size of the area below the ROC Curve. The larger the area under the ROC curve, the better the model performance.
[0073] 2. Improve XGBoost detection algorithm
[0074] The previous work of this application is to solve the problem of data imbalance from the data level, and then improve the model. Compared with the article [Liu Yun, Yi Chuanhuan, Hu Di, Zhao Tian, Liang Yu. Communication satellite fault detection based on recurrent neural network. [J]. Computer Science 2020, 47 (02), 227-232.], the recurrent neural network LSTM is used to train multi-dimensional time series data to obtain a fault diagnosis model. The amount of data required is too large, and the missing values and wrong values in the middle have a serious impact on the model and the results. The article [Ni Ping, Wen Xin. Satellite attitude actuator fault diagnosis based on recurrent neural network [J]. Chinese Space Science and Technology, 202141 (04), 121-126.] uses recurrent neural network to diagnose satellite attitude actuator faults. Due to the large time and computing resources consumed by deep neural network training, it is easy to overfit for attitude fault data with too low dimensions and does not have good generalization ability. Using XGBoost in the tree model can be well suited to the characteristics of our satellite fault data.
[0075] This application discloses a satellite attitude fault detection method combining Xgboost with FocalLoss under data imbalance. The specific steps are as follows:
[0076] Step 1: The satellite ground station receives data from the star sensor, gyroscope and reaction wheel in the attitude control system on the satellite through telemetry, and encodes, decodes and stores the received data;
[0077] Step 2: Preprocess the extremely unbalanced distribution of normal data and fault data in the satellite attitude telemetry data stored in step 1; specifically, use the restricted sampling of the SMOTE sampling method:
[0078] The principle of SMOTE sampling algorithm is as follows: SMOTE is an oversampling technology for synthesizing minority classes. It achieves data balance by synthesizing samples in minority classes and increasing the data in minority classes. It finds two samples in minority classes through linear interpolation and synthesizes new samples between them, thereby alleviating and avoiding overfitting problems caused by random sampling.
[0079] x new,attr =x i,attr +(x ij,attr -x i,attr )×γ (3.1)
[0080] Among them, x represents the generated sample, the subscript new of x represents the newly generated, attr represents the features of the newly generated sample x, and x i,attr The meaning of is the feature attr of the i-th original sample;
[0081] The sampling algorithm process of SMOTE is:
[0082] Input: sample set T of minority category, upsampling factor α, number of sample neighbors k;
[0083] process:
[0084]
[0085] Output: synthetic minority class sample set S;
[0086] The original SMOTE samples the minority samples at a ratio of 1:1, thus limiting the sampling rate so that the data is sampled at a ratio of 4:1.
[0087] Step 3: Model training based on XGBoost combined with FocalLoss loss function. XGBoost supports custom objective functions and loss functions. Aiming at the unbalanced characteristics in satellite attitude fault data, satellite attitude fault detection is performed through FocalLoss loss function. The details are as follows: The idea of the XGBoost algorithm is to continuously add CART trees during the training process, and then continuously split the features to generate a tree. In this process, each time a tree is added, it is essentially learning a new function, so that the previous error can be fitted through this function. When the model training is completed, k trees will be obtained. When the model needs to predict the score of a sample, it is essentially based on the characteristics of this sample. In each trained tree, a corresponding leaf node will fall, and each leaf node will correspond to a score. The final goal is to add up the scores corresponding to each tree, which is the predicted value required for this sample.
[0088] The original objective function of the XGBoost model is:
[0089]
[0090] in, is the loss function, ∑ k Ω(f k ) is a regular term to prevent the model from overfitting;
[0091]
[0092] in, is the predicted output; yi is the label value; is the model of the kth tree; T is the number of leaf nodes; ω is the leaf weight value; γ is the penalty regularization term of each subtree, and its function is to prune; λ is the leaf weight penalty regularization term, which aims to prevent the model from overfitting;
[0093] Combined with FocalLoss loss function:
[0094]
[0095] Among them, y' is the probability of output, between [0,1]. The larger the output probability, the smaller the loss. For negative samples, the smaller the output probability, the smaller the loss.
[0096] By adding α to balance the importance of positive and negative samples, and adding γ to solve the problem of simple and difficult to classify samples, the FocalLoss loss function is regulated by the two parameters α and γ; when γ = 0, the FocalLoss loss function formula is the cross entropy loss function. When γ increases, the modulation coefficient will also increase, which is used to control the proportion of easy-to-classify samples and difficult-to-classify samples. α is used to control the weights of the two categories. In the case of unbalanced data, the faulty data in the data is much smaller than the normal data, so α will take [0,0.5] to increase the sample weight of the faulty data, so that the model pays more attention to the faulty data.
[0097] Step 4: Use the training model in step 3 to perform fault detection on the satellite attitude telemetry data preprocessed in step 2.
[0098] 3. Experimental Design and Results
[0099] According to the model design of this application, several groups of comparative experiments were conducted for the data set analyzed above. At the same time, the public data set of satellite fault data on the Outlier Detection Datasets on the website of Stony Brook University of New York was also used. The classification results were also compared with traditional models such as SVM and random forest.
[0100] The experimental results of the proposed method in this application are based on the characteristics of satellite fault data imbalance, using the characteristics of XGBoost and FocalLoss. The experimental results of the original XGBoost are shown in Table 3. The experimental results of Svm are shown in Table 4. The experimental results of RF are shown in Table 5. The experimental results of the improved method in this application are shown in Table 6. The experimental results are compared in Figure 1 .
[0101] Table 3
[0102]
[0103]
[0104] Table 4
[0105]
[0106] Table 5
[0107]
[0108] Table 6
[0109]
[0110] In the algorithm of the model, this application applies FocalLoss loss to structured data. The effect can be seen from the above experiments, which is significantly improved. F1-Score is affected by the majority of positive samples, and the effect is not as obvious as the AUC evaluation indicator.
[0111] From the experimental results, we can see that the experimental results of the original XGBoost method, Svm and random forest are compared, and public data sets are also introduced.
[0112] The improved method from data to model proposed in this application has obvious improvement in effect and is also highly credible.
[0113] This application uses the Focalloss loss function proposed in the image to improve XGBoost by targeting the unbalanced characteristics of satellite fault data at the data level and model level, and has a good effect on classifying structured data such as telemetry. In the case of unbalanced telemetry fault data, it can have a good detection effect on the fault.
[0114] The above is only 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 principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. Satellite attitude fault detection method based on XGBoost combined with FocalLoss under data imbalance, characterized by: The specific steps are as follows: Step 1: The satellite ground station receives data from the star sensor, gyroscope and reaction wheel in the attitude control system on the satellite through telemetry, and encodes, decodes and stores the received data; Step 2: preprocessing the extremely unbalanced distribution of normal data and fault data in the satellite attitude telemetry data stored in step 1; Step 2 preprocesses the extremely unbalanced distribution of normal data and fault data in the satellite attitude telemetry data stored in step 1; specifically, the restricted sampling of the SMOTE sampling method is used: The principle of SMOTE sampling algorithm is as follows: SMOTE is an oversampling technology for synthesizing minority classes. It achieves data balance by synthesizing samples in minority classes and increasing the data in minority classes. It finds two samples in minority classes through linear interpolation and synthesizes new samples between them, thereby alleviating and avoiding overfitting problems caused by random sampling. x new,attr =x i,attr +(x ij,attr -x i,attr )×γ (3.1) Among them, x represents the generated sample, the subscript new of x represents the newly generated, attr represents the features of the newly generated sample x, and x i,att The meaning of r is the feature attr of the i-th original sample; The sampling algorithm process of SMOTE is: Input: sample set T of minority category, upsampling factor α, number of sample neighbors k; process: (1) for i = 1 to | T | do (2) Calculate x i The k nearest neighbor samples are stored in X ik gather; (3)forj=1ton do (4) From X ik Randomly select a sample x from ij ; (5) Generate a random number γ between [0, 1]; (6) Using formula (3.1) to synthesize x ij and x i New samples x between new Each attribute value x new,attr ; (7) x new Add to the set S; (8)endfor (9)endfor Output: synthetic minority class sample set s; Limit the sampling rate so that the data is sampled at a ratio of 4:1; Step 3: Model training based on XGBoost combined with FocalLoss loss function. XGBoost supports custom objective functions and loss functions. Aiming at the unbalanced characteristics of satellite attitude fault data, the FocalLoss loss function is used to detect satellite attitude faults. The model training based on XGBoost combined with FocalLoss loss function described in step 3 is as follows: The idea of the XGBoost algorithm is to continuously add CART trees during the training process, and then continuously split the features to generate a tree. In this process, each time a tree is added, the essence is to learn a new function, so that the previous error can be fitted by this function; when the model training is completed, k trees will be obtained. When the model needs to predict the score of a sample, the essence is to fall into a corresponding leaf node in each trained tree according to the characteristics of the sample. Each leaf node will correspond to a score. The final goal is to add up the scores corresponding to each tree to get the predicted value required for this sample; The original objective function of the XGBoost model is: in, is the loss function, ∑kΩ(fk) is a regular term to prevent the model from overfitting; in, is the predicted output; yi is the label value; is the model of the kth tree; T is the number of leaf nodes; ω is the leaf weight value; γ is the penalty regularization term of each subtree, and its function is to prune; λ is the leaf weight penalty regularization term, which is used to prevent the model from overfitting; Combined with FocalLoss loss function: Among them, y′ is the probability of output, between [o,1], the larger the output probability, the smaller the loss; for negative samples, the smaller the output probability, the smaller the loss; By adding α to balance the importance of positive and negative samples, and adding γ to solve the problem of simple and difficult classification of samples, the FocalLoss loss function is regulated by the two parameters α and γ; when γ = 0, the FocalLoss loss function formula is the cross entropy loss function. When γ increases, the modulation coefficient will also increase, which is used to control the proportion of easy-to-classify samples and difficult-to-classify samples. α is used to control the weights of the two categories. In the case of unbalanced data, the fault data in the data is much smaller than the normal data, so α will take [0,0.5] to increase the sample weight of the fault data, so that the model pays more attention to the fault data; Step 4: Use the training model in step 3 to perform fault detection on the satellite attitude telemetry data preprocessed in step 2.