Protection of networks from changing cyberthreats depends critically on intrusion detection. This article presents a hybrid deep learning framework using a tunicate swarm algorithm and brown-bear optimization for intrusion detection. The Tunicate Swarm Algorithm (TSA) was utilized for hyperparameter tuning; the Brown-Bear Optimization Algorithm (BBOA) was employed for feature selection, therefore lowering the dataset from 41 to 25 features. After five epochs, the model tested on the NSL-KDD dataset achieves 98% accuracy. Comparative study using conventional models showed that the suggested framework improved accuracy and loss reduction, therefore stressing its possibilities to improve intrusion detection systems.