Crashes involving heavy trucks on rural mountainous freeways are known to result in severe injuries and fatalities, particularly under challenging driving conditions. This study aims to develop a robust model to accurately predict fatal and injury crashes involving heavy trucks on rural mountainous freeways. The crash database of Interstate-80 in Wyoming was used to extract a wide range of variables related to environmental, roadway, crash, occupant, and vehicle characteristics. This study employed a state-of-the-art deep neural network architecture named ResNet-50 using transfer learning to develop crash severity prediction models. The numeric crash data were converted to images utilizing DeepInsight to facilitate the application of the proposed deep learning model. Due to the imbalanced nature of the crash severity data, this study employed random undersampling (RUS) and synthetic minority oversampling technique (SMOTE) data balancing techniques and investigated several data sampling ratios. A ratio of 1 : 2 : 2 (Fatal: Injury: PDO) combined with both RUS and SMOTE produced the best performance with recall values of 99.7%, 79.7%, and 79.3% for fatal, injury, and PDO crashes, respectively. This study also employed Boruta and extreme gradient boosting (XGBoost) to examine the significance of variables on crash severity. The findings revealed that the deployment of airbags, use of seatbelts, driver distraction, and driver conditions such as inattentiveness and fatigue, vehicle type, vertical grades, weather, and road surface conditions were the most critical variables contributing to the severity of crashes involving heavy trucks. Furthermore, this study developed several reduced truck-involved crash severity prediction models without significantly compromising the prediction performance. The proposed deep neural network model can provide accurate and timely prediction of fatal and injury crashes involving heavy trucks, which is beneficial for ensuring efficient collision management, avoiding secondary pile-up crashes, and facilitating prompt medical assistance. The proposed method offers a potential solution to predict crash severity, particularly for fatal and injury crashes, in challenging mountainous regions. This is crucial for effective collision management, prevention of secondary crashes, and timely medical assistance. Key contributing factors to crash severity, such as steep grades, sharp turns, driver distraction, fatigue, weather conditions, and road surface conditions, were identified. This information can guide safety practitioners, emergency services, traffic management centers, and manufacturers in improving their countermeasures and safety applications to provide accurate warnings to road users. For example, connected and automated vehicles can use this information to warn drivers about difficult roads with lots of trucks or upcoming bad weather on mountainous roads. Smart cameras inside the car can also be used to detect if the driver is distracted, not paying attention, or tired and can give them physical or sound alerts to help prevent serious accidents. The proposed method can be applied in various safety-related scenarios using numerical or vision-based data to gain a deeper understanding of driver behavior and its association with safety events, ultimately improving road safety for everyone.