Britain's gambling industry is booming, and new figures show almost one in 20 iPhone owners use sports betting apps, but a UK technology firm is using behavioural data to combat the onset of gambling addiction.

Featurespace, the corporate spin-out of a University of Cambridge engineering department project, is using machine learning techniques to identify people showing patterns indicative of problem gambling, before consulting psychologists on the best and safest preventative action to take.

Gaming sites collect data on the betting patterns of every one of their customers, including the time of day, frequency and size of bets placed and the types of games an individual typically plays.

By analysing this information, Featurespace is able to build up a picture of what is normal for any given individual, and what would constitute erratic or uncharacteristically risky behaviour that might indicate the onset of a gambling problem.

Initially a consultancy, the company began working on fraud-detection solutions after winning a contract in 2008, and it was from its work in this area with gaming companies that the idea of looking at addictive behaviour emerged.

"As we worked with the gaming industry, we know a lot of the companies really well, it was looking at one aspect of fraud - first party fraud - which is where a customer will charge back a transaction and say "well I didn't make that", though sometimes they actually did make that transaction but they may have been spending a lot more than they wanted to", said David Excell, co-founder and CTO.

"So it's that false claim, maybe out of desperation, that constitutes the fraud, and we decided to start looking at the protections in place for customers at the moment to stop this kind of thing happening. We decided since we're harvesting so much data for our fraud solution work, how can we use some of that to try to understand the player from a corporate social responsibility point of view, to understand "is that player in control?" and so on", said Excell.

The business case for tackling problem gambling

When successful, there is not doubt that the results of Featurespace's work are providing a public service, but there are also commercial benefits for the gaming companies when addiction can be thwarted.

"Commercially, the worst case scenario with a problem gambler is that the customer self-excludes - stops being a source of revenue altogether - so while we're effectively helping people stop developing a gambling addiction, a part of this is about serving the best interests of the gaming company.

"If you can help that player have long term sustainable activity, then over the long term that customer will be of more value to you than if they make a short term loss, decide they are out of control and withdraw completely", said Excell.

Gambling companies tend to be fairly footloose - they will often relocate depending on which country is the most lenient or has the most favourable tax rates at a particular time - take Gibraltar for example, host to dozens of gaming firms including Ladbrokes, Bwin and Victor Chandler (BetVictor).

Leniency, in this case, concerns regulatory pressures. Gambling firms are more likely to set up in countries where they have more freedom to operate.

"Part of the incentive to tackle addiction comes down to protecting business. A lot of countries will tighten regulations on gambling when it becomes a social issue, so as the number of problem gamblers rises, a firm may find conditions become less favourable.

"Firms are trying to do everything they can to try and keep things at a point where legislators are not under public pressure to bring in more stringent laws", said Matt Mills, commercial director at Featurespace.

"And there's also brand reputation for the operator. No company wants to be named in a case study of extreme gambling addiction, to be named in relation to a problem gambler losing their house", said Excell.

What is normal for one person, can trigger alarms for another

In traditional fraud-detection systems, alarms are raised when certain thresholds are crossed, but with gaming addiction, this rule-based approach is all but ineffectual.

"Where our technology really is works is that we get to know the habits of each individual. We start to learn an individual's playing patterns, and to what extent they are predictable. Our hypothesis around this is that where a player is in control of their gambling, their gaming patterns will be relatively regular.

"That definition of 'regular' will be defined based on who they are, so if they play a lot, that's not necessarily a problem, but if we start seeing more erratic behaviour, rash decisions, playing at random times of the day, alarm bells will start ringing", said Excell.

As well as patterns in the kinds of bets that are made and their timing, it is also important to account for customers' different financial constraints.

"You could have a city trader and someone on minimum wage, and their ability to absorb different losses would be completely different. You can't just apply thresholds and rules across the spectrum", said Excell.

Even the same betting pattern seen in two individuals could mean two completely different things, so a proper understanding of the context in which gamblers' decisions are made is vital.

"We have data on such a diverse range of gaming patterns, and by their very nature we're also dealing with random outcomes - slot machines, roulette tables and the like - so working out what people are likely to do next gets very difficult.

"By working with specialists we can look at how people increase their risk level or stake level to chase losses, and try to understand why people might be making the decisions we're seeing", said Excell.

Having identified a problem gambler, the next step is critical

Having identified an individual as a problem gambler, the next step the gaming company takes is crucial. A wrong move, and the customer could simply head elsewhere to carry on where they left off.

"We work with psychologists to try to establish how best to communicate with a customer identified as a potential problem gambler. People don't necessarily want to be told they have a problem - in many cases this can exacerbate the issue - so we need to make sure we're treading very carefully.

"Most operators regulated by the UK market will offer session limits, deposit limits and loss limits, so what they might do is contact the individual and ask if they are aware of this functionality. The key is to be more suggestive than authoritative", said Excell.

Another option available to the betting firms is to use advertising banners to direct customers to games that are more likely to ease them away from the site.

"A lot of casino games operate around a return-to-player rate (RTP) whereby if the customer pays, say £100, the game would be set up to pay back an average of £90. Different games will have different RTPs, and there are a few schools of thought on whether certain rates have different impacts on somebody's likelihood of becoming addicted.

"Some believe that if you lose really quickly, you'll be out of funds very quickly and will leave, and that a higher RTP will keep people on site, but others disagree", said Excell.

An altogether different consideration for a gaming site that believes it has identified an at-risk individual is whether or not they are then deemed to have adopted a duty of care.

"It's a really interesting one for the operators. Unless stipulated by a regulator, if they're aware that a customer may be a problem gambler, are they then liable for any loss? It's really difficult from a legal point of view for them to decide where they sit", said Excell.

A potential new danger: social gaming

Another area where Featurespace is seeing worrying patterns emerge is in an entirely different sphere: social gaming.

The likes of Farmville and Candy Crush - games played over social networks or as smartphone apps - may seem innocent enough, but there are risks, especially for young users.

Although players are not obliged to part with any funds, upgrades or access to new levels can be bought for a nominal amount, but the costs an stack up.

"Social gaming is not actually under the jurisdiction of gaming regulators, because you don't win money per se, but you're still being incentivised to deposit funds to buy upgrades.

"We're seeing people becoming addicted in-game, but it's not actually gambling. There are considerable financial costs involved, but no regulation around what that actually means. Many games have no age restrictions, so you can have very young people paying their 69p to get to the next level", said Excell.

"You only have to look at the App Store and see that the highest revenue earner is Candy Crush, which is making over $600,000 per day, entirely through people paying for additional in-game bonuses. This is a huge amount of money, and is completely unregulated", said Mills.

Where successful in preventing addiction, Featurespace are tackling a social problem, but to what extent do you think this is just a happy coincidence brought about by trying to ensure a steady revenue stream for the gaming firms? Join the debate by leaving a comment below or contacting me directly on Twitter at @jburnmurdoch or @GuardianData.