The prediction of UAV sensor faults is of great significance for improving system reliability and safety. However, current prediction methods suffer from insufficient accuracy and high computational complexity. To address this issue, this study proposed a random forest fault prediction algorithm based on improved pigeon-inspired optimization (PIO). The wavelet packet transform (WPT) was employed to extract fault features, and the Levy flight mechanism was introduced to form a mutation mechanism to enhance population diversity, thereby alleviating the problem of PIO easily falling into local optima and enhancing both the convergence speed and global optimization ability of the algorithm. The improved PIO was then applied to the random forest algorithm to achieve autonomous hyperparameter optimization, enabling early prediction of sensor faults. Simulation results show that the random forest algorithm optimized by the improved PIO converged faster and achieved an accuracy improvement of more than 20% compared with traditional algorithms, indicating the effectiveness and superiority of the proposed method in UAV sensor fault prediction.