An accurate prognosis of the marine lithium-ion battery capacity is significant in guiding electric ships’ optimal operation and maintenance. Under real-world operating conditions, lithium-ion batteries are exposed to various external factors, making accurate capacity prognostication a complex challenge. The paper develops a marine lithium-ion battery capacity prognostic method based on ICPO-Bi-LSTM under dynamic operating conditions to address this. First, the battery is simulated according to the actual operating conditions of an all-electric ferry, and in each charge/discharge cycle, the sum, mean, and standard deviation of each parameter (current, voltage, energy, and power) during battery charging, as well as the voltage difference before and after the simulated operating conditions, are calculated to extract a series of features that capture the complex nonlinear degradation tendency of the battery, and then a correlation analysis is performed on the extracted features to select the optimal feature set. Next, to address the challenge of determining the neural network’s hyperparameters, an improved crested porcupine optimization algorithm is proposed to identify the optimal hyperparameters for the model. Finally, to prevent the interference of test data during model training, which could lead to evaluation errors, the training dataset is used for parameter fitting, the validation dataset for hyperparameter adjustment, and the test dataset for the model performance evaluation. The experimental results demonstrate that the proposed method achieves high accuracy and robustness in capacity prognostics of lithium-ion batteries across various operating conditions and types.