Assessment Requirements / Tasks There are two parts to the assessment: Part I: An image classification...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Assessment Requirements / Tasks There are two parts to the assessment: Part I: An image classification application based on k Nearest Neighbour algorithm (50%) • Part II: Worksheets Portfolio (50%) Part I: An image classification application based on k Nearest Neighbour algorithm You are required to implement a GUI application to perform image classification based on k- Nearest Neighbour (kNN) algorithm for CIFAR-10 image dataset. Key requirements of the application and guidance on the kNN algorithm are given below. Req1: The GUI application should allow the users to select one (or more) input sources (.bin files) as training data. Training data: https://learn.cardiffmet.ac.uk/mod/folder/view.php?id=939464 The images are stored in binary format detailed below. The binary version contains the files data_batch_1.bin, data_batch_2.bin,..., and data_batch_5.bin. Each of these files is formatted as follows: <1 x label><3072 x pixel> <1 x label><3072 x pixel> In other words, the first byte is the label of the first image, which is a number in the range 0-9. The next 3072 bytes are the values of the pixels of the image. The first 1024 bytes are the red channel values, the next 1024 the green, and the final 1024 the blue. The values are stored in row-major order, so the first 32 bytes are the red channel values of the first row of the image. Each file contains 10000 such 3073-byte "rows" of images, although there is nothing delimiting the rows. Therefore, each file should be exactly 30730000 bytes long. There is another file, called batches.meta.txt. This is an ASCII file that maps numeric labels in the range 0-9 to meaningful class names. It is merely a list of the 10 class names, one per row. The class name on row i corresponds to numeric label i. Further details can be found in http://www.cs.toronto.edu/~kriz/cifar.html Req2: The GUI application should allow the users to select a single.png image of size 32x32 as a test image, or specify the folder containing the test images so that all test images can be tested. Test images of size 32x32 in .png format are contained in Moodle, the link is given below https://learn.cardiffmet.ac.uk/mod/folder/view.php?id=939465 Req3: The GUI should allow the users to specify the parameters for the of the algorithm such as "k" value (range 1 to 10). Req4: Once all inputs (training images/labels, test image, k value) users should be allowed to start the classification process. The progress of the process should be made visible to the user and user should be able to stop the classification process. Req5: Once the processing is finished: For a single image input: the result (correct label) along side the test image should be displayed to the user together with the confidence level. For multiple test images: The accuracy of the algorithm should be displayed for the corresponding 'k' value. Accuracy (%) = classifications images num num The test images are labelled in "i_xxxx.png" format where i € [0-9] representing the correct class, and 'xxxx' is the image identifier. Therefore, the num_correct_classifications can be obtained by comparing the i value in the test image name with the prediction obtained from the KNN algorithm The pseudo code for a potential implementation of the k-NN algorithm is given below. train_dataset: [train_images, train_lables] # Structure holding training images and labels d_img # Variable that holds the test input image # Structure to hold distances and labels end distance_lbl_array # iterate through each element in the train_dataset structure for each elemente in train_dataset for each elemente in train_dataset t_img=train_dataset[e][0] t_lbl train_dataset[e][1] #eh training image #eth label for the corresponding image # compute the Euclidian distance between test image and current image N N Ed=ΣΣg.-d.j² [t j-0 1-0 # store the Euclidian distance and the label of the training image distance_lbl_array[e] := [distance, t_lbl] # Sort distance_lbl_array according to the distance sorted distance_lbl_array:= sort (distance_lbl_array) # extract elements for k closest labels. e.g., if k-10, get the first 10 elements in the sorted_distance_lbl_array. closest_k_label_array:= sorted_distance_lbl_array[:k] # Find the label class with maximum number of label counts Estimated_label :=max_label_count(closest_k_label_array) # Find the confidence as a ratio of selected label count to total number of closest elements Confidence : max_label_count(closest_k_label_array)/size(closest_k_label_array) Req6: A report should be created including a instructions and steps to build, and execute your programs. This should clearly specify if any 3rd party libraries such as javafx, Lombok are used in your project and if a specific java version is needed to execute and run your program. A graph explaining the performance of the KNN algorithm with changing 'k' values (1 - 10) should be included, with a small discussion of what you think about the algorithm's behaviour and suitability for classification tasks. The accuracy figures for this plot can be obtained from the equation given in Req5. Assessment Requirements / Tasks There are two parts to the assessment: Part I: An image classification application based on k Nearest Neighbour algorithm (50%) • Part II: Worksheets Portfolio (50%) Part I: An image classification application based on k Nearest Neighbour algorithm You are required to implement a GUI application to perform image classification based on k- Nearest Neighbour (kNN) algorithm for CIFAR-10 image dataset. Key requirements of the application and guidance on the kNN algorithm are given below. Req1: The GUI application should allow the users to select one (or more) input sources (.bin files) as training data. Training data: https://learn.cardiffmet.ac.uk/mod/folder/view.php?id=939464 The images are stored in binary format detailed below. The binary version contains the files data_batch_1.bin, data_batch_2.bin,..., and data_batch_5.bin. Each of these files is formatted as follows: <1 x label><3072 x pixel> <1 x label><3072 x pixel> In other words, the first byte is the label of the first image, which is a number in the range 0-9. The next 3072 bytes are the values of the pixels of the image. The first 1024 bytes are the red channel values, the next 1024 the green, and the final 1024 the blue. The values are stored in row-major order, so the first 32 bytes are the red channel values of the first row of the image. Each file contains 10000 such 3073-byte "rows" of images, although there is nothing delimiting the rows. Therefore, each file should be exactly 30730000 bytes long. There is another file, called batches.meta.txt. This is an ASCII file that maps numeric labels in the range 0-9 to meaningful class names. It is merely a list of the 10 class names, one per row. The class name on row i corresponds to numeric label i. Further details can be found in http://www.cs.toronto.edu/~kriz/cifar.html Req2: The GUI application should allow the users to select a single.png image of size 32x32 as a test image, or specify the folder containing the test images so that all test images can be tested. Test images of size 32x32 in .png format are contained in Moodle, the link is given below https://learn.cardiffmet.ac.uk/mod/folder/view.php?id=939465 Req3: The GUI should allow the users to specify the parameters for the of the algorithm such as "k" value (range 1 to 10). Req4: Once all inputs (training images/labels, test image, k value) users should be allowed to start the classification process. The progress of the process should be made visible to the user and user should be able to stop the classification process. Req5: Once the processing is finished: For a single image input: the result (correct label) along side the test image should be displayed to the user together with the confidence level. For multiple test images: The accuracy of the algorithm should be displayed for the corresponding 'k' value. Accuracy (%) = classifications images num num The test images are labelled in "i_xxxx.png" format where i € [0-9] representing the correct class, and 'xxxx' is the image identifier. Therefore, the num_correct_classifications can be obtained by comparing the i value in the test image name with the prediction obtained from the KNN algorithm The pseudo code for a potential implementation of the k-NN algorithm is given below. train_dataset: [train_images, train_lables] # Structure holding training images and labels d_img # Variable that holds the test input image # Structure to hold distances and labels end distance_lbl_array # iterate through each element in the train_dataset structure for each elemente in train_dataset for each elemente in train_dataset t_img=train_dataset[e][0] t_lbl train_dataset[e][1] #eh training image #eth label for the corresponding image # compute the Euclidian distance between test image and current image N N Ed=ΣΣg.-d.j² [t j-0 1-0 # store the Euclidian distance and the label of the training image distance_lbl_array[e] := [distance, t_lbl] # Sort distance_lbl_array according to the distance sorted distance_lbl_array:= sort (distance_lbl_array) # extract elements for k closest labels. e.g., if k-10, get the first 10 elements in the sorted_distance_lbl_array. closest_k_label_array:= sorted_distance_lbl_array[:k] # Find the label class with maximum number of label counts Estimated_label :=max_label_count(closest_k_label_array) # Find the confidence as a ratio of selected label count to total number of closest elements Confidence : max_label_count(closest_k_label_array)/size(closest_k_label_array) Req6: A report should be created including a instructions and steps to build, and execute your programs. This should clearly specify if any 3rd party libraries such as javafx, Lombok are used in your project and if a specific java version is needed to execute and run your program. A graph explaining the performance of the KNN algorithm with changing 'k' values (1 - 10) should be included, with a small discussion of what you think about the algorithm's behaviour and suitability for classification tasks. The accuracy figures for this plot can be obtained from the equation given in Req5.
Expert Answer:
Answer rating: 100% (QA)
code from sklearn import datasets from sklearnmodelsel... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write the program in either C++ or JAVA to implement a min-heap (priority queue) to schedule real-time processes. The heap should be stored in a fixed-size array of 1,000 records. You must provide...
-
Quick&Chic is an online fashion retailer for occasion wear with monthly changing offerings. As the operations manager of the company, you are responsible for managing the required level of...
-
In this assignment, you are required to implement a class MyArray as defined below, to store an array of integers (int). Many of its methods will be implemented using the principle of recursion....
-
Calculate the labour turnover rate according to replacement method from the following: No. of workers on the payroll: - At the beginning of the month: 500 - At the end of the month: 600 During the...
-
Define and explain privity, primary beneficiary, foreseen party, and foreseeable party in terms of the degree of failure to exercise the appropriate level of professional care on the part of auditors...
-
Discuss the major trends that have prevailed in international business during the last two decades.
-
The accountant's response to inter-dependence between parts of an organization is to allocate costs or charge transfer prices. What properties do these treatments have in common, and when can they be...
-
Given the demand equation Q = 1,500 - 200P, calculate all the numbers necessary to fill in the following table: Elasticity Total Revenue Marginal Revenue Point $7.00 6.50 6.00 5.50 5.00 4.50 4.00...
-
Barnes Company uses a job order cost system. The following data summarize the operations related to production for October: October 1 Materials purchased on account, $663,320. 2 Materials...
-
You are asked to evaluate employees' exposures to methyl n-amyl ketone during a painting operation using NIOSH Method 2553 for the sampling. You can access the method by clicking the link below: ...
-
ces Cases Sales Beginning Purchases Revenue Inventory Total Available Ending Cost of Inventory Goods Sold Gross Profit Selling and General Expenses Income from Operations A $ 1,700 $ 400 $ 625 $1,025...
-
Review both links above about race and U.S. immigration law and policy. Reflecting on how racism has penetrated the treatment of immigrants in the U.S. How might the recent/current public awareness...
-
Needing assistance with answering from a classmate recognizes that OCD is a complex disorder that arises from a combination of biological, psychological, and social factors (Beidel & Frueh, eds.,...
-
One fundamental choice in algorithm (or ADT) design is whether to use arrays or linked lists to store information. Both of these data types have advantages, and disadvantages, and choosing the...
-
Charge A and charge B are 3.00 m apart, and charge A is +2.00 C and charge B is +3.00 C. Charge C is located between them at a certain point and the force on charge C is zero. How far from charge A...
-
Bethany is a 12-year-old girl who has been referred to you, a BCBA, by her parents. Bethany's parents describe that their daughter's behavior has gotten "out of control" lately. They report to you...
-
Crane, Inc., is considering investing in a new production line for eye drops. Other than investing in the equipment, the company needs to increase its cash and cash equivalents by $10,000, increase...
-
Subprime loans have higher loss rates than many other types of loans. Explain why lenders offer subprime loans. Describe the characteristics of the typical borrower in a subprime consumer loan.
-
Which compound is more likely to be carcinogenic? b. or
-
Identify A through O: CH3 Br HOT ABC+ D H30+ 1. BH3/THF 2. H202, HO 1. Mg, Et20 2. ethylene oxide HBr 1. 03,-78C 2. Zn, H2O soCl2 CH3OH H2CrOa CH3CH2NH2 CH3CH2OH excess
-
Show how each of the following compounds can be prepared from the given starting material. In each case, you will need to use a protecting group. a. b. c. CH3 CH,CHCH,CCH, CH,CHCH-COCH3 - OH OH Cl...
-
Cuzco Carpets, S.A., is the Peruvian subsidiary of the U.S. firm, Carolina Fabrics, Inc. Cuzco Carpets manufactures high-quality carpets from llama wool and sells its finished carpets to its U,S....
-
Elliott Transmitters (ET) imports and sells special telephone equipment such as portable telephones and car phones and also walkie-talkies. Its customers include chain stores, mail order companies...
-
The Enormous Electrical Company Ltd (EE) was formed in March 19X8 by the merger of two smaller companies. It retails household electrical appliances of all kinds through a chain of thirty shops which...
Study smarter with the SolutionInn App