With the diminishing availability of oil and gas resources, the Rotary Steerable System has become increasingly important. However, the vibrations and shocks during the drilling process pose challenges to the Measurement While Drilling. In recent years, the application of machine learning in the field of petroleum exploration has gradually expanded, especially in the estimation of geological parameters and lithology discrimination. However, there is still limited research on drilling tool attitude measurement. To address the above-mentioned issues, this study proposes a method that combines drilling tool attitude sensor data with artificial neural networks to improve the accuracy of dynamic inclination measurement. This method utilizes machine learning techniques, combining real-time z-axis acceleration signals and magnetic induction signals, and employs a deep learning model to invert the x and y-axis acceleration signals, thereby achieving high-precision measurement of dynamic inclination angles. Experimental results show that Long Short-Term Memory model, under simulated measurement conditions with different rotational speeds, yields dynamic inclination curve errors ranging from 0.4° to 0.7°, significantly reducing the errors compared to the original measurements. This method not only improves the accuracy of inclination angle measurement but also demonstrates strong adaptability to different rotational speeds, providing more accurate data support for drilling operations.