Something in theway she movesHow do you tell ifthe person walkingtowards you is aman or woman?Getting it wrongcan be incrediblyembarrassing!Hairstyle? Men have ponytails.Women have short hair.Body shape? What if they are wearingbaggy clothing?Is there actually any feature that isa reliable way to tell?Research by Kevin Shan at Queen Mary,University of London has shown thatcomputers can be taught to identifywhether a person is male or female,but in a surprising way. When we walk,our limbs act like pendulums, and thelength and swing of the pendulum largelydetermines our individual pattern ofmovement. This swing is different for boysand girls; it’s due to the difference in ourbody shapes and skeletons. By showing thecomputer examples of how lots of peoplewalk the computer can be taughtto recognise the difference.All the clues point to…To be even better at making the judgmentwe can combine this with computer facialanalysis techniques that are trained torecognise the sorts of shapes of male andfemale faces. This bringing together ofdifferent clues to solve the problem iscalled ‘data fusion’. It turns out it is a keyidea in saving the lives of babies too(see page 12).So if you have ever been in thatembarrassing situation when it dawns onyou have been chatting up a woman notthe man (or vice versa) you thought youwere talking to, at least you know theemotional robots of the future won’t havethe same problem.DATA FUSIONData fusion can go even further combiningthese and other visual clues such as bodytemperature, the direction people arelooking, or even how long a person hasbeen standing still. From this set of cluesa computer can, after it’s been trained andknows the patterns to look for, decide ifthere is suspicious behaviour going on andalert the appropriate authorities.6Passionate about computer science?www.<strong>cs4fn</strong>.org
Join the crowd…with swarm intelligenceNext time you are in a large crowd, have alook around you: all those people movingtogether, and mostly not bumping into eachother. How does it happen? Flocksof birds and schools of fish are also examplesof this “swarm intelligence”. Swarmingbehaviour requires the individuals (birds, fishor people) to have a set of rules about how tointeract with the individuals nearest to them.These so-called “local” rules are all that’sneeded to give rise to the overall or “global”behaviour of the swarm. We adjust ourindividual behaviour according to our currentstate but also according to the current state ofthose around us. If I want to turn left then I doit slowly so that others in the crowd can beaware of it and also start to turn. I know whatI am doing and I know what they are doing.This is how information makes its way fromthe edges of the crowd to the centre and viceversa.A swarm is bornThe way a crowd or swarm interacts can beexplained with simple maths. This maths isa way of approximating the complexpsychological behaviour of all theindividuals on the basis of local and globalrules. Back in 1995 James Kennedy, aresearch psychologist, and ComputerScientist Russ Eberhart, having beeninspired by the study of bird flockingbehaviour by biologist Frank Heppner,realised that this swarm intelligencecould be used to solve difficult computerproblems. The result was a techniquecalled PSO (particle swarm optimisation).Travel broadensthe mindAn optimisation problem is one where youhave a range of options to choose from andyou want to know the best solution. One ofthe classic problems is called ‘Thetravelling salesperson’ problem. You workfor a company and have to deliver packagesto say 12 towns. You look at the map.There are many different routes to take, butwhich is the one that will let you visit all 12towns using the least petrol? Here thechoices are the order in which you visit thetowns, and the constraint is that you wantto do the least driving. You could have aguess, select the towns in a random orderand work out how far you’d have to travel tovisit them in this order. You then try anotherroute through all 12 and see if it takes lessmileage, and so on. Phew! It could take along time to work out all the possible routesfor 12 towns to see which was best. Nowimagine your company grows and you haveto deliver to 120 towns or 1200 towns. Youwould spend all your time with the mapstrying to come up with the cheapestsolutions. There must be a better way? Wellactually simple as this problem seems it’san example of a set of computationalproblems known as NP-Complete (see Page14), and it’s not easy to solve! You needsome guidance to help you through andthat’s where swarm optimisation come in.It’s an example of a so-called metaheuristicalgorithm: a sort of ‘general rule of thumb’to help solve these types of problem. Itwon’t always work unless you have infinitetime but it’s better than just trying randomsolutions. So how does swarm optimisationwork here?State space:the final frontierFirst we need to turn the problem intosomething called a state space. Youprobably use state spaces all the time butjust don’t know it. Think about yourself.What are the characteristic you would useto tell people about your current state: age,height, weight and so on. You can identifyyourself by a list of say 3 numbers – one forage, one for height, one for weight. It’s noteverything about you of course but it doesdefine your state to some extent. Yournumbers will be different to other people’snumbers, if you take all the numbers foryour friends you would have a state space.It would be a 3 dimensional space withaxes: age, height and weight, and eachperson would be a point in that space atsome coordinate (X, Y, Z).So state spaces are just a way ofrepresenting the possible variations insome problem. With the 12 towns problemhowever you couldn’t draw this space: itwould be 12 dimensional! It would haveone axis for each town, with the position onthe axis an indication of where in the routeit was. Every point in that space would be adifferent route through the 12 towns, soeach point in the space would havecoordinates (x1, x2, x3, … x11, x12). Foreach point there would also be a mileageassociated with the route, and the task isto find the coordinate point (route) with thelowest mileage.Swarming all overthe mapEnter swarm optimisation. We create a setof ‘particles’ that will be like birds or fish,and will fly and swarm through our statespace. Each particle starts with a randomstarting location in the state space andcalculates the mileages involved for thecoordinates (route) they are at. Theparticles remember (store) this coordinateand also the value of the mileage at thatposition. Each particle therefore has it’sown known ‘local’ best value (where thelowest mileage was) but can compare thiswith other neighbouring particles to see ifthey have found any even better solutions.The particles then move onwards randomlyin a direction that tends to move themtowards their own local best and the bestvalue found by their neighbours. Theparticles ‘fly’ around the state space in aswarm homing in on even better solutionsuntil they all converge on the best they canfind: the answer.Where no particle hasswarmed beforeIt may be that somewhere in a part of thespace where no particle has been there isan even better solution, perhaps even thebest solution possible. Our swarm will havemissed it! That’s why this algorithm is aheuristic, a best guess to a tough problem.We can always add some more particles atthe start to fill more of the state space andreduce the chance of missing a goodsolution, but we can’t ever be 100% sure.Swarm optimisation has been appliedto a whole range of tough problems incomputing, electronic engineering,medicinal chemistry and economics. Allit needs is for you to create an appropriatestate space for your problem and let theparticles fly and swarm to a good solution.It’s yet another example of clevercomputing based on behaviours found inthe natural world. So next time you’re in acrowd, look around and appreciate all thatcollective interacting swarm intelligence…but make sure you remember to watchwhere you are stepping.Email us at <strong>cs4fn</strong>dcs.qmul.ac.ukFeel free to photocopy pages from <strong>cs4fn</strong> for personal or class use 7