As the financial technology develops fast, the application of artificial intelligence in stock prediction has attracted widespread attention. However, financial market data are characterized by high dimensionality, strong nonlinearity, and considerable noise, which limit the accuracy and stability of traditional models. To address these challenges, this study proposes a stock prediction method based on an improved Flower Pollination Algorithm (FPA) and the Categorical Boosting (CatBoost) classification model. The improved FPA enhances the identification of key factors during the feature selection stage, while CatBoost effectively handles mixed-type features in the modeling stage, thereby improving both generalization and predictive accuracy. Empirical analyses were conducted using the University of California, Irvine (UCI) bank dataset and core constituent stocks of the CSI 300 Index, with comparisons made against Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), Extreme Gradient Boosting (XGBoost), and Light Gradient Boosting Machine (LightGBM) models. The results demonstrate that the proposed model significantly outperforms the benchmark models in terms of accuracy, recall, F1 score, and area under the curve (AUC), while maintaining strong stability and risk resistance under extreme market conditions. This study provides new insights and methodological support for developing efficient and robust stock prediction systems.