COSC420 Assignment 1Classifying text from imagesWeight:20% Lecturer: Lech SzymanskiFor this assignment, you will be building and training neural network models usingTensorflow’s Keras library. Datasets for your training and testing will be provided andthey correspond to three different types of classification.Simple classificationIn this task you are given 28x28 pixel colour images of letters from the English alphabetwritten in different fonts. The task is to identify the letter in the image, meaning 26classes (same class for the lower and upper case character). There are two variants of thisdataset – one with black characters over uniform light background (20000 train images,4000 test images), and the other of multi-colour characters over random imagebackground (60000 train images, 12000 test images).Figure 1: Simple classification dataset – ‘clean’ on the left, ‘noisy’ on th代写COSC420程序e right.Fine-grained classificationIn this task you are given the same set of images as in simple classification, but the labelsindicate which font the text is written in. There are 8 fonts in total. The differencebetween this task and simple classification is that the nature of differences betweenrepresentatives of different classes are more subtle, and (presumably) harder for thenetwork to distinguish.1Figure 2: Fine-grained classification dataset – ‘clean’ on the left, ‘noisy’ on the right.Multi-label classificationIn this task you are given 48x48 pixel colour images of three-letter words made of randomletters written in one of possible 8 choices of font types. The label indicates the lettersfound in the image (order is of no significance for this task) as well as the font type.There are variants of this dataset – one with black characters over uniform lightbackground (20000 train images, 4000 test images), and the other of multi-colourcharacters over random image background (60000 train images, 12000 test images).Figure 3: Multi-label classification dataset – ‘clean’ on the left, ‘noisy’ on the right.2Task 1, Implementation (10 marks)Select two classification tasks you want to work with, devise a neural networkarchitecture(s), build the network(s) in Tensorflow and test their performance. The orderof tasks, as presented above, is roughly in the increasing order of difficulty ofclassification. That is, simple classification should be pretty easy (in terms of the networkachieving good accuracy) and multi-label classification will most likely be the hardest toget the network to perform well. If you manage to build a network that performs well onthe ‘clean’ version of the data, train it also on the ‘noisy‘ version. Try to come up withstrategies for the network architecture, data augmentation, and anything else that youcan think of to get the best accuracy.The point of this exercise is not necessarily to attempt all tasks, but rather to find achallenging problem and have a go at trying to solve it with a neural network.Specifically, you should aim to have a go at two of the tasks. You might need to considerdifferent architectures for different tasks.Don’t forget to clean up your code before submission and add comments. Make sure tosave your model after training, and it would be very helpful if you set up your script sothat it loads pre-trained network when I run it (so that I don’t have to wait for them totrain).I will test the accuracy of your model on completely new set of test images.Task 2, Report (10 marks)Write a report of what you have done. What I am looking for here is a justification forchoices made in your implementation and a methodical approach to your investigation. Ifyou attempt different types of regularisations, record the results, report what happenedand provide some justification for why you think it did (or did not) work. This is meantto be a technical report – concise, but clear. Including diagrams and figures, such as plotsof training and validation accuracy over the course of training, is a good way to give memore insight into what you have done, and to back up any decisions made abouthyper-parameters, strategies, etc.3Importing the data into PythonDownload cosc420_assig1_data.py into the folder of your Python scripts project. Inyour own script you can import the load_data function and invoke it (as shown below)to load training data, testing data and a list of class names.from cosc420 assig1 data import load data
...