The document describes a three-layer hybrid learning model combining LSTM and Random Forest to improve intrusion detection system (IDS) performance, particularly in handling imbalanced network traffic and detecting various types of cyberattacks. The model, validated on the CSE-CIC-IDS2018 dataset, achieved high metrics including 99.76% accuracy, precision, recall, and F1-score. Techniques such as Nearmiss-2 for class balancing and feature selection via Chi-square and RF were utilized to enhance the detection capabilities of the IDS.