1. Trang chủ
  2. » Luận Văn - Báo Cáo

(Đồ án hcmute) ứng dụng máy học để phân loại kiểu dáng implant trong nha khoa

86 1 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC SƯ PHẠM KỸ THUẬT THÀNH PHỐ HỒ CHÍ MINH ĐỒ ÁN TỐT NGHIỆP NGÀNH KỸ THUẬT Y SINH ỨNG DỤNG MÁY HỌC ĐỂ PHÂN LOẠI KIỂU DÁNG IMPLANT TRONG NHA KHOA GVHD: ThS NGÔ BÁ VIỆT SVTH: NGUYỄN THỊ THẢO HIỀN VÕ MINH NHÃ TRÚC SKL008911 Tp.Hồ Chí Minh, tháng 6/2022 h BỘ GIÁO DỤC & ĐÀO TẠO TRƯỜNG ĐẠI HỌC SƯ PHẠM KỸ THUẬT TP HỒ CHÍ MINH KHOA ĐIỆN – ĐIỆN TỬ BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH - KHÓA LUẬN TỐT NGHIỆP NGÀNH KỸ THUẬT Y SINH ĐỀ TÀI: ỨNG DỤNG MÁY HỌC ĐỂ PHÂN LOẠI KIỂU DÁNG IMPLANT TRONG NHA KHOA GVHD: ThS Ngô Bá Việt SVTH1: Nguyễn Thị Thảo Hiền MSSV1: 18129020 SVTH2: Võ Minh Nhã Trúc MSSV2: 17129058 Tp Hồ Chí Minh - 6/2022 h BỘ GIÁO DỤC & ĐÀO TẠO TRƯỜNG ĐẠI HỌC SƯ PHẠM KỸ THUẬT TP HỒ CHÍ MINH KHOA ĐIỆN – ĐIỆN TỬ BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH - KHÓA LUẬN TỐT NGHIỆP NGÀNH KỸ THUẬT Y SINH ĐỀ TÀI: ỨNG DỤNG MÁY HỌC ĐỂ PHÂN LOẠI KIỂU DÁNG IMPLANT TRONG NHA KHOA GVHD: ThS Ngô Bá Việt SVTH1: Nguyễn Thị Thảo Hiền MSSV1: 18129020 SVTH2: Võ Minh Nhã Trúc MSSV2: 17129058 Tp Hồ Chí Minh - 6/2022 h TRƯỜNG ĐH SPKT TP HỒ CHÍ MINH CỘNG HỊA XÃ HỘI CHỦ NGHĨA VIỆT NAM KHOA ĐIỆN-ĐIỆN TỬ ĐỘC LẬP - TỰ DO - HẠNH PHÚC BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH o0o -Tp HCM, ngày 19 tháng năm 2022 NHIỆM VỤ KHÓA LUẬN TỐT NGHIỆP Họ tên sinh viên: Nguyễn Thị Thảo Hiền MSSV: 18129020 Võ Minh Nhã Trúc MSSV: 17129058 Chuyên ngành: Kỹ thuật Y Sinh Mã ngành: 129 Hệ đào tạo: Đại học quy Mã hệ: I TÊN ĐỀ TÀI: ỨNG DỤNG MÁY HỌC ĐỂ PHÂN LOẠI KIỂU DÁNG IMPLANT TRONG NHA KHOA II NHIỆM VỤ Các số liệu ban đầu: - Ngôn ngữ sử dụng: Python - Phần mềm: Pycharm, Qt designer - Tập liệu: Dữ liệu ảnh gồm đặc điểm phân loại Implant lấy từ nguồn truy cập trực tuyến thuộc Trung tâm cấy ghép Nha khoa Revive Mesa, Arizona, Hoa Kỳ - Sử dụng mơ hình mạng nơ-ron tích chập VGG16 để phân loại ảnh Implant Nội dung thực hiện: - Thu thập liệu hình ảnh từ nguồn truy cập trực tuyến phân chia liệu theo kiểu đặc điểm cần phân loại - Xây dựng mơ hình huấn luyện phân loại đặc điểm Implant - Tiến hành cho máy học, điều chỉnh đánh giá kết thực - Thiết kế giao diện hiển thị kết phân loại III NGÀY GIAO NHIỆM VỤ: 25/02/2022 IV NGÀY HOÀN THÀNH NHIỆM VỤ: 19/06/2022 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h i V HỌ VÀ TÊN CÁN BỘ HƯỚNG DẪN: CÁN BỘ HƯỚNG DẪN ThS Ngô Bá Việt BM ĐIỆN TỬ CÔNG NGHIỆP – Y SINH BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h ii 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 TRƯỜNG ĐH SPKT TP HỒ CHÍ MINH CỘNG HỊA XÃ HỘI CHỦ NGHĨA VIỆT NAM KHOA ĐIỆN-ĐIỆN TỬ ĐỘC LẬP - TỰ DO - HẠNH PHÚC BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH o0o -Tp HCM, ngày 19 tháng năm 2022 LỊCH TRÌNH THỰC HIỆN KHÓA LUẬN TỐT NGHIỆP Họ tên sinh viên 1: Nguyễn Thị Thảo Hiền Lớp: 181290B MSSV: 18129020 Họ tên sinh viên 2: Võ Minh Nhã Trúc Lớp: 171290A MSSV: 17129058 Tên đề tài: ỨNG DỤNG MÁY HỌC ĐỂ PHÂN LOẠI KIỂU DÁNG IMPLANT TRONG NHA KHOA Tuần/ngày Nội dung Xác nhận GVHD - Gặp GVHD để nghe phổ biến yêu cầu Tuần (21/2 – 27/2) làm đồ án, tiến hành chọn đề tài - GVHD tiến hành xét duyệt đề tài - Tóm tắt yêu cầu đề tài chọn bao gồm Tuần bước cần phải làm, xây dựng mơ hình (28/2 – 6/3) - Tiến hành viết đề cương KLTN Tuần – Tuần (7/3 – 27/3) - Tìm hiểu mạng nơ-ron tích chập - Tìm hiểu, liệt kê phân loại đặc điểm Implant Tuần – Tuần - Viết chương trình xây dựng mơ hình (28/3 – 10/4) phân loại Implant mạng CNN Tuần – Tuần 11 (11/4 – 1/5) - Hiệu chỉnh mơ hình, xây dựng mơ hình phân loại cho đặc điểm nhận dạng 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h iii 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 Tuần 12 – Tuần 14 (2/5 – 22/5) Tuần 15 – Tuần 17 - Thiết kế giao diện chọn hiển thị kết phân loại - Viết báo cáo - Viết hoàn thành báo cáo (23/5 – 12/6) - Hiệu chỉnh chương trình giao diện Tuần 18 – Tuần 19 - GVHD xét duyệt chỉnh sửa báo cáo (13/6 – 19/6) - Chỉnh sửa báo cáo GV HƯỚNG DẪN (Ký ghi rõ họ tên) 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h iv 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 LỜI CAM ĐOAN Đề tài nhóm tự thực dựa vào nỗ lực cố gắng hướng dẫn thầy hướng dẫn Th.S Ngô Bá Việt Mọi tài liệu đề tài tham khảo trích phần tài liệu tham khảo hồn tồn khơng chép từ tài liệu hay cơng trình có trước Mọi vi phạm nhóm xin chịu trách nhiệm Nhóm sinh viên thực đề tài Nguyễn Thị Thảo Hiền Võ Minh Nhã Trúc 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h v 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 LỜI CẢM ƠN Lời cảm ơn mà nhóm muốn gửi đến khơng khác thầy Ngơ Bá Việt Cảm ơn thầy tận tâm hướng dẫn, góp ý, bảo, giúp đỡ nhóm lúc khó khăn Ngồi ra, nhờ lời động viên thầy giúp nhóm có thêm niềm tin thân hồn thành nhiệm vụ giao Nhóm xin gửi lời cảm ơn đến tất quý thầy cô khoa Điện - Điện Tử nói chung mơn Điện tử Cơng nghiệp – Y sinh nói riêng bỏ nhiều tâm huyết, thời gian để truyền đạt kiến thức suốt trình học tập Trường Đại học Sư phạm Kỹ thuật Thành phố Hồ Chí Minh Lời cảm ơn này, chúng xin gửi đến bố mẹ, gia đình ln sát cánh, động viên tạo điều kiện để chúng học tập, lao động thật tốt Và cuối cùng, nhóm xin gửi lời cảm ơn đến tập thể lớp 171290 - 181290 người sẵn sàng sẻ chia, ủng hộ giúp đỡ nhóm học tập sống Thời sinh viên chẳng thể trọn vẹn khơng có người cạnh bên Tuy có nhiều cố gắng, song đề tài khơng thể tránh khỏi thiếu sót Nhóm hy vọng nhận đóng góp, chia sẻ người đặc biệt từ quý thầy cô, người quan tâm đến đề tài để nhóm cải thiện hoàn thiện Xin chân thành cảm ơn! Nhóm sinh viên thực đề tài Nguyễn Thị Thảo Hiền Võ Minh Nhã Trúc 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h vi 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 MỤC LỤC NHIỆM VỤ KHÓA LUẬN TỐT NGHIỆP i LỊCH TRÌNH THỰC HIỆN KHÓA LUẬN TỐT NGHIỆP iii LỜI CAM ĐOAN .v LỜI CẢM ƠN vi MỤC LỤC vii LIỆT KÊ HÌNH VẼ ix LIỆT KÊ BẢNG xi DANH SÁCH CÁC TỪ VIẾT TẮT xii DANH SÁCH CÁC THUẬT NGỮ xiii TÓM TẮT xiv Chương TỔNG QUAN 1.1 ĐẶT VẤN ĐỀ .1 1.2 MỤC TIÊU 1.3 NỘI DUNG NGHIÊN CỨU 1.4 GIỚI HẠN .3 1.5 BỐ CỤC Chương CƠ SỞ LÝ THUYẾT 2.1 CÔNG NGHỆ CẤY GHÉP IMPLANT 2.2 MỘT SỐ PHƯƠNG PHÁP PHÂN LOẠI IMPLANT .7 2.2.1 Phương pháp máy vector hỗ trợ 2.2.2 Phương pháp K-Nearest Neighbors 2.2.3 Phương pháp mạng nơ-ron nhân tạo 10 2.2.4 Phương pháp mạng nơ-ron tích chập 12 2.3 KỸ THUẬT HỌC CHUYỂN GIAO 17 Chương XÂY DỰNG MƠ HÌNH PHÂN LOẠI IMPLANT 21 3.1 GIỚI THIỆU .21 3.2 SƠ ĐỒ KHỐI 21 3.3 TẬP DỮ LIỆU 22 3.4 TIỀN XỬ LÝ 23 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h vii 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 TÀI LIỆU THAM KHẢO [31] Sarang Narkhede, “Understanding Confusion Matrix”, Towards Data Science, https://towardsdatascience.com/understanding-confusion-matrix-, 2018 [32] Huy Tuong, “Tạo Ứng Dụng Desktop Đơn Giản Với Python” Codelearn.io, https://codelearn.io/sharing/tao-ung-dung-desktop-voi-python, 2020 [33] PYQT6, “PyPI”, https://pypi.org/project/PyQt6/, 2022 [34] QT Documentation, “QT Designer Manual”, https://doc.qt.io/qt-5/qtdesignermanual.html [35] “Stackoverflow converting ui file into py using pyside6” https://stackoverflow.com/questions/69077280/converting-ui-file-into-py-usingpyside6 [36] Lập trình bản, “Đóng gói chương trình python với Pyinstaller”, https://laptrinhcanban.com/python/nhap-mon-lap-trinh-python/dong-goi-chuongtrinh-python/dong-goi-chuong-trinh-python-pyinstaller/ [37] Sevda Kurt Bayrakdar and Kaan Orhan, “A deep learning approach for dental implant planning in cone-beam computed tomography images”, BMC Medical Imaging, doi: 10.1186/s12880-021-00618-z, 2021 [38] Toshihito Takahashi and Kazunori Nozaki, “Identification of dental implants using deep learning-pilot study”, International journal of implant dentistry, doi: 10.1186/s40729-020-00250-6, 2020 [39] Thomas Wood, “Convolutional Neural Network”, Machine Learning Glossary and Terms, DeepAI, https://deepai.org/machine-learning-glossary-and- terms/convolutional-neural-network [40] Nguyen Van Dat, “[Deep Learning]: Break hệ thống captcha dễ hay khó?”, Viblo, https://viblo.asia/p/deep-learning-break-1-he-thong-captcha-de-hay-khom68Z0pgzZkG, 2020 [41] Hồng Thị Ngọc Lan, Huỳnh Hoàng Duy Linh, “Phân loại ảnh MRI u não sử dụng phương pháp CNN”, Đồ án Tốt nghiệp, trường ĐHSPKT, Tp.HCM, 2021 [42] Ngô Thị Anh Thư, Phạm Thiên Vương, “Ứng dụng xử lý ảnh AI để nhận biết bệnh viêm phổi trẻ em”, Đồ án Tốt nghiệp, trường ĐHSPKT, Tp.HCM, 2020 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 55 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 TÀI LIỆU THAM KHẢO [43] Nguyễn Thị Thu Hương, Nguyễn Thị Minh Tính, “Phân loại bệnh da sử dụng mạng nơ-ron”, Đồ án Tốt nghiệp, trường ĐHSPKT, Tp.HCM, 2021 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 56 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC PHỤ LỤC Mơ hình mạng CNN ❖ Mơ hình phân loại kiểu ren, kiểu đuôi: # Build the Image Data Generator train_generator = ImageDataGenerator(fill_mode= 'nearest',rotation_range=15, validation_split=0.1) # Build the model base_model = VGG16(weights= 'imagenet', input_tensor= Input(shape = (180, 70, 3)), include_top= False) base_input = base_model.input base_output = base_model.output base_output = Flatten(name="flatten")(base_output) base_output = Dense(1024, activation="relu")(base_output) base_output = Dense(256, activation="relu")(base_output) base_output = Dense(2, activation="softmax")(base_output) # Freeze the layers for layer in base_model.layers: layer.trainable = False # Compile the model model = Model(inputs = base_input, outputs = base_output) model.compile(optimizer= Adam(learning_rate= 1e-3), metrics= ['accuracy'], loss= 'binary_crossentropy') batch_size = 32 train_steps = len(train_X) // batch_size validation_steps = len(test_X) // batch_size epochs = 200 ❖ Mơ hình phân loại kiểu đầu # Build the Image Data Generator train_generator = ImageDataGenerator(fill_mode= 'nearest',rotation_range=15, validation_split=0.1) # Build the model base_model = VGG16(weights= 'imagenet', input_tensor= Input(shape = (180, 70, 3)), include_top= False) base_input = base_model.input base_output = base_model.output base_output = Flatten(name="flatten")(base_output) base_output = Dense(1024, activation="relu")(base_output) base_output = Dense(512, activation="relu")(base_output) base_output = Dense(256, activation="relu")(base_output) base_output = Dense(3, activation="softmax")(base_output) # Freeze the layers for layer in base_model.layers: layer.trainable = False 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 57 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC # Compile the model model = Model(inputs = base_input, outputs = base_output) model.compile(optimizer= Adam(learning_rate= 1e-3), metrics= ['accuracy'], loss= 'binary_crossentropy') batch_size = 32 train_steps = len(train_X) // batch_size validation_steps = len(test_X) // batch_size epochs = 200 ❖ Mơ hình phân loại kiểu thân: # Build the Image Data Generator train_generator = ImageDataGenerator(fill_mode= 'nearest',rotation_range=15, validation_split=0.1) # Build the model base_model = VGG16(weights= 'imagenet', input_tensor= Input(shape = (180, 70, 3)), include_top= False) base_input = base_model.input base_output = base_model.output base_output = Flatten(name="flatten")(base_output) base_output = Dense(1024, activation="relu")(base_output) base_output = Dense(512, activation="relu")(base_output) base_output = Dense(256, activation="relu")(base_output) base_output = Dense(128, activation="relu")(base_output) base_output = Dense(3, activation="softmax")(base_output) # Freeze the layers for layer in base_model.layers: layer.trainable = False # Compile the model model = Model(inputs = base_input, outputs = base_output) model.compile(optimizer= Adam(learning_rate= 1e-3), metrics= ['accuracy'], loss= 'binary_crossentropy') batch_size = 16 train_steps = len(train_X) // batch_size validation_steps = len(test_X) // batch_size epochs = 200 Thiết kế giao diện Phân loại Implant ❖ UI_main.py from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, QMetaObject, QObject, QPoint, QRect, QSize, QTime, QUrl, Qt) from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, QGradient, QIcon, QImage, QKeySequence, QLinearGradient, QPainter, QPalette, QPixmap, QRadialGradient, 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 58 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC QTransform) from PySide6.QtWidgets import (QApplication, QComboBox, QGroupBox, QLabel, QLineEdit, QMainWindow, QMenu, QMenuBar, QPushButton, QSizePolicy, QStatusBar, QWidget) # import resource_rc class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(662, 798) MainWindow.setMinimumSize(QSize(655, 655)) MainWindow.setMaximumSize(QSize(1000, 1000)) self.actionIntroduction = QAction(MainWindow) self.actionIntroduction.setObjectName(u"actionIntroduction") self.actionLogout = QAction(MainWindow) self.actionLogout.setObjectName(u"actionLogout") self.actionLight_theme = QAction(MainWindow) self.actionLight_theme.setObjectName(u"actionLight_theme") self.actiondark = QAction(MainWindow) self.actiondark.setObjectName(u"actiondark") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.image_btn = QPushButton(self.centralwidget) self.image_btn.setObjectName(u"image_btn") self.image_btn.setGeometry(QRect(10, 10, 121, 31)) self.path_edit = QLabel(self.centralwidget) self.path_edit.setObjectName(u"path_edit") self.path_edit.setGeometry(QRect(140, 20, 281, 16)) self.method_box = QComboBox(self.centralwidget) self.method_box.addItem("") self.method_box.addItem("") self.method_box.addItem("") self.method_box.addItem("") self.method_box.setObjectName(u"method_box") self.method_box.setGeometry(QRect(440, 10, 131, 31)) self.analysis_btn = QPushButton(self.centralwidget) self.analysis_btn.setObjectName(u"analysis_btn") self.analysis_btn.setGeometry(QRect(575, 10, 71, 31)) self.groupBox_2 = QGroupBox(self.centralwidget) self.groupBox_2.setObjectName(u"groupBox_2") self.groupBox_2.setGeometry(QRect(10, 530, 641, 71)) self.result_edit = QLineEdit(self.groupBox_2) self.result_edit.setObjectName(u"result_edit") self.result_edit.setGeometry(QRect(10, 20, 621, 41)) self.image_display = QLabel(self.centralwidget) self.image_display.setObjectName(u"image_display") 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 59 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC self.image_display.setGeometry(QRect(10, 50, 640, 480)) self.image_display.setStyleSheet(u"background-color: rgb(166, 166, 166);") self.label = QLabel(self.centralwidget) self.label.setObjectName(u"label") self.label.setGeometry(QRect(380, 620, 91, 91)) self.label.setStyleSheet(u"image: url(E:/implant system/app/ui_files/logo/truong.png);") self.label_2 = QLabel(self.centralwidget) self.label_2.setObjectName(u"label_2") self.label_2.setGeometry(QRect(470, 630, 81, 71)) self.label_2.setStyleSheet(u"image: url(E:/implant system/app/ui_files/logo/Khoa.jpg);") self.label_3 = QLabel(self.centralwidget) self.label_3.setObjectName(u"label_3") self.label_3.setGeometry(QRect(560, 630, 81, 71)) self.label_3.setStyleSheet(u"image: url(E:/implant system/app/ui_files/logo/nganh.png);") self.label_4 = QLabel(self.centralwidget) self.label_4.setObjectName(u"label_4") self.label_4.setGeometry(QRect(30, 620, 341, 31)) self.label_4.setStyleSheet(u"font: 10pt \"MS Shell Dlg 2\";") self.label_5 = QLabel(self.centralwidget) self.label_5.setObjectName(u"label_5") self.label_5.setGeometry(QRect(30, 660, 111, 21)) self.label_5.setStyleSheet(u"font: 9pt \"MS Shell Dlg 2\";") self.label_6 = QLabel(self.centralwidget) self.label_6.setObjectName(u"label_6") self.label_6.setGeometry(QRect(30, 690, 311, 21)) self.label_6.setStyleSheet(u"\n" "font: 9pt \"MS Shell Dlg 2\";") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(MainWindow) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 662, 22)) self.menumenu = QMenu(self.menubar) self.menumenu.setObjectName(u"menumenu") self.menuThemes = QMenu(self.menumenu) self.menuThemes.setObjectName(u"menuThemes") MainWindow.setMenuBar(self.menubar) self.statusBar = QStatusBar(MainWindow) self.statusBar.setObjectName(u"statusBar") MainWindow.setStatusBar(self.statusBar) self.menubar.addAction(self.menumenu.menuAction()) self.menumenu.addAction(self.actionIntroduction) self.menumenu.addAction(self.menuThemes.menuAction()) self.menumenu.addAction(self.actionLogout) 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 60 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC self.menuThemes.addAction(self.actionLight_theme) self.menuThemes.addAction(self.actiondark) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow) # setupUi def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) self.actionIntroduction.setText(QCoreApplication.translate("MainWindow", u"Introduction", None)) self.actionLogout.setText(QCoreApplication.translate("MainWindow", u"Logout", None)) self.actionLight_theme.setText(QCoreApplication.translate("MainWindow", u"light", None)) self.actiondark.setText(QCoreApplication.translate("MainWindow", u"dark", None)) self.image_btn.setText(QCoreApplication.translate("MainWindow", u"Load image", None)) self.path_edit.setText(QCoreApplication.translate("MainWindow", u"insert images path ", None)) self.method_box.setItemText(0, QCoreApplication.translate("MainWindow", u"Choose methods", None)) self.method_box.setItemText(1, QCoreApplication.translate("MainWindow", u"Threaded", None)) self.method_box.setItemText(2, QCoreApplication.translate("MainWindow", u"Tapered", None)) self.method_box.setItemText(3, QCoreApplication.translate("MainWindow", u"Apex", None)) self.analysis_btn.setText(QCoreApplication.translate("MainWindow", u"Analysis", None)) self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow", u"Result", None)) self.image_display.setText("") self.label.setText("") self.label_2.setText("") self.label_3.setText("") self.label_4.setText(QCoreApplication.translate("MainWindow", u"Tr\u01b0\u1eddng \u0110H S\u01b0 ph\u1ea1m K\u1ef9 thu\u1eadt TP H\u1ed3 Ch\u00ed Minh", None)) self.label_5.setText(QCoreApplication.translate("MainWindow", u"Ng\u01b0\u1eddi th\u1ef1c hi\u1ec7n:", None)) 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 61 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC self.label_6.setText(QCoreApplication.translate("MainWindow", u"Nguy\u1ec5n Th\u1ecb Th\u1ea3o Hi\u1ec1n - V\u00f5 Minh Nh\u00e3 Tr\u00fac", None)) self.menumenu.setTitle(QCoreApplication.translate("MainWindow", u"Menu", None)) self.menuThemes.setTitle(QCoreApplication.translate("MainWindow", u"Themes", None)) # retranslateUi ❖ Analysis_function.py from modules import * from dialog import CustomMessageDialog from PySide6.QtWidgets import QGraphicsDropShadowEffect, QMessageBox, QFileDialog from PySide6.QtGui import QColor, QImage, QPixmap from PySide6.QtCore import Qt import tensorflow as tf import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import keras import os.path from pathlib import Path from sklearn.model_selection import train_test_split from tensorflow.keras.layers import Input from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.image import ImageDataGenerator from sklearn.metrics import classification_report, confusion_matrix from tensorflow.keras.preprocessing import image os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' class AnalysisFunctions(MainWindow): def error_result_handle(self): title = str("error:") message = str('problems happened in the analysis process.\n' 'Please try again.') dialog = CustomMessageDialog(message, title) if dialog.exec_(): AnalysisFunctions.reset(self) return else: AnalysisFunctions.reset(self) def threaded_analysis(self): 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 62 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC savedModel = keras.models.load_model(r'E:\implant system\app\models\AFinal_kieu_ren.h5') test_image = image.load_img(self.image, target_size=(180, 70, 3)) test_image = image.img_to_array(test_image) test_image = np.expand_dims(test_image, axis=0) result = savedModel.predict(test_image) a = np.round(result) if (a == [1, 0]).all(): prediction = 'V-Shaped Threads' elif (a == [0, 1]).all(): prediction = 'Reverse Buttress' else: prediction = 'Not found' if AnalysisFunctions.progress_run(self): try: self.result_edit.setText(prediction) except: AnalysisFunctions.error_result_handle() def tapered_analysis(self): savedModel = keras.models.load_model(r'E:\implant system\app\models\AFinal_kieu_than.h5') test_image = image.load_img(self.image, target_size=(180, 70, 3)) test_image = image.img_to_array(test_image) test_image = np.expand_dims(test_image, axis=0) result = savedModel.predict(test_image) a = np.round(result) if (a == [1, 0, 0]).all(): prediction = 'Tapered' elif (a == [0, 1, 0]).all(): prediction = 'TaperedApex' elif (a == [0, 0, 1]).all(): prediction = 'NonTapered' else: prediction = 'Not found' if AnalysisFunctions.progress_run(self): try: self.result_edit.setText(prediction) except: AnalysisFunctions.error_result_handle() def apex_analysis(self): savedModel = keras.models.load_model(r'E:\implant system\app\models\AFinal_kieu_duoi.h5') test_image = image.load_img(self.image, target_size=(180, 70, 3)) test_image = image.img_to_array(test_image) test_image = np.expand_dims(test_image, axis=0) 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 63 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC result = savedModel.predict(test_image) a = np.round(result) if (a == [1, 0]).all(): prediction = 'Curved' elif (a == [0, 1]).all(): prediction = 'Flat' else: prediction = 'Not found' if AnalysisFunctions.progress_run(self): try: self.result_edit.setText(prediction) except: AnalysisFunctions.error_result_handle() def head_analysis(self): savedModel = keras.models.load_model(r'E:\implant system\app\models\AFinal_kieu_dau.h5') test_image = image.load_img(self.image, target_size=(180, 70, 3)) test_image = image.img_to_array(test_image) test_image = np.expand_dims(test_image, axis=0) result = savedModel.predict(test_image) a = np.round(result) if (a == [1, 0, 0]).all(): prediction = 'Wider' elif (a == [0, 1, 0]).all(): prediction = 'Flared' elif (a == [0, 0, 1]).all(): prediction = 'Straight' else: prediction = 'Not found' if AnalysisFunctions.progress_run(self): try: self.result_edit.setText(prediction) except: AnalysisFunctions.error_result_handle() def confirm_analysis(self): if AnalysisFunctions.progress_run(self): method = self.method_box.currentText().strip() if method == str('Choose methods'): self.option = method return title = str("confirm:") confirm_message = str(f'Confirm to analysis by {method} (Y/N)?') dialog = CustomMessageDialog(confirm_message, title) if dialog.exec_(): 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 64 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC style_str = "QPushButton {background-color: #007300; color: #000000;}" \ "QPushButton:hover {" \ "background-color: rgb(240, 240, 240);" \ "color:#000000;}" \ "QPushButton:pressed {" \ "background-color: rgb(65, 64, 66);" \ "color: rgb(240, 235, 225);}" self.analysis_btn.setStyleSheet(style_str) self.option = method else: return def error_analysis_handle(self, message): title = str("error:") dialog = CustomMessageDialog(message, title) if dialog.exec_(): style_str = "QPushButton {background-color: #c30000; color: #000000;}" \ "QPushButton:hover {" \ "background-color: rgb(240, 240, 240);" \ "color:#000000;}" \ "QPushButton:pressed {" \ "background-color: rgb(65, 64, 66);" \ "color: rgb(240, 235, 225);}" self.analysis_btn.setStyleSheet(style_str) AnalysisFunctions.reset(self) def progress_run(self, plus=0.0005): self.completed = self.progressBar.setValue(0) while self.completed < 100: self.statusBar.showMessage('in Progress ') self.completed += plus self.progressBar.setValue(self.completed) self.statusBar.showMessage('ready') return True def start_analysis(self): if AnalysisFunctions.progress_run(self): if self.option == str('Choose methods'): AnalysisFunctions.error_analysis_handle(self, "Make sure you choose the right analysis method!") else: if self.method_box.currentText() == 'Threaded': AnalysisFunctions.threaded_analysis(self) 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 65 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC elif self.method_box.currentText() == 'Tapered': AnalysisFunctions.tapered_analysis(self) elif self.method_box.currentText() == 'Apex': AnalysisFunctions.apex_analysis(self) elif self.method_box.currentText() == 'Head': AnalysisFunctions.head_analysis(self) def error_loading_handle(self): title = str("error:") message = str('error loading images.\n' 'Please try again.') dialog = CustomMessageDialog(message, title) if dialog.exec_(): AnalysisFunctions.reset(self) return else: AnalysisFunctions.reset(self) def image_loading(self): if AnalysisFunctions.progress_run(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog filename, _ = QFileDialog.getOpenFileName(self, "Implantsystem", "", "Images (*.png *.jpg)", options=options) if filename: if AnalysisFunctions.progress_run(self,plus=0.0001): try: self.image = filename self.path_edit.setText(self.image) pixmap = QPixmap(self.image) pixmap = pixmap.scaled(640, 480, Qt.KeepAspectRatio) self.image_display.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) self.image_display.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) self.image_display.setPixmap(QPixmap(pixmap)) self.image_display.repaint() except: self.image = None AnalysisFunctions.error_loading_handle(self) def logout_handle(self): title = str("Logout:") message = str('Logout of system?(Y/N)') dialog = CustomMessageDialog(message, title) if dialog.exec_(): self.close() else: return 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 66 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC def introduction_message_handle(self): title = str("Introduction:") message = str('You can describe your system here.\n' ' ') dialog = CustomMessageDialog(message, title) if dialog.exec_(): return def reset(self): self.path_edit.clear() self.image_display.clear() self.statusBar.showMessage('Error') self.progressBar.setValue(0) ❖ init_.py from analysis_function import AnalysisFunctions ❖ Modules.py from main import MainWindow ❖ Main.py from PySide6.QtWidgets import QApplication, QMainWindow, QProgressBar from PySide6.QtCore import Qt, QCoreApplication, QTimer from PySide6.QtGui import QScreen import serial import sys from qdarktheme import load_stylesheet, get_themes import ui_files import functions def toggle_theme(theme) -> None: stylesheet = load_stylesheet(theme) QApplication.instance().setStyleSheet(stylesheet) class MainWindow(QMainWindow, ui_files.Ui_MainWindow): # -def init (self): """Constructor""" super(). init () self.setupUi(self) self.result_edit.setReadOnly(True) self.setWindowTitle('Implant Analysis System') 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 67 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 PHỤ LỤC self.statusBar.showMessage('Ready') self.progressBar = QProgressBar() self.statusBar.addPermanentWidget(self.progressBar) self.method_box.addItem("Heads") # setup status bar self.progressBar.setGeometry(30, 40, 100, 10) self.progressBar.setValue(10) # self.progressBar.setHidden(True) self.actionLight_theme.triggered.connect(lambda: toggle_theme('light')) self.actiondark.triggered.connect(lambda: toggle_theme('dark')) self.actionLogout.triggered.connect(lambda: functions.AnalysisFunctions.logout_handle(self)) self.actionIntroduction.triggered.connect(lambda: functions.AnalysisFunctions.introduction_message_handle(self)) # main variables: self.option = self.method_box.currentText() self.completed = self.image = None # set widget signals: self.method_box.currentIndexChanged.connect(lambda: functions.AnalysisFunctions.confirm_analysis(self)) self.analysis_btn.clicked.connect(lambda: functions.AnalysisFunctions.start_analysis(self)) self.image_btn.clicked.connect(lambda: functions.AnalysisFunctions.image_loading(self)) # Press the green button in the gutter to run the script if name == ' main ': # setting screen to the center app = QApplication(sys.argv) QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts) centerPoint = QScreen.availableGeometry(app.primaryScreen()).center() window = MainWindow() fg = window.frameGeometry() fg.moveCenter(centerPoint) window.move(fg.topLeft()) # setup stylesheet app.setStyleSheet(load_stylesheet(theme="light")) # run window.show() app.exec() 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99 BỘ MÔN ĐIỆN TỬ CÔNG NGHIỆP – Y SINH h 68 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.C.33.44.55.54.78.655.43.22.2.4.55.2237.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.66 37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.55.77.77.99.44.45.67.22.55.77.C.37.99.44.45.67.22.99

Ngày đăng: 07/09/2023, 23:18

Xem thêm:

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w