{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,5,4]],"date-time":"2026-05-04T11:28:58Z","timestamp":1777894138509,"version":"3.51.4"},"reference-count":39,"publisher":"MDPI AG","issue":"14","license":[{"start":{"date-parts":[[2021,7,20]],"date-time":"2021-07-20T00:00:00Z","timestamp":1626739200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Sensors"],"abstract":"<jats:p>The Internet of Things (IoT) consists of small devices or a network of sensors, which permanently generate huge amounts of data. Usually, they have limited resources, either computing power or memory, which means that raw data are transferred to central systems or the cloud for analysis. Lately, the idea of moving intelligence to the IoT is becoming feasible, with machine learning (ML) moved to edge devices. The aim of this study is to provide an experimental analysis of processing a large imbalanced dataset (DS2OS), split into a training dataset (80%) and a test dataset (20%). The training dataset was reduced by randomly selecting a smaller number of samples to create new datasets Di (i = 1, 2, 5, 10, 15, 20, 40, 60, 80%). Afterwards, they were used with several machine learning algorithms to identify the size at which the performance metrics show saturation and classification results stop improving with an F1 score equal to 0.95 or higher, which happened at 20% of the training dataset. Further on, two solutions for the reduction of the number of samples to provide a balanced dataset are given. In the first, datasets DRi consist of all anomalous samples in seven classes and a reduced majority class (\u2018NL\u2019) with i = 0.1, 0.2, 0.5, 1, 2, 5, 10, 15, 20 percent of randomly selected samples. In the second, datasets DCi are generated from the representative samples determined with clustering from the training dataset. All three dataset reduction methods showed comparable performance results. Further evaluation of training times and memory usage on Raspberry Pi 4 shows a possibility to run ML algorithms with limited sized datasets on edge devices.<\/jats:p>","DOI":"10.3390\/s21144946","type":"journal-article","created":{"date-parts":[[2021,7,20]],"date-time":"2021-07-20T23:19:51Z","timestamp":1626823191000},"page":"4946","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":25,"title":["Analysis of Machine Learning Algorithms for Anomaly Detection on Edge Devices"],"prefix":"10.3390","volume":"21","author":[{"given":"Aleks","family":"Hu\u010d","sequence":"first","affiliation":[{"name":"Faculty of Computer and Information Science, University of Ljubljana, Ve\u010dna Pot 113, SI-1000 Ljubljana, Slovenia"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Jakob","family":"\u0160alej","sequence":"additional","affiliation":[{"name":"Faculty of Computer and Information Science, University of Ljubljana, Ve\u010dna Pot 113, SI-1000 Ljubljana, Slovenia"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Mira","family":"Trebar","sequence":"additional","affiliation":[{"name":"Faculty of Computer and Information Science, University of Ljubljana, Ve\u010dna Pot 113, SI-1000 Ljubljana, Slovenia"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"1968","published-online":{"date-parts":[[2021,7,20]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"289","DOI":"10.1016\/j.sysarc.2019.02.009","article-title":"All one needs to know about fog computing and related edge computing paradigms: A complete survey","volume":"98","author":"Yousefpour","year":"2019","journal-title":"J. Syst. Archit."},{"key":"ref_2","doi-asserted-by":"crossref","unstructured":"Merenda, M., Porcaro, C., and Iero, D. (2020). Edge Machine Learning for AI-Enabled IoT Devices: A Review. Sensors, 20.","DOI":"10.3390\/s20092533"},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"1275","DOI":"10.1109\/JIOT.2018.2805263","article-title":"Edge Computing for the Internet of Things","volume":"5","author":"Premsankar","year":"2018","journal-title":"IEEE Internet Things J."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"1655","DOI":"10.1109\/JPROC.2019.2921977","article-title":"Deep Learning With Edge Computing: A Review","volume":"107","author":"Chen","year":"2019","journal-title":"Proc. IEEE"},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"18","DOI":"10.1016\/j.jpdc.2018.03.006","article-title":"A scalable distributed machine learning approach for attack detection in edge computing environments","volume":"119","author":"Kozik","year":"2018","journal-title":"J. Parallel Distrib. Comput."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"331","DOI":"10.1016\/j.comcom.2020.01.005","article-title":"Anomaly detection in wireless sensor network using machine learning algorithm","volume":"151","author":"Poornima","year":"2020","journal-title":"Comput. Commun."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"100059","DOI":"10.1016\/j.iot.2019.100059","article-title":"Attack and anomaly detection in IoT sensors in IoT sites using machine learning approaches","volume":"7","author":"Hasan","year":"2019","journal-title":"Internet Things"},{"key":"ref_8","unstructured":"Elsayed, M.S., Le-Khac, N.A., Dev, S., and Jurcut, A.D. (2020, January 16\u201320). Network Anomaly Detection Using LSTM Based Auto-encoder. Proceedings of the 16th ACM Symposium on QoS and Security for Wireless and Mobile Networks, Alicante, Spain."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3439950","article-title":"Deep Learning for Anomaly Detection: A Review","volume":"54","author":"Pang","year":"2021","journal-title":"ACM Comput. Surv."},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Churcher, A., Ullah, R., Ahmad, J., Rehman, S., Masood, F., Gogate, M., Alqahtani, F., Nour, B., and Buchanan, W.J. (2021). An Experimental Analysis of Attack Classification Using Machine Learning in IoT Networks. Sensors, 21.","DOI":"10.3390\/s21020446"},{"key":"ref_11","unstructured":"Kim, J.M., Cho, W.C., and Kim, D. (2020, January 21\u201323). Anomaly Detection of Environmental Sensor Data. Proceedings of the 2020 International Conference on Information and Communication Technology Conference (ICTC), Jeju, Korea."},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"41","DOI":"10.1016\/j.engappai.2019.05.011","article-title":"IRESE: An intelligent rare-event detection system using unsupervised learning on the IoT edge","volume":"84","author":"Janjua","year":"2019","journal-title":"Eng. Appl. Artif. Intel."},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"995","DOI":"10.1016\/j.future.2017.11.013","article-title":"Raspberry Pi assisted face recognition framework for enhanced law-enforcement services in smart cities","volume":"108","author":"Sajjad","year":"2017","journal-title":"Future Gener. Comput. Syst."},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"1597","DOI":"10.1016\/j.aej.2017.06.008","article-title":"A novel approach in real-time vehicle detection and tracking using Raspberry Pi","volume":"57","author":"Anandhalli","year":"2017","journal-title":"Alex. Eng. J."},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Xu, R., Nikouei, S.Y., Chen, Y., Polunchenko, A., Song, S., Deng, C., and Faughan, T.R. (2018, January 20\u201324). Real-Time Human Objects Tracking for Smart Surveillance at the Edge. Proceedings of the IEEE International Conference on Communications (ICC), Kansas City, MO, USA.","DOI":"10.1109\/ICC.2018.8422970"},{"key":"ref_16","unstructured":"Komninos, A., Simou, I., Gkorgkolis, N., and Garofalakis, J. (2019, January 4). Performance of Raspberry Pi microclusters for Edge Machine Learning in Tourism. Proceedings of the Poster and Workshop Sessions of AmI-2019, the 2019 European Conference on Ambient Intelligence, Rome, Italy."},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Kamaraj, K., Dezfouli, B., and Liu, Y. (2019, January 18\u201321). Edge mining on IoT Devices using Anomaly Detection. Proceedings of the APSIPA Annual Summit and Conference 2019, Lanzhou, China.","DOI":"10.1109\/APSIPAASC47483.2019.9023207"},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"39","DOI":"10.1016\/j.mfglet.2020.12.004","article-title":"Edge-cloud computing performance benchmarking for IoT based machinery vibration monitoring","volume":"27","author":"Verma","year":"2021","journal-title":"Manuf. Lett."},{"key":"ref_19","first-page":"3371","article-title":"BeSafe B2.0 Smart Multisensory Platform for Safety in Workplaces","volume":"21","author":"Rodriguez","year":"2021","journal-title":"Sensors"},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Liu, C., Su, X., and Li, C. (2021). Edge Computing for Data Anomaly Detection of Multi-Sensors in Underground Mining. Electronics, 10.","DOI":"10.3390\/electronics10030302"},{"key":"ref_21","first-page":"6122","article-title":"Internet of things-IOT: Definition, characteristics, architecture, enabling technologies, application & future challenges","volume":"6","author":"Patel","year":"2016","journal-title":"Int. J. Eng. Comput. Sci."},{"key":"ref_22","doi-asserted-by":"crossref","unstructured":"Zantalis, F., Koulouras, G., Karabetsos, S., and Kandris, D. (2019). A Review of Machine Learning and IoT in Smart Transportation. Future Internet, 11.","DOI":"10.3390\/fi11040094"},{"key":"ref_23","first-page":"159","article-title":"Anomaly Detection Using SVMs as Classifier and Decision Tree for Optimizing Feature Vectors","volume":"11","author":"Serkani","year":"2019","journal-title":"Int. J. Inf. Secur."},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"102657","DOI":"10.1016\/j.dsp.2020.102657","article-title":"A Novel Distributed anomaly detection Algorithm Based on Support Vector Machines","volume":"99","author":"Ergen","year":"2020","journal-title":"Digit. Signal Process."},{"key":"ref_25","unstructured":"(2020, November 20). Keras. Available online: https:\/\/keras.io\/."},{"key":"ref_26","unstructured":"(2020, November 20). Linear Models (Logistic Regression). Available online: https:\/\/scikit-learn.org\/stable\/modules\/linear_model.html#logistic-regression."},{"key":"ref_27","unstructured":"(2020, November 20). Logistic Regression. Available online: https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.LogisticRegression.html#sklearn.linear_model.LogisticRegression."},{"key":"ref_28","unstructured":"(2020, November 20). Support Vector Machines. Available online: https:\/\/scikit-learn.org\/stable\/modules\/svm.html#svm."},{"key":"ref_29","unstructured":"(2020, November 20). SVM-libsvm. Available online: https:\/\/www.csie.ntu.edu.tw\/~cjlin\/papers\/libsvm.pdf."},{"key":"ref_30","unstructured":"(2020, November 20). Decision Trees. Available online: https:\/\/scikit-learn.org\/stable\/modules\/tree.html."},{"key":"ref_31","unstructured":"(2020, November 20). DT Function. Available online: https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.tree.DecisionTreeClassifier.html."},{"key":"ref_32","unstructured":"(2020, November 20). Forests of Randomized Trees. Available online: https:\/\/scikit-learn.org\/stable\/modules\/ensemble.html#forest."},{"key":"ref_33","unstructured":"(2020, November 20). Neural Network Models. Available online: https:\/\/scikit-learn.org\/stable\/modules\/neural_networks_supervised.html."},{"key":"ref_34","unstructured":"(2020, November 20). Metrics and Scoring: Quantifying the Quality of Predictions. Available online: https:\/\/scikit-learn.org\/stable\/modules\/model_evaluation.html."},{"key":"ref_35","unstructured":"(2020, November 20). DS2OS Traffic Traces. Available online: https:\/\/www.kaggle.com\/francoisxa\/ds2ostraffictraces."},{"key":"ref_36","unstructured":"Ester, M., Kriegel, H.P., Sander, J., and Xu, X. (1996, January 2\u20134). A density-based algorithm for discovering clusters in large spatial databases with noise. Proceedings of the Second International Conference on Knowledge Discovery and Data Mining, Portland, OR, USA."},{"key":"ref_37","unstructured":"Jang, J., and Jiang, H. (2019, January 9\u201315). DBSCAN++: Towards fast and scalable density clustering. Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA."},{"key":"ref_38","unstructured":"(2021, January 15). Raspberry Pi 4. Available online: https:\/\/www.raspberrypi.org\/products\/raspberry-pi-4-model-b\/specifications."},{"key":"ref_39","unstructured":"(2021, June 18). Resource. Available online: https:\/\/docs.python.org\/3\/library\/resource.html."}],"container-title":["Sensors"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1424-8220\/21\/14\/4946\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,11]],"date-time":"2025-10-11T06:32:32Z","timestamp":1760164352000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1424-8220\/21\/14\/4946"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2021,7,20]]},"references-count":39,"journal-issue":{"issue":"14","published-online":{"date-parts":[[2021,7]]}},"alternative-id":["s21144946"],"URL":"https:\/\/doi.org\/10.3390\/s21144946","relation":{},"ISSN":["1424-8220"],"issn-type":[{"value":"1424-8220","type":"electronic"}],"subject":[],"published":{"date-parts":[[2021,7,20]]}}}