## 2 Methods
Loss function: The present work applies the cross-entropy loss function, which measures the difference between the probability distribution of the predicted values \(Y[l]\) and the probability distribution of the true values \(T\), and is commonly used in classification problems as a method to minimize information entropy. This is defined as follows:  
\[J\Big{(}Y^{[l]},T\Big{)}=-\Big{[}T\cdot\log\Big{(}Y^{[l]}\Big{)}+(1-T)\cdot\log \Big{(}1-Y^{[l]}\Big{)}\Big{]} \tag{3}\]  
Here, the true values \(T\in\) {0,1} represent a binary classification task, where the value of the target lithofacies type is 1 and the value of the non-target lithofacies type is 0. Figure 4: Example of the process by which a three-channel lithofacies image is flattened into a single column vector of length 14,700, which is then applied as the input of a DANN composed of \(N\) hidden layers of varying number of nodes, and a single-node output layer. Parameter update: The training process iteratively yields the network parameters \(W^{[l]}\) and \(B^{[l]}\) of the \(l\)-th layer according to the following parameter update processes based on the gradients of \(W^{[l]}\) and \(B^{[l]}\), and the learning rate \(\alpha\):  
\[W^{[l]}=W^{[l]}-\alpha\frac{\partial J\left(Y^{[l]},T\right)}{\partial W^{[l]}} \tag{4}\]  
\[B^{[l]}=B^{[l]}-\alpha\frac{\partial J\left(Y^{[l]},T\right)}{\partial B^{[l]}} \tag{5}\]  
Here, \(\alpha\) is a hyperparameter that can be adjusted to improve the machine learning step size, where the network parameters may converge to a local minimum if \(\alpha\) is too small, while the gradients may oscillate around the optimum point if \(\alpha\) is too large. The ideal value of \(\alpha\) ensures that the gradients of \(W^{[l]}\) and \(B^{[l]}\) decrease steadily. The process of updating parameters \(W^{[l]}\) and \(B^{[l]}\) represents a continuous learning of the features of the drilling data, and eventually establishes a fully trained model capable of accurately predicting the lithofacies type of an unknown data sample. Sample prediction: As a binary classification problem, the predicted geological label \(P_{n}\) of sample \(n\) is defined as follows:  
\[P_{n}= \begin{cases}1,&\text{if }Y_{n}^{[L]}\geq 0.5\\ 0,&\text{if }Y_{n}^{[L]}<0.5\end{cases}  \tag{6}\]  
Here, the final predicted value is marked as 1 (i.e., as the target lithofacies type) for any value greater than or equal to 0.5, and the final predicted value is marked as 0 (i.e., as the non-target lithofacies type) for any value less than 0.5. The prediction accuracy of the trained model is then defined according to the true lithofacies type label \(T_{n}\)\(\in\) [0,1] of the training sample data as follows:  
\[\text{Accuracyrate}=\left(1-\frac{1}{n}\sum_{i=1}^{n}\left|T_{n}-P_{n}\right| \right)\times 100\% \tag{7}\]  
Here, an accuracy rate of 100% represents a perfectly accurate prediction and 0 indicates an entirely incorrect prediction. The core drilling data employed in the present work were obtained for drilling operations conducted in granite and concrete materials. Granite is a natural rock composed of various minerals such as quartz, feldspar, and mica. It has a high strength and rigidity, with a compressive strength typically between 100-300 MPa and an elastic modulus usually between 50-100 GPa. In contrast, concrete is usually a mixture of cement with other materials such as aggregates and sand. Its strength and elastic modulus are generally less than those of granite, with a compressive strength usually between 20-60 MPa and an elastic modulus usually between 20-40 GPa. The significant differences in the mechanical properties of these materials will ensure that the corresponding drilling data are more easily distinguished by the DANN, which is helpful in a proof-of-concept study like the one presented herein. The dataset was sourced from data collected on a small-scale indoor core drilling machine equipped with a full range of sensors [26].