Brain cancer is among the most fatal diseases globally, requiring early detection and timely intervention to reduce mortality rates. Traditional diagnosis relies on oncol- ogists manually examining MRI images for signs of cancer, a process that, while effective, is time-consuming and labor- intensive. Recently, artificial intelligence (AI)-driven computer vision has emerged as a practical solution for image analysis and diagnosis. However, previous AI methods often demanded high computational resources and large datasets to achieve sufficient accuracy. This paper introduces a cascaded network combining deep learning and traditional machine learning techniques, opti- mized using a bio-inspired heuristic algorithm, for brain cancer detection from MRI images. The proposed approach achieves a high accuracy of 99.16% using limited data and low-computation devices. The cascaded network leverages five popular CNN models for feature extraction, Bacterial Foraging Optimization (BFO) for optimal feature selection, and seven machine-learning models for cancer detection. Among these, the MobileNetV2- BFO-KNN combination proved to be the most effective. The proposed method ensures efficiency, accuracy, scalability, and robustness, offering a reliable solution for brain cancer screening.