Coursework Assignment Summer
Coursework Assignment Summer
Coursework Assignment
1 Assignment Overview
This assignment will involve you designing, building, testing and critiquing a system for per-
forming face alignment, aka. locating facial landmarks in images. There is also a small extension
task detailed below.
It is worth 100% of the grade for this module. It’s designed to ensure you can demonstrate
achieving the learning outcomes for this module, which are:
• Write and document a computer program to extract useful information from image data.
• A summary and justification for all the steps in your face alignment system, including
preprocessing, choice of image features and prediction model. Explaining diagram-
matically is very welcome.
• Results of your experiments: This should include some discussion of qualitative (ex-
ample based) and quantitative (number based) comparisons between different ap-
proaches that you have experimented with.
Ivor Simpson: Computer Vision @ University of Sussex – Summer 2021
• Qualitative examples of your face alignment approach running on the small set of
provided example images, found in the compressed numpy file (examples.npz) here.
• Examples of failure cases in the face alignment system and a critical analysis of these,
identifying potential causes and solutions.
• Results and a description of your pose-based image retrieval system. This should
include details of how the distance between face poses is calculated and the closest
examples are retrieved.
2. A .csv file that contains the face landmark positions on the test set of images, found in the
compressed numpy file (“test images”.npz) here. You must use the provided “save as csv”
function in the colab worksheet to process an array of shape (number test image, num-
ber points, 2) to a csv file. Please make sure you run this on the right data and submit in
the correct format to avoid losing marks.
3. Either .ipynb files or .py files containing annotated code for all data preprocessing, model
training and testing.
• what methods you have used, with what training parameters and why.
• what image features you have used, briefly describe how they were calculated, and
why you chose them.
• any image pre-processing steps you have used, and why.
For top marks, you should clearly demonstrate a creative and methodical approach for
designing your system, drawing ideas from different sources. Explaining using diagrams
and/or flowcharts is very welcome.
methods. Please note that I am interested in your final prediction results, rather than how
the cost function changes during training. A detailed qualitative analysis would investigate
and identify systematic failure cases, providing visual examples, and propose potential
solutions.
25 Marks Pose-based image retrieval Describe and justify your pose-based image retrieval algo-
rithm, ideally using a diagram, flowchart or psuedocode. Provide a mathematical definition
for your distance function between face poses. The absolute coordinates of the face in the
image are not the best description of pose as they incorporates the position in the image
as well as shape, so you should compensate for this in your approach.
The results should be presented for up to 5 images of different poses taken from either
the training/testing set for use as query images, and you should retrieve the 3 images that
have the closest facial pose. Marks will be allocated for the quality of the description,
appropriateness of the method and presentation of the results.
5 Marks Code annotation is for annotating sections of the training/testing code with what they
do. To get maximum marks, explain each algorithmic step (not necessarily each line) in
your notebook/.py files.
• Provide references, if you read anything useful. You can take figures from other works as
long as you reference them appropriately.
• Diagrams, flowcharts and pictures are very welcome, make sure you label them properly
and refer to them from the text.
• Saving the results to a .csv file, which contains some checks to make sure you’re predicting
on the correct dataset.
A set of test images, without landmarks is provided in the compressed numpy array (test images.npz)
here. This data is loaded the same way as before, but there are no points stored in the file.
I also include 6 images to use for qualitative comparisons found in the compressed numpy
array (examples.npz) here. These images should be included in your report to demonstrate face
alignment performance across different genders, ethnicities and poses.
A well justified and high performing CNN approach will receive equivalently high marks as if
you’d built it any other way.
In terms of sourcing additional labelled data, this is not allowed for this assignment. This
is because in real-world commercial projects you will typically have a finite dataset, and even if
there are possibly useful public datasets available, their license normally prohibits commercial
use. On the other hand data augmentation, which effectively synthesises additional training
examples from the labelled data that you have, is highly encouraged. If you use this, please try
and add some text or a flow-chart of this process in your report.
5 Where do I start
5.1 Face Alignment
Face alignment is covered in lecture 14, so that’s a good place to look for information. I briefly
discussed the assignment at the end of the lecture, which you can listen to on Canvas. I’ve also
included some references below.
I have included a very basic colab worksheet illustrating how to load the data and visualise
the points on the face.
The simplest approach would be to treat this as either a regular or a cascaded regression
problem. To follow this approach you will need to consider what image features are helpful to
predict the landmarks and whether some pre-processing is required on the data. One simple way
to proceed is to choose a set of locations, either evenly spaced across the image, or in some more
useful pattern (think about where in the image you might want to calculate more informations).
Using a feature descriptor, such as SIFT, you could predict the landmark locations using linear
regression (see FML lecture 13) and the associated lab.
You’re not restricted to taking this approach, and for higher marks creativity is very much
encouraged. Face alignment has seen a lot of interesting and varied ideas, and if you find some
good ideas while reading around the topic that would be great.
• Start with a simple achievable goal and use that as a baseline to test against. Keep track
of early models/results to use as points of comparison.
Ivor Simpson: Computer Vision @ University of Sussex – Summer 2021
Figure 1: Illustration of the 0-indexed (counting from 0 as you would in Python) locations of
the points on the face. For example, if we wanted to find the tip of the nose, that’s index 14
so we would look up points[14,:], which would give you the x and y coordinate of the tip of the
nose.
• Remember that even if it doesn’t work well, having a go at the extension tasks is worth a
few marks. We’re only looking for simple solutions.
• You don’t need to work at very high resolution to get accurate results. Particularly when
doing initial tests, resize your images to a lower resolution images. Make sure you also
transform your training points so they are in the same geometry as the image. For your
predicted points, make sure these are all at the same resolution as the original images.
• Think about things that you’ve learned about in FML as well as Computer Vision. Di-
mensionality reduction could be helpful. Overfitting and outliers may be an issue, and you
should consider using methods to minimise this.
7 Further reading
Face alignment is a reasonably well researched field, and a wide variety of methods have been
proposed. Some relatively recent approaches are documented below. [1] is probably a good one
to look at, [2] contains a survey of methods, which might give you some ideas and [3] describes
the results of a competition. The other references are very much optional reading on other
popular recent methods.
References
[1] Xiong X, De la Torre F. Supervised descent method and its applications to face alignment.
InProceedings of the IEEE conference on computer vision and pattern recognition 2013
(pp. 532-539). Paper link.
Ivor Simpson: Computer Vision @ University of Sussex – Summer 2021
[2] Learned-Miller E, Huang GB, RoyChowdhury A, Li H, Hua G. Labeled faces in the wild: A
survey. InAdvances in face detection and facial image analysis 2016 (pp. 189-248). Springer,
Cham. Paper link.
[4] Cao X, Wei Y, Wen F, Sun J. Face alignment by explicit shape regression. International
Journal of Computer Vision. 2014 Apr 1;107(2):177-90. Paper link.
[5] Burgos-Artizzu XP, Perona P, Dollár P. Robust face landmark estimation under occlusion.
InProceedings of the IEEE international conference on computer vision 2013 (pp. 1513-
1520). Paper link
[6] Zhu S, Li C, Change Loy C, Tang X. Face alignment by coarse-to-fine shape searching.
InProceedings of the IEEE conference on computer vision and pattern recognition 2015
(pp. 4998-5006). Paper link