Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

RBE306TC Computer Vision Systems

Lab Manuals and Reports

Lab 1 on Nov. 10th, 2023

Objectives:

•  Introducing the image processing capabilities of Matlab with Image Processing Toolbox

Learn to read and display images

Learn basic image processing steps

Learn several image enhancement techniques

Before you dive into this Exercise 1 to Exercise 3, please check the following OpenCV functions in Python Coding Platform for example:

imread, shape, imshow, imwrite, imnoise, resize, calcHist, equalizeHist, etc.

Some other Python built-in functions, or functions in Scipy package may also be used. Please refer to online resources.

Hint: read the descriptions about each of the previous functions and any other function you might use. You may find descriptive sections of Algorithms(s) in some of the Python functions.

Task in Lab 1 (20%)

In this lab, we use the monochrome image Lenna (i.e., lenna512.bmp) to conduct the following subtasks. Let’s call the original image Lenna as I0.

•  (a) I0 -> down-sampling to I1 with 1/2 size of I0 (both horizontally and vertically) using the mean value  (implement  it  by  yourself).  Display  it  and  compare  to the  original  image.  Explain  your finding in the report (5%).

• (b) I1->  up-sampling  to I1 with  the  same  size  of I0 using  nearest  neighbour  interpolation (implement it by yourself). Display it and compare to the original image. Explain your finding in the report (5%).

(c) Calculate the PSNR between the original image I0 and the up-sampled images, i.e., nearest , bilinear,and  bicubic respectively ,Compare  the  results  of  different  interpolation  methods. Explain your finding in the report. (Note: for the bilinear and bicubic interpolation, please use the Matlab function directly) (10%)

* For the peak value use 255, the PSNR should be calculated via:

where the Mean Square Error MSE should be evaluated as:

Lab 2 on Nov. 17th, 2023

Objectives:

Learn different image enhancement techniques

Learn basic morphological operations

Task in Lab 2 (20%)

Feature detection and matching: edge detection, interest points and cornets, local image features, and feature matching

Morphological operation on the image of im_sawtooth (please load the image sawtooth.bmp as im_sawtooth).

(a). Extract the boundary of the image, and show it in the report (10%).

• (b). Conduct the operations of erosion, dilation, opening, and closing. Please use the function of strel to create the structuring element with the shape of disk (You can set your preferred radius). Show the results after each operations and calculate the number of foreground pixel. Write your comments on comparing the results of dilation and closing  (10%).

Lab 3 on Nov. 24th, 2023

Objectives:

Learn basic Linux (ubuntu) operations via remote ssh connection

Practice basic Linux commands via remote terminals

• Learn basic coding skills with Python upon Pycharm Professional (education free version) / VS- Code;

(An individual ppt will help students go through these bullets instructed by the lecturer / TA)

Lab 4 on Dec. 1st, 2023

Objectives:

•  Review operations involved in Lab 4

•  Install Anaconda virtual environment via remote ssh terminals

•  Install Anaconda + Pytorch + GPU functionalities and test the validation.

•  Instruct to debug a piece of code on remote Linux machine via Pycharm / VS-Code ssh tunnel functionalities.

(An individual ppt will help students go through these bullets instructed by the lecturer / TA)

Lab 5 on Dec. 8th, 2023

Objectives:

• Try to  implement a simple Convolutional  Neural  Network  (CNN) Architecture  LeNet-5  on the MNIST dataset.

Get familiar with a conventional workflow to train and inference with a CNN including:

Data preparation and processing

Data augmentation

• Architecture construction

Choose a proper batch size during the training

Optimiser choice with losses formulation

Training

Validation in the middle to avoid overfitting

inference for testing.

• Learn basic knowledge to work with remote GPU including selecting, monitoring running status, kill process, etc., that are necessary in this exercise;

• Learn how to debug in the above-mentioned workflow in Pycharm / VS-Code with ssh tunnel based on school servers

(An individual ppt will help students go through these bullets instructed by the lecturer / TA)

Task in Lab 5 (30%)

In this task, you will be asked to build a very simple CNN model LeNet-5 and try to play with it with the MNIST dataset for hand-written dataset. The architecture of LeNet-5 is as follows:

The MNIST database of handwritten digits, available from this page, consists of a training set with 60,000 examples, and a test set with 10,000 examples. It is a subset of a larger set available from NIST. The digits have been size-normalized and centered in a fixed-size image. See the following image for a few examples from MNIST dataset.

Please give explanations in your report to the following questions:

• (a). What data preprocessing and data augmentation techniques you have used and do you see any difference in both your training and testing (4%)?

• (b). During the network architecture construction, what difficulties you have met and how you solved them (4%)?

• (c). What optimiser you have used in this task and do you see any difference in both training and testing (4%)?

• (d).  What  optimising  losses  you  have  used  during  the  training?  How  is  your  training  loss evoluting during the training (6%)?

• (e). How does your validation error become during the training and when you stop training, what criterion you have fulfilled (6%)?

(f). How the batch size affect both the training and testing (6%)?

Please use necessary figures and summarized data (such as training time, accuracy, loss, etc.) to make your demonstration clear.

Lab 6 on Dec. 15th, 2023

Objectives:

• Try to implement a relatively more complicated Convolutional Neural Network (CNN) Architecture AlexNet on the MNIST dataset.

Task in Lab 6 (30%)

In this lab, you will be asked to build a AlexNet (see the following architecture) to train a classifier on MINST dataset based on the python + PyTorch codes implemented in Lab 5 for LeNet.

Please give explanations in your report to the following questions:

• (a). Please try to compare performance difference in prediction power of both models (LeNet-5 and AlexNet);  Please  also  demonstrate what similarities  and difference you  have found  and possible reasons that due to these similarities and differences (15%).

• (b). Please demonstrate whether LeNet-5  and AlexNet are suitable for the given task and specify reasons contributing to your conclusions (15%).

Lab Report Submission:

Write a short report which should contain concise descriptions of your results and observations. Please include listings of the Matlab / Python scripts that you have written. Describe each of the images that you were asked to display.

Answer each question completely:

•  Do not attach the code at the end of the report. Please only paste the useful code under each question;

The results maybe contain some figures, please add some index and title of each figure;

•  Electrical version to LMO with a rar/zip of all files

Rar file name: RBE306TC-LabReport-FirstnameFAMILYNAME-studentID.rar

One file with same file  name  of  *.rar  File:  Report  (with  studentID,  name,  Lab  title  on  the homepage)

One folder: codes and other materials. (Examiners are able to run your codes directly)

Marking Scheme:

• 80%-100% Essentially complete and correct work including proper pieces of functional codes, necessary of illustrations, and clear demonstrations.

60%-79% Shows understanding, but contains a small number of errors or gaps.

• 40%-59% Clear evidence of a serious attempt at the work, showing some understanding, but with important gaps.

20%-39% Scrappy work, bare evidence of understanding or significant work omitted.

<20% No understanding or little real attempt made.