Monthly Archives: May 2014

Computer Science Annual Dinner

Sunday 18th May was the Computer Science Annual dinner for Queens’ undergrads, graduates and supervisors.  One of my favourite things about the dinner is getting a chance to catch up with our graduates and with a total 63 people attending it was the biggest I’ve been to.  There was a very relaxed and social atmosphere and all the different groups of people got on really well.


We were especially pleased to welcome Demis as our guest of honour this year.  Demis graduated from Queens’ in 1997, went on to do a PhD and then founded DeepMind Technologies – recently acquired by Google.   Demis featured in our elevator pitching session a few weeks ago (can you spot it?) and he was in hot demand from the more entrepreneurial undergraduates.

This year’s organizers, Mistral and Eduard, did an excellent job.  Everything ran smoothly from the Champagne reception (photo below), to formal hall, to the extra food and drink in Old Hall to round the evening off.


I complete the takeover as Director of Studies this year and so Robin Walker gave his final Computer Science Dinner Speech.  Next year I’ll have to do it all by myself although Robin admitted he might come along if we extend an invitation.

The dinner is greatly enhanced by some generous sponsorship by both companies and individuals.   The companies sponsoring us this year were: Jane Street, Skin Analytics, Coherent Graphics, G-Research, Bromium and Acano – all of these were represented at the dinner by a Queens’ graduate or two.

James King’s AI Playlists (

It’s an hour after the last exam and people are coming back to my place to celebrate. However, my choice in music is terrible, and I don’t want to kill the buzz by playing things no one else likes. The solution: have a computer do it for me.


James developed a music analysis platform for his part III project, which provides a q-learning hierarchical-clustering Markov-model solution to the problem of playlist creation. The idea is to it separate music that sounds similarly into clusters, so that if there is one track in my library that I can identify as socially acceptable, the algorithms will find others like it as well. Additionally, James used modern AI techniques to model how I interact with my music in order to produce better recommendations based on different user moods (e.g. revision vs. hacking). Here’s an overview of how it works:

Feature Extraction (Learned in Part II)

The first step is to take a song and turn it into a set of descriptive features. He takes in music files that look like:


And by doing autocorrelation, a method of exaggerating repeated features and suppressing others, he turns them into signals like the following:


The high peaks labeled “good match” are then used to identify songs.

Clustering (Learned in Part IB)

Since the first goal of the project is to divide songs into clusters (playlists) based on similarity, these features need further processing. In particular, a clustering algorithm, which takes a set of unorganized points and divides them like this:


Each point here represents a song, and they are currently being clustered by two different features. However, this type of clustering doesn’t capture the notions of genres and subgenres, so James opted for a more refined hierarchical clustering algorithm, which does stuff like this instead:


What to Play Next

At this point, the algorithms have everything grouped into playlists and subplaylists, using hierarchical clustering on the characteristic features of each song. The next part of the problem is figuring out which song in the playlist to play next, given the previous song. This is done with Markov Models.

Markov Models (Learned in Part IB)

A Markov model shows how states are probabilistically linked, making the assumption that the next state is entirely dependent on the current state. So for example (probabilities are heavily adjusted because Andy can see this):

If I’ve been revising, it’s highly likely that I’ll keep revising, with only a tiny chance that I’ll end up going to a pub. And even if I make it to a pub, I definitely wont go to another one afterwards; instead it’s straight to sleep.

James took this and replaced the states (revising, sleep, go to pub) with clusters and subclusters in his model. The model then contains the likelihoods of switching artists, genres, and different songs within the same genre. It is initially created to make similar songs likely to be played in sequence, but then uses AI to learn a better way of doing this based on user actions.

The AI – Q-Learning (Learned in Pat II)

This part is more involved, so I can only give a general overview.

In essence, Q-learning is a method of teaching a computer to perform some task by shouting at it when it gets it wrong and giving it a cookie when it gets it right, learning by reinforcement. In this case, the recommender did a good job if the user listens to a track all of the way through and a bad job if the user skips over it after the first few seconds.

With this information, the system can update the Markov model describing how the next song is chosen. For more information, here’s a link to our AI II course’s notes on the topic (page 339):  

Now that James has done the hard work for us, you can try out his system at to see for yourself how it works.

The ‘Untrusted’ games

Last Wednesday all Queens’ Computer Science students participated in a team programming game with delicious prizes offered by Dr. Rice.

The evening started off nicely with -guess what- special prizes offered for the best team name and for matching outfits. Team “’) DROP TABLE PARTICIPANTS; – -” managed to secure first place. Even though they were not the only ones trying to do that(!) they were the ones with the closest correct SQL injection (fortunately Google Forms is not vulnerable to these attacks).

XCKD SQL injection

Teams with similar hats, similar shirts and/or “fancy” dressed were awarded prizes as well.

1 2 3 4

The actual programming contest consisted of playing the game Untrusted and seeing who manages to finish it first. This is a puzzle game, where you have to write/complete, under some limitation, Javascript code in order to pass different levels. The game proved to be quite tricky and quite entertaining. I especially liked the level – sorry for the spoiler – where your player was in the forest and you had to regenerate the trees until you can move him and reach the exit.

Overall the contest was useful since we learned a bit of JavaScript – for those who didn’t know it already- and got to work in teams. Prizes were awarded along the way for funny or efficient solutions to different levels. We stopped after 2 hours with no team managing to finish the game –although coming really close to the end and even stopping on the last level- but with all teams doing much better than Dr. Rice.

Part II Project Demos

This week the Part II students demonstrated their finished projects to the rest of us.

Giving a demo requires quite a bit of preparation because it needs to be fast moving and to keep the audience interested about what they are seeing.

Simon presented his secured package management tool.  He demonstrated how you can add new packages to the repository and have the client program build a dependency resolution plan.  He found an interesting split in package dependencies: packages seemed to either have lots of immediate dependencies (bushy) or a long chain of dependencies but with only a few branches at each level (stringy).  Simon had a nice demo idea of preparing breakpoints in his code so that the IDE would stop at interesting points in the execution so he could point them out.   He had also prepared a variety of terminal windows with the right commands ready to go so that he didn’t have to spend time typing during the demo.

Tom showed off his optical music recognition system. He showed us his program processing a musical score and he mentioned each processing stage as it ran – I was pleased to see that he had worked out in advance how long this took and made sure his voice-over matched the real execution of the code.  After showing it working (and playing the music back to us) he used a series of intermediate images to explain what the processing code had done.  He highlighted how well the line following algorithm he used for following stave lines has worked out.

Stephen has built a gaze tracker which works with a commodity webcam.  He explained the various tracking stages by showing a video and then showed us a live demo of it working.  As always seems to be the way when demoing a machine vision system it actually worked less well during the demo than it has previously but he still managed to show us some interesting results.  I thought that for this project the idea of using a prepared video to explain the operation of the system and then following with a live demo was a good approach – it meant that he didn’t have to hide behind his laptop for the bulk of the talk and that we had a good idea of what to watch for when he showed the live version.

Lingnan has been building software to automatically score essays written by people learning English.  He had two prepared examples of a bad and a good essay and explained the features that his program looks for.  After showing the scoring output he showed how you can configure the classifier, and how important it is to configure the right features with useful thresholds.  I liked the fact that he gave some advice for others thinking about machine-learning/classifier-based projects: be prepared to spend a lot of time tuning parameters and experimenting with different options.  Much of Lingnan’s demo was done by showing us different text files in vim – which he drove like an expert.  However, as a member of the audience it was hard to follow at some points because of the quick way in which different views would appear and disappear as he navigated the interface.  When using an editor for editing its a good feature that it quickly jumps to new spots as a result of keyboard presses but probably when doing a demo some sort of visual way of showing the path or the movement through the files would help people follow.

Craig investigated text compression using grammar induction.  Despite his efforts the day before the projector took a strange dislike to his laptop and so Craig had to go with a backup plan – which was very well done.  He explained the operation of the algorithms he has implemented on the white board and then showed the compression output and ratios on his laptop screen in a huge font.  This approach worked well for his more theoretical project since it gave us a chance to understand better what we were seeing in the demo.   Craig showed off his grammar fuzzing technique and had a nice bit of audience interaction where he asked for some example strings that people wanted to try.

Well done to all the part II students for a very interesting set of projects and demos.  All that remains now is to finish the dissertations and submit them before the deadline: 12 noon on the 16th May.

Two of the project supervisors: Lech Świrski (who supervised Stephen) and Helen Yannakoudakis (who supervised Lingnan) came along to see the show and joined us for dinner after.  I’m very grateful to all the project supervisors for their work with Queens’ students this year.

Meet the supervisors

The other new supervisor for Queens’ this term is Fawad Jamshed.  Fawad will be supervising the 1B students for Artificial Intelligence I.

Here’s a bit of text about Fawad’s background:

Hi My name is Fawad Jamshed. My research interests include evolutionary computation modelling and multimodal neuroimaging analysis. Evolutionary computing is to develop computers programs using similar rules as that are used by human brain. If we want to make computers intelligent, best way to do this is to copy human brain (i.e. most intelligent entity known). A major problem in this regard is that we do not know much about how human brain works. There are number of neuroimaging studies that use number of different methods to test different assumptions about human brain to understand it’s working.

I hold undergraduate degree in Computer Science, postgraduate degree in business Information technology and PhD in Computer Science (Artificial Intelligence). Currently, I am working in the Neurolex group at the department of experimental Psychology, University of Cambridge. My current research involves, analysing neuroimaging data from functional magnetic resonance (FMRI) along with magnetoencephalography (MEG) and electroencephalography (EEG) experiments.

When an area of the brain is in use, blood flow to that region also increases. FMRI uses technology that measures brain activity by detecting associated changes in blood flow. MEG is a functional neuroimaging technique for mapping brain activity by recording magnetic fields produced by electrical currents occurring naturally in the brain. EEG is the recording of electrical activity along the scalp. EEG measures voltage fluctuations resulting from ionic current flows within the neurons of the brain. Aim of this research is to develop understanding about how human brain works, by relating cognitive theories to the underlying neural systems.

My PhD thesis title was “A basic Framework for Grounding Symbols by using Cell Assemblies that Emerges from Simulated Neurons”. During my PhD, main goal of my research was to develop an artificially intelligent agent that can understand meanings of different words like humans do so to effectively perceive and interact with its surrounding environment. A more biological faithful neuron model (fatigue leaky, integrating and firing neurons, fLIF), were develop to build an agent that can communicates via natural language, senses the environment, and assists the user. A 3D game was developed and an artificial agent was modelled in the game to check how intelligently it can behave using algorithms that was designed.