In order to fully explore the fault information embedded in electromechanical faults and realize the accurate judgment of electromechanical faults, this paper improves the FOA algorithm with an electromechanical fault prediction model based on IFOA-SVM. The population division process is added, the better subpopulation and the worse subpopulation are updated according to different steps, the balance of the algorithm’s search ability in different periods is realized, and the optimal parameters of the support vector machine are obtained by using the improved fruit fly algorithm. It not only realizes the diagnosis of electromechanical faults with higher accuracy, but also solves the defects that the fruit fly algorithm is easy to fall into the local optimum and has low convergence accuracy in the later stage. In the experimental validation, the gun control box component in the fire control system of a certain tank is selected as the research object, and the IFOA algorithm is compared with BP neural network, GA-SVM, GWO-SVM and other algorithms, and the average prediction accuracy of the three experiments reaches 100.00%, and optimal fitness is obtained when the number of iterations reaches 10 times. The research in this paper provides a new effective method for electromechanical fault prediction, which has important theoretical and practical application value.