Determining residual stresses is essential for ensuring the safety and longevity of gear components. Traditional methods, such as analytical, numerical, and experimental approaches, are often costly, time-consuming, and sometimes destructive. This study proposes a new method to predict residual stresses in gear units using artificial intelligence based on data from finite element analysis. To achieve this, a commercial finite element tool models the heat treatment and carburization processes, grounded in thermomechanical metallurgical physics. The residual stresses obtained from finite element analysis are then compared to the ones from experiment using deep hole drilling approach. This is followed by a sensitivity analysis. Next, a specific class of gearbox component geometries and the computed stress fields are utilized to train artificial neural networks. The performance of the artificial neural networks approach is compared to that of two different machine learning regression methods. It has been concluded that this technique successfully anticipates residual stresses in components with scaled geometries and similar heat treatment steps, outperforming the two regression models in accuracy and efficiency. Importantly, it achieves this with incomparable, significantly less computation time compared to standard finite element analysis.