Ship motion attitude data have strong random and non-stationary characteristics under severe sea states. Real-time and accurate prediction of the ship's motion attitude can significantly improve the safety of navigation. Therefore, this article proposes a prediction model based on the improved empirical mode decomposition (IEMD) and the dynamic residual recurrent neural network with bidirectional structure and time pattern attention mechanism (TPA-Bi-DRRNN), and proposes a new algorithm: dynamic adaptive beetle swarm antennae search (DABSAS) algorithm to optimise the initial weight and threshold of the prediction model. The input data are adaptively composed into multiple intrinsic mode functions (IMFs) containing their frequency characteristics using IEMD, and a prediction is made for each IMF using TPA-Bi-DRRNN. The model structure can be regulated in real time according to the sliding window. The destroyer DTMB5415 is used as an example to conduct a performance test of the hybrid prediction model and DABSAS. The results show that no mode mixing occurred in the IMFs, the noise in each IMF was significantly reduced, thus dramatically reducing the difficulty of using the input data for prediction; and the optimization performance of DABSAS in applying the TPA-Bi-DRRNN is much better than that of the traditional algorithms. Compared with other models, the difference in the predictive accuracy of TPA-Bi-DRRNN under each condition is the smallest, suggestings that it has extremely high robustness and will always be able to maintain much higher accuracy than other models over a long period, thus meeting the needs for real-time accurate prediction of ship motion attitude.