## 5 Discussion
### Performance Analysis of the Optimal Method for Identifying Highly Heterogeneous Formations  
The combination of UMAP + K-means and CatBoost achieves multi-dimensional optimization in lithology identification. UMAP dimensionality reduction provides high-fidelity input to the model by preserving the global structure and lithologic genetic characteristics of the sedimentary sequence. The 15 cluster labels generated by K-means clustering uncover \begin{table}
\begin{tabular}{c c c c c} \hline
**Lithology Label** & **Random Forest** & **SVM** & **LightGBM** & **CatBoost** \\ \hline Silt & 0.811 & 0.789 & 0.850 & 0.821 \\ Fine sandstone & 0.878 & 0.780 & 0.893 & 0.903 \\ Limestone & 0.692 & 0.562 & 0.775 & 0.792 \\ Clay shale & 0.732 & 0.649 & 0.791 & 0.833 \\ Fine sand & 0.823 & 0.793 & 0.837 & 0.846 \\ Coarse sand & 0.839 & 0.850 & 0.878 & 0.893 \\ \hline \end{tabular}
\end{table} 
Table 6: Comparison of different lithology F1-scores under four models. lithology sub-classes not captured by manual classification, such as the microfacies differences in clay shale and the gradual transition zones between sand and claystone. One-Hot encoding was employed to enhance the category information, enriching the lithology labels. Experiments demonstrate that this method significantly improves the model's ability to delineate complex stratigraphic boundaries and enhances the recognition accuracy of thin reservoirs. For instance, the misclassification rate between coarse-grained and fine-grained sands is reduced by 21%, and the misclassification from limestone to shale decreases by 32%. Furthermore, confusion matrix analysis reveals that CatBoost delivers a more balanced misclassification distribution across classes, validating its enhanced generalization performance through unbiased gradient estimation. This approach not only addresses the challenge of sparse lithology and geological labels in traditional supervised learning but also provides a solution that is both data-driven and geologically interpretable for real-time recognition of strongly heterogeneous formations in LWD applications. Compared with traditional petrophysical interpretation methods, which often rely on manual analysis and heuristic rules, the proposed approach offers significant advantages in terms of accuracy, efficiency, and adaptability to complex geological conditions. In this study, a collaborative optimization mechanism between LWD logging and drilling engineering parameters was developed. The drilling rate was dynamically adjusted through real-time identification of strongly heterogeneous formations, and the drilling time was reduced by modifying surface parameters (such as WOB, TQA, and HKLA) to maximize rock breakage efficiency and accurately target reservoirs. Generally, the ROP of conglomerate facies was the highest, followed by clay-rich facies and carbonate facies. The optimization process begins by predicting formation lithology using the CatBoost machine learning model, followed by the selection of the optimal drilling parameter combination based on the lithofacies characteristics. For instance, to increase the ROP of carbonate facies from 19.1 m/h to 34.3 m/h, the WOB, TQA, and HKLA should be adjusted to 16.5 kN, 22.6 kN.m, and 135.4 kN, respectively. The optimization system integrates predictive confidence thresholds from the CatBoost model to manage operational risks. High-confidence predictions (probability > 0.85) trigger automated parameter adjustments, while moderate confidence (0.6-0.85) activates real-time cross-validation with adjacent data points. Low-confidence scenarios (<0.6) require manual verification before parameter changes. This tiered uncertainty control prevents automated decisions in ambiguous lithological transitions or thin-bedded sequences. During critical reservoir entry phases, all automated adjustments mandate engineer authorization regardless of confidence level, ensuring operational safety against tool sticking or wellbore instability risks.