# Detecting Arcing Faults in Switchgear by Using Deep Learning Techniques
## 2 Materials and Methods
### Proposed Methods
#### 2.1.5 1D-CNN-LSTM  
In the hybrid architecture, the LSTM model learned to remember long-term temporal dependencies by analyzing the output from the 1D-CNN model. When these two models were put together, the network was able to pick up both local and global features of the input data. This made it easier to find both arcing and non-arcing faults. The input data was first processed by the 1D-CNN layers to extract relevant features, and the output was then fed into the LSTM layers to capture the temporal dependencies. Finally, the FC and output layers were used to classify the faults. This approach showed promising results in fault classification and can be extended to other sequential modeling tasks. Figure 4 shows a sample of a hybrid 1D-CNN-LSTM model. In the proposed 1D-CNN-LSTM architecture, the collected samples in the time domain were in the form of a dimensional matrix containing multiple input sequences. The LSTM neural network was then employed to classify the arcing and non-arcing conditions after training. The Adam optimizer was used for weight optimization during the optimization process. The model's parameters, such as the number of convolutional layers, kernel size, MaxPooling, and FC layer were fine-tuned for maximum accuracy and minimum loss. The final architecture of the 1D-CNN-LSTM model consisted of two global MaxPooling layers and two 1D convolutional layers, each with 64 and 128 filters. In the 1D-CNN part, which required less processing time, the RELU activation function was used with dropouts of 0.2  
Figure 4: An instance of a 1D CNN-LSTM model. Figure 3: The fundamental design of LSTM. after every layer starting from the global MaxPooling layers. The pool size of MaxPooling and the kernel size were set to 3. The following two LSTM layers were employed with dropouts of 0.2 between each of their 1 st LSTM and 2 nd LSTM unit. The subsequent FC layer had a learning rate of 0.0001 and contained a SoftMax activation function. The 1D-CNN architecture in the time domain scenario consists of two convolutional layers with 16 and 32 filters, respectively, and a dropout rate of 0.4 after each layer. Two MaxPooling layers were also included, with a pool size of 2 and a kernel size of 3. The fully connected layer had 32 neurons and a SoftMax activation function, and the learning rate was set to 0.0001. In comparison, the LSTM model was designed with two connected LSTM units, each with 64 and 32 units, respectively, and a dropout rate of 0.5 after each unit. The fully connected layer had 32 neurons and a SoftMax activation function, and the learning rate was also set to 0.0001. The training time for the LSTM model was longer than the 1D-CNN model due to its architecture. Figure 5 provides a visual representation of the 1D-CNN, LSTM, and 1D-CNN-LSTM hybrid model in the Time domain. Table 2 provides more detailed information about the design of deep learning algorithms for the time domain scenario. It is worth noting that the proposed method for the frequency domain followed a similar approach as that for the time domain. The collected samples included various input sequences as one-dimensional frequency domain data. The 1D-CNN model was applied in the first stage to extract features from the input samples. The features were then fed into the LSTM model for training and classification of arcing and non-arcing conditions. The Adam optimizer was also used for weight optimization in this case. The 1D-CNN-LSTM architecture for the frequency domain included two 1D convolutional layers with 64 and 128 filters, followed by two MaxPooling layers with a pool size of 2 and a kernel size of 3. RELU activation function was used for the CNN layers with a dropout of 0.2 after each MaxPooling layer. The LSTM layers included two connected units with 128 and 32 units, respectively, and a dropout of 0.2 between them. Finally, a fully connected layer with 32 neurons and a SoftMax activation function was added. The learning rate for the FC layer was set to 0.0001.