代写SCC361 Artificial Intelligence Coursework 1 – Data Preparation and Classification代做R语言

SCC361            Artificial  Intelligence

Coursework 1 - Data Preparation and Classification

Date Released: Friday,  18th   October 2024

Date Due: Friday 8th   November 2024

This coursework is worth 20 % of your overall mark

1. Introduction

In this coursework, you are required to carryout a mini research project in Machine Learning classification. This will take the form. of supervised image classification on the CIFAR-10 dataset. You will be required to load the data, select target classes, create training and testing subsets, and use    these to train several machine learning models and perform. inference on the testing data. You will   be required to evaluate and compare the results, using this to determine the most suitable model.

The submission will include the code as a single .m file, a 1-page extended abstract and a data file as  a .mat file, containing your indices and result measures. An abstract template is included for use and an example abstract accepted by a conference is included for reference.

2. Dataset

The CIFAR-10 dataset contains 60,000 images in 10 classes along with labels showing the object that they represent. The dataset is contained in the file cifar-10-data.mat. This is 174MB but we    will not use the whole set for training and testing. This mat file contains:

•    A 60000x32x32x3 variable data holding the images.

•    A 60000x1 variable labels holding the corresponding image labels.

•    A 10x1 variable label_names showing the categorical names of each indexed label.

Each image is of size 32 x 32 x 3 pixels. Since the first dimension of the data variable is the image index, to view an example image, you should use the squeeze command. E.g.

imagesc(squeeze(data(120,:,:,:)));

Figure 1 - Example Data from CIFAR-10

3. Data Preparation

Data Loading: To use the images with your method effectively, you will need to load the data into MATLAB, and convert the images to a double data type once imported.

Image Visualisation: Produce a 1-row and 4-column array of figures (Hint: the subplot command will be useful here), showing randomly-chosen examples and including the corresponding labels as the subfigure titles. Save this figure as a portable network graphic (png) file and use it in your report to  show what your data looks like.

Class Selection: Since we have a lot of data, we will only work with three classes. Select these three classes pseudo-randomly using the randperm command with a Mersenne Twister. You must use your student ID as a seed for the random number generator. You will find the rng function useful for this. For example, if my ID is 200212365, I would use classes 6 (dog), 9 (ship) and 10 (truck). Store this list in a 3x1 vector called “classes”; you will need to submit this along with your code. Extract the data corresponding to these classes, while preserving the original order. Do not forget to ensure that your labels vector needs to correspond to your image data so this will also need to be extracted. You should now have a data matrix of size 18000x32x32x3 and a labels vector of size 18000x1.

Training and Testing Split: For this task, we will use a 50-50 pseudo-randomly-selected training-

testing split. Split your dataset into training and testing subsets, each containing 50% of the data.

Use your student ID again as a seed for a Mersenne Twister random number generator and the randperm command to select half of your images (i.e. 9000 images) for your training set. Note that  you will need to set the seed each time you want to use it. Store the index resulting from randperm as a 9000x1 vector called training_index”; you will need to submit this along with your code. Now, use this index to extract your training images and labels; the remaining 9000 images and labels should be set aside for testing. Be careful to ensure that the labels still correspond to the correct images.

Data Format: As in week 3, the image data needs to reshaped into a suitable format for training and testing and you will need four matrices: in this case, you should have a 9000x3072 matrix each for your training and testing data, and a 9000x1 matrix each for your training and testing labels.

Check your label distribution to examine the representation of each class in training and testing. You can comment on this in your report but must not change the data split.

4. Model Training and Evaluation

4.1. Model Training with K-Nearest Neighbour

In this section, you will be required to classify the test data using your own implementation of k-nearest neighbour (see Week 3 Lab for reference). This should be carried out separately using two different distance metrics to provide one set of results per distance metric:

1.    L2-distance, also known as Euclidean distance.

2.   Another distance metric of your choice but not an Lp-distance. For example, you could use Bray-Curtis or Cosine Distance.

Be sure to save the prediction results and computation times for evaluation and comparison later.

4.2. Model Training with Existing Models

It is important to compare with existing models and we often do this by implementing the author’s code. We will use some existing classification algorithms that are already implemented in MATLAB.

You will need to train and compare any two classification algorithms implemented in MATLAB, not    including KNN. It is sufficient for this coursework to use the models’ default parameters but you are  welcome tooptimise these parameters to improve performance. Please note that, given the dataset size, the models make take several minutes to run.

Table 1 shows some examples of classification algorithms in MATLAB and their function names as implemented in MATLAB’s Statistics and Machine Learning ToolboxTM. You may find it useful to have a look at this MATLAB documentation page on Supervised Learning Workflow and Algorithms for some ideas on how to structure your solution and select your algorithms. You are encouraged to make use of the suggestions on this page but feel free to explore further.

Table 1: MATLAB Classification of Algorithms and their function Names

Algorithm

Function

SVM for Multiclass

fitcecoc()

Decision Tree

fitctree()

Ensembles

fitcensemble()

4.3. Evaluation

It is important to evaluate methods from multiple points of view. For this work, please evaluate the models in terms of their accuracy, confusion matrix and the time taken to train and test. These can  then be presented and discussed in your report to select the most suitable model for your problem. Please name the corresponding variables according using the format “modelname_measure”, e.g.    “knnL2_accuracy”, “SVM_timetaken”, “decisiontree_confusionmatrix” . You will need to submit

these in a data file.

Accuracy is measured by comparing the predictions from your models to the test labels in the dataset. Accuracy can be calculated as

The time taken to train the models can be computed using the tic and toc commands.

5. Report

As part of this coursework, you are asked to write a 1-page report in the form. of an Extended Abstract, which is acommon way of submitting work to a conference or workshop. A template is provided in the file SCC361-CW1-Report-Template.docx and an example abstract accepted at BioMedEng23 is included in Example-ExtendedAbstract-BioMedEng23.docx.

The report must include the following sections:

1. Introduction: This should be a paragraph, describing the problem that you aresolving and potential uses for it.

2. Data and Preparation: Describe the content of the dataset and the data preparation method. Please include the figure that you generated in Section 3.

3. Methodology: Describe the model training and evaluation methods used, including your   reasons for choosing the models. You should briefly describe each method but you do not need to give a detailed technical description.

4. Results: This should include presentation of your results in a table and the confusion matrices as figures, along with your error analysis and observations

5. Conclusion: In this section, you should identify the model that you would recommend for use with your problem and justify your reasoning.

Most conference submissions will not permit you to change the margins, font or font size. Beyond the report title, please use the font Arial at size 10.

Ordinarily, in a paper submission, you would include the names and affiliations of the authors at the top, as in the template. Please do not do this; this submission should be anonymous.

6. Submission

Please submit the data file, code and report on Moodleonor before the deadline of 4pm on Friday, 8th November, 2024. The data file must be submitted as a single file called “cw1.mat” contain only the following variables; you do not need to submit the whole dataset:

classesvariable

•    “training_index” variable

•    Accuracy, confusion matrix and time taken measures.

You can do this with the save command, which takes the format

save(‘cw1’,’variable1’,’variable2’,’variable3’ );

You code should be submitted as a single MATLAB script. (.m file), which is running without any errors, structured and includes documentation/ detailed comments.

Your 1-page report should be submitted as a pdf file, without your name.

There will be separate submission points for the data file, code and for the report. If for some reason, you cannot upload your submission, please zip it up and e-mail it to

b.williams6@lancaster.ac.uk and scc-teaching-office@lancaster.ac.uk as soon as possible. You do not need to submit the rest of your data.

Your submission should be anonymous and not include your name in the data file, code or report.

7. Marking

Marks and feedback will be returned by 29th  November 2024. There area total of 20 marks for this coursework and the coursework mark constitutes 20% of your overall mark for this module.

•    10 marks are allocated to correct implementation and results.

•    5 marks are allocated to your code, including appropriate structure and suitable annotation/documentation of your code using comments.

•    5 marks are allocated to your report, with 1 marks per section mentioned above.





热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图