Energy conservation and emission reduction have become important issues in social development [
1]. As the largest energy consumer in the world, China is optimizing its energy structure and upgrading its energy industry following the “two-carbon” policy. Therefore, it is imperative to vigorously develop and use sustainable new energy sources [
2]. As a kind of new energy, wind power has become an important part of new energy development due to its green, pollution-free, and sustainable nature [
3]. As the largest wind power country in the world, China’s onshore wind power has developed rapidly, but the development of offshore wind power is still in the initial stage [
4]. Due to the decreasing availability of onshore wind energy resources and the higher utilization rate of offshore wind power facilities compared with onshore wind power, the power generation of offshore wind turbines is 20–40% higher than that of onshore wind turbines [
5]. Therefore, the study of offshore wind power is urgent. The global installed capacity of wind turbines is growing at an annual rate of 20–30% [
6]. Offshore wind turbines are also developing in the direction of large-scale grids, and the probability of failure has correspondingly increased [
7]. Although the wind power industry in China is developing rapidly, the fault monitoring and early warning of offshore wind power units are weak points in the research [
8], especially the fire warning research of wind power units [
9]. Wind farms are usually located in areas with good ventilation and abundant wind resources. Once a fire breaks out, it will spread quickly. Compared with onshore wind farms, offshore wind farms are mostly located in remote coastal areas, and some offshore wind farms are even situated tens of kilometers away from the coast, with extremely inconvenient traffic, which is not conducive to timely firefighting and disaster protection for wind turbines. The fire accident rate of wind turbines has also gradually increased in recent years, becoming the second largest disaster after lightning strikes [
10]. Due to difficulties in firefighting, multiple fire hazards, and complex fire types in wind turbines, once a wind turbine catches fire, it will cause the loss of the whole unit, which easily causes great economic losses, and the rescue possibility is almost zero [
11]. In addition, due to the complexity of the operating conditions of offshore wind turbines and the severity of the operating environment [
12], the main fire-extinguishing agents and water mist technology used at present are limited and cannot achieve good fire control effects [
13]. Therefore, a fire warning for offshore wind turbines is crucial to protecting the security of on-site staff and the safe operation of the wind turbines. Kim et al. [
14] proposed using a vacuum circuit breaker, a vacuum interrupter combined with the main circuit breaker, and a vacuum degree change analysis method of partial discharge to monitor and control overcurrent in real time to prevent fire caused by overcurrent in wind turbines. This method can warn of fires caused by overcurrent, but it has difficulty warning of other types. Sun et al. [
15] used Fourier transform infrared spectroscopy to analyze the effect of functional group changes in hydraulic oil, gear oil, and transformer oil on temperature during wind turbine operation to provide early warnings of fire. However, an entire wind turbine has not been studied. However, it is challenging to provide early warnings of fires caused by other factors using this method. Chen et al. [
16] made a quantitative analysis of the importance of factors affecting wind turbine cabin fires and proposed methods to improve the safety of wind turbine cabins. However, some factors (such as inappropriate laws and regulations, low technical levels, and illegal operations) are difficult to analyze quantitatively, and these factors can be eliminated. To provide early warnings of fires in wind turbines, it is necessary to analyze all of the operation data of wind turbines. However, traditional data analysis cannot effectively process such huge amounts of data [
17]. Therefore, a machine learning algorithm [
18] is introduced to process, analyze, and predict wind turbine operation data. Thus, a wind turbine unit fire can be predicted. Ma et al. [
19] used the XGBoost model to predict outdoor air temperature and humidity. This model had great prediction performance, with an R2_score > 0.73 and an RMSE < 1.77 for an outdoor air temperature prediction model and an R2_score > 0.81 and an RMSE < 6.33 for an air humidity prediction model. However, indoor air temperature and humidity could not be predicted, so the effect of indoor and outdoor temperature and humidity cannot be comprehensively judged. Trizoglou et al. [
20] used the XGBoost model and the LSTM model to predict wind turbine gearbox temperature, generator internal air temperature, and generator stator temperature; the average MAE of the temperature prediction of the LSTM model was 2.75, and the average MAE of the temperature prediction of the XGBoost model was 0.31, indicating that the prediction performance of the model was great. The prediction performance of the XGBoost model was better than that of the LSTM model. Kaligambe et al. [
21] used the XGBoost model to predict indoor temperature and relative humidity. The RMSE of the temperature and humidity prediction model were 0.3 and 2.7, and the MAPE of the temperature and humidity prediction model were 0.7% and 2.6%, which showed that the models had excellent prediction performance. However, they only predicted indoor and relative humidity without predicting outdoor temperature and humidity. Thus, they have difficulty judging indoor and outdoor temperature and humidity changes comprehensively.
In addition, due to the wide variety and large number of offshore wind turbines, if separate model designs, data processing, and feature prediction are carried out for each wind turbine to provide early warnings of fires, the implementation cost may be very high [
22]. Moreover, historical operation data for some newly installed wind turbines may be limited or unavailable [
23], making it difficult to train a model with reliable prediction performance for fire early warning. Therefore, transfer learning [
24] is introduced to carry out fire warnings for different numbers and types of wind turbines. Guo et al. [
25] used XGBoost and transfer learning to predict the effect of antenna assembly error on gain, and the results showed that the prediction performance was better than that of the ANN and SVM models. Tang et al. [
26] used XGBoost to predict photovoltaic power based on transfer learning. They analyzed the similarity between different and target prediction models to carry out mobility analysis and selected models with high similarity for transfer learning. The results showed that this model improves the prediction accuracy of photovoltaic power generation. Liu et al. [
27] used XGBoost and transfer learning methods to predict water absorption based on jointly distributed adaptation. The experimental results showed that transfer learning and XGBoost can be used to predict water absorption. Yang et al. [
28] predicted the short-term loads in data-poor regions based on transfer learning and XGBoost. The experimental results showed that transfer learning can significantly reduce prediction error and improve prediction accuracy. In view of the above situations, this paper proposes an offshore wind turbine unit fire warning model based on XGBoost [
29] and transfer learning. We predict the average cabin temperature, average outdoor temperature, average cabin humidity, and average atmospheric humidity of one particular wind turbine unit by constructing different XGBoost prediction models, which can not only quantitatively analyze the factors affecting fires in a wind turbine unit but can also conduct fire analysis on the entire wind turbine unit. Then, the prediction models are transferred to other types of units, and the prediction performance of the transfer learning models is analyzed to complete a fire warning system for wind turbine units.