# Optimizing the Parameters of Long Short-Term Memory Networks Using the Bees Algorithm
## 5 Conclusions  
Improving the performance of Deep Learning (DL) algorithms is an ongoing challenge. However, DL is applied to different types of Deep Neural Networks, and Long Short-Term Memory (LSTM) is one of them that deals with time series or sequential data. This paper addressed this issue by optimizing LSTM parameters using one of the most popular nature-inspired algorithms known as the Bees Algorithm (BA) which mimics the foraging behavior of honey bees. Artificial porosity images were used for testing the algorithms; since the input data were images, a Convolutional Neural Network (CNN) was added in order to extract the features in the images and feed the LSTM to predict the percent of porosity in sequential layers of artificial porosity images that mimicked real CT scan images of products manufactured by the Selective Laser Melting process. The MATLAB platform was used to develop and apply the Convolutional Neural Network Long Short-Term Memory (CNN-LSTM), which yielded a porosity prediction accuracy of 93.17%. Using the BO to optimize LSTM parameters did not improve the performance of the LSTM, as the BO performs poorly with a high dimensional objective function of more than 20 dimensions, which is the case in regression problems. However, Adding the BA to optimize the same LSTM parameters improved their performance in predicting the porosity, which yielded an accuracy of 95.17% using the hybrid Bees Algorithm Convolutional Neural Network Long Short-Term Memory (BA-CNN-LSTM). Hence, this work has contributed to improving the performance of the LSTM network for predicting sequential data using the BA. As the input data were images, a CNN was added to extract the image features to yield a hybrid algorithm (BA-CNN-LSTM) that provided a more accurate prediction and an improvement of 10% for the percent of porosity in sequential layers of artificial porosity images that mimicked CT scan images of parts manufactured by the SLM process. Furthermore, the hybrid BA-CNN-LSTM algorithm can be designed to deal with classification problems as well. Applying it to Electrocardiogram (ECG) benchmark images improved the test set classification accuracy from 92.50% for the CNN-LSTM algorithm to 95% for both the BO-CNN-LSTM and BA-CNN-LSTM algorithms. In addition, the turbofan engine degradation simulation dataset was used to predict the Remaining Useful Life (RUL) of the engines using the LSTM network. A CNN was not needed in this case, as there was no feature extraction for the images. However, adding the BA to optimize the LSTM parameters improved the prediction accuracy of the testing set for the LSTM and BO-LSTM, which increased from 74% to 77% for the hybrid BA-LSTM algorithm. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **LSTM** & **BO-LSTM** & **BA-LSTM** \\ \hline Training set & 72\% & 72\% & 73\% \\ Validation set & 74\% & 74\% & 76\% \\ Testing set & 74\% & 74\% & 77\% \\ Computation time & 4 min 16 s & 4 min 18 s & 4 min 20 s \\ \hline \hline \end{tabular}
\end{table} 
Table 12: The prediction accuracy and time for RUL (engine dataset). Further improvement to the novel hybrid BA-CNN-LSTM algorithm will be done in the future by optimizing the adjustment factor of regularization to reduce the overfitting, which in turn is expected to improve the overall performance of the LSTM network. Conceptualization, N.M.H.A., M.P. and S.B. ; methodology, N.M.H.A., M.P. and S.B. ; software, N.M.H.A. ; validation, M.P. and S.B. ; formal analysis, N.M.H.A., M.P. and S.B. ; investigation, N.M.H.A. and M.P. ; resources, N.M.H.A., M.P. and S.B. ; data curation, N.M.H.A. and S.B. ; writing--original draft preparation, N.M.H.A. ; writing--review and editing, M.P. and S.B. ; visualization, N.M.H.A., M.P. and S.B. ; supervision, M.P. and S.B. ; project administration, N.M.H.A., M.P. and S.B. ; funding acquisition, N.M.H.A., M.P. and S.B. All authors have read and agreed to the published version of the manuscript. Not applicable.