The compound classification strategies addressed in this study encounter challenges related to either low efficiency or accuracy. Precise classification of chemical compounds from SMILES symbols holds significant importance in domains such as drug discovery, materials science, and environmental toxicology. In this paper, we introduce a novel hybrid optimization framework named GA-CMA-ES which integrates Genetic Algorithms (GA) and the Covariance Matrix Adaptation Evolution Strategy (CMA-ES) to train Recurrent Neural Networks (RNNs) for compound classification. Leveraging the global exploration capabilities og GAs and local exploration abilities of the CMA-ES, the proposed method achieves notable performance, attaining an 83% classification accuracy on a benchmark dataset, surpassing the baseline method. Furthermore, the hybrid approach exhibits enhanced convergence speed, computational efficiency, and robustness across diverse datasets and levels of complexity.