§ 瀏覽學位論文書目資料
  
系統識別號 U0002-0207202312275400
DOI 10.6846/tku202300268
論文名稱(中文) 結合人臉偵測及一次性密碼認證的智慧門鎖系統
論文名稱(英文) A Smart Door Lock System with Face Detection and One-Time Password Authentication
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 資訊工程學系碩士班
系所名稱(英文) Department of Computer Science and Information Engineering
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 111
學期 2
出版年 112
研究生(中文) 蘇冠力
研究生(英文) Kuan-Li Su
學號 610410226
學位類別 碩士
語言別 繁體中文
第二語言別
口試日期 2023-06-20
論文頁數 55頁
口試委員 指導教授 - 林其誼(chiyilin@mail.tku.edu.tw)
口試委員 - 蔡智強(jichiangt@nchu.edu.tw)
口試委員 - 林振緯(jwlin@csie.fju.edu.tw)
關鍵字(中) 物聯網
一次性密碼
樹莓派
OpenCV
智慧家庭
關鍵字(英) Internet of Things
One-Time Password
Raspberry Pi
OpenCV
Smart Home
第三語言關鍵字
學科別分類
中文摘要
近年來在物聯網技術蓬勃發展的態勢下,其技術至今已跨足到各個產業當中,企業體以現行的產業生產模式為基礎,再結合了物聯網技術,更能使其便利性再大幅的增加。以智慧家庭設備為例,其數量正在以越來越快的速度增長,目前正處在產業的頂峰階段,這是由於日常之中使用到的家庭設備,在市場上正被大量智慧化的緣故。
而在所有的家居設備當中,門與門鎖扮演了極其重要的地位。門的存在隔絕了外界的干擾,使得人們得以在家中放下警戒安心休憩。一個有效的家庭安全系統能使得家庭成為一個更安全舒心的居住場所,達到更高的生活水平。近年來,智慧門鎖作為家庭安全系統的組成部分,其在市場越來越受歡迎。
本論文所提出的智慧門鎖系統,在門鎖的部分是利用Raspberry Pi 4 以及Pi Camera進行系統建置,當門鈴或門鎖被觸動之時,系統會開啟攝影鏡頭利用OpenCV進行人臉偵測,以此了解門前的是否為人類,且是否持續停留在門前,以確保該目標並非行經的路人誤觸了門鈴或門鎖。門鎖系統也連接了後端資料庫,資料庫負責儲存使用者資料,以及生成、發送、驗證一次性密碼。此外,本系統搭配一個手機APP供使用者使用,想要開門的使用者,需要利用此APP進行註冊並登入,即可申請一次性密碼,再將其密碼輸入樹莓派所連接的鍵盤之後,即可視其登入者的權限決定是否予以開門,而權限高低可由屋主登入APP後,透過後端管理介面對家庭成員進行權限更動。最後在開門成功或失敗時,皆會附上開門者的照片,寄送通知給屋主。
英文摘要
In recent years, under the vigorous development of Internet of Things (IoT) technology, IoT has now spanned into various industries. Enterprises based on the current industrial production mode have begun to leverage the IoT technology to greatly increase the convenience both for themselves and for their customers. Taking smart home devices as an example, the number of them is growing at an increasingly rapid rate. This is because home devices are used by people every day, which creates a huge market for the industry to turn traditional home devices into smart devices.
Among all household equipment, doors and locks play an extremely important role. The presence of doors and locks offers the sense of security, allowing people to relax at home. An effective home security system can make the home a safer and more comfortable place to live and achieve a higher standard of living. In recent years, smart door locks have become more and more popular in the market as an integral part of home security systems.
In this thesis we propose a smart door lock system, consisting of a door lock, a backend database, and a mobile app for users. The door lock component is implemented using Raspberry Pi 4 and Pi Camera. When the doorbell or door lock is touched, the system will turn on the camera and use OpenCV for face detection, to see whether the event is triggered by human. It is possible that the doorbell/door lock is accidentally touched by a passing person, so our system will also check whether the human continues to stay in front of the door. The door lock component is connected to the backend database, which is responsible for storing user information, as well as producing, sending, verifying one-time passwords. Whenever a user would like to open the door, he/she uses the mobile app to apply for a one-time password. After entering the password with the keyboard connected to the Raspberry Pi, our system can decide whether to open the door by checking the authority level of the user. The system owner can configure the authority level for family members through the mobile App. Finally, no matter whether the door lock system granted or denied the door access, a photo of the requested person will be sent to the system owner as a notification or warning.
第三語言摘要
論文目次
目錄
第一章    緒論	1
1.1	研究背景與動機	1
1.2	研究目的	4
1.3	論文架構	6
第二章    技術背景與相關研究	7
2.1      OpenCV	7
2.2       PostgreSQL	10
2.3	相關研究	12
第三章    系統架構	16
3.1	相關軟硬體介紹	16
3.2	系統架構	20
3.3	系統作業流程	21
第四章    系統實作與功能展示	25
4.1	實驗環境介紹	25
4.2       樹莓派	26
4.2.1	人臉偵測	26
4.2.2	權限檢測	30
4.2.3	密碼檢測	32
4.2.4	提醒訊息與人臉照片的發送	33
4.3       資料庫	36
4.4       帳戶管理與一次性密碼	38
4.4.1	使用者的註冊登入與後端管理	38
4.3.2	接一次性密碼(OTP)的生成與發送	42
4.5	手機應用程式介面	43
4.6	人臉偵測/辨識的比較	45
4.7	人臉偵測方法的比較	47

第五章    結論與未來展望	49
5.1	結論	49
5.2	未來展望	49
參考文獻	51

 
圖目錄
圖 1 1 現有人臉辨識門禁架構	4
圖 1 2 系統三大部件簡易架構	5
圖 2 1利用OpenCV實現人臉偵測	8
圖 3 1 Raspberry Pi4	17
圖 3 2 Pi Camera V2	18
圖 3 3 系統架構圖	20
圖3 4人臉檢測階段運作流程圖	22
圖 3 5權限檢測運作流程圖	23
圖 3 6密碼檢測運作流程圖	24
圖 4 1樹莓派端部署	25
圖 4 2整體系統部署架構圖	26
圖 4 3樹莓派套件引入	28
圖 4 4人臉偵測與鏡頭參數設定	28
圖 4 5人臉偵測前處理	29
圖 4 6人臉的偵測框選與儲存	30
圖 4 7與PostgreSQL資料庫的連線設定	31
圖 4 8權限檢測	32
圖 4 9 密碼檢測	33
圖 4 10 信件發送套件需求	34
圖 4 11 成功開門通知信件內容	34
圖4 12 開門失敗警告信件內容	35
圖 4 13信件附帶照片設定	35
圖 4 14 SMTP連接與身分驗證方法	36
圖 4 15使用者資訊資料表	37
圖 4 16一次性密碼資料表	37
圖 4 17 SQL插入資料	37
圖 4 18 Flask連接PostgreSQL參數設定	39
圖4 19 SQLAlchemy資料表設定	40
圖 4 20 使用者註冊帳號	41
圖4 21 使用者帳號登入	41
圖 4 22權限階級更動	42
圖 4 23 刪除指定子帳號	42
圖 4 24 OTP的生成與延遲刪除	43
圖 4 25 應用程式登入和註冊	44
圖 4 26應用程式一次性密碼生成	44
圖 4 27父帳號後端管理功能	45
圖 4 28人臉偵測耗費時間之實測結果	46
圖 4 29 Baseline人臉辨識耗費時間之實測結果	47
圖 4 30 HOG特徵人臉偵測耗費時間之實測結果	48

 
表目錄
表 3 1 Raspberry Pi 4規格	17
表 3 2 Pi Camera V2規格	18
表 3 3 個人電腦規格	19
參考文獻
[1]	W. Ali, G. Dustgeer, M. Awais and M. A. Shah, "IoT based smart home: Security challenges, security requirements and solutions," 2017 23rd International Conference on Automation and Computing (ICAC), Huddersfield, 2017, pp. 1-6, doi: 10.23919/IConAC.2017.8082057.
[2]	F. Aman and C. Anitha, "Motion sensing and image capturing based smart door system on android platform," 2017 International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS), Chennai, India, 2017, pp. 2346-2350, doi: 10.1109/ICECDS.2017.8389871.
[3]	J. Baikerikar, V. Kavathekar, N. Ghavate, R. Sawant and K. Madan, "Smart Door Locking Mechanism," 2021 4th Biennial International Conference on Nascent Technologies in Engineering (ICNTE), NaviMumbai, India, 2021, pp. 1-4, doi: 10.1109/ICNTE51185.2021.9487704.
[4]	M. Shanthini, G. Vidya and R. Arun, "IoT Enhanced Smart Door Locking System," 2020 Third International Conference on Smart Systems and Inventive Technology (ICSSIT), Tirunelveli, India, 2020, pp. 92-96, doi: 10.1109/ICSSIT48917.2020.9214288.
[5]	Saraf, T., Shukla, K., Balkhande, H., & Deshmukh, A. (2018). Automated door access control system using face recognition. IRJET, 5, 3036-3040.
[6]	N. H. Motlagh, M. Bagaa and T. Taleb, "UAV-Based IoT Platform: A Crowd Surveillance Use Case," in IEEE Communications Magazine, vol. 55, no. 2, pp. 128-134, February 2017, doi: 10.1109/MCOM.2017.1600587CM.
[7]	C. H. Chang, "Smart Classroom Roll Caller System with IOT Architecture," 2011 Second International Conference on Innovations in Bio-inspired Computing and Applications, Shenzhen, China, 2011, pp. 356-360, doi: 10.1109/IBICA.2011.94.
[8]	L. Y. Mano et al., “Exploiting IOT technologies for enhancing health smart homes through patient identification and emotion recognition,” Computer Communications, vol. 89–90, pp. 178–190, 2016. doi:10.1016/j.comcom.2016.03.010 .
[9]	P. Viola and M. Jones, “Robust real-time face detection,” Proceedings Eighth IEEE International Conference on Computer Vision. ICCV 2001, pp. 137--154, 2004. doi:10.1023/B:VISI.0000013087.49260.fb 
[10]	T. Ojala, M. Pietikainen and T. Maenpaa, "Multiresolution gray-scale and rotation invariant texture classification with local binary patterns," in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 24, no. 7, pp. 971-987, July 2002, doi: 10.1109/TPAMI.2002.1017623.
[11]	N. Dalal and B. Triggs, "Histograms of oriented gradients for human detection," 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05), San Diego, CA, USA, 2005, pp. 886-893 vol. 1, doi: 10.1109/CVPR.2005.177.
[12]	C. Sudar, S. K. Arjun and L. R. Deepthi, "Time-based one-time password for Wi-Fi authentication and security," 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Udupi, India, 2017, pp. 1212-1216, doi: 10.1109/ICACCI.2017.8126007.
[13]	M. Sahani, C. Nanda, A. K. Sahu and B. Pattnaik, "Web-based online embedded door access control and home security system based on face recognition," 2015 International Conference on Circuits, Power and Computing Technologies [ICCPCT-2015], Nagercoil, India, 2015, pp. 1-6, doi: 10.1109/ICCPCT.2015.7159473.
[14]	H. H. Lwin, A. S. Khaing, and H. M. Tun, "Automatic door access system using face recognition," international Journal of scientific & technology research, vol. 4, no. 6, pp. 294-299, 2015.
[15]	A. N. Patil, R. B. Ranavare, D. V. Ballal, and A. Kotekar, "Raspberry pi based face recognition system for door unlocking," International journal of innovative research in science and engineering, vol. 2, no. 3, pp. 735-738, 2016.
[16]	S. Yedulapuram, R. Arabelli, K. Mahender, and C. Sidhardha, "Automatic Door Lock System by Face Recognition," in IOP Conference Series: Materials Science and Engineering, 2020, vol. 981, no. 3, p. 032036: IOP Publishing.
[17]	A. Khan, S. Aisha, "Face Recognition Door Lock Using Raspberry Pi with AWS Recognition," International Journal of Engineering Development and Research(IJEDR), vol. 9, no. 3, pp. 155-158, 2021.
[18]	R. Saputra and N. Surantha, “Smart and real-time door lock system for an elderly user based on face recognition,” Bulletin of Electrical Engineering and Informatics, vol. 10, no. 3, pp. 1345-1355, 2021. doi:10.11591/eei.v10i3.2955 .
[19]	K. Prasade, S. Nalavade, and D. Pathak, "Face Recognition Based Door Locking System," International Research Journal of Engineering and Technology (IRJET), vol. 5, no. 7, pp. 1253-1255, 2018. 
[20]	T. Ahonen, A. Hadid, and M. Pietikäinen, “Face Recognition with Local Binary Patterns,” Lecture Notes in Computer Science, pp. 469–481, 2004, doi: https://doi.org/10.1007/978-3-540-24670-1_36.
[21]	R. Ganjoo and A. Purohit, "Anti-Spoofing Door Lock Using Face Recognition and Blink Detection," 2021 6th International Conference on Inventive Computation Technologies (ICICT), Coimbatore, India, 2021, pp. 1090-1096, doi: 10.1109/ICICT50816.2021.9358795.
[22]	Vercel , https://vercel.com/ ,  last accessed May, 2023.
[23]	Raspberry Pi , https://www.raspberrypi.com/ , last accessed May,  2023.
[24]	Github , https://github.com/ , last accessed May, 2023.
[25]	OpenCV Github haarcascades , https://github.com/opencv/opencv/tree/4.x/data/haarcascades ,  last accessed April, 2023.
[26]	PostgreSQL, https://www.postgresql.org/ ,last accessed May, 2023
[27]	Android Studio , https://developer.android.com/studio , last accessed April, 2023
[28]	Andriod 使用 WebView 內嵌網頁 , https://xyz.cinc.biz/2022/05/blog-post.html , last accessed April, 2023
[29]	OpenCV人臉辨識, https://steam.oxxostudio.tw/category/python/ai/ai-face-recognizer.html , last accessed April, 2023
論文全文使用權限
國家圖書館
同意無償授權國家圖書館,書目與全文電子檔於繳交授權書後, 於網際網路立即公開
校內
校內紙本論文立即公開
同意電子論文全文授權於全球公開
校內電子論文立即公開
校外
同意授權予資料庫廠商
校外電子論文立即公開

如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信