## 8 Conclusions  
This work presented a novel methodology for anomaly detection, leveraging the combination of a deep learning model and an anomaly detector. The deep learning model, implemented as a RNN, was compared with both LSTM and DeepESN architectures, with our findings demonstrating the superiority of the proposed DeepESN approach. This architecture proved to be not only efficient but also faster and lightweight, making it well-suited for deployment on resource-constrained embedded devices at the edge. The anomaly detector, a critical component of our framework, exhibited its effectiveness in distinguishing normal behavior from anomalies based on the comparison of predicted and real inputs, further augmented by the standard deviation of errors. The three-phase model selection and model assessment approach facilitated the identification of optimal hyperparameters, ensuring the robustness and adaptability of the deep learning model. The introduction of DeepESN, a hybrid model combining efficient deep learning functionality with the strengths of ESN, proved advantageous. DeepESN exhibited enhanced temporal representation diversification, powerful short-term memory capacity, and amplified computing efficiency compared to the baseline ESN mechanism. These advantages position DeepESN as a formidable choice for the short-term forecasting of electrical parameters within our proposed methodology. Experimental results showcased the effectiveness and efficiency of our proposal, particularly when compared to the state-of-the-art LSTM model. Despite the slight superiority of LSTM in the mean squared error metric, our approach demonstrated comparable effectiveness metrics, with notable improvements in efficiency. The significant reduction in training time and CO\({}_{2}\) emissions highlights the potential environmental and cost benefits of our proposed methodology. In summary, our comprehensive evaluation demonstrates the feasibility and advantages of our proposed approach, making it a compelling solution for on-the-edge deployment, directly addressing the limitations of traditional server-based implementations. The proposed methodology, grounded in the robustness of DeepESN and the efficiency of the anomaly detector, sets the stage for advancements in real-time anomaly detection on resource-constrained devices at the edge of the network. However, although the initial findings are promising, there is still a need for further exploration with objectives such as:  
* Monitoring the production line as different types of items are manufactured, linking time-series data to the specific products being produced;
* Labeling all types of faults and malfunctions to continuously improve the performance of the AD model;
* Implementing a continuous learning technique to enable the model to update itself and adapt to temporal changes in the degradation of the production line. Methodology, A.B., M.P. and S.L. ; validation, A.B., M.P., G.P. and L.L. ; formal analysis, A.B. and M.P. ; investigation, M.P., L.F., R.K., G.P. and L.L. ; resources, M.P., G.P., L.F., R.K., L.L., A.B. and C.V.; data curation, G.P., L.L. and C.V.; writing--original draft preparation, M.P., G.P. and L.L. ; writing--review and editing, A.B. and M.P. ; visualization, A.B. and M.P. ; supervision, M.P., A.B. and S.L. ; project administration, A.B. and M.P. All authors have read and agreed to the published version of the manuscript. This research has been supported by Italian PON \"RICERCA E INNOVAZIONE\" 2014-2020-AZIONE IV.6 \"CONTRATTI DI RICERCA SU TEMATICHE GREEN\", and it was partially funded by the European project Horizon Europe \"EDIH4 Marche\" (European Digital Innovation Hub for Marche), Call DIGITAL-2021-EDIH-01, Grant Agreement no. 101084027 on topic DIGITAL-2021-EDIH-INITIAL-01 (DIGITAL Simple Grants Actor). The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.