Close panel

Close panel

Close panel

Close panel

BBVA shares its Mercury code library with the open source developer community

The Mercury library stores the code that BBVA's data scientists reuse to develop analytical models embedded in a range of financial products. In line with the open source philosophy, the bank has published Mercury on Github, a code hosting platform for version control and collaboration. This means other programmers will be able to use Mercury code in their work, which will help drive fintech innovation and further evolve the library with contributions from the community.

The development of AI- and machine learning-driven products requires a major investment of time and resources to design, implement and test data algorithms. BBVA employs more than 900 data scientists around the world, who need to provide similar solutions to similar business challenges. To avoid duplication, streamline developments and enhance the globalization and reuse of analytical products, the Advanced Analytics discipline of the Data area at BBVA has created the Mercury library, which centralizes algorithms. The bank has now made the library public on the Github platform so that external programmers can use it in their work.

The code components in Mercury were created by data scientists and machine learning engineers from Spain, Mexico and Latin America to meet business challenges in areas as diverse as Finance, Corporate and Investment Banking or customer solution development. Currently, more than a third of the bank's key advanced analytics use-cases are based code from the Mercury library, covering a wide range of functionalities: monitor algorithm robustness, ensure that algorithms comply with regulations, design recommendation systems--such as the feature in BBVA's app that detects key facts in customers' banking transactions and suggests courses of action--and speed up data tagging to enable the bank to add new categories of expenses in the app.

The code (which does not include internal or customer data) is freely accessible to the external developer community from Github, where it is hosted, or from a special-purpose web page that helps users browse the information. The main goal of this release is to help drive fintech innovation. "We have developments underway of all kinds, but generally these components aid development of analytical solutions in the financial environment," explains Curro Maturana, Head of the Large Language Models and Mercury specialty at BBVA. "Algorithms like these are uncommon in the open source environment, so they provide added value to the community, especially for developers working in fintech or insurtech."

"By making our analytical developments public we give back to the community some of the value it has helped us create for our customers."

The code repository managers also hope to evolve the library with fresh contributions from the community. "Centralizing and publishing the code we write in-house via Mercury has enabled us to greatly enrich the library with input from all the bank's Advanced Analytics teams," says Maturana. "By releasing the repository we are not only making the work of our developers visible and bringing this resource to the entire community, but we also hope that external contributions will help us to further strengthen our algorithms."

"We also use open source libraries to solve day-to-day use-cases, such as Tensorflow, Spark or Scikit-Learn," he adds. "By making our analytical developments public we give back to the community some of the value it has helped us create for our customers."

More robust and 'explainable' algorithms

Mercury launched in 2019 at BBVA AI Factory, the bank's artificial intelligence center. Two years later, with the help of BBVA's Advanced Analytics discipline, the Mercury library was used to centralize in a single repository the algorithms commonly used by multiple teams of developers and code with high potential for reuse. Hosted components must meet a range of requirements: add value to existing options in other libraries, comprise quality tested code and be fully functional.

The bank's data scientists and machine learning engineers make use of the Mercury library by repurposing its components and contributing new items from a wide range of areas, after approval by the team that maintains and organizes the resource. In this way, BBVA's products can be developed and reach customers in different countries more quickly.

External developers accessing Mercury will find components that make their machine learning algorithms explainable. Developers thus understand how the machine arrives at its conclusions or predictions. This functionality is especially important in the financial services industry, where regulators require algorithms to be understandable to ensure that decisions made with their help are risk-free for customers.

Using the software hosted in this library, data scientists will also be able to measure the robustness of their machine learning models. The risks of inaccurate results are mitigated. In addition, they can detect significant changes in the data the models are working with that might impair the quality of their predictions, especially in dynamic environments such as finance.