Skip to main content

K-Nearest Neighbour Algorithm for Classification of IoT-Based Edge Computing Device

  • Chapter
  • First Online:
Artificial Intelligence for Cloud and Edge Computing

Abstract

The world’s population has boomed with the billions of connected devices in our households, towns, factories, hospitals, and so on. Limited-resource applications communicate with the world and users. To evaluate meaningful behavior to execute specific predictions and make decisions, several of these technologies are built on machine learning (ML) procedures. Hence, the need to integrate intelligence using machine learning algorithms on end devices is important. Implementing machine learning on edge devices enhances and makes it possible to perform computations near to the data sources. Therefore, the objective of this investigation is to provide a method that guarantees the implementation of low-performance ML techniques on hardware in the Internet of Things model, creating means for IoT awareness. The study employed the use of the KNN ML algorithm for the implementation, and a confusion matrix in terms of accuracy was used to evaluate the system. The result of the experiment shows an 85% accuracy which outperformed other methods that have been suggested and compared within the literature. However, this study proves to be relevant and can be adopted for better efficiency in IoT and edge/cloud computing applications.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 149.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 199.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 199.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Adeniyi EA, Ogundokun RO, Awotunde JB (2021) IoMT-based wearable body sensors network healthcare monitoring system. In: IoT in healthcare and ambient assisted living. Springer, Singapore, pp 103–121

    Chapter  Google Scholar 

  2. Merenda M, Porcaro C, Iero D (2020) Edge machine learning for AI-enabled IoT devices: a review. Sensors 20(9):2533. https://doi.org/10.3390/s20092533

    Article  Google Scholar 

  3. Liu Y, Yang C, Jiang L, Xie S, Zhang Y (2019) Intelligent edge computing for IoT-based energy management in smart cities. IEEE Netw 33(2):111–117. https://doi.org/10.1109/MNET.2019.1800254

    Article  Google Scholar 

  4. Odusami M, Abayomi-Alli O, Misra S, Shobayo O, Damasevicius R, Maskeliunas R (2018) Android malware detection: a survey. In: International conference on applied informatics. Springer, Cham, pp 255–266

    Chapter  Google Scholar 

  5. Adeyinka AA, Adebiyi MO, Akande NO, Ogundokun RO, Kayode AA, Oladele TO (2019) A deep convolutional encoder-decoder architecture for retinal blood vessels segmentation. In: International conference on computational science and it applications, Lecture notes in computer science (including subseries Lecture notes in artificial intelligence and Lecture notes in bioinformatics). Springer, Cham. 11623 LNCS, pp 180–189

    Google Scholar 

  6. Oladele TO, Ogundokun RO, Kayode AA, Adegun AA, Adebiyi MO (2019) Application of data mining algorithms for feature selection and prediction of diabetic retinopathy. Lecture notes in computer science (including subseries Lecture notes in artificial intelligence and Lecture notes in bioinformatics), International conference on computational science and it applications. Springer, Cham. 11623 LNCS, pp. 716–730

    Google Scholar 

  7. Ikedinachi AP, Misra S, Assibong PA, Olu-Owolabi EF, Maskeliūnas R, Damasevicius R (2019) Artificial intelligence, smart classrooms and online education in the 21st century: implications for human development. J Cases Inf Technol (JCIT) 21(3):66–79

    Article  Google Scholar 

  8. Alagbe V, Popoola SI, Atayero AA, Adebisi B, Abolade RO, Misra S (2019) Artificial intelligence techniques for electrical load forecasting in smart and connected communities. In: International conference on computational science and its applications. Springer, Cham, pp 219–230

    Google Scholar 

  9. Xu H (2017) Machine learning based data analytics for IoT devices. Nanyang Technological University. https://doi.org/10.32657/10356/72342

    Book  Google Scholar 

  10. Ieracitano C, Mammone N, Hussain A, Morabito FC (2020) A novel multi-modal machine learning based approach for automatic classification of EEG recordings in dementia. Neural Netw 123:176–190. https://doi.org/10.1016/j.neunet.2019.12.006

    Article  Google Scholar 

  11. Panesar A (2021) Machine learning algorithms. Apress, Berkeley, pp 85–144. https://doi.org/10.1007/978-1-4842-6537-6_4

    Book  Google Scholar 

  12. Yazici M, Basurra S, Gaber M (2018) Edge machine learning: enabling smart internet of things applications. Big Data Cogn Comput 2(3):26. https://doi.org/10.3390/bdcc2030026

    Article  Google Scholar 

  13. Portal S (2018) Internet of things (IoT) connected devices installed base worldwide from 2015 to 2025. https://www.statista.com/statistics/471264/iot-number-of-connected-devices-worldwide/

  14. Gubbi J et al (2013) Internet of things (IoT): a vision, architectural elements, and future directions. Futur Gener Comput Syst 29(7):1645–1660

    Article  Google Scholar 

  15. Lin J, Yu W, Zhang N, Yang X, Ge L (2017) On data integrity attacks against route guidance in transportation-based cyber-physical systems. In: Proceedings of the 14th IEEE annual conference in consumer communications and networking conference (CCNC 2017)

    Google Scholar 

  16. Singh D, Tripathi G, Jara AJ (2014) A survey of internet-of-things: future vision, architecture, challenges and services. In: Proceedings of 2014 IEEE world forum on internet of things (WF-IoT)

    Google Scholar 

  17. Chen X, Jiao L, Li W, Fu X (2016) Efficient multi-user computation offloading for mobile-edge cloud computing. IEEE/ACM Trans Netw 24(5):2795–2808

    Article  Google Scholar 

  18. Lee I, Lee K (2015) The internet of things (IoT): applications, investments, and challenges for enterprises. Bus Horiz 58(4):431–440

    Article  Google Scholar 

  19. Sha K et al (2018) On security challenges and open issues in internet of things. Futur Gener Comput Syst 83:326–337

    Article  Google Scholar 

  20. Brewster T (2016) How hacked cameras are helping launch the biggest attacks the internet has ever seen. https://www.forbes.com/sites/thomasbrewster/2016/09/25/brian-krebs-overwatch-ovh-smashed-by-largest-ddos-attacks-ever/#705007235899. Sept 2016

  21. Russon M-A (2016) Hackers turning millions of smart CCTV cameras into botnets for DDoS attacks. http://www.ibtimes.co.uk/hackers-turning-millions-smart-cctv-cameras-into-botnets-ddos-attacks-1525736. Accessed Sept 2016

  22. Sha K, Alatrash N, Wang Z (2017) A secure and efficient framework to read isolated smart grid devices. IEEE Trans Smart Grid 8(6):2519–2531

    Article  Google Scholar 

  23. Li S, Da Xu L, Zhao S (2015) The internet of things: a survey. Inf Syst Front 17(2):243–259

    Article  Google Scholar 

  24. Gokhale P, Bhat O, Bhat S (2018) Introduction to IOT. Int Adv Res J Sci Eng Technol 5(1):41–44

    Google Scholar 

  25. Gubbi J, Buyya R, Marusic S, Palaniswami M (2013) Internet of things (IoT): a vision, architectural elements, and future directions. Futur Gener Comput Syst 29(7):1645–1660

    Article  Google Scholar 

  26. Stergiou C, Psannis KE, Kim BG, Gupta B (2018) Secure integration of IoT and cloud computing. Futur Gener Comput Syst 78:964–975

    Article  Google Scholar 

  27. Atzori L, Iera A, Morabito G (2017) Understanding the internet of things: definition, potentials, and societal role of a fast-evolving paradigm. Ad Hoc Netw 56:122–140

    Article  Google Scholar 

  28. Chahal RK, Kumar N, Batra S (2020) Trust management in social internet of things: a taxonomy, open issues, and challenges. Comput Commun 150:13–46

    Article  Google Scholar 

  29. Srivastava G, Parizi RM, Dehghantanha A (2020) The future of blockchain technology in healthcare internet of things security. In: Blockchain cybersecurity, trust and privacy. Springer, Cham, pp 161–184

    Chapter  Google Scholar 

  30. Shafique MN, Khurshid MM, Rahman H, Khanna A, Gupta D (2019) The role of big data predictive analytics and radio frequency identification in the pharmaceutical industry. IEEE Access 7:9013–9021

    Article  Google Scholar 

  31. Manavalan E, Jayakrishna K (2019) A review of internet of things (IoT) embedded sustainable supply chain for industry 4.0 requirements. Comput Ind Eng 127:925–953

    Article  Google Scholar 

  32. Georgakopoulos D, Jayaraman PP, Fazia M, Villari M, Ranjan R (2016) Internet of things and edge cloud computing roadmap for manufacturing. IEEE Cloud Comput 3(4):66–73

    Article  Google Scholar 

  33. Bilal K, Khalid O, Erbad A, Khan SU (2018) Potentials, trends, and prospects in edge technologies: fog, cloudlet, mobile edge, and micro data centers. Comput Netw 130:94–120. https://doi.org/10.1016/j.comnet.2017.10.002

    Article  Google Scholar 

  34. Yousefpour A, Fung C, Nguyen T, Kadiyala K, Jalali F, Niakanlahiji A, Kong J, Jue JP (2019) All one needs to know about fog computing and related edge computing paradigms: a complete survey. J Syst Archit 98:289–330. https://doi.org/10.1016/j.sysarc.2019.02.009

    Article  Google Scholar 

  35. Wang Y, Meng W, Li W, Liu Z, Liu Y, Xue H (2019) Adaptive machine learning-based alarm reduction via edge computing for distributed intrusion detection systems. Concurr Comput Pract Exp 31(19). https://doi.org/10.1002/cpe.5101

  36. Wang S, Zhao Y, Xu J, Yuan J, Hsu C-H (2019) Edge server placement in mobile edge computing. J Parallel Distrib Comput 127:160–168. https://doi.org/10.1016/j.jpdc.2018.06.008

    Article  Google Scholar 

  37. Wang Y, Xie L, Li W, Meng W, Li J (2017) A privacy-preserving framework for collaborative intrusion detection networks through fog computing, pp 267–279. https://doi.org/10.1007/978-3-319-69471-9_20

  38. Agarwal P, Alam M (2019) A lightweight deep learning model for human activity recognition on edge devices. Journal title Sensors and page 1--17

    Google Scholar 

  39. Makkar A (2020) Machine learning techniques. In: Machine learning in cognitive IoT. CRC Press, pp 67–85

    Google Scholar 

  40. Gope D, Dasika G, Mattina M (2019) Ternary hybrid neural-tree networks for highly constrained iot applications. arXiv preprint arXiv:1903.01531

    Google Scholar 

  41. Lin J, Yu W, Zhang N, Yang X, Zhang H, Zhao W (2017) A survey on internet of things: architecture, enabling technologies, security and privacy, and applications. IEEE Internet Things J 4(5):1125–1142

    Article  Google Scholar 

  42. Guevara JC, Torres RDS, da Fonseca NL (2020) On the classification of fog computing applications: a machine learning perspective. J Netw Comp Appl 159:102596

    Article  Google Scholar 

  43. Wang J, Pan J, Esposito F, Calyam P, Yang Z, Mohapatra P (2019) Edge cloud offloading algorithms: issues, methods, and perspectives. ACM Comput Surv (CSUR) 52(1):2

    Google Scholar 

  44. Aazam M, Zeadally S, Harras KA (2018) Offloading in fog computing for IoT: review, enabling technologies, and research opportunities. Futur Gener Comput Syst 87:278–289

    Article  Google Scholar 

  45. Mach P, Becvar Z (2017) Mobile edge computing: a survey on architecture and computation offloading. IEEE Commun Surv Tutor 19(3):1628–1656

    Article  Google Scholar 

  46. Boukerche A, Guan S, Grande RED (2019) Sustainable offloading in mobile cloud computing: algorithmic design and implementation. ACM Comput Surv (CSUR) 52(1):11

    Article  Google Scholar 

  47. Peng K, Leung VC, Xu X, Zheng L, Wang J, Huang Q (2018) A survey on mobile edge computing: focusing on service adoption and provision. Wirel Commun Mob Comput 2018., Article ID: 8267838:1–16. https://doi.org/10.1155/2018/8267838

    Article  Google Scholar 

  48. Shakarami A, Shahidinejad A, Ghobaei-Arani M (2020) A review on the computation offloading approaches in mobile edge computing: a game-theoretic perspective. Softw Pract Exp 50:1719–1759

    Article  Google Scholar 

  49. Cao B, Zhang L, Li Y, Feng D, Cao W (2019) Intelligent offloading in multi-access edge computing: a state-of-the-art review and framework. IEEE Commun Mag 57(3):56–62

    Article  Google Scholar 

  50. Taleb T, Samdanis K, Mada B, Flinck H, Dutta S, Sabella D (2017) On multi-access edge computing: a survey of the emerging 5G network edge cloud architecture and orchestration. IEEE Commun Surv Tutor 19(3) Third Quarter:1657–1681

    Article  Google Scholar 

  51. Madakam S, Ramaswamy R, Tripathi S (2015) Internet of things (IoT): a literature review. J Comput Commun 3:164–173

    Article  Google Scholar 

  52. Dolui K, Datta SK (2017) Comparison of edge computing implementations: fog computing, cloudlet and mobile edge computing. IEEE

    Google Scholar 

  53. Mao Y, You C, Zhang J, Huang K, Letaief KB (2017) A survey on mobile edge computing: the communication perspective. IEEE

    Google Scholar 

  54. Rodriguez-Zurrunero R, Ramiro U (2019) Dataset of process management in IoT operating systems: cross-influence between processing and communication tasks in end-devices. https://doi.org/10.17632/rxsdfg8ct9.1

  55. Davis GA, Nihan NL (1991) Nonparametric regression and short-term freeway traffic forecasting. J Transp Eng 117(2):178–188

    Article  Google Scholar 

  56. Mehrotra R, Sharma A (2006) Conditional resampling of hydrologic time series using multiple predictor variables: a K-nearest neighbour approach. Adv Water Resour 29(7):987–999

    Article  Google Scholar 

  57. Bannayan M, Hoogenboom G (2008) Weather analogue: a tool for real-time prediction of daily weather data realizations based on a modified k-nearest neighbor approach. Environ Model Softw 23(6):703–713

    Article  Google Scholar 

  58. Mangalova E, Agafonov E (2014) Wind power forecasting using the k-nearest neighbors algorithm. Int J Forecast 30(2):402–406

    Article  Google Scholar 

  59. Cai P, Wang Y, Lu G, Chen P, Ding C, Sun J (2016) A spatiotemporal correlative k-nearest neighbor model for short-term traffic multistep forecasting. Transp Res Part C Emerg Technol 62:21–34

    Article  Google Scholar 

  60. Cheng S, Lu F, Peng P, Wu S (2018) Short-term traffic forecasting: an adaptive ST-KNN model that considers spatial heterogeneity. Comput Environ Urban Syst 71:186–198

    Article  Google Scholar 

  61. Martínez F, Frías MP, Pérez-Godoy MD, Rivera AJ (2018) Dealing with seasonality by narrowing the training set in time series forecasting with kNN. Expert Syst Appl 103:38–48

    Article  Google Scholar 

  62. Fan GF, Guo YH, Zheng JM, Hong WC (2019) Application of the weighted k-nearest neighbor algorithm for short-term load forecasting. Energies 12(5):916

    Article  Google Scholar 

  63. Xu D, Wang Y, Peng P, Beilun S, Deng Z, Guo H (2020) Real-time road traffic state prediction based on kernel-KNN. Transportmetrica A TranspSci 16(1):104–118

    Article  Google Scholar 

  64. KĂĽck M, Freitag M (2020) Forecasting of customer demands for production planning by local k-nearest neighbor models. Int J Prod Econ 231:107837

    Article  Google Scholar 

  65. Hattori K, Takahashi M (1999) A new nearest-neighbor rule in the pattern classification problem. Pattern Recogn 32(3):425–432

    Article  Google Scholar 

  66. Hattori K, Takahashi M (2000) A new edited k-nearest neighbor rule in the pattern classification problem. Pattern Recogn 33(3):521–528

    Article  Google Scholar 

  67. Jiang S, Pang G, Wu M, Kuang L (2012a) An improved K-nearest-neighbor algorithm for text categorization. Expert Syst Appl 39(1):1503–1509

    Article  Google Scholar 

  68. Jiang JY, Tsai SC, Lee SJ (2012b) FSKNN: multi-label text categorization based on fuzzy similarity and k nearest neighbors. Expert Syst Appl 39(3):2813–2821

    Article  Google Scholar 

  69. Miao D, Duan Q, Zhang H, Jiao N (2009) Rough set based hybrid algorithm for text classification. Expert Syst Appl 36(5):9168–9174

    Article  Google Scholar 

  70. Cui B, Shen HT, Shen J, Tan KL (2005, December) Exploring bit-di® erence for approximate KNN search in high-dimensional databases. In: Conferences in research and practice in information technology series, vol 39, pp 165–174

    Google Scholar 

  71. Tan S (2006) An effective refinement strategy for KNN text classifier. Expert Syst Appl 30(2):290–298

    Article  Google Scholar 

  72. Wan CH, Lee LH, Rajkumar R, Isa D (2012) A hybrid text classification approach with low dependency on parameter by integrating K-nearest neighbor and support vector machine. Expert Syst Appl 39(15):11880–11888

    Article  Google Scholar 

  73. Yoon JW, Friel N (2015) Efficient model selection for probabilistic K nearest neighbour classification. Neurocomputing 149:1098–1108

    Article  Google Scholar 

  74. Zhang H, Berg AC, Maire M, Malik J (2006, June) SVM-KNN: discriminative nearest neighbor classification for visual category recognition. In: 2006 IEEE computer society conference on computer vision and pattern recognition (CVPR’06), vol 2. IEEE, pp 2126–2136

    Google Scholar 

  75. Zhang S, Cheng D, Deng Z, Zong M, Deng X (2018) A novel kNN algorithm with data-driven k parameter computation. Pattern Recogn Lett 109:44–54

    Article  Google Scholar 

  76. Khateeb N, Usman M (2017). Efficient heart disease prediction system using K-nearest neighbor classification technique. In Proceedings of the international conference on big data and internet of thing, pp 21–26

    Google Scholar 

  77. Hashi EK, Zaman MSU, Hasan MR (2017) An expert clinical decision support system to predict disease using classification techniques. In: 2017 International conference on electrical, computer and communication engineering (ECCE). IEEE, pp 396–400

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Roseline Oluwaseun Ogundokun .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Arowolo, M.O., Ogundokun, R.O., Misra, S., Oluranti, J., Kadri, A.F. (2022). K-Nearest Neighbour Algorithm for Classification of IoT-Based Edge Computing Device. In: Misra, S., Kumar Tyagi, A., Piuri, V., Garg, L. (eds) Artificial Intelligence for Cloud and Edge Computing. Internet of Things. Springer, Cham. https://doi.org/10.1007/978-3-030-80821-1_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-80821-1_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-80820-4

  • Online ISBN: 978-3-030-80821-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics