MCLD's blog 2017-01-31T07:53:08Z Dan Stowell urn:uuid:c5f023f0-b017-11df-94e2-0800200c9a66 Paper: Applications of machine learning in animal behaviour studies 2017-01-31T07:51:06Z 2017-01-31T07:53:08Z A colleague pointed out this new review paper in the journal "Animal Behaviour": Applications of machine learning in animal behaviour studies.

It's a useful introduction to machine learning for animal behaviour people. In particular, the distinction between machine learning (ML) and classical statistical modelling is nicely described (sometimes tricky to convey that without insulting one or other paradigm).

The use of illustrative case studies is good. Most introductions to machine learning base themselves around standard examples predicting "unstructured" outcomes such as house prices (i.e. predict a number) or image categories (i.e. predict a discrete label). Two of the three case studies (all of which are by the authors themselves) similarly are about predicting categorical labels, but couched in useful biological context. It was good to see the case study relating to social networks and jackdaws. Not only because it relates to my own recent work with colleagues (specifically: this on communication networks in songbirds and this on monitoring the daily activities of jackdaws - although in our case we're using audio as the data source), but also because it shows an example of using machine learning to help elucidate structured information about animal behaviour rather than just labels.

The paper is sometimes mathematically imprecise: it's incorrect that Gaussian mixture models "lack a global optimum solution", for example (it's just that the global optimum can be hard to find). But the biggest omission, given that the paper was written so recently, is any real mention of deep learning. Deep learning has been showing its strengths for years now, and is not yet widely used in animal behaviour but certainly will be in years to come; researchers reading a review of "machine learning" should really come away with at least a sense of what deep learning is, and how it sits alongside other methods such as random forests. I encourage animal behaviour researchers to look at the very readable overview by LeCun et al in Nature.

Spy in the Wild 2017-01-20T18:27:01Z 2017-01-20T18:29:10Z Last year, when I took part in the Dagstuhl workshop on Vocal Interactivity in-and-between Humans, Animals and Robots, we had a brainstorming session, fantasising about how advanced robots might help us with animal behaviour research. "Spy" animals, if you will. Imagine a robot bird or a robot chimp, living as part of an ecosystem, but giving us the ability to modify its behaviour and study what happens. If you could send a spy to live among a group of animals, sharing food, communicating, collaborating, imagine how much you could learn about those animals!

So it particularly makes me smile to see the BBC nature doc Spy in the Wild, in which they've... gone there and done it already.

--- Well, not quite. It's a great documentary, some really astounding footage that makes you think again about what animals' inner lives are like. They use animatronic "spy" animals with film cameras in, which let them get up very close, to film from the middle of an animal's social group. These aren't autonomous robots though, they're remotely operated, and they're not capable of the full range of an animal's behaviours. They're pretty capable though: in order both to blend in and to interact, the spies can do things such as adopt submissive body language - crouching, ear movements, mouth movements, etc. And...

...some of them vocalise too. Yes there's some vocal interaction between animals and (human-piloted) robots. The vocal interaction is at a pretty simple level, it seems some of the robots have one or two pre-recorded calls built in and triggered by the operator, but it's interesting to see some occasional vocal back-and-forth between the animals and their electrical counterparts.

There are obviously some limitations. The spies generally can't move fast or dramatically. The spy birds can't fly. But - maybe soon?

In the mean time, watch the programme, it has loads of great moments caught on film.

Making eye contact with strangers 2016-12-31T06:40:20Z 2016-12-31T06:40:48Z If you're looking for a New Year's resolution how about this one: make more eye contact with strangers.

I was reading this powerful little list of Twenty Lessons from the 20th Century by some Professor of History. One idea that struck me is a very simple one:

11: Make eye contact and small talk. This is not just polite. It is a way to stay in touch with your surroundings, break down unnecessary social barriers, and come to understand whom you should and should not trust.

In a large city like the one I live in, eye contact and small talk are rare. They're even rarer thanks to smartphones, of course - although, twenty years ago, Londoners were still avoiding each other, but using newspapers, novels and Gameboys instead. Anyway I do think smartphones create a mode of interaction which reduces incidental eye contact etc.

So I decided to take the advice. Over the past month or so I took those little opportunities - at the bus stop, at the pedestrian crossing, at the supermarket. A bit of eye contact, a few words about the traffic or whatever. I was surprised how many opportunities for effortless (and not awkward!) tiny bits of smalltalk there were and how worthwhile it was to take them. After the year we've had, this is a little tweak you can try, and who knows, it might help.

The best vegetarian recipes of 2016 2016-12-22T04:12:16Z 2016-12-24T06:38:35Z I've been cooking vegetarian in 2016. It's about climate change: meat-eating is a big part of our carbon footprint, and it's something we can change. So here I'm sharing some of the best veggie recipes I found this year. Most of them are not too complex, the point is everyday meals not dinner parties.

Note: you don't have to go full-vegan - phew. You can do meat-free Mondays, you can try Veganuary, you can give up beef, or whatever, it all makes a difference. It's true that vegans have the smallest carbon footprint but it's pretty unlikely we're all going to go that far, and a more vegetarian diet makes a big improvement. (Here's an article with some data about that...)

So here we go, the best vegetarian recipes of 2016 - as judged by a meat-eater! ;)




  • Asparagus, pea, feta and mint salad - great combination.
  • Pea, mozzarella & lemon tart (from Take One Veg) - wasn't quite as "speedy" as the recipe's name suggested (40 min when I did it...). But maybe it gets quicker once you get handier with the puff pastry. It was really nice, fresh-tasting.
  • Untitled Sweet onion and puy lentil stew - I was so impressed with this, one of those simple meals that if you do it well is really satisfying. The texture+flavour contrast from the onions on top is the key.
  • Grilled orange, carrot & halloumi (from "River Cottage Fruit") - ace, just an ace combination of three flavours, lightly dressed. Easy to make and the ingredients are not exotic. Really handy.


  • Untitled Jackfruit "pulled pork". This is extremely handy - it fills a gap that a lot of veggy stuff doesn't, i.e. it's a big barbecue nom with a meaningful texture. Really all you need is to keep a tin of green jackfruit in your store-cupboard, it doesn't need anything else exotic. It's easy to cook (just a pan on a gentle heat for half an hour, really). (However, one tin of jackfruit feeds about me-and-a-quarter. If only we were perfectly size-matched...)
  • Big aubergine and lemon tagine - OH YEAH is really all I've got to say about this.
  • Roast pumpkin and aubergine spaghetti


  • Butternut squash toad-in-the-hole
  • Untitled Slow-roasted tomato lasagne (from Take One Veg) - great flavour, and easy to make - though the tomatoes take a while to slow-roast, so do note that it's slow even though really easy. Also note that you need loads of tomatoes, you'll be surprised. I was low on creme fraiche so I used half creme fraiche half greek yogurt, that worked fine and makes it a bit lighter.

These are all ones that were new discoveries. Of course there's plenty of standard stuff too. Anyway - pick a recipe, give it a go.

Twelvetrees ramp is open! First pics 2016-12-17T11:00:51Z 2016-12-17T11:48:54Z The Twelvetrees Ramp is open! It's the "missing link" in the walk down the River Lea from the Olympic Park all the way down to Cody Dock. Previously, to complete the walk you had to come off the river at Three Mills and go on an ugly detour round the Tesco's and the Blackwall Tunnel Approach. This ramp links up two bits so you can go more-or-less continuously down the river paths.

It was supposed to be open in September but... well... you know. And finally today it's open! Here are my exciting first pictures of it, looking robust against the wintry fog:


A fun bit of ironwork on top there. In the evening, the old streetlamp on the bridge lights up, and the new ironwork and the old streetlamp work well together.


It would have been nice if it had been open for all those autumnnal walks in the evening sun and the lengthening shadows. Instead, now you can walk all the way down to Cody Dock, except you won't find much going on down there in winter time. But hey ho, it's ready for 2017!

Oh and by the way here's Twelvetrees Ramp on the map

Govt report on implications of leaving the EU for UK science and research 2016-11-21T07:41:36Z 2016-11-21T08:14:45Z The House of Commons Science and Technology Committee has published its report into the implications of leaving the EU for UK science and research. The report is accompanied by a set of conclusions and recommendations.

By the way: the implications of Brexit (if indeed the UK ends up going through with it! So much is uncertain, even now) are massive and widespread. Science and engineering are only one of the many big issues that need to be considered. But as a UK sci/eng researcher I have good reasons to pay attention to this side of things! It's not about how much money I get. It's about whether the UK will be maintaining its attractive leading edge in research, as I said before the vote.

There are some really sound recommendations in there. Recommendation #4 is good: the Government should articulate a "genuinely comprehensive strategy for communicating its messages of ongoing support for science and research in the context of its plans for leaving the EU and the negotiations to follow." Why is this important? Because the Brexit vote itself send a message round the world about what kind of place Britain was, to existing and potential researchers. On top of that, really unfortunate messages were sent when certain government ministers talked casually about whether or not EU nationals would be allowed to stay in the country. So the Government has some work to do, to make sure the researchers of the future - currently planning to apply for PhDs, choosing courses/locations, and looking at global politics with eyebrows raised - understand that we want to work with them and we plan to treat them honourably.

This goes hand-in-hand with recommendation #6 and #7: mobility is crucial for research, and it'd be shooting ourselves in the foot to forget that. The Government's choice of negotiating position is going to make a massive difference here: how will they balance freedom-of-movement (though it's not my own wish to reduce it, a Brexit would be rather hollow if it didn't do so) against the access to market/finance which they seem to be expending the most energy worrying about? But in order for UK research to flourish, researchers from other countries - both present and future - need to know that they're welcome here and not threatened by uncertainty.

Frankly, though, I'm still left with the feeling "Why the hell are we still going through with this stupid idea?" I respect the outcome of the referendum but it expressed the nation's preferences, not any actual plan - and the elephant in the room is that any actual specific choice of Brexit is going to be one that the majority of people think is stupid and unjust - both the ones who voted for it as well as the ones who voted against it.

Read the recommendations in full - they are sensible.

Butternut squash toad-in-the-hole 2016-11-06T09:22:30Z 2016-11-06T11:27:25Z This is a good hearty Sunday lunch for a vegetarian. One thing I'm missing as I increase my vegetarian-ness is something that's a proper centrepiece for a Sunday roast - those "nut roast" things which are fairly common are OK but I don't think I've had one that could outshine the roast potatoes on a plate. Anyway toad to the rescue. Of course you can do toad-in-the-hole with veggy sausages, but this here is great and not pretending to be anything it isn't!

Serves 2. Takes about 90 minutes in total, including a lot of oven-time where you can do other things.

I recommend you serve this with onion and red wine gravy (takes about 30 mins in a gentle pan), and have some raspberry vinegar available to sprinkle on the pud.

  • 1/2 a butternut squash (easiest to use the top half for this one)
  • 75 ml milk
  • 75 ml water
  • 65 g plain flour
  • 1/2 tsp mustard
  • 1 egg

With a whisk or a fork, mix the milk, water and egg. Whisk the flour in, beating out any lumps. Now let this batter stand for a little while, e.g. 15 minutes, though it can easily rest for an hour.

Preheat the oven to 210 C.

Peel the squash and cut it into big thick fingers, like oversized chunky chips. (This is easiest if you're using the top of the squash and not the lower half with the seeds.)

Brush a roasting tray with oil (olive or vegetable) and then spread the squash pieces out on it. Drizzle over some more oil then roast the squash in the oven for about 40 minutes. They're going to get a bit more cooking after this, so they don't need to be "done" - they need to be at the point where they're just starting to soften and to get some darkening caramelisation at the edges.

While the squash is roasting, prepare the roasting tin in which you'll cook the toad. This needs to be at least 1 inch deep. Put a good glug of vegetable oil in, and then put this in the oven alongside the other stuff, so the tin and the oil can pre-heat to a good hot heat.

Take the squash out of the oven. If you leave them out a couple of minutes, they'll cool a bit so they're easier to handle in the next step.

Next is assembling the toad. It has to be done quickly! So that everything's hot in the hot tin. Quickly get the hot tin from the oven, pour the batter into it, then place the squash pieces one-by-one into the middle of the batter with a bit of space between them - and immediately return this to the hot oven and shut the door. This then cooks for 20-25 minutes until the batter is risen and crusty, the squash is nicely cooked and getting a nice roast colour.

If you have more pieces of squash than you can accommodate in the tin, simply put them back on the roasting tray and continue to roast them. You can serve them alongside.

Vegetarian food in Paris 2016-10-30T16:04:27Z 2016-10-30T16:04:27Z While in Paris briefly (on my way somewhere else), I decided to go only to vegetarian restaurants. This helps to narrow down the list!

The curiously-named is an Italian veggy restaurant right in the centre of town, just a touch south of the river. Friendly and efficient atmosphere, and lots of really nice flavours. It was a good sign when they served a little starting-taste of creamed sweet potato garnished with wafer-thin slices of yellow beetroot - delicious flavour, expertly done. Then, for my starter, I had a puree of... well I don't really know how to translate what I had, but let's say a puree of some sort of pea, with courgette flowers, topped with fried kale and pumpkin seeds. It tasted ace.

For the main course I went for the fancy-sounding tofu crusted with quinoa, served with a big mushroom and a mushroomy broth. The tofu was fine, but to be honest not really more than the sum of its parts. The mushroom and the broth tasted really deeply though. You can't tell from a photo whether it's just a mushroom or something more, but rest assured it was really flavourful:


Later the same day I ate in Brasserie Lola. The fun thing about Brasserie Lola is that it's vegan but they basically keep that a secret - you can't tell from outside, in fact you can't really tell from the menu unless you peer really closely and wonder why the cheeseburger involves "seitan".

I had said cheeseburger and chips, and it's good. I also had a nice starter of leeks in vinaigrette. The sorbet I had for afters was a bit marred by being covered in cream (wtf?) but never mind. The place is nice and has a good feel to it, classic French brasserie style.

I've got to give credit to for helping me find both these places.

Vegetarian armoury: things you might need 2016-10-02T06:00:21Z 2016-10-02T13:49:50Z I've been cooking more and more vegetarian food this year. It's better for the climate and why not. You don't have to give anything up, in my opinion - you don't ned to go full veggy, just go in that direction.

So, to mark World Vegetarian Day here are my secrets, as a meat-eater, for how I'm cooking vegetarian for myself and not going hungry or getting bored. It's not really a glamorous list. The point is everyday eating. These are things that I didn't always have in the past but are now really handy go-to things to have in the cupboard:

  • Halloumi - lasts ages in the fridge. It's a classic veggie standby but the main reason I've added it is I've worked out a few different recipes with it - it's not just a one-trick pony. Most veggies will tell you "just grill it and eat it, it's lovely" but you need to have a few options. One unusual but easy and good is griddled halloumi+carrot+orange - a trick I got from the "River Cottage Fruit" cookbook - those three flavours go together great as a fast warm salad.
  • Black beans - a tin of black beans is really handy. A full flavour, and versatile. My top tip is my "black bean chorizo": Drain & mash 1 tin black beans, marinate with red wine, paprika, fennel, crushed garlic, salt&pepper. Then keep that in a sealed box in the fridge - it lasts for weeks and weeks and you can add a dab to stews or whatever to add a deep developed flavour that sometimes is missing from veggy life. Other things you can do with black beans include putting them in a wrap/taco, using them in stews, salads, you get the idea.
  • Puy lentils (ready-cooked and vacuum packed) - a pack lasts for ever in the cupboard, can be an emergency meal in itself, and is a great ingredient for a roast tomato lasagne, or a stew. The roast tomato lasagne is a great recipe in Take One Veg by Georgina Fuggle.
  • Chickpeas - kinda obvious, but: chickpeas are (a) handy for curries or tagines, (b) can be whizzed up for a nice fresh hummus at the drop of a hat, and as a bonus trick, (c) the water from a tin of chickpeas can be used for those bonkers vegan meringues.
  • Spinach - lasts ages in the fridge, and versatile - it can be salad, or cooked, or put into curries etc.
  • Cauliflower/broccoli - in British cookery, the tradition is to have these as just a veg on the side of your meat dish. But a cauliflower or a broccoli can totally be the centrepiece of lots of good veggie main courses. Cauliflower cheese is an obvious one. Roasted cauli/broccoli makes a good basis for a warm salad like this one. This year has also seen lots of recipes for "cauliflower couscous" or "cauliflower pesto" in which you put a cauliflower in a blender. Not my favourite thing to do with a cauli, I'll admit, but at least it's showing its adaptability.
  • Nuts! I've now got an old ice-cream tub full of different types of nuts. peanuts (plain), almonds, pine nuts, walnuts, etc etc. again, they last forever, they add protein and sweetness and variety, and yeah loads of recipes.

None of this is big news, especially not to anyone who's already a vegetarian. But if you're a meat eater, try getting these things in stock, and adding a couple more recipes to your inventory.

There are a couple of things not included in that list above. I'm too impatient to spend a lot of time with tofu (I don't see why I should spend ages marinating tofu to add some flavour to it, when I could just fry some halloumi or some paneer instead), though I love tofu in a thai green curry. Avocados are great but they don't last long, they're expensive, and although people do various weird things with avocados (like make cakes from them), I usually find the best thing to do with an avocado is just to eat it!

Some papers seen at MLSP 2016 2016-09-18T15:18:47Z 2016-09-18T16:01:23Z MLSP 2016 - i.e. the IEEE International Workshop on Machine Learning for Signal Processing - was a great, well-organised workshop, held last week on Italy's Amalfi coast. (Yes, lovely place to go for work - if only I'd had some spare time for sightseeing on the side! Anyway.)

Here are a few of the papers that caught my interest:

  • Approximate State-Space Gaussian Processes Via Spectral Transformation by Toni Karvonen and Simo Särkkä. This is an important contribution to the current work on Gaussian processes and in particular on running efficient Gaussian process inference. It builds on other work from the Särkkä lab converting Gaussian processes to state-space models, which often involves a (mild) approximation. This paper introduces some new methods in that vein, with proofs, and in fact the paper includes various ways to approximate a GP. A veritable mathematical toolkit. It seems the Taylor expansion (the most immediately comprehensible IMHO) is not the best.

Actually, there was substantial work involving Gaussian processes at MLSP. Is it a growth area? Well, if the use of GPs can be made more scalable (as in the above paper) then yes, it certainly should be. They are a very flexible and general tool, and nicely Bayesian too. Richard Turner's keynote about Gaussian processes was a beautiful introduction - he manages to make GPs extremely understandable. If you get a chance to see him speak on them then do.

  • Localizing Users And Items From Paired Comparisons by O'Shaughnessy and Davenport. This is a nicely conceived addition to the literature on recommendation algorithms, and with good demonstrations of how the approach is robust to issues such as incoherent paired comparisons.
  • "Data Privacy Protection By Kernel Subspace Projection And Generalized Eigenvalue Decomposition" by Diamantaras and Kung. Privacy-preserving computing is an important area for current research. It's made obvious when we see how much a large company like Facebook or Tesco can infer about its users. Here, the authors treat privacy as a classification task - i.e. the data to be kept private is some kind of discrete label - and they apply an LDA-like method: maximise the scatter between the target classes for the "allowed" task, while minimising the scatter between the private classes. (I raised an issue with their "Privacy Index", noting that the desired accuracy for the private task was not in fact zero but ignorance. I'd presume that a metric based on mutual information would be a nice alternative.)
  • "Scale and shift invariant time/frequency representation using auditory statistics: application to rhythm description" by Marchand and Peeters. They use the "Scale Transform", a class of Mellin transform. Equivalent to exponentially time-warping a signal then weighting by an exponential window. Since it's not shift-invariant you don't want to apply it directly to audio, but to e.g. autocorrelation. From there, they argue you get a good featureset for characterising musical rhythm.
  • Score-Matching Estimators For Continuous-Time Point-Process Regression Models by Sahani, Bohner and Meyer - good to see this. I've been using point process models to analyse bird communication and so I'm interested in efficient ways to do such analysis, which commonly seem to come from the computational neuroscience literature at the moment. Notable that this approach doesn't require any time discretisation, so could be useful. The functions analysed need to be differentiable, so to work with impulsive time series they actually convolve/correlate them with basis functions; feels like a minor hack but there you go.

Also, I was very pleased that Pablo A Alvarado Duran presented his work on Gaussian processes for music audio modelling - his first publication as part of his PhD with me!