In this research, we propose a method that utilizes machine learning to maintain the parallelism of the resonant cavity in a Fabry–Perot interferometer designed specifically for glass substrates. Based on the optical principle and theory, we establish a proportional relationship between interference fringes and the inclination angle of the mirrors. This enables an accurate determination of the inclination angle using supervised learning, specifically classification. By training a machine learning model with labeled data, interference fringe patterns are categorized into three levels, with approximately 100 training data available for each level in each location. The experimental results of Level 2 and Level 3 classification indicate an average number of corrections of 2.55 and 3.55 times, respectively, in achieving the target position with a correction error of less than 30 arc seconds. These findings demonstrate the essential nature of this parallelism maintenance technology for the semiconductor industry and precision mechanical engineering.