Photo (c) Jan Trutzschler von Falkenstein; CC-BY-NCPhoto (c) Rain RabbitPhoto (c) Samuel CravenPhoto (c) Gregorio Karman; CC-BY-NC

Research

I am a research fellow, conducting research into automatic analysis of bird sounds using machine learning.
 —> Click here for more about my research.

Music


Other

Older things: Evolutionary sound · MCLD software · Sponsored haircut · StepMania · Oddmusic · Knots · Tetrastar fractal generator · Cipher cracking · CV · Emancipation fanzine

Blog

I first encountered the vegetable which I call the dudhi many years ago. But now I've moved to a part of London with a large Bangladeshi community it's available everywhere.

It's a big vegetable like a cross between a cucumber and a potato. You can treat it a bit like a tough courgette. Steaming it the other day didn't work out well. But today I tried frying it with chicken, in a mediterranean fashion, and yeah that worked out.

This simple thing is to serve one and takes less than 20 minutes:

Slice the dudhi down the middle and then into slices about 1cm thick. Get some oil nice and hot in a big frying pan and add the dudhi. Fry the dudhi for a total of maybe 15 minutes, but adding more things about half-way through as follows.

While the dudhi is cooking, dice the chicken breast. Add some salt and pepper to a handful of plain flour on a plate, and toss the chicken in the flour, to coat evenly. Add it to the hot pan, making sure the chicken pieces are in the hottest and oiliest bit of the pan so that they're going to fry and cook. Slice the garlic and add that too.

When the food is ready to serve - you need to be confident that the chicken has had time to cook through - turn the heat off, then sprinkle the basil leaves on top of everything. Also sprinkle a small splash of water on top, which will instantly turn to steam and just help the basil along a touch. Stir briefly and serve, with bread or pasta.

recipes · Permalink / Comment

I found this great old book in an Edinburgh library a few years ago, about the invention of cooking. It's called "Food in History" by Reay Tannahill, published 1975.

I copied out a fascinating couple of paragraphs, let me quote them here:

But how the process of boiling was discovered - as it appears to have been long before the invention of pottery or the development of metalworking techniques - is a much more difficult problem. Fire may turn up by accident, and roasting may be the equally accidental result. But hot water is a rare natural phenomenon, and cannot be produced either accidentally without containers which are both heatproof and waterproof.

It is usually argued that food in prehistoric times was boiled by the following method. A pit or depression in the earth was first lined with flat, overlapping stones, to prevent seepage, and then filled with water. The water was brought to the boil by heating other stones or pebbles directly in the hearthfire and manhandling them (by some unspecified means) into the water. While the food was cooking, more hot stones were added to keep the water at a suitable temperature. In fact, this pit method sounds like a late development, a mass catering technique designed for large social gatherings which may have been spread by migrating tribes of advanced peoples. These, passing through the territory of backward communities, would repay their hosts by giving a feast. The backward communities, impressed by the new boiled food, would imitate the method - and continue to imitate it - because it was the only one they knew. 5000 B.C. appears to be the earliest date at which there is proof that the technique was used.

Long before this, however, many widely scattered peoples had their own more logical and far less tiresome ways of boiling meat, making use of pre-pottery containers which not only allowed them to use water in their cooking but may even, in some cases, have inspired the idea - either because without some form of liquid the food would stick to the container, or because food cooked in them produced its own moisture in the form of juices or steam.

In many parts of the world, for example, large mollusc or reptile shells must have been used, as they still were in the Amazon in the nineteenth century, when the naturalist Henry Walter Bates sampled a dish made from the entrails of the turtle, "chopped up and made into a delicious soup called sarapatel, which is generally boiled in the concave upper shell of the animal."

In Asia, that productive tree, the bamboo, was probably used. A hollow section stoppered with clay at one end, filled with scraps of meat and a little liquid, then stoppered again at the other would answer the purpose well. The method is still used in Indonesia today.

In Central America, in the Tehuacan valley near the south-western corner of the Gulf of Mexico, the people who lived in rock shelters around 7000 B.C. and gathered wild maize for food had begun to use stone cooking pots. It seems likely that a pot, once made, was sited in the centre of the hearth and left there permanently. It would be very heavy, suitable for use only when a community was firmly fixed in its abode or willing to fashion a new pot each time it moved its cave.

Before the advent of pottery and bronze, there was at least one type of container which was widely distributed, waterproof, and heatproof enough to be hung over (if not in) the fire. This was an animal stomach. In paleolithic times, the hunter, having killed his prey and carved up the flesh for transport, rewarded himself with a banquet of the more perishable parts - the heart, the liver, the brain, the fat behind the eyeballs, and some of the soft internal organs. Like twentieth-century Eskimos, he may have regarded the partially digested stomach contents of his kill as a special treat. It would be a logical development, as his liking for cooked food became a habit, to cook the contents in one of the stomach bags, and finally to use the same container for other dishes, some of them not too far removed in their finished effect from the modern casserole.

As late as the fifth century B.C., the nomad Scythians still cooked their food in a stomach bag when they had no cauldron available. "They put all the flesh into the animal's paunch," said Herodotus, "mix water with it, and boil it like that over the bonefire. The bones burn very well, and the paunch easily contains all the meat once it has been stripped off. [The rumen of a twentieth-century cow has a capacity of thirty to forty gallons.] In this way an ox, or any other sacrificial beast, is ingeniously made to boil itself."

Lots more interesting detail in this chapter ("Food and Cooking before 10,000 B.C."), The focus in this passage is on boiling, coming after some earlier developments such as roasting although roasting "was wasteful because of the shrinkage inevitable with high-temperature cooking."

This book came out in 1975, and it seems it was re-issued in 2000, so you should be able to find a copy. I might get one too. Inventions such as the wheel are well-known cliches - similarly, there must have been so many little revolutions in prehistoric cooking. I wonder if the research on this prehistory has developed further.

food · Permalink / Comment

For two months I've been visiting Richard Turner and the Machine Learning Group at Cambridge University. It's been a very stimulating visit. As part of my fellowship applying machine learning to bird sounds this was planned as a time to think about methods appropriate for the various purposes we want to analyse bird sounds - in particular given the constraints of uncontrolled audio recorded in the wild.

We considered approaches derived from non-negative matrix factorisation (NMF), from convolutional neural networks (ConvNets), and from neural spiking models.

NMF is conceptually simple and easy to optimise, and there have been some interesting recent extensions to hierarchical representations and so forth, which might allow for a structured decomposition of an audio scene. One thing I'd love to do is augment NMF with Markov renewal process temporal modelling, and it looked like Cemgil-style NMF would give us a way to inject that in as a prior on the activation patterns, but then we found a hole in our maths which meant it wasn't going to give us that. NMF models are interesting and very clear, but it's not always obvious when your problem will admit a cute algorithm to solve it. Still lots of interesting things one can do with NMF.

We then put most of our time into looking at convolutional auto-encoders (ConvAEs). As with the rest of the neural net renaissance, these offer very flexible ways to model data. An auto-encoder is good for unsupervised learning, and has a lot of potential for learning useful representations of data, given appropriate constraints. These have been used for all sorts of purposes, and occasionally for audio.

Some interesting recent papers look at how to get a structured/semantic representation out of an autoencoder. This is often helped by having speech/vision datasets which are highly structured themselves (e.g. a photo of the same face from many angles and many lighting conditions). With natural birdsong we don't really have that opportunity, so the interesting question is whether we can design a system to do something along those lines despite the uncontrolled (and often unlabelled!) data.

I'm not going to say too much about the method here because the work isn't finished, but here's a work-in-progress image, showing (in the top row) a spectrogram of some birdsong contaminated by background noise. In the lower two rows the autoencoder is outputting an estimate of the foreground and of the background. Not perfect but certainly encouraging.

three spectrogram plots

Thanks to Rich and the group for their welcome in Cambridge!

Also thanks to some people who offered some specific insights into convolutional neural networks and Theano: Sander Dieleman, Matthew Koichi Grimes, Vijay Badrinarayanan.

science · Permalink / Comment

I've been staying in Cambridge recently, on a research visit. (Cambridge UK, that is.) So I've had lots of opportunity to try the local eateries. So! Now you get to find out which are the best places to eat, if you ever need to eat in Cambridge:

Those are my definite recommendations. Here's a map with them marked on. Thanks to everyone who gave me tips on where to eat! Also some honourable mentions to:

(I also previously blogged about sushi in Cambridge...)

food · Permalink / Comment

All these years I've been living in South Woodford I've been tweeting food things from my @nomnomdan twitter. Now, as I prepare to leave South Woodford, what will I miss? Or to put it another way, if you're in South Woodford what should you definitely eat?

Restaurant-wise, there's plenty of stuff to choose from. Turkish Mangal I've already recommended. Also good are Ark (fish restaurant), Wildwood (italian chain), Nino's (italian), Morello (italian).

So now you know what to eat! (BTW - if you agree or disagree, let me know on twitter. For example, Welshbeard says Bella Naples is great, I didn't get round to trying it.)

food · Permalink / Comment

Maths can be magic sometimes. Here's a probability thing - it's very very niche, but it works out nicely.

I needed to sample K iid exponential variables given that I knew their sum was S. The exponential distribution has one parameter for the "rate" (usually written as the greek character lambda, but let me write it as L). We don't necessarily know the value of L but we do know S.

Let's start simply. Instead of saying we have K variables we'll start with just two, and we'll call them x and y. So we know S, and we know that x+y=S.

For comparison, let me see what happens when we condition on the maximum rather than the sum. So we know the maximum M, and we know that x<M and y<M. It's quite a similar problem, and in that case we find that x and y remain independent, and identically distributed: P(x|M) and P(y|M) are just the truncated exponential distribution. This distribution still involves L. The shape of the distribution still depends on this unknown rate parameter.

So back to the real problem. It's the sum x+y=S that we know. So let's write the joint distribution:

P(x,y|S) α L exp(-Lx) L exp(-Ly) I(x+y=S)

(where "I()" is the indicator function, and "α" means "is proportional to" - my blog doesn't do proper maths typesetting.)

and we can substitute y=S-x:

P(x,y|S) α L exp(-Lx) L exp(-LS + Lx) I(x+y=S)

P(x,y|S) α L exp(-Lx) L exp(-LS) exp(Lx) I(x+y=S)

P(x,y|S) α L^2 exp(-LS) I(x+y=S)

So the x and y vanish to leave constant terms (except for the indicator that limits us to the 2-simplex). The distribution is simply uniform on the 2-simplex! It doesn't even depend on L - the lambda vanishes. Magic.

In other words, to sample two iid exponentials conditioned on their sum S, you can do it by taking a single uniform sample in the range [0,S]. Much easier than we might have thought.

This generalises to more than two variables. Sampling K exponentials conditioned on their sum S is equivalent to sampling uniformly from the unit K-simplex and multiplying the result by S.

This is covered more formally in this free book Non-Uniform Random Variate Generation, which I found via someone's blog article Sampling from a simplex (where they're coming at the problem from the other way round).

maths · Permalink / Comment

I'm surprised that Cambridge doesn't have many sushi places. Surely they've always had plenty of Japanese students around, and plenty of posh metropolitan types? Or does it not work like that? Anyway, I have found two proper sushi restaurants in Cambridge (UK) so here's a quick review.

(Actually, as well as these two, in the middle of town there's a Yo Sushi and soon-to-be a Wasabi too. I've nothing against those chain shops but I don't think of them as proper sushi, simply because you can usually only get tuna and salmon stuff, they don't have a proper sushi selection. Good for convenient food but not the full deal.)

  1. U-Sushi near the Grafton Centre is a friendly little place that does a lot of takeaway. The fish could have been fresher, but there's plenty of variety on the menu and I particularly liked their vegetarian california rolls, made with asparagus, avocado, cucumber, shitake mushroom and pickle.

  2. Japas just off Lensfield Road has a bit more of a restauranty vibe, if that's what you're after. They also seem to do plenty of takeaway. The fish is the same quality as U-Sushi and the range is pretty similar too. I wouldn't bother with their deep-fried ice-cream for afters though, it's nowhere near as much fun as it should be.

Anyone got any more tips? Let me know. There must be a secret sushi palace secreted around here somewhere...

food · Permalink / Comment

I want to tell you which is the best DAB radio. I have it here in front of me:

Radio photo

I've seen many DAB radios in my time. My ex worked at the first BBC digital radio station when it launched, so we saw all the early models.

Old analogue radios, like a lot of analogue things, had this great built-in interface quirk. In the old days you couldn't just choose a radio station, you had to turn a dial and that would tune the frequency to the station you wanted. I'm NOT talking nostalgia here, I'm talking usability. This strange quirk meant you could learn the interface really well - the radio stations were always at the same place on the dial, and you very quickly learnt exactly how much to turn to go straight from Radio 4 to Radio 1.

DAB radio designers didn't really have this, they just had a big list of stations. In fact they had it worse than that: if there was any "natural" interface driven by the mechanics of DAB it would be a hierarchical list where first you choose your multiplex, then you choose your station. The early DAB radios forced you to do this. Firstly, navigating a hierarchical list is fecking annoying on any device that doesn't have a massive computer screen. Secondly, the hierarchical list means nothing to anyone. No-one knows intuitively if Smooth FM and the World Service are on the same multiplex or not, and they shouldn't have to know.

DAB radio designers came up with various ways round this. They added presets of course - lots of FM radios have this too. Trouble is, they generally had to add lots of buttons, especially as they needed to support both DAB and FM. Bleh. Clicky interfaces, menus to scroll through. Bleh.

Well now the perfect DAB/FM radio interface has been settled on and it looks like this:

Radio photo

It's from John Lewis (it's called the "Spectrum"), and it's a little portable thing. It does DAB, FM and USB, it runs off battery or mains, it doesn't take more than 4 seconds to turn on (unlike many other digital radios which sit around saying "hello" while secretly they're frantically booting stuff up).

But the one thing I want you to notice is how easy it is to operate it in the dark, with your eyes closed, or with one hand stirring a pot of soup. There is a very small number of buttons/knobs, and when you grab for it without looking you can instantly feel which button you're on. After a day or two you can change the station, change the volume, change DAB/FM, or turn it on/off without looking, and really that's all you need!

The minimalism continues through the interface too: there are no presets, for example. Some might find miss the lack of presets, but it takes away a lot of interface complexity. There's an implicit "two-preset" character anyway, since of course it remembers one DAB station and one FM station, the ones you had on last.

The two dials on the top are not continuous dials, by the way, they're click-wheels. I do miss a little the ability to be as subtle as you like with the volume control, but I don't mind much. On the station dial, for DAB you're wheeling through the alphabetical list, which you can sometimes do with your eyes shut but not always - but at least the stations are always in exactly the same place, it's still a learnable interface. On FM, the dial changes the frequency, as you'd expect, plus the curiously named "Reset" button does auto-scanning for you on FM, and that works fine too.

I actually bought this radio for my ex. After seeing it in action for a while, I went and bought another one, for myself!

design · Permalink / Comment

Other recent posts: