# Control of a Mobile Line-Following Robot Using Neural Networks
## 7 Conclusions  
This paper investigated the use of neural networks in the control of a mobile line-follower robot using the LSTM and CNN approaches.  
Various control methods based on deep learning and PID were developed and tested on the robot, resulting in a comparative analysis between the techniques. This comparison demonstrated the advantages of neural networks for complex paths despite their greater sensitivity to factors such as lighting and computational load, which required a reduced sampling rate and limited speed.  
The first approach, based on infrared sensors and using an LSTM model, proved to be efficient for simple paths, with a higher sampling rate and reduced dependence on environmental conditions. The second approach, which used a camera and a CNN, was more effective for complex paths but revealed to be sensitive to noise and reflections from the environment, requiring careful calibration. Another source of uncertainty was the classification process, which, being performed manually, is not free from biases.  
Compared to the PID controller, neural networks showed better adaptation to difficult paths but with high computational complexity. PID remains practical for simple controlled paths, while neural networks offer great potential for AGVs in dynamic and unpredictable scenarios.  
For future work, we can consider creating a simulation environment that allows us to test different scenarios, tracks, and configurations more quickly and under controlled conditions, thus reducing time and resources. The use of non-linear controllers over the traditional linear PID controllers could be an interesting research area. For better performance and reliability, a hybrid approach could be used that combines the neural networks of LSTM and CNN with the mathematical model of the robot. Another improvement would be the use of pre-trained networks, such as those trained on large datasets for autonomous navigation or path detection. To achieve this, the use of transfer learning (adapting an already trained network for new tasks) could significantly reduce training time and improve model accuracy under certain conditions. Testing the robot in more com  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Method** & **MSE** & **MAE** & **RMSE** & **Lap Time (s)** & **Oscillations** \\ \hline PID & 10,684,111 \(\pm\) 515,855 & 2257 \(\pm\) 71 & 3267 \(\pm\) 79 & 16.40 \(\pm\) 0.22 & + \\ \hline LSTM & 17,158,701 \(\pm\) 1,598,305 & 3435 \(\pm\) 242 & 4137 \(\pm\) 192 & 20.53 \(\pm\) 1.04 & +++ \\ \hline CNN & 21,040,166 \(\pm\) 1,186,665 & 3857 \(\pm\) 188 & 4585 \(\pm\) 128 & 25.96 \(\pm\) 0.29 & ++ \\ \hline \hline \end{tabular}
\end{table}
Table 7: Performance results.  
plex environments, simulating industrial or urban scenarios, would also make it possible to validate the robustness of the models under more realistic and demanding conditions.  
Conceptualization, H.M.L. and R.S.B.; methodology, H.M.L. and R.S.B.; software, H.M.L.; validation, H.M.L. and R.S.B.; formal analysis, H.M.L.; investigation, H.M.L.; writing--original draft preparation, H.M.L.; writing--review and editing, H.M.L., R.S.B. and I.S.J.; visualization, H.M.L.; supervision, R.S.B. and I.S.J. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
The original data presented in the study are openly available from GitHub repository at [[https://github.com/[PERSON]/TEDI1190660](https://github.com/HugoMLeal/TEDI1190660)]([https://github.com/[PERSON]/TEDI1190660](https://github.com/HugoMLeal/TEDI1190660)) (accessed on 13 January 2025).  
The authors declare no conflicts of interest.