Ứng dụng trí tuệ nhân tạo để đánh giá chất lượng của trái dừa xuất khẩu

104 3 0
Ứng dụng trí tuệ nhân tạo để đánh giá chất lượng của trái dừa xuất khẩu

Đ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 LUẬN VĂN THẠC SĨ TRẦN THỊ THẢO VY ỨNG DỤNG TRÍ TUỆ NHÂN TẠO ĐỂ ĐÁNH GIÁ CHẤT LƯỢNG CỦA TRÁI DỪA XUẤT KHẨU NGÀNH: KỸ THUẬT CƠ ĐIỆN TỬ Tp Hồ Chí Minh, tháng 11/2022 TRƯỜNG ĐẠI HỌC SƯ PHẠM KỸ THUẬT THÀNH PHỐ HỒ CHÍ MINH LUẬN VĂN THẠC SĨ TRẦN THỊ THẢO VY ỨNG DỤNG TRÍ TUỆ NHÂN TẠO ĐỂ ĐÁNH GIÁ CHẤT LƯỢNG CỦA TRÁI DỪA XUẤT KHẨU NGÀNH: KỸ THUẬT CƠ ĐIỆN TỬ - 1920907 Hướng dẫn khoa học: PGS.TS NGUYỄN TRƯỜNG THỊNH Tp Hồ Chí Minh, tháng 11/2022 LÝ LỊCH KHOA HỌC I LÝ LỊCH SƠ LƯỢC: Họ & tên: Trần Thị Thảo Vy Giới tính: Nữ Ngày, tháng, năm sinh: 06/07/1991 Nơi sinh: Tây Ninh Quê quán: Tây Ninh Dân tộc: Kinh Chỗ riêng địa liên lạc: Trại Bí, Tân Phong, Tân Biên, Tây Ninh Chức vụ, đơn vị công tác trước học tập, nghiên cứu: Tư vấn Đào tạo & Phát triển, công ty TNHH SMC Corporation Việt Nam Điện thoại nhà riêng: 089 996 7723 E-mail: vytranspkt710@gmail.com II QUÁ TRÌNH ĐÀO TẠO: Trung học chuyên nghiệp: Hệ đào tạo: Thời gian đào tạo từ ……/…… đến ……/ …… Nơi học (trường, thành phố): Ngành học: Đại học: Hệ đào tạo: Chính quy Thời gian đào tạo từ 09/2011 đến 05/2016 Nơi học (trường, thành phố): Trường Đại học Sư phạm Kỹ thuật Tp Hồ Chí Minh Ngành học: Sư phạm Kỹ thuật Công nghiệp Tên đồ án, luận án môn thi tốt nghiệp: “Thiết kế giảng phương pháp kiểm tra đánh giá vật liệu” Ngày & nơi bảo vệ đồ án, luận án thi tốt nghiệp: 29/07/2015 phòng Vật liệu học thuộc khoa Cơ khí chế tạo máy Người hướng dẫn: ThS Nguyễn Văn Thức i III Q TRÌNH CƠNG TÁC CHUN MƠN KỂ TỪ KHI TỐT NGHIỆP ĐẠI HỌC: Thời gian Từ tháng 08 đến tháng 12 năm 2015 Nơi công tác Cơng việc đảm nhiệm Cơng ty TNHH Cơ Khí – Thương Hỗ trợ kỹ thuật: vẽ chi tiết máy, tính toán khối lượng máy Mại Lê Duyên Anh Nhân viên kinh doanh (2016Từ tháng 02/2016 đến 2018) Công ty TNHH SMC Corporation Chuyên viên đào tạo kỹ thuật Việt Nam (2018-2021) Tư vấn Đào tạo & Phát triển (2021-2022) ii LỜI CAM ĐOAN Tôi cam đoan công trình nghiên cứu tơi Các số liệu, kết nêu luận văn trung thực chưa cơng bố cơng trình khác Tp Hồ Chí Minh, ngày … tháng 11 năm 2022 (Ký tên ghi rõ họ tên) Trần Thị Thảo Vy iii LỜI CẢM ƠN Trong khoá học Trường Đại học Sư Phạm Kỹ Thuật TP.HCM, em đã nhận tận tình dạy dỗ quý Thầy (Cô) về kiến thức chuyên môn cũng kiến thức sống Từ kiến thức quý Thầy (Cơ) trùn đạt đã giúp em hồn thành Chun đề thời gian cho phép Em xin chân thành cảm ơn quý Thầy (Cô) đã giảng dạy em kiến thức về chuyên môn giúp em định hướng theo hiểu biết khả để em thực tốt đề tài “Ứng dụng trí tuệ nhân tạo để đánh giá chất lượng trái dừa xuất khẩu” tạo điều kiện thuận lợi cho em hồn thành khố học Trong suốt trình thực đồ án hoàn thành báo cáo đã nhận giúp đỡ, hướng dẫn quý báu thầy, anh chị bạn khóa học Với lịng kính trọng biết ơn sâu sắc, chúng em xin bày tỏ lời cảm ơn chân thành tới: Thầy PGS TS Nguyễn Trường Thịnh, người thầy kính mến đã hết lịng giúp đỡ, dạy bảo, tạo điều kiện thuận lợi cho chúng em trình thực đồ án Một lần xin gửi lời tri ân sâu sắc đến q Thầy (Cơ), anh chị bạn Ngồi ra, em cũng hết lịng biết ơn gia đình, bạn bè đã hết lòng giúp đỡ, động viên, ủng hộ đóng góp ý kiến cho em suốt thời gian thực Chuyên đề Chúc quý Thầy (Cô) sức khỏe thành công Em xin chân thành cảm ơn! Học viên thực Trần Thị Thảo Vy iv TÓM TẮT Đánh giá phân loại khâu quan trọng sau thu hoạch trái ảnh hưởng đến giá trị sản phẩm Việc dùng phương pháp thủ công chưa mang lại hiệu cao khâu nên việc sử dụng hệ thống phân loại xử lý thông minh điều cần thiết để đảm bảo suất chất lượng đầu trái Việc áp dụng hệ thống tự động thông minh cho phép doanh nghiệp tăng suất, giảm sức lao động đạt độ xác cao cơng đoạn xử lý Hiện nay, có nhiều nghiên cứu liên quan đến việc đánh giá phân loại loại thực phẩm, đặc biệt trái Dừa loại trái có hương vị thơm ngon, nhiều chất dinh dưỡng, đa công dụng nên ưa chuộng sử dụng không thị trường nước mà thị trường nước Hiện tại, nhu cầu sử dụng trái dừa sản phẩm từ dừa ngày gia tăng tồn giới Mỗi thị trường đều có tiêu chí đánh giá chất lượng trái dừa riêng điều quan trọng Đề tài nghiên cứu đã đề xuất mơ hình phân loại dừa tự động thông minh dựa mạng nơ-ron nhân tạo (ANN) Hệ thống đã sử dụng phương pháp xử lý hình ảnh trùn thống để trích xuất đặc trưng trái dừa đưa đặc trưng vào đầu vào ANN Sau đó, hệ thống ANN xử lý phân loại thành loại dừa khác Qua nhiều lần thử nghiệm điều chỉnh, hệ thống phân loại đánh giá chất lượng trái dừa mạng nơ-ron nhân tạo ANN đạt độ xác 98%, so với phương pháp đánh giá khác hệ thống đáp ứng yêu cầu phân loại đánh giá chất lượng trái dừa xuất địa phương nước v ABSTRACT Evaluation and grading is an important step after harvesting the fruit as it affects the value of the product The use of manual methods has not yet brought high efficiency in this stage, so the use of a smart sorting and processing system is essential to ensure the yield and quality of the fruit The application of automatic and intelligent systems allows businesses to increase productivity, reduce labor and achieve high accuracy in processing stages Currently, there is a lot of research related to the evaluation and classification of foods, especially fruits Coconut is a fruit with a delicious taste, many nutrients, and many uses, so it is popular not only in the domestic market but also in foreign markets Currently, the demand for coconut and coconut products is increasing worldwide Each market has its own criteria for evaluating the quality of coconuts and that is very important This research topic has proposed an automatic and intelligent coconut classification model based on an artificial neural network (ANN) The system used the traditional image processing method to extract the features of the coconut and feed those features into the input of the ANN Then, the ANN system will process and classify into different types of coconuts After many times of testing and adjusting, the system of classifying and evaluating coconut quality by artificial neural network ANN achieves an accuracy of more than 98%, so compared to other evaluation methods, this system meets meet the requirements of classification and assessment of the quality of exported coconuts in localities in the country vi MỤC LỤC LÝ LỊCH KHOA HỌC i LỜI CAM ĐOAN iii LỜI CẢM ƠN iv TÓM TẮT v ABSTRACT vi DANH SÁCH CÁC HÌNH x DANH SÁCH CÁC BẢNG xiii MỞ ĐẦU 1 Đặt vấn đề … Các nghiên cứu công bố a Nghiên cứu tình hình ngồi nước b Nghiên cứu tình hình nước Mục tiêu nghiên cứu Nhiệm vụ giới hạn a Nhiệm vụ b Giới hạn Phương pháp nghiên cứu a Phương pháp khảo sát b Phương pháp thu thập thông tin c Phương pháp phân tích, tổng hợp Cấu trúc luận văn CHƯƠNG I: TỔNG QUAN 1.1 Thị phần xuất dừa 1.1.1 Thị phần xuất dừa giới 1.1.2 Thị phần xuất dừa Việt Nam 1.2 Đối tượng đánh giá 10 vii count = for x_idx, y_idx in ContourPoints: count = count + if(count % 15 == 0): cv2.drawMarker(image_demo, (x_idx, y_idx),(255,0,0), markerType=cv2.MARKER_STAR, markerSize=10, thickness=2, line_type =cv2.LINE_AA) ShowImage([image_mask, image_demo], 1, 5) return CenterPoints, ContourPoints import math def GetMinorMajorLength(image, image_mask, display = 1): image_label = label(GetLargestBinaryArea(image, image_mask, display = 0)) regions = regionprops(image_label, intensity_image= image_mask) props = regions[0] minorLength = props.minor_axis_length majorLength = props.major_axis_length orientation = props.orientation if(display): print(f"Minor Length = {minorLength} and Major Length = {majorLength} and Orient ation = {orientation}") y0, x0 = props.centroid minr, minc, maxr, maxc = props.bbox x1 = int(x0 + math.cos(orientation) * 0.5 * minorLength) y1 = int(y0 - math.sin(orientation) * 0.5 * minorLength) x2 = int(x0 - math.sin(orientation) * 0.5 * majorLength) y2 = int(y0 - math.cos(orientation) * 0.5 * majorLength) x0 = int(x0) y0 = int(y0) 74 image_demo = image.copy() cv2.line(image_demo, (x0, y0), (x1, y1), (0, 255, 0), thickness=3) cv2.line(image_demo, (x0, y0), (x2, y2), (0, 255, 0), thickness=3) ShowImage([image_mask, image_demo], 1, 5) return minorLength, majorLength, orientation def GetAreaPerimeterSolidity(image, image_mask, display = 1): image_label = label(GetLargestBinaryArea(image, image_mask, display = 0)) regions = regionprops(image_label, intensity_image= image_mask) props = regions[0] Area = int(props.area) Perimeter = int(props.perimeter) # Ratio of pixels in the region to pixels of the convex hull image Solidity = props.solidity Roundness = (4 * math.pi * Area) / (Perimeter * Perimeter) if(display): print(f"Area : {Area}, Perimeter : {Perimeter}, Solidity : {Solidity}, Roundness : {Rou ndness}") return Area, Perimeter, Solidity, Roundness import numpy as np def GetMinMaxMeanQuantileIntensity(image, image_mask, image_value, display = 1): image_label = label(GetLargestBinaryArea(image, image_mask, display = 0)) regions = regionprops(image_label, intensity_image= image_value) props = regions[0] image_value[image_mask != 1] = vectorized = image_value.reshape(-1) vectorized = np.float32(vectorized) vectorized = vectorized[vectorized != 0] IntensityMax = np.max(vectorized) IntensityMean = np.mean(vectorized) 75 IntensityMin = np.min(vectorized) IntensityQ1 = np.quantile(vectorized, 0.25) IntensityQ2 = np.quantile(vectorized, 0.5) IntensityQ3 = np.quantile(vectorized, 0.75) if(display): print(f"Min : {IntensityMin}, Max : {IntensityMax} , Mean : {IntensityMean}") print(f"Q1 : {IntensityQ1}, Q2 : {IntensityQ2}, Q3 : {IntensityQ3}") return IntensityMin, IntensityMax, IntensityMean, IntensityQ1, IntensityQ2, IntensityQ import json def WriteJSON(filename, DataDict, SaveFolderPath): content = json.dumps(DataDict, indent=4) try: f = open(f'{SaveFolderPath}/{filename}.json', "w") f.write(content) print("Finish Writing to file with contents: ", f'{SaveFolderPath}/{filename}.json') except OSError: print("Could not write file:", filename) finally: f.close() def ReadJSON(fname): import json data = [] try: with open(fname, "r") as fid: data = json.load(fid) print("Finish Reading fname \n") except OSError: print("Could not read file:", fname) 76 finally: fid.close() return data Userful Function from skimage.feature import hog from skimage import exposure def HogFeatureExtraction(image, display = 1): HoGfeature, hog_image = hog(AnImage, orientations=9, pixels_per_cell=(8, 8), cells_per_block=(2, 2), visualize=True, feature_vector = True, multi channel=True) if(display): print(f"Len of HoG Feature is {len(HoGfeature)} and Values are :") print(HoGfeature) # Rescale histogram for better display hog_image_rescaled = exposure.rescale_intensity(hog_image, in_range=(0, 10)) ShowImage([image, hog_image, hog_image_rescaled], 1, 3, ImageTitleList= ["Origin" , "HoG Image", "Rescaled HoG Image"]) return HoGfeature from skimage.feature import corner_harris, corner_peaks def DetectHarisCorner(image, image_value, image_mask, display = 1): coords = corner_peaks(corner_harris(image_value), min_distance=5, threshold_rel=0.00 5) coordsList = [] image_mask_dilated = Morphology(image, image_mask, morType = "dilation", size = , display = 0) for x_idx, y_idx in coords: if (image_mask_dilated[x_idx, y_idx]): 77 coordsList.append((x_idx, y_idx)) if(display): image_demo = AnImage.copy() for x_idx, y_idx in coordsList: cv2.drawMarker(image_demo, (y_idx, x_idx),(0,255,255), markerType=cv2.MARKER_STAR, markerSize=10, thickness=2, line_type= cv2.LINE_AA) ShowImage([image_demo], 1, 3, ["Harris Corner Detection"]) return coordsList from skimage.feature import match_descriptors, plot_matches, ORB def DetectORBKeypoints(image, image_value, image_mask, NumKeypoints = 50, displa y = 1): descriptor_extractor = ORB(n_keypoints = NumKeypoints) descriptor_extractor.detect_and_extract(image_value) keypoints = descriptor_extractor.keypoints KeyPointsList = [] image_mask_dilated = Morphology(image, image_mask, morType = "dilation", size = , display = 0) for x_idx, y_idx in keypoints: if (image_mask_dilated[int(x_idx), int(y_idx)]): KeyPointsList.append((int(x_idx), int(y_idx))) if(display): image_demo = image.copy() print(f"Original there are {NumKeypoints} ORB features points but only {len(KeyPoi ntsList)} ORB features inside") for x_idx, y_idx in KeyPointsList: cv2.drawMarker(image_demo, (y_idx, x_idx),(0,255,255), markerType=cv2.MARKER_STAR, markerSize=5, thickness=2, line_type=c v2.LINE_AA) 78 ShowImage([image_demo], 1, 3, ["ORB Keypoints Detection"]) return KeyPointsList Observations from google.colab import drive drive.mount('/content/drive') → Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True) FolderPath = "/content/drive/MyDrive/LVTN - Ứng dụng AI/Hình dừa 10-07-2022" ConnectToDataFolder(FolderPath) =============================================================== ================= - Begin: ConnectToDataFolder List of Data in the Folder : ['Output(Segmentation2)', 'Output(VisualFeatureExtraction)', 'Màu OK - Loại 1', 'Trầy xước nặng - Loại 3', 'Trầy xước nhẹ - Loại 2', 'Màu NG - Loại 3', 'Khối lượng dừa 10-07.xlsx', 'Datasets', 'Output(Segmentation)', 'Coconuts_Segmentation_Traditional_CVs.ipynb', 'Giải thích code - AI Specialist - Traditional Computer Vision Step 2(Feature Extraction).ipynb', 'Running man - AI Specialist - Traditional Computer Vision Step 2(Feature Extraction).ipynb', 'AI Specialist - Traditional Computer Vision Step Extra (Feature Descriptors).ipynb', 'AI Specialist - Traditional Computer Vision Step 2(Feature Extraction) (1).ipynb', 'AI Specialist - Traditional Computer Vision-Step 1(Boundary Segmentation).ipynb'] 79 =============================================================== ================= - Finish: ConnectToDataFolder DatasetFiles = GetSubFiles("Datasets", ExtensionList = ["jpg"]) print(DatasetFiles) =============================================================== ================= - Begin: GetSubFiles There are 385 files are found Here is some samples : Datasets/10.1.jpg Datasets/10.2.jpg Datasets/10.3.jpg Datasets/10.4.jpg Datasets/11.1.jpg =============================================================== ================= - End: GetSubFiles ['Datasets/10.1.jpg', 'Datasets/10.2.jpg', 'Datasets/10.3.jpg', 'Datasets/10.4.jpg', 'Datasets/11.1.jpg', 'Datasets/11.2.jpg', 'Datasets/11.3.jpg', 'Datasets/11.4.jpg', 'Datasets/12.1.jpg', 'Datasets/12.2.jpg', 'Datasets/12.3.jpg', 'Datasets/12.4.jpg', 'Datasets/13.1.jpg', 'Datasets/13.2.jpg', 'Datasets/13.3.jpg', 'Datasets/13.4.jpg', 'Datasets/14.1.jpg', 'Datasets/14.2.jpg', 'Datasets/14.3.jpg', 'Datasets/14.4.jpg', 'Datasets/15.1.jpg', 'Datasets/15.2.jpg', 'Datasets/15.3.jpg', 'Datasets/15.4.jpg', 'Datasets/16.1.jpg', 'Datasets/16.2.jpg', 'Datasets/16.3.jpg', 'Datasets/16.4.jpg', 'Datasets/17.1.jpg', 'Datasets/17.2.jpg', 'Datasets/17.3.jpg', 'Datasets/17.4.jpg', 'Datasets/18.1.jpg', 'Datasets/18.2.jpg', 'Datasets/18.3.jpg', 'Datasets/18.4.jpg', 'Datasets/19.1.jpg', 'Datasets/19.2.jpg', 'Datasets/19.3.jpg', 'Datasets/19.4.jpg', 'Datasets/2.3.jpg', 'Datasets/2.4.jpg', 'Datasets/20.3.jpg', 'Datasets/20.4.jpg', 'Datasets/21.1.jpg', 'Datasets/21.2.jpg', 'Datasets/21.3.jpg', 'Datasets/21.4.jpg', 'Datasets/22.1.jpg', 'Datasets/22.2.jpg', 'Datasets/22.3.jpg', 'Datasets/22.4.jpg', 'Datasets/23.1.jpg', 'Datasets/23.2.jpg', 'Datasets/20.1.jpg', 80 'Datasets/20.2.jpg', 'Datasets/23.3.jpg', 'Datasets/23.4.jpg', 'Datasets/24.1.jpg', 'Datasets/24.2.jpg', 'Datasets/24.3.jpg', 'Datasets/24.4.jpg', 'Datasets/25.1.jpg', 'Datasets/25.2.jpg', 'Datasets/25.3.jpg', 'Datasets/25.4.jpg', 'Datasets/26.1.jpg', 'Datasets/26.2.jpg', 'Datasets/26.3.jpg', 'Datasets/26.4.jpg', 'Datasets/27.1.jpg', 'Datasets/27.2.jpg', 'Datasets/27.3.jpg', 'Datasets/27.4.jpg', 'Datasets/28.1.jpg', 'Datasets/28.2.jpg', 'Datasets/28.3.jpg', 'Datasets/28.4.jpg', 'Datasets/29.1.jpg', 'Datasets/29.2.jpg', 'Datasets/3.1.jpg', 'Datasets/3.2.jpg', 'Datasets/29.3.jpg', 'Datasets/29.4.jpg', 'Datasets/3.3.jpg', 'Datasets/3.4.jpg', 'Datasets/30.3.jpg', 'Datasets/30.4.jpg', 'Datasets/31.1.jpg', 'Datasets/31.2.jpg', 'Datasets/31.3.jpg', 'Datasets/31.4.jpg', 'Datasets/32.1.jpg', 'Datasets/32.2.jpg', 'Datasets/32.3.jpg', 'Datasets/32.4.jpg', 'Datasets/33.1.jpg', 'Datasets/33.2.jpg', 'Datasets/33.3.jpg', 'Datasets/33.4.jpg', 'Datasets/34.1.jpg', 'Datasets/34.2.jpg', 'Datasets/34.3.jpg', 'Datasets/34.4.jpg', 'Datasets/35.1.jpg', 'Datasets/35.2.jpg', 'Datasets/35.3.jpg', 'Datasets/35.4.jpg', 'Datasets/36.1.jpg', 'Datasets/36.2.jpg', 'Datasets/36.3.jpg', 'Datasets/36.4.jpg', 'Datasets/37.1.jpg', 'Datasets/37.2.jpg', 'Datasets/37.3.jpg', 'Datasets/37.4.jpg', 'Datasets/38.1.jpg', 'Datasets/38.2.jpg', 'Datasets/38.3.jpg', 'Datasets/38.4.jpg', 'Datasets/39.1.jpg', 'Datasets/39.2.jpg', 'Datasets/4.1.jpg', 'Datasets/4.2.jpg', 'Datasets/39.3.jpg', 'Datasets/30.1.jpg', 'Datasets/39.4.jpg', 'Datasets/4.3.jpg', 'Datasets/4.4.jpg', 'Datasets/40.3.jpg', 'Datasets/40.4.jpg', 'Datasets/41.1.jpg', 'Datasets/41.2.jpg', 'Datasets/41.3.jpg', 'Datasets/41.4.jpg', 'Datasets/42.1.jpg', 'Datasets/42.2.jpg', 'Datasets/42.3.jpg', 'Datasets/42.4.jpg', 'Datasets/43.1.jpg', 'Datasets/43.2.jpg', 'Datasets/43.3.jpg', 'Datasets/43.4.jpg', 'Datasets/44.1.jpg', 'Datasets/44.2.jpg', 'Datasets/44.3.jpg', 'Datasets/44.4.jpg', 'Datasets/45.1.jpg', 'Datasets/45.2.jpg', 'Datasets/45.3.jpg', 'Datasets/45.4.jpg', 'Datasets/46.1.jpg', 'Datasets/46.2.jpg', 'Datasets/46.3.jpg', 'Datasets/46.4.jpg', 'Datasets/47.1.jpg', 'Datasets/47.2.jpg', 'Datasets/47.3.jpg', 'Datasets/47.4.jpg', 'Datasets/48.1.jpg', 'Datasets/48.2.jpg', 'Datasets/48.3.jpg', 'Datasets/48.4.jpg', 'Datasets/49.1.jpg', 'Datasets/49.2.jpg', 'Datasets/5.1.jpg', 'Datasets/5.2.jpg', 'Datasets/49.3.jpg', 'Datasets/40.1.jpg', 'Datasets/30.2.jpg', 'Datasets/49.4.jpg', 81 'Datasets/40.2.jpg', 'Datasets/5.3.jpg', 'Datasets/5.4.jpg', 'Datasets/50.3.jpg', 'Datasets/50.4.jpg', 'Datasets/51.1.jpg', 'Datasets/51.2.jpg', 'Datasets/51.3.jpg', 'Datasets/51.4.jpg', 'Datasets/52.1.jpg', 'Datasets/52.2.jpg', 'Datasets/52.3.jpg', 'Datasets/52.4.jpg', 'Datasets/53.1.jpg', 'Datasets/53.2.jpg', 'Datasets/53.3.jpg', 'Datasets/53.4.jpg', 'Datasets/54.1.jpg', 'Datasets/54.2.jpg', 'Datasets/54.3.jpg', 'Datasets/54.4.jpg', 'Datasets/55.1.jpg', 'Datasets/55.2.jpg', 'Datasets/55.3.jpg', 'Datasets/55.4.jpg', 'Datasets/56.1.jpg', 'Datasets/56.2.jpg', 'Datasets/56.3.jpg', 'Datasets/56.4.jpg', 'Datasets/57.1.jpg', 'Datasets/57.2.jpg', 'Datasets/57.3.jpg', 'Datasets/57.4.jpg', 'Datasets/58.1.jpg', 'Datasets/58.2.jpg', 'Datasets/58.3.jpg', 'Datasets/58.4.jpg', 'Datasets/59.1.jpg', 'Datasets/59.2.jpg', 'Datasets/6.1.jpg', 'Datasets/6.2.jpg', 'Datasets/59.3.jpg', 'Datasets/50.1.jpg', 'Datasets/59.4.jpg', 'Datasets/6.3.jpg', 'Datasets/6.4.jpg', 'Datasets/60.3.jpg', 'Datasets/60.4.jpg', 'Datasets/61.1.jpg', 'Datasets/61.2.jpg', 'Datasets/61.3.jpg', 'Datasets/61.4.jpg', 'Datasets/62.1.jpg', 'Datasets/62.2.jpg', 'Datasets/62.3.jpg', 'Datasets/62.4.jpg', 'Datasets/63.1.jpg', 'Datasets/63.2.jpg', 'Datasets/63.3.jpg', 'Datasets/63.4.jpg', 'Datasets/64.1.jpg', 'Datasets/64.2.jpg', 'Datasets/64.3.jpg', 'Datasets/64.4.jpg', 'Datasets/65.1.jpg', 'Datasets/65.2.jpg', 'Datasets/65.3.jpg', 'Datasets/65.4.jpg', 'Datasets/66.1.jpg', 'Datasets/66.2.jpg', 'Datasets/66.3.jpg', 'Datasets/66.4.jpg', 'Datasets/67.1.jpg', 'Datasets/67.2.jpg', 'Datasets/67.3.jpg', 'Datasets/67.4.jpg', 'Datasets/68.1.jpg', 'Datasets/68.2.jpg', 'Datasets/68.3.jpg', 'Datasets/68.4.jpg', 'Datasets/69.1.jpg', 'Datasets/69.2.jpg', 'Datasets/7.1.jpg', 'Datasets/7.2.jpg', 'Datasets/69.3.jpg', 'Datasets/60.1.jpg', 'Datasets/50.2.jpg', 'Datasets/69.4.jpg', 'Datasets/70.1.jpg', 'Datasets/60.2.jpg', 'Datasets/7.3.jpg', 'Datasets/7.4.jpg', 'Datasets/70.3.jpg', 'Datasets/70.4.jpg', 'Datasets/71.1.jpg', 'Datasets/71.2.jpg', 'Datasets/71.3.jpg', 'Datasets/71.4.jpg', 'Datasets/72.1.jpg', 'Datasets/72.2.jpg', 'Datasets/72.3.jpg', 'Datasets/72.4.jpg', 'Datasets/73.1.jpg', 'Datasets/73.2.jpg', 'Datasets/73.3.jpg', 'Datasets/73.4.jpg', 'Datasets/74.1.jpg', 'Datasets/74.3.jpg', 'Datasets/74.4.jpg', 'Datasets/75.1.jpg', 'Datasets/75.2.jpg', 'Datasets/75.3.jpg', 'Datasets/75.4.jpg', 'Datasets/76.1.jpg', 'Datasets/76.2.jpg', 'Datasets/76.3.jpg', 82 'Datasets/70.2.jpg', 'Datasets/76.4.jpg', 'Datasets/77.1.jpg', 'Datasets/77.2.jpg', 'Datasets/77.3.jpg', 'Datasets/77.4.jpg', 'Datasets/78.1.jpg', 'Datasets/78.2.jpg', 'Datasets/78.3.jpg', 'Datasets/78.4.jpg', 'Datasets/79.1.jpg', 'Datasets/79.2.jpg', 'Datasets/79.3.jpg', 'Datasets/79.4.jpg', 'Datasets/8.1.jpg', 'Datasets/8.2.jpg', 'Datasets/8.3.jpg', 'Datasets/80.2.jpg', 'Datasets/80.3.jpg', 'Datasets/9.2.jpg', 'Datasets/9.3.jpg', 'Datasets/8.4.jpg', 'Datasets/80.4.jpg', 'Datasets/80.1.jpg', 'Datasets/9.1.jpg', 'Datasets/9.4.jpg'] FileNameList, ImageList = ShowRandomImage(DatasetFiles, seedNo = 30) =============================================================== ================= - Begin: ShowRandomImage =============================================================== ================= - Finish: ShowRandomImage Idx = filename = Path(FileNameList[Idx]).stem print(f"Here is the image {FileNameList[Idx]}") AnImage = ResizeImage(ImageList[Idx], 0, 300) image_gray = ConvertColorSpaces(AnImage, ColorSpace = "GRAY") image_hsv = ConvertColorSpaces(AnImage, ColorSpace = "HSV") image_ycrcb = ConvertColorSpaces(AnImage, ColorSpace = "YCrCb") image_lab = ConvertColorSpaces(AnImage, ColorSpace = "Lab") Here is the image Datasets/73.3.jpg 83 image_mask = imread("Output(Segmentation2)/" + filename + "_mask.jpg") image_mask = image_mask[:,:,0] > 200 image_demo = imread("Output(Segmentation2)/" + filename + "_demo.jpg") ShowImage([AnImage, image_mask], 1, 5) ShowImage([image_demo], 1, 3) 84 fname = f"Output(VisualFeatureExtraction)/{filename}.json" JsonData = ReadJSON(fname) Finish Reading fname =============================================================== ================= - Begin: ConnectToDataFolder List of Data in the Folder : ['AI Specialist - Traditional Computer Vision Step Extra (Feature Descriptors).ipynb', 'AI Specialist - Traditional Computer Vision Step 2(Feature Extraction) (1).ipynb', 'Khối lượng dừa 10-07.xlsx', 'Datasets', 'Output(Segmentation)', 'Coconuts_Segmentation_Traditional_CVs.ipynb', 'Output(Segmentation2)', 85 'Giải thích code - AI Specialist - Traditional Computer Vision Step 2(Feature Extraction).ipynb', 'Running man - AI Specialist - Traditional Computer Vision Step 2(Feature Extraction).ipynb', 'Output(VisualFeatureExtraction)', 'ANN-1.png', 'data_train.csv', 'HHH', '179-LVTN-TTTV.docx', '179-Get-Json-data.ipynb', 'AI Specialist - Traditional Computer Vision-Step 1(Boundary Segmentation).ipynb', 'Copy of AI Specialist - Traditional Computer Vision 1_D - Image Segmentation.ipynb', 'TRAINING-MODEL-1.ipynb'] =============================================================== ================= - Finish: ConnectToDataFolder JsonData {'FileName': '73.3', 'CenterPoints': '[186, 139]', 'ContourPoints': '[[174 39]\n [173 40]\n [172 40]\n \n [177 39]\n [176 39]\n [175 39]]', 'minorLength': '195.47990614179184', 'majorLength': '222.94392743209482', 'orientation': '1.460999717217968', 'Area': '34185', 'Perimeter': '694', 'Solidity': '0.9931725740848344', 'Roundness': '0.8919212422905852', 'IntensityMinHue': '5.0', 'IntensityMaxHue': '40.0', 'IntensityMeanHue': '31.888807', 'IntensityQ1Hue': '31.0', 'IntensityQ2Hue': 'IntensityMinSaturation': '53.0', 'IntensityMeanSaturation': '134.48741', '33.0', 'IntensityQ3Hue': 'IntensityMaxSaturation': 'IntensityQ1Saturation': '34.0', '255.0', '121.0', 'IntensityQ2Saturation': '132.0', 'IntensityQ3Saturation': '145.0', 'IntensityMinValue': '14.0', 'IntensityMaxValue': '155.0', 'IntensityMeanValue': '99.26366', 'IntensityQ1Value': '83.0', 'IntensityQ2Value': '104.0', 'IntensityQ3Value': '117.0'} 86 hue = image_hsv[:,:,0] saturation = image_hsv[:,:,1] value = image_hsv[:,:,2] Feature Descriptors HoGfeature = HogFeatureExtraction(AnImage, display = 1) 87 S K L 0 ... đến chất lượng suất đầu trái dừa xuất khẩu, em thực đề tài ? ?Ứng dụng trí tuệ nhân tạo để đánh giá chất lượng trái dừa xuất khẩu? ?? nhằm tự động hóa q trình đánh giá chất lượng trái dừa xuất khẩu, ... tra tồn trái dừa Hình 1.8 Sử dụng siêu âm để đánh giá chất lượng trái dừa 20 Qua việc đánh giá ý tưởng, em định lựa chọn phương án sử dụng trí tuệ nhân tạo để đánh giá chất lượng trái dừa Đây... đề xuất ứng dụng trí tuệ nhân tạo vào khâu đánh giá chất lượng trái dừa xuất khẩu, sau trái dừa đã qua giai đoạn như: Làm bên vỏ dừa, tiếp đến xử lý ảnh ứng dụng cơng nghệ máy học trí tuệ nhân

Ngày đăng: 07/03/2023, 16:06

Tài liệu cùng người dùng

Tài liệu liên quan