Network Intrusion Detection System (NIDS) plays a crucial role in network security defense. Traditional rule-based matching methods struggle to detect unknown attacks effectively, while deep learning enhances detection performance, but is constrained by the data privacy issue caused by centralized training. In this context, federated learning enables collaborative learning while preserving data privacy through local training and parameter sharing, offering a feasible solution for network intrusion detection. However, federated learning still faces challenges in NIDS applications, including the temporal dependency of network traffic and imbalanced data distribution, which limits the federated model’s ability to detect minority-class attacks. Therefore, a hybrid framework that integrates bidirectional Recurrent Neural Network (RNN) parallel architecture with Federated Class Balancing (FedCB) algorithm was proposed, so as to enhance the temporal modeling capabilities and optimize the federated aggregation strategy. Experimental results on the NSL-KDD dataset demonstrate that the proposed algorithm achieves superior performance in a five-class classification task. Compared with the intrusion detection model combining federated learning and convolutional neural networks — CNN-FL and FL-SEResNet (Federation Learning Squeeze-and-Excitation network ResNet), the proposed algorithm improves the accuracy by 3.30 and 1.48 percentage points, respectively, highlighting the effectiveness of the proposed method in federated learning-based intrusion detection.