A Better Way to Evaluate Money Laundering Detection Algorithms

Each day some trillion dollars change hands in any sort of financial transaction. Hidden in this money ocean there are also fraudulent actors, which attempt to sanitize illicit money by making its provenance appear normal. No one can manually verify all transactions, so there are a number of machine learning algorithms trying to spot the fraudulent ones. The problem is how we evaluate which algorithm is better than the other.

Ada Matilde Gige found an interesting problem in the normal evaluation workflow of money laundering detectors during her master work, supervised by Lasse Alsbirk and myself. This resulted in the paper I’m writing about today: “Evaluating fraud detection algorithms in a decentralized scenario“, which appeared a couple of days ago on the Royal Society Open Science journal.

The problem lies in the information the algorithms receive during their training phase. One issue with working in this field is that data is hard to come by: because it involves financial transaction, real world data is tightly controlled by the financial institutions. The solution is to use synthetic data. Luckily, IBM has created a nice, handy, and quite big dataset that simulates a world’s economy – many different banks, currencies, countries – that is free to use. In it, they injected fraudulent transactions following money laundering patterns and identified them. Naturally, it became the cornerstone of the evaluation workflow of the anti-money laundering detectors.

I’m going to oversimplify the machine learning pipeline, but essentially it works by splitting data in two parts: the training set and the test set. You can give the algorithm, say, 80% randomly selected transactions to train on. The algorithm will hopefully learn the pattern by seeing which transactions were actually fraudulent and which one were not. To know whether it actually learned, you will then give it the 20% transactions it never saw before, hide whether they were fraudulent or not, and ask the algorithm to guess.

And the algorithms guess quite well! In one version of the IBM dataset, the state of the art has a precision of 85% – meaning 85% of all flagged transactions are actually fraudulent – and a recall of 74% – meaning it captures 74% of all fraudulent transactions: a transaction has only one chance out of four to pass unnoticed.

However, Ada and Lasse argued that this standard machine learning pipeline does not work for the money laundering case. The IBM dataset contains data from different banks and different countries. If you take a random 80% sample of all transactions to train on, you’re de facto assuming that there exists an international agency that can access data from all the banks in all the countries in the world. Does this agency exist? No. Should it exist? Probably not, as it would wield an amount of power over the world that even the purest of the angels would be tempted to abuse.

What happens in the real world is that the banks will only analyze the transactions that they process directly. They will flag some transactions as suspicious and send them to the national authority. The national authority will receive only the suspicious data from all the banks. Since this is still more than can be managed manually, they will also run some sort of machine learning, to identify the most suspicious transactions. It is a two-step pipeline with some non-trivial interactions between two machine learning algorithms. This is the realistic pipeline the money laundering detectors should be evaluated with.

What happens if we do? In the same scenario as before, the precision takes a bit of a hit: it goes down from the original 85% to 75%. This is unfortunate, but not extremely critical. The real problem is with recall, which plummets from 74% to 24%. Now a fraudulent transaction has three chances out of four to pass unnoticed, the failure case has tripled!

And here’s another serving of food for thought. Remember that in this realistic pipeline we have to apply two detectors: one for the banks and one for the central authority. If we were to apply the state of the art method, the one that performs the best in the one-step evaluation, we would get a worse result, with recall going down to 7%. To get to 24% we need either the banks or the central authority to use a simpler method.

Why is this happening? Likely, it’s a combination of two things. At the first step, each bank can only use its own data. This means that each independent training set is much smaller and therefore an over-complex state of the art method might not be able to learn enough with this little amount of data. At the second step, the central authority does not receive a random sample of transactions any more, but a selected sample of the most suspicious ones. This likely breaks the assumptions on which a money laundering detector is founded.

The good news is that all of this is fixable, although it requires a lot of coordination between all the stakeholders. Banks can partner and use federated learning, each keeping their own data but being able to exploit what has been learned by the algorithm on the other banks’ data. Central authorities should coordinate with the banks and agree on which algorithms each should be using, because if these actors don’t talk and each use the state of the art method, this will likely result in a worse outcome. Finally, machine learning practitioners should use our updated evaluation pipeline in two steps to get a proper picture of how a machine learning algorithm is used in the real world.

Predictability, Home Advantage, and Fairness in Team Sports

There was a nice paper published a while ago by the excellent Taha Yasseri showing that soccer is becoming more predictable over time: from the early 90s to now, models trying to guess who would win a game had grown in accuracy. I got curious and asked myself: does this hold only for soccer, or is it a general phenomenon across different team sports? The result of this question was the paper: “Which sport is becoming more predictable? A cross-discipline analysis of predictability in team sports,” which just appeared on EPJ Data Science.

My idea was that, as there is more and more money and professionalism in sport, those who are richer will become stronger over time, and dominate for a season, which will make them more rich, and therefore more dominant, and more rich, until you get Juventus, which came in first or second in almost 50% of the 119 soccer league seasons played in Italy.

My first step was to get data about 300,000 matches played across 49 leagues in nine disciplines (baseball, basket, cricket, football, handball, hockey, rugby, soccer, and volleyball). My second step was to blatantly steal the entire methodology from Taha’s paper because, hey, why innovate when you can just copy the best? (Besides, this way I could reproduce and confirm their finding, at least that’s the story I tell myself to fall asleep at night)

Predictability (y axis, higher means more predictable) over time (x axis) across all disciplines. No clear trend here!

The first answer I got was that Taha was right, but mostly only about soccer. Along with volleyball (and maybe baseball) it is one of the few disciplines that is getting more predictable over time. The rest of the disciplines are a mixed bag of non-significant results and actual decreases in predictability.

One factor that could influence these results is home advantage. Normally, the team playing home has slighter higher odds of winning. And, sometimes, not so slight. In the elite rugby tournament in France, home advantage is something like 80%. To give an idea, 2014 French champions Toulon only won 4 out of their 13 away games, and two of them were against the bottom two teams of the league that got relegated that season.

It’s all in the pilou pilou. Would you really go to Toulon and tell this guy you expect to win? Didn’t think so.

Well, this is something that actually changed almost universally across disciplines: home advantage has been shrinking across the board — from an average of 64% probability of home win in 2011 to 55% post-pandemic. The home advantage did shrink during Covid, but this trend started almost a decade before the pandemic. The little bugger did nothing to help — having matches played behind closed doors altered the dynamics of the games –, but it only sped up the trend, it didn’t create it.

What about my original hypothesis? Is it true that the rich-get-richer effect is behind predictability? This can be tested, because most American sports are managed under a socialist regime: players have unions, the worst performing teams in one season can pick the best rookies for the next, etc. In Europe, players don’t have unions and if you have enough money you can buy whomever you want.

Boxplot with the distributions of predictability for European sports (red) and American ones (green). The higher the box, the more predictable the results.

When I split leagues by the management system they follow, I can clearly see that indeed those under the European capitalistic system tend to be more predictable. So next time you’re talking with somebody preaching laissez-faire anarcho-capitalism tell them that, at least, under socialism you don’t get bored at the stadium by knowing in advance who’ll win.