## 2 Methods  
The flowchart depicting the drilling data preprocessing method proposed in this study is shown in Figure 1. It consists of four steps: collecting drilling data; matrixing the drilling data and converting it into lithofacies images; transforming the data into single column vectors; and using the high-dimensional column vectors as the input layer to train the DANN. An example of three-dimensional input data comprising time sequences of \(m\) core drilling data points, including torque, WOB, and rotational speed, is presented in Figure 2. Just as objects in images can be accurately recognized based on image parameters [25], types of lithofacies can be recognized based on core drilling parameters. For example, just as a color image contains red, green, and blue data channels, a sample of drilling data can be formulated according to torque, WOB, and rotational speed data channels. As shown in Figure 3, these three data channels can be transformed into three square matrices based on 70 \(\times\) 70 = 4900 data points, and then combined into a single three-channel data structure analogous to a lithofacies image. As is typical for image recognition applications, the present work flattens the lithofacies image data into a single column vector of length 14,700, as shown in Figure 4, which is then applied as the input of a DANN composed of N hidden layers. As a result, the original three-dimensional time sequence data have been transformed into 14,700 dimensions, which can effectively address the difficulty of extracting important features from the data due to insufficient parameter dimensions, and thereby greatly enhancing the fitting capacity of the machine learning model. Figure 1: Flowchart of the drilling data preprocessing method. Figure 2: Example of low-dimensional network input data comprising time sequences of \(m\) core drilling data points, including torque, weight on bit (WOB), and rotational speed. Forward propagation: The input matrix \(X\) of the neural network is defined as follows:  
\[X=\left[ \begin{array}{cccc}\vdots&\vdots&\cdots&\vdots\\ x_{1}&x_{2}&\ddots&x_{n}\\ \vdots&\vdots&\cdots&\vdots\end{array} \right] \tag{1}\]  
here, \(X\) is formed of \(n\) flattened 14,700-element feature vectors composed of torque, WOB, and rotational speed parameters. Specifically, the input dimension of the neural network applied in the present work is a (14,700, 32) matrix composed of 32 training set samples obtained by labeling drilling data samples according to the different types of lithodacies represented. This yields the following DANN layer structure and the predicted value \(Y[I]\) output by the \(l\)-th layer:  
\[Y^{[l]}=g^{[l]}\Big{(}Z^{[l]}\Big{)}\left\{ \begin{array}{ll}g^{[l]}=\text{ ReLU}(\ldots),&\text{if }(l\
eq L)\\ g^{[l]}=\text{Sigmoid}(\ldots),&\text{if }(l=L)\end{array} \right. \tag{2}\]  
Figure 3: Example of converting torque, WOB, and rotational speed data channels into three square matrices based on 70 \(\times\) 70 = 4900 data points, and then combining them into a single 70 \(\times\) 70 data structure analogous to a three-channel lithofacies image. Here, \(L\) is the total number of layers in the neural network, which must be optimized based on the final bias and variance values, as well as the required training time, \(Z^{[l]}\) is the output of the linear regression unit in the \(l\)-th layer, where \(Z^{[1]}=X\), and \(g^{[l]}\) is an activation function. As indicated in (2), the neurons in all hidden layers except the last layer are activated using the rectified linear unit (ReLU) function, which has a relatively high computation speed and effectively mitigates the vanishing gradient problem. Finally, the sigmoid function is applied to activate the neurons in the last layer, which is highly suitable for binary classification problems because it outputs values in the range of (0,1). In addition, the neurons in the input layer are fully connected to the neurons in the hidden layer.