Fault Diagnosis Technology for Ship Electrical Power System

: This paper proposes a fault diagnosis method for ship electrical power systems on the basis of an improved convolutional neural network (CNN) to support normal ship operation. First, according to the mathematical model of the ship electrical power system, the simulation model of the ship electrical power system is built using the MATLAB/Simulink simulation software platform in order to understand the normal working state and fault state of the generator and load in the power system. Then, the model is simulated to generate the fault response curve, and the picture dataset of the network model is obtained. Second, a CNN fault diagnosis model is designed using TensorFlow, an open-source tool for deep learning. Finally, network model training is performed, and the optimal diagnosis results of the ship electrical power system are obtained to realize structural parameter optimization and diagnosis. The diagnosis results show that the established simulation model and improved CNN can provide support for fault diagnosis of the ship electrical power system, improve the operation stability and safety of the ship electrical power system, and ensure safety of the crew.


Introduction
With the continuous development of modern technology, ship electrical power systems that can realize overall coordination of the energy of the entire ship are expected to constitute the development trend of ships in the future [1,2]. Ship electrical power systems are significantly different from land power systems [3]. In particular, they are strongly independent. Because ship electrical power systems have a smaller capacity than onshore power systems, bus voltage fluctuation may occur under the application or removal of a large load, which can easily cause serious faults. Any equipment fault in the system can affect the entire power grid. If potential safety hazards occur during operation, they will threaten the safety of the entire ship. Ship electrical power systems are regarded as the core of the entire ship. They are independent and have high requirements in terms of safe operation and fault diagnosis. They need faster and more accurate fault diagnosis than land power systems in case of system faults [4]. Therefore, fault diagnosis technologies are necessary to study ship electrical power systems [5].
Fault diagnosis of a ship electrical power system entails modeling and simulation of the system. Early modeling methods mainly involved physical modeling, i.e., a physical model was established using the similarity principle. At present, the mathematical modeling method is mainly used. This method can abstract the internal characteristics of the system into mathematical formulas, deduce the internal characteristics of the actual system, and diagnose faults through changes in the relationship between the independent variables and the dependent variables of the mathematical formulas. Research on modeling and simulation of ship electrical power systems is based on the power system model and involves a series of studies on how to maintain system stability. The ship electrical power system model is integrated with the modules of each basic unit. First, a mathematical model is established for each basic unit of the power system according to the structure and basic principles of the ship electrical power system. Then, a simulation model is built to form a complete ship electrical power system model [6]. The research process should include modeling and simulation technologies, automatic control, and other theoretical methods. In particular, the generator and its excitation are related to the voltage stability of the power system. The linear single variable control method, which was first used in excitation control, has been subsequently modified into the nonlinear multivariable control method. The development of the excitation control method has undergone several stages [7], from the earliest classical proportional integral and differential (PID) control method to the multivariable control method based on modern theory. At present, it is applied as an intelligent control method. In [8], the authors proposed a T-S fuzzy-weightingbased excitation switching control method for a tidal generator set, which can overcome the dynamic and static performance defects in the excitation control of the tidal generator set and improve its performance. In [9], feedback control was adopted for the field currents of the two-phase brushless exciter, and speed reference control was adopted for the excitation frequency and phase sequence; this method achieves a constant field current for the main generator. In [10], the authors presented a nonlinear coordinated excitation and static VAR compensator (SVC) control for regulating the output voltage and improving the transient stability of a synchronous generator infinite bus (SGIB) power system. In terms of the mathematical development of fault diagnosis methods for ship electrical power systems, the author in [11] developed a higher-order mathematical model of the generator to describe the generator state in greater detail. In [12], the authors proposed three different mathematical models for the mathematical modeling of a synchronous generator, used the models under different working conditions, and conducted a detailed comparative analysis of the models to improve the simulation accuracy.
In general, fault diagnosis methods are currently categorized into three main types [13], namely fault diagnosis based on analytical modeling, fault diagnosis based on signal processing, and fault diagnosis based on artificial intelligence. Analytical modeling includes state and parameter estimation as well as consistency testing. It has the characteristics of real-time diagnosis and the essence of deep human systems. However, it also has some defects, such as a large modeling error and significant noise interference. Signal processing includes spectrum analysis and wavelet transformation. It has the advantages of simple application and good real-time performance. However, it cannot deal with potential faults. Artificial intelligence [14] includes neural networks, fuzzy theory, genetic algorithms, rough sets, artificial immune systems and fuzzy cluster analysis algorithms, fault trees, and support vector machines, which have strong learning and reasoning abilities. To overcome key faults such as a broken rotor bar or electrical phase fault, a fault diagnosis method for the electric drive of an electric ship has been proposed [15]; however, the number of fault diagnosis objects is insufficient. In [4], the proposed load monitoring and fault detection method outlines a data-clustering-based approach to extract unique feature vectors from short-time Fourier transform analysis for any pulsed load; however, this method is not suitable for any general load curve integrated solution. In [16], the location and severity of a stator winding fault of a permanent magnet synchronous motor were modeled and detected, and a mathematical model that can describe both the health state and the fault state was established; however, the mathematical model is not suitable for other ship electrical power system equipment. In [17], a remote system was introduced for online condition monitoring and fault diagnosis of a gas turbine on an offshore oil well drilling platform on the basis of a kernelized information entropy model. In [18], a multi-class multi-core correlation vector machine fault diagnosis method based on manifold learning and swarm intelligence optimization was proposed to improve the predictive maintenance activities of diesel engines. This paper proposes an improved network fault diagnosis model based on a convolutional neural network (CNN). This method can directly input the original image without feature decomposition and extraction. It has significant advantages, such as simple application, high operation speed, automatic parameter updates, and stable, convergent, and accurate results. These advantages enable the method to overcome existing drawbacks in the fault diagnosis of ship electrical power systems. First, based on the MATLAB/Simulink (The MathWorks Inc., Natick, MA, USA) simulation software platform, the ship electrical power system simulation model is established to understand the normal working state and fault state of the generator and load. Then, the fault response curve is generated and the picture dataset of the network model is obtained. Second, the CNN fault diagnosis model is designed using TensorFlow, an open source tool for deep learning. Finally, network model training is performed, and optimal diagnosis results are obtained to realize structural parameter optimization and diagnosis.
The remainder of this paper is organized as follows. Section 2 describes the model and simulation of the ship electrical power system. Section 3 discusses the development of the improved CNN. Section 4 presents and analyzes the experimental results. Finally, Section 5 concludes the paper.

Model of Excitation Control System
At present, most ships use AC electric propulsion systems. Because the electrical equipment of the ship mainly comprises inductive loads, the load current will cause demagnetization of the synchronous generator, and the load change will alter the power grid voltage of the ship [19]. To ensure stable operation of the power system, the excitation system will adjust the excitation current supplied to the generator according to the load change, make the generator terminal voltage return to the given value, and realize stability of the generator terminal voltage.
Currently, the most common excitation mode of generators in ship electrical power systems is phase compound excitation of brushless excitation systems. The combination of brushless excitation and automatic voltage regulation (AVR) can effectively enhance the forced excitation capacity and reaction speed of the excitation system. The principle of the excitation system is that the rotating exciter rotates at the same speed as the magnetic field of the main generator, and the auxiliary exciter rotates with the rotating exciter.
AVR plays an important role in phase compound excitation systems [20]. The power supply unit in AVR converts the output voltage of the generator into the voltage required by the system through voltage transformation, rectification and other links, and then transmits the results to the PID control unit and phase control unit. The synchronous control unit controls and adjusts the phase change of the excitation current output through the exciter to maintain the same change as the phase change of the applied thyristor excitation voltage. The voltage difference detection unit monitors the error signal between the reference voltage and the actual voltage in the system. The PID control unit amplifies the voltage error signal. The phase control unit mainly amplifies the signal. The main thyristor rectifier unit mainly rectifies the armature current of the static exciter.
Based on the above-mentioned principles and by referring to the excitation system model recommended by IEEE [21], the mathematical model of the excitation system can be obtained as follows: (1) Mathematical model of phase compound excitation device is represented by d and q components as follows: where U r is the output voltage of the phase compound excitation device, U d is the armature terminal voltage of generator axis d, U q is the armature terminal voltage of generator axis q, K = 9 √ 2/π, and x is the moving reactance. (2) Mathematical model of voltage difference The model of voltage difference is an adder model, which compares the effective voltage signal input of other elements and obtains a voltage difference signal as a control signal. The difference between the output terminal voltage and the set voltage satisfies Equation (3): where U t f is phase compound excitation voltage signal, T r is the time constant of the filter, U re f is the reference voltage of the automatic voltage regulating device, ∆U is the voltage difference between the output terminal voltage and the set voltage, U f 0 is the initial excitation voltage, k e is the effective gain of the exciter, U stab is the grounding voltage of power system (0), and U f f is the feedback output voltage.
(3) Amplifier mathematical model The mathematical equation that the amplifier satisfies is: where U a is the output voltage of the amplifier, U c is the voltage output by the compensator, K a is the gain of the amplifier, and T a is the time constant of the amplifier.
(4) Mathematical model of lead-lag compensator The mathematical equation that the lead-lag compensator satisfies is: where T c and T b are the lead compensation time constant and lag compensation time constant of the compensator, respectively.
(5) Mathematical model of proportional saturation element The mathematical equation of proportional saturation element is: Then, E f d = U a + U r (6) where E f d is the voltage output by the voltage regulating device, and E f and E f max are the proportional saturation element output voltage value and maximum voltage value, respectively.
(6) Simplified exciter mathematical model Exciter is usually represented by one-order inertia element, as shown in Equation (7): where U f is the output voltage of the exciter and T e is the time constant of the exciter.
(7) The mathematical equation that the feedback stabilization element satisfies is: where K f and T f are the gain and time constant of the feedback element.

Simulation Model of Diesel-Driven Synchronous Generator and Its Excitation System
According to the above-mentioned mathematical model, the simulation model of the excitation control system [22] is established using simulation software as follows: As shown in Figure 1, the main regulator and lead-lag compensator, as the main controller and damping feedback link, constitute a closed-loop PID control loop. Input vref is the set value of the synchronous generator terminal voltage, vd and vq are the voltage values on the d-axis and q-axis of the generator, respectively, and vstab is the synchronous generator ground zero voltage. The output terminal Vf of the excitation control system is the excitation voltage. In addition to the corresponding parameters of each link shown in Figure 1, the initial excitation voltage Vf0 is set to 1, and the upper and lower limits of the proportional saturation link for the limiting amplitude are 5 and 0, respectively.

= 1 +
where and are the gain and time constant of the feedback element.

Simulation Model of Diesel-Driven Synchronous Generator and Its Excitation System
According to the above-mentioned mathematical model, the simulation model of t excitation control system [22] is established using simulation software as follows: As shown in Figure 1, the main regulator and lead-lag compensator, as the ma controller and damping feedback link, constitute a closed-loop PID control loop. Inp vref is the set value of the synchronous generator terminal voltage, vd and vq are t voltage values on the d-axis and q-axis of the generator, respectively, and vstab is t synchronous generator ground zero voltage. The output terminal Vf of the excitation co trol system is the excitation voltage. In addition to the corresponding parameters of ea link shown in Figure 1, the initial excitation voltage Vf0 is set to 1, and the upper a lower limits of the proportional saturation link for the limiting amplitude are 5 and respectively. The power unit of the power system of the ship adopts diesel fuel combination combined power. The main power unit is the synchronous generator driven by dies while the auxiliary power unit is the asynchronous generator driven by a gas turbine. T synchronous generator is the synchronous generator simulation model in t MATLAB/Simulink/SimPowerSystems module library, and its parameters are listed Table 1. To ensure stability and correctness of the simulation graphics, it is also necessa to use the built-in function of the powergui module in Simulink in order to initialize t generator. The power unit of the power system of the ship adopts diesel fuel combination for combined power. The main power unit is the synchronous generator driven by diesel, while the auxiliary power unit is the asynchronous generator driven by a gas turbine. The synchronous generator is the synchronous generator simulation model in the MAT-LAB/Simulink/SimPowerSystems module library, and its parameters are listed in Table 1.
To ensure stability and correctness of the simulation graphics, it is also necessary to use the built-in function of the powergui module in Simulink in order to initialize the generator.

Simulation Model of Gas-Turbine-Driven Asynchronous Generator
The auxiliary power unit gas turbine has a complex structure. To better simulate the operation, the turbine part of the of gas turbine is used to replace the entire gas turbine [23], as shown in Figure 2.

Simulation Model of Gas-Turbine-Driven Asynchronous Generator
The auxiliary power unit gas turbine has a complex structure. To better simulate the operation, the turbine part of the of gas turbine is used to replace the entire gas turbine [23], as shown in Figure 2. The turbine uses a two-dimensional look-up table to calculate the turbine torque output (TM) as a function of the gas speed (w speed) and turbine speed (w turbo) of the gas turbine.
The asynchronous generator is the asynchronous generator simulation model in the MATLAB/Simulink/SimPowerSystems module library. Its parameters are listed in Table  2. The turbine uses a two-dimensional look-up table to calculate the turbine torque output (TM) as a function of the gas speed (w speed) and turbine speed (w turbo) of the gas turbine.
The asynchronous generator is the asynchronous generator simulation model in the MATLAB/Simulink/SimPowerSystems module library. Its parameters are listed in Table 2.  Figure 3 shows the simulation model of the discrete frequency regulator [24]. The frequency is controlled by the discrete frequency regulator module. The controller uses a standard three-phase phase locked loop (PLL) system to measure the system frequency. The measured frequency is compared with the reference frequency (60 Hz) to obtain the frequency error. The error is then integrated to obtain the phase error. Further, the proportional differential (PD) controller uses the phase error to generate an output signal representing the required secondary load power. The signal is converted into an 8 bit digital signal to control the switching of eight three-phase secondary loads. To minimize voltage interference, switching occurs when the voltage crosses zero.

Ship Electrical Power System Simulation Model
The ship electrical power system model consists of the diesel-driven main generator set module, gas-turbine-driven auxiliary generator set module, and power load. The main load is 300 kW [25]. The secondary load block consists of eight groups of three-phase resistors connected in series with the GTO thyristor switch. The nominal power of each unit follows a binary series; thus, the load can be varied from 0 to 510 kW in steps of 2 kW. The GTO is simulated by an ideal switch. In summary, the simulation model of the ship electrical power system can be obtained as shown in Figure 4. A, B and C are phase lines. The measured frequency is compared with the reference frequency (60 Hz) to obtain the frequency error. The error is then integrated to obtain the phase error. Further, the proportional differential (PD) controller uses the phase error to generate an output signal representing the required secondary load power. The signal is converted into an 8 bit digital signal to control the switching of eight three-phase secondary loads. To minimize voltage interference, switching occurs when the voltage crosses zero.

Ship Electrical Power System Simulation Model
The ship electrical power system model consists of the diesel-driven main generator set module, gas-turbine-driven auxiliary generator set module, and power load. The main load is 300 kW [25]. The secondary load block consists of eight groups of three-phase resistors connected in series with the GTO thyristor switch. The nominal power of each unit follows a binary series; thus, the load can be varied from 0 to 510 kW in steps of 2 kW. The GTO is simulated by an ideal switch. In summary, the simulation model of the ship electrical power system can be obtained as shown in Figure 4. A, B and C are phase lines.

Typical Fault Simulation of Ship Electrical Power System
Ship electrical power systems are different from land power systems. In particular, ship electrical power systems are strongly independent. A component fault in the ship power grid may affect the entire power grid. Short-circuit faults and open-phase faults are typical faults that pose serious threats. Such faults affect not only individual equipment but also the power grid of the entire ship. In severe cases, they may lead to paralysis of the ship power grid. As shown in Table 3, short-circuit faults include single-phase shortcircuit grounding, two-phase short circuit, two-phase short-circuit grounding, and threephase short circuit, while open-phase faults include single-phase disconnection and twophase disconnection. It is necessary to simulate and diagnose the state of short-circuit and open-phase faults as typical faults in ship electrical power systems.

Faults Type Schematic Diagram
Single-phase short-circuit grounding Two-phase short circuit

Typical Fault Simulation of Ship Electrical Power System
Ship electrical power systems are different from land power systems. In particular, ship electrical power systems are strongly independent. A component fault in the ship power grid may affect the entire power grid. Short-circuit faults and open-phase faults are typical faults that pose serious threats. Such faults affect not only individual equipment but also the power grid of the entire ship. In severe cases, they may lead to paralysis of the ship power grid. As shown in Table 3 short-circuit faults include single-phase short-circuit grounding, two-phase short circuit, two-phase short-circuit grounding, and three-phase short circuit, while open-phase faults include single-phase disconnection and two-phase disconnection. It is necessary to simulate and diagnose the state of short-circuit and open-phase faults as typical faults in ship electrical power systems.
There are many reasons for short-circuit faults [26], such as line aging, component damage, corrosion and ring breaking in the working environment of the ship, and component insulation. Short-circuit faults pose serious threats, as they may burn important equipment, interfere with nearby communication, endanger life, and even lead to power grid collapse and loss of power supply for the entire ship. For ship electrical power systems, any type of short-circuit fault can not only threaten the safety of the entire ship power grid but also produce various problems such as electromagnetic interference. Open-phase faults, similar to short-circuit failure, will also has devastating effects.
Based on the simulation model of the ship electrical power system, the "three-phase fault" fault module of Simulink is added at the synchronous generator, asynchronous generator, main load, and secondary load ends to set the time of fault occurrence and simulate typical single-phase short-circuit grounding faults, two-phase short-circuit faults, two-phase short-circuit grounding faults, and three-phase short-circuit faults [27]. A "threephase breaker" is used to set the occurrence time of open-phase faults and simulate typical single-phase disconnection and two-phase disconnection. Table 3. Schematic diagram of faults.

Faults Type Schematic Diagram
Single-phase short-circuit grounding Ship electrical power systems are different from land power systems. In particular, ship electrical power systems are strongly independent. A component fault in the ship power grid may affect the entire power grid. Short-circuit faults and open-phase faults are typical faults that pose serious threats. Such faults affect not only individual equipment but also the power grid of the entire ship. In severe cases, they may lead to paralysis of the ship power grid. As shown in Table 3, short-circuit faults include single-phase shortcircuit grounding, two-phase short circuit, two-phase short-circuit grounding, and threephase short circuit, while open-phase faults include single-phase disconnection and twophase disconnection. It is necessary to simulate and diagnose the state of short-circuit and open-phase faults as typical faults in ship electrical power systems.

Faults Type Schematic Diagram
Single-phase short-circuit grounding Two-phase short circuit Two-phase short-circuit grounding Two-phase short circuit Ship electrical power systems are different from land power systems. In particular, ship electrical power systems are strongly independent. A component fault in the ship power grid may affect the entire power grid. Short-circuit faults and open-phase faults are typical faults that pose serious threats. Such faults affect not only individual equipment but also the power grid of the entire ship. In severe cases, they may lead to paralysis of the ship power grid. As shown in Table 3, short-circuit faults include single-phase shortcircuit grounding, two-phase short circuit, two-phase short-circuit grounding, and threephase short circuit, while open-phase faults include single-phase disconnection and twophase disconnection. It is necessary to simulate and diagnose the state of short-circuit and open-phase faults as typical faults in ship electrical power systems.

Faults Type Schematic Diagram
Single-phase short-circuit grounding Two-phase short circuit Two-phase short-circuit grounding Two-phase short-circuit grounding power grid may affect the entire power grid. Short-circuit faults and open-phase faults are typical faults that pose serious threats. Such faults affect not only individual equipment but also the power grid of the entire ship. In severe cases, they may lead to paralysis of the ship power grid. As shown in Table 3, short-circuit faults include single-phase shortcircuit grounding, two-phase short circuit, two-phase short-circuit grounding, and threephase short circuit, while open-phase faults include single-phase disconnection and twophase disconnection. It is necessary to simulate and diagnose the state of short-circuit and open-phase faults as typical faults in ship electrical power systems.

Faults Type Schematic Diagram
Single-phase short-circuit grounding Two-phase short circuit Two-phase short-circuit grounding Three-phase short circuit Single-phase disconnection Two-phase disconnection There are many reasons for short-circuit faults [26], such as line aging, component damage, corrosion and ring breaking in the working environment of the ship, and component insulation. Short-circuit faults pose serious threats, as they may burn important equipment, interfere with nearby communication, endanger life, and even lead to power grid collapse and loss of power supply for the entire ship. For ship electrical power systems, any type of short-circuit fault can not only threaten the safety of the entire ship power grid but also produce various problems such as electromagnetic interference. Open-phase faults, similar to short-circuit failure, will also has devastating effects.
Based on the simulation model of the ship electrical power system, the "three-phase fault" fault module of Simulink is added at the synchronous generator, asynchronous generator, main load, and secondary load ends to set the time of fault occurrence and simulate typical single-phase short-circuit grounding faults, two-phase short-circuit faults, twophase short-circuit grounding faults, and three-phase short-circuit faults [27]. A ″threephase breaker″ is used to set the occurrence time of open-phase faults and simulate typical single-phase disconnection and two-phase disconnection.
This section describes single-phase short-circuit grounding faults at the synchronous generator end. During normal operation, the three phases are symmetrical; hence, regardless of which phase of ABC is grounded, the changes in the short-circuit faults are basically the same. The single-phase short-circuit grounding fault simulation is performed by taking phase a as an example. The fault module is set to phase a grounding in 10 s, the fault module is cut off in 10.5 s, and the total simulation time is 25 s. Before 10 s, the entire power system was in stable operation. At 10 s, the fault module caused phase a shortcircuit grounding fault, and the fault was removed after 0.5 s. The simulation results are shown as response curves in Figure 5. When different faults occur in different equipment Three-phase short circuit

Single-phase disconnection
Single-phase disconnection

Two-phase disconnection
There are many reasons for short-circuit faults [26], such as line aging, component damage, corrosion and ring breaking in the working environment of the ship, and component insulation. Short-circuit faults pose serious threats, as they may burn important equipment, interfere with nearby communication, endanger life, and even lead to power grid collapse and loss of power supply for the entire ship. For ship electrical power systems, any type of short-circuit fault can not only threaten the safety of the entire ship power grid but also produce various problems such as electromagnetic interference. Open-phase faults, similar to short-circuit failure, will also has devastating effects.
Based on the simulation model of the ship electrical power system, the "three-phase fault" fault module of Simulink is added at the synchronous generator, asynchronous generator, main load, and secondary load ends to set the time of fault occurrence and simulate typical single-phase short-circuit grounding faults, two-phase short-circuit faults, twophase short-circuit grounding faults, and three-phase short-circuit faults [27]. A ″threephase breaker″ is used to set the occurrence time of open-phase faults and simulate typical single-phase disconnection and two-phase disconnection.
This section describes single-phase short-circuit grounding faults at the synchronous generator end. During normal operation, the three phases are symmetrical; hence, regardless of which phase of ABC is grounded, the changes in the short-circuit faults are basically the same. The single-phase short-circuit grounding fault simulation is performed by taking phase a as an example. The fault module is set to phase a grounding in 10 s, the fault module is cut off in 10.5 s, and the total simulation time is 25 s. Before 10 s, the entire power system was in stable operation. At 10 s, the fault module caused phase a shortcircuit grounding fault, and the fault was removed after 0.5 s. The simulation results are shown as response curves in Figure 5. When different faults occur in different equipment of the power system of the ship, the amplitudes of the four output response curves in the Two-phase disconnection Three-phase short circuit Single-phase disconnection

Two-phase disconnection
There are many reasons for short-circuit faults [26], such as line aging, component damage, corrosion and ring breaking in the working environment of the ship, and component insulation. Short-circuit faults pose serious threats, as they may burn important equipment, interfere with nearby communication, endanger life, and even lead to power grid collapse and loss of power supply for the entire ship. For ship electrical power systems, any type of short-circuit fault can not only threaten the safety of the entire ship power grid but also produce various problems such as electromagnetic interference. Open-phase faults, similar to short-circuit failure, will also has devastating effects.
Based on the simulation model of the ship electrical power system, the "three-phase fault" fault module of Simulink is added at the synchronous generator, asynchronous generator, main load, and secondary load ends to set the time of fault occurrence and simulate typical single-phase short-circuit grounding faults, two-phase short-circuit faults, twophase short-circuit grounding faults, and three-phase short-circuit faults [27]. A ″threephase breaker″ is used to set the occurrence time of open-phase faults and simulate typical single-phase disconnection and two-phase disconnection.
This section describes single-phase short-circuit grounding faults at the synchronous generator end. During normal operation, the three phases are symmetrical; hence, regardless of which phase of ABC is grounded, the changes in the short-circuit faults are basically the same. The single-phase short-circuit grounding fault simulation is performed by taking phase a as an example. The fault module is set to phase a grounding in 10 s, the fault module is cut off in 10.5 s, and the total simulation time is 25 s. Before 10 s, the entire power system was in stable operation. At 10 s, the fault module caused phase a shortcircuit grounding fault, and the fault was removed after 0.5 s. The simulation results are shown as response curves in Figure 5. When different faults occur in different equipment of the power system of the ship, the amplitudes of the four output response curves in the fault time period are different from the normal waveform, and the differences are signifi-This section describes single-phase short-circuit grounding faults at the synchronous generator end. During normal operation, the three phases are symmetrical; hence, regardless of which phase of ABC is grounded, the changes in the short-circuit faults are basically the same. The single-phase short-circuit grounding fault simulation is performed by taking phase a as an example. The fault module is set to phase a grounding in 10 s, the fault module is cut off in 10.5 s, and the total simulation time is 25 s. Before 10 s, the entire power system was in stable operation. At 10 s, the fault module caused phase a short-circuit grounding fault, and the fault was removed after 0.5 s. The simulation results are shown as response curves in Figure 5. When different faults occur in different equipment of the power system of the ship, the amplitudes of the four output response curves in the fault time period are different from the normal waveform, and the differences are significant. Therefore, this is used as the basis for fault diagnosis.
The abscissa represents time, and its unit is second (s). Vf (pu) is the unit value of the excitation voltage, Frequency (Hz) is the system frequency, rotor speed wm (pu) is the unit value of the synchronous generator speed, and ASM speed (pu) is the unit value of the asynchronous generator speed.
It can be seen that in the initial stage of the ship electrical power system, the system tends to be in stable operation after starting, and the speed, excitation voltage and frequency of the two generators have not changed, and the entire power system has not fluctuated significantly. At 10 s, the fault module "Three-Phase Fault" causes the single-phase shortcircuit grounding fault of Phase A, and the short-circuit current in phase A, generator speed, excitation voltage and frequency fluctuate greatly. The single-phase short-circuit grounding fault affects the stability of the power system and makes the ship unable to run normally. At 10.5 s, the fault module "Three-Phase Fault" is removed, and the single-phase short-circuit grounding fault disappears. After adjustment by the excitation control system, the ship electrical power system returns to normal; the speed, excitation voltage, and frequency of the two generators return to stability. Similarly, the simulation results of two-phase short-circuit, two-phase short-circuit grounding, three-phase short circuit, single-phase disconnection, and two-phase disconnection at the synchronous generator end are shown in Figure 6. The faults at the asynchronous generator, main load, and secondary load ends will not be repeated. The abscissa represents time, and its unit is second (s). Vf (pu) is the unit value of the excitation voltage, Frequency (Hz) is the system frequency, rotor speed wm (pu) is the unit value of the synchronous generator speed, and ASM speed (pu) is the unit value of the asynchronous generator speed.
It can be seen that in the initial stage of the ship electrical power system, the system tends to be in stable operation after starting, and the speed, excitation voltage and frequency of the two generators have not changed, and the entire power system has not fluctuated significantly. At 10 s, the fault module ″Three-Phase Fault″ causes the single-phase short-circuit grounding fault of Phase A, and the short-circuit current in phase A, generator speed, excitation voltage and frequency fluctuate greatly. The single-phase short-circuit grounding fault affects the stability of the power system and makes the ship unable to run normally. At 10.5 s, the fault module ″Three-Phase Fault″ is removed, and the single-phase short-circuit grounding fault disappears. After adjustment by the excitation control system, the ship electrical power system returns to normal; the speed, excitation voltage, and frequency of the two generators return to stability. Similarly, the simulation results of two-phase short-circuit, two-phase short-circuit grounding, three-phase short circuit, single-phase disconnection, and two-phase disconnection at the synchronous generator end are shown in Figure 6. The faults at the asynchronous generator, main load, and secondary load ends will not be repeated.

CNN
CNN has emerged as a research hotspot in many scientific fields, espec classification [28]. CNN is composed of a series of layers, as well as data flo the layers. The basic structure is as follows: input layer, convolution layer, acti

CNN
CNN has emerged as a research hotspot in many scientific fields, especially pattern classification [28]. CNN is composed of a series of layers, as well as data flows between the layers. The basic structure is as follows: input layer, convolution layer, activation function, pooling layer, and fully connected layer, i.e., INPUT-CONV-RELU -POOL-FC.
The convolution layer is a feature extraction layer. The input of each neuron is connected to the local receptive field of the previous layer and extracts local features. The convolution layer mainly convolutes the image according to the convolution kernel and reduces noise [29]. It also involves the principle of "weight sharing". The calculation formula of the convolution layer is as follows: where l denotes the number of layers, M j represents the feature graph set of the previous layer associated with the jthe feature graph of the current layer, x l j is the jth characteristic diagram output by the lth layer, x l−1 i is the ith characteristic diagram of the output of the l − 1th layer, k l ij is the convolution kernel between the jth characteristic graph of the lth layer and the ith characteristic graph of the previous layer, and b l j is the offset of the jth characteristic graph of the lth layer.
The activation function is used to add nonlinear factors, because the convolution method is used to deal with linear operations, i.e., assign weights to each pixel. The expression of the linear model is not sufficient; hence, an activation function is required. Common activation functions include the sigmoid function, tanh function, ReLU function, and leaky ReLU function.
The pooling layer is a feature mapping layer. After adding bias, a new feature map is obtained in the pooling layer through a nonlinear function [30]. The functions of pooling are as follows: (i) reducing the size of the characteristic diagram and simplifying the computational complexity of the network; (ii) feature compression to extract the main features. The operation formula of the pooling layer is as follows: where subdown(·) represents the pooled down-sampling function, β l j is the ratio column offset, and b l j is the additive bias. The fully connected layer is used to connect all the features and send the output value to a classifier (such as a softmax classifier) for classification.
Finally, the test accuracy and error loss function value of the model are output. The structure and parameters of CNN are shown in Figure 7.

Improved CNN
The traditional model has a complex structure, massive parameters, and low running speed. Moreover, the convergence speed of the classification results is affected by the method of initializing the parameters and the updating of the network weights, and there are oscillation problems in the accuracy and loss rate curves. In summary, this study makes the following improvements and proposes a CNN model with better performance, which can avoid the above-mentioned issues.
(1) All local response normalization (LRN) layers are removed and the initial value program is changed. It is proven by practice that the normalization operation of batch normalization (BN) is used after simple parameter initialization. The use of BN is conducive to the convergence of the samples and the stability of the network.
(2) The number of nodes in the fully connected layer is adjusted; based on the reduction and updating of parameters and weights, the running speed is improved and the calculation time is shortened. (3) Nesterov-accelerated adaptive moment estimation (NAdam) is used to update the weights of the neural networks iteratively on the basis of the training data, and the weights can be updated iteratively according to the output results. (4) Kaiming initialization is used to initialize the normal_initializer. After testing, the results will be improved.

Improved CNN
The traditional model has a complex structure, massive parameters, and low r speed. Moreover, the convergence speed of the classification results is affected method of initializing the parameters and the updating of the network weights, an are oscillation problems in the accuracy and loss rate curves. In summary, this makes the following improvements and proposes a CNN model with better perfor which can avoid the above-mentioned issues.

Flow of CNN Algorithm
The algorithm flow of the proposed CNN fault diagnosis model is shown in Figure 8. It is mainly divided into four stages: (1) Sample image preprocessing: First, the sample dataset is constructed. Second, the size and color of the image are processed to facilitate network learning.

Data Preprocessing
This study employs MATLAB/Simulink to build the ship electrical power system and takes the waveform of fault response curve as the input of the network fault model. Data preprocessing is divided into the following parts: data acquisition, image culling and data normalization.
(1) Data acquisition: In the simulation model, different faults in the "three-phase fault" fault module are set for different generators and loads to output the fault response curve. The file type is the JPG-format picture set recognized by CNN. (2) Image culling: After converting the data into JPG-format pictures, some problems such as image overlap or feature blur will occur. These interfering images must be selected and eliminated to ensure the accuracy of the network training and test results. (3) Data normalization: Owing to the difference between the orders of magnitude of the images, this difference will affect the results of the data analysis. To eliminate the influence between dimensions, data normalization is required. The min-max standardization method used in this study is the commonly used linear transformation of data. The result value is mapped to the interval of (0,1). The transformation function is as follows: where max and min are the maximum and minimum values of the sample data. After preprocessing of the above-mentioned data, the image set with significant characteristics is used as the input of the CNN. The CNN model performs convolution, pooling, and other operations on the picture set to generate the output of the network model.

Experimental Results and Analysis
This study employed a Windows 10 system (Microsoft, Redmond, DC, USA) with the Python 3.7.11 (Python Software Foundation, Wilmington, DE, USA) compiling environment and TensorFlow learning framework to write the network programs. Because the image dataset used in this study was simple and regular, and the amount of data was small, the conventional method was used to adjust the parameters in order to optimize the CNN model.

Learning Rate
In the training network model, the learning rate is an important super-parameter that controls the speed of network weight adjustment. In general, the higher the learning rate, the faster is the learning of the network. However, if it is too high and reaches extreme values, the accuracy will be reduced; the loss value will stop falling and oscillate repeatedly at a certain position. The lower the learning rate, the slower the decrease in the loss gradient and the longer the convergence time. Therefore, it is crucial to choose an appropriate learning rate. By referring to numerous experiments as well as the literature, the learning rate of the network model was set to 0.0001.

Experimental Results
After several experiments, the optimal network fault diagnosis model is finally obtained. Compared with the original CNN model proposed, the average accuracy of the identification and classification of the ship electrical power system is up to 99%. This method makes the fault diagnosis of the ship electrical power system more convenient and reliable. The accuracy and loss variation diagrams were generated using PyCharm and TensorFlow frameworks, as shown in Figure 9a,b, respectively. The accuracy and loss variation diagrams of the original CNN are shown in Figure 9c,d, respectively. The accuracy of each fault category is listed in Table 6.
As can be seen from Figure 9a,b, the overall identification accuracy of the improved model for ship electrical power systems faults increases, and the loss rate decreases as the number of training epochs increases. After the improved model is trained once, the average accuracy of fault diagnosis reaches 97%, and the loss value is less than 0.1. After 4 times of model training, the average accuracy of fault diagnosis is 99%, and the loss value is less than 0.05. A comparison of Figure 9a-d shows that the recognition accuracy of the improved CNN after the first training epoch is higher than that of the original network after four training epochs. At the same time, the convergence speed of the loss value curve of the improved model is higher than that of the original model; the fluctuation range is smaller and is more stable after convergence. As can be seen from Table 6, the accuracy of the improved CNN for different faults at different locations is higher than that of the original network, indicating that the improved CNN provides good classification results for the fault identification of the ship electrical power systems; thus, it has considerable potential for the fault diagnosis of ship electrical power systems.

Conclusions
A fault diagnosis method for ship electrical power systems was proposed on the basis of an improved CNN to support the normal operation of ships. According to the results, the following conclusions can be drawn: (1) To achieve multi-class fault diagnosis of different components of ship electrical power systems, this paper proposed an improved CNN fault diagnosis model, which can completely eliminate the subjectivity of manual feature extraction and expert experience, directly take the original fault data as the model input, automatically extract the fault features layer by layer in a nonlinear manner, and automatically output the fault classification results. Thus, "end-to-end" diagnosis from the original data to the fault category can be realized. The algorithm has a high fault recognition rate, and the evaluation accuracy is 99%. (2) Through image culling, the accuracy of the network training results is improved significantly. (3) The method used to realize fault diagnosis of the ship electrical power systems can also be used for fault diagnosis of other parts of more complex power systems. The simulation results showed that the improved model outperforms the original network.
In particular, this method achieves high accuracy and reliability in ship electrical power systems fault diagnosis.
Nevertheless, there remains a scope for improvement in terms of the training time of the model. In the future, the simulation model will be improved such that it is more in line with actual ship electrical power systems. Based on the optimized CNN model, fault diagnosis accuracy can be improved further.