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...
-
Let X equal the number of alpha particle emissions of carbon-14 that are counted by a Geiger counter each second. Assume that the distribution of X is Poisson with mean 16. Let W equal the time in...
-
Determine the force in each member of the space truss and state if the members are in tension or compression. The truss is supported by a ball-and-socket joints at A, B, and E. Hint: The support...
-
A moving object that has inertia \(m\) strikes a stationary object that has inertia \(0.5 \mathrm{~m}\). (a) What fraction of the initial kinetic energy of the system is convertible? (b) Why can't...
-
At the beginning of 2015, Brads Heating & Air (BHA) has a balance of $26,000 in accounts receivable. Because BHA is a privately owned company, the company has used only the direct write-off method to...
-
"Managing Away Bad Habits Team Assignment Organizational Behavior IILeadership Assigned is ashort case from the exercise Managing Away Bad Habits. The task is to develop a turnaround strategy for...
-
Assign latest poverty to a three-column table with one row for each country that appears in the poverty table. The first column should contain the 3-letter code for the country. The second column...
-
Find each value. 10. If mLL = 58, then MLLKJ . 11. If JL 5, then ML-. 12. If MJKM = 48, then m -. M L 13. If mI = 55, then MJKM = . %3!
-
Determine theoretical. According to the theory, for light refracting from water into air, the critical angle will Occur at an incident angle Oc where n sin(0)= sin(90). Using your experimental value...
-
A person is holding two drill bits: one is 3/8 and one is 11/32. The person wants to first drill a hole using the smaller of the two bits. To decide which is smaller, the person expands 3/8 to 32nds....
-
What is the single most important quality you look for in a close friend, such as trustworthiness, honesty, intelligence, or a sense of humor? Why is that quality important to you? How well can you...
-
Below are incomplete financial statements for Riley. Incorporated. Required: Calculate the missing amounts. RILEY, INCORPORATED Income Statement Year ended December 31, 2024 S Revenues Expenses...
-
What do you mean by Entrepreneurship Development? What factors influences Entrepreneurship development?
-
The Animal Welfare Act (AWC) identifies requirements for transporting, selling, and handling animals used in scientific research laboratories. The federal agency that implements and administers the...
-
CLASS PERIO Solving Linear Equations: Variable on Both Sides Solve each equation. 1) 6r+ 7 = 13 + 7r 3) -7x-3x+2=-8x-8 5)-14 +66+7-26=1+5b 7) n-3n = 14-4n 2) 13-4x=1-x 4)-8-x= x - 4x 6)n+2=-14-n 8)...
-
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...
-
The exhaust gases of a compression-ignition engine are to be used to drive an exhaust gas turbo-supercharger. Estimate the mean pressure ratio of expansion and the isentropic enthalpy drop per kmol...
-
(a) An amount of substance equal to 2 kmols of an ideal gas at temperature \(T\) and pressure \(p\) is contained in a compartment. In an adjacent compartment is an amount of substance equal to \(1...
-
The exhaust gas from a two-stroke cycle compression-ignition engine is exhausted at an elevated pressure into a large chamber. The gas from the chamber is subsequently expanded in a turbine. If the...
Study smarter with the SolutionInn App