Lithium-ion batteries are extensively utilised in various industries and everyday life. Typically, these batteries are considered retired when their state of health (SOH) drops below 80%. These retired batteries, known as secondary batteries, can be repurposed for applications that demand lower battery performance. Precise forecasting of the lifespan of secondary batteries is crucial for determining suitable operational management approaches. Initially, we use the CACLE dataset for thorough investigation. Therefore, to account for the unpredictable and random character of the application circumstances, we employ the U-chord long curvature feature extraction approach to minimise errors resulting from rotation and noise. Additionally, we utilise the discharged power as a feature. This study employs two optimization algorithms, namely, particle swarm optimization (PSO) and sparrow optimization algorithm (SSA), in conjunction with least squares support vector machine (LSSVM) to compare the model against three conventional models, namely, Gaussian process regression (GPR), convolutional neural networks (CNN), and long short-term memory (LSTM). This work comprises two experiments: Experiment 1 utilises the battery’s charging and discharging history data to train the model for estimating the SOH of the remaining cycles of the same battery. Experiment 2, on the other hand, employs the complete discharging data of the battery to train the model for predicting the SOH of the remaining cycles of other batteries. The error evaluation metrics used are mean absolute error (MAE), mean absolute percentage error (MAPE), and root mean square error (RMSE). The results indicate that the average MAE for SSA-LSSVM, LSTM, CNN, PSO-LSSVM, and GPR in Experiment 1 and Experiment 2 are 1.11%, 1.82%, 2.02%, 2.04%, and 12.18% respectively. The best prediction results are obtained by SSA-LSSVM.