Improving Virtual Card Numbers with Edge Machine Learning
How the Eno browser extension uses ML on device to read the DOM & pixel coordinates for a more accurate VCN experience
Capital One customers have come to depend on Eno—our intelligent assistant—to check their bank balances, track purchases, pay bills online, and proactively monitor their accounts. This kind of personal, real-time service at scale is one of the hallmarks of our approach to business. Another is our continual quest to use cutting-edge technologies to power those services.
As Eno has grown from its roots as the first natural language SMS chatbot from a U.S. bank to a multichannel solution with numerous capabilities, we’ve identified opportunities to use machine learning to improve the Eno experience even more. One such opportunity presented itself around Eno’s virtual card number (VCN) capabilities. Virtual card numbers are unique, separate credit card numbers for every merchant you shop with. They allow you to transact on your credit card account with that specific merchant and that merchant only, reducing your main credit card number’s exposure to potential card fraud.
When we first launched Eno in 2017, our goal was to build an intelligent assistant that provided customers with answers to simple account questions, in real-time, without them needing to visit a branch or make a phone call. Fast forward to 2021. Thanks to the work of teams across the company, Eno is helping more customers, in more places, do more things. We’ve expanded and refined the answers Eno provides to questions customers ask, Eno proactively sends customers valuable insights about important account activity, and we’ve continually improved Eno’s virtual card number capabilities to enable customers to more seamlessly shop safely online.
One such opportunity presented itself around Eno’s virtual card number (VCN) capabilities. By using machine learning in the Eno browser extension, could we better detect payment pages and locate payment fields, making our VCNs more accurate and frictionless to use?
How VCNs can transform the cardholder experience
Using virtual card numbers with Eno is simple. When Capital One customers want to make an online purchase, the Eno browser extension can bind a unique virtual card number to a specific merchant in lieu of their physical credit card number. From the point of view of both the cardholder and the merchant, little changes when using a VCN—the VCN is processed as seamlessly as transactions using the actual card number printed on a physical card, and the cardholder earns the same rewards. But the cardholder can rest assured that the VCN will only function for that specific merchant. If that particular online retailer stores a VCN and experiences a breach that exposes the VCN, it can’t be used elsewhere, unlike a traditional credit card number.
Everything about the VCN process is designed to seamlessly prioritize the security of customer credit card information. Not only does Eno automatically create VCNs at the payment page and populate (autofill) them on the page, but it also simplifies the process of updating expired or lost credit card information, as well as managing subscriptions and automatic charges and fighting fraud.
Using machine learning, DOM, and pixel coordinates for a more accurate VCN experience
The Eno browser extension identifies payment pages and fields using rules, autocomplete patterns, and payment processor patterns. Merchant sites use different HTML markup for their payment pages, and they often change that markup. Therefore, Eno’s rules and patterns have to be created, monitored, and maintained for each merchant site or ecommerce platform.
Since our browser extension launched in 2018, our feature teams have worked continuously to improve the customer experience. In 2020, one of our teams saw an opportunity to expand the Eno browser extension’s AI web navigation capabilities by using machine learning to automate the identification of payment fields, reducing the reliance on rules and the manual toil involved in maintaining them.
They proposed building a machine learning model to identify payment pages and fields in order to improve Eno’s precision and recall. After all, rules are brittle and can be time consuming to maintain. With rules, we could only build as good of an experience as we could manually scale, since expanding our VCN capabilities to serve additional merchants would be dependent on building rules for those sites and platforms. By leveraging machine learning, we could support more customers, with a better experience, while reducing the engineering work involved in rules maintenance.
Because deep learning and deep neural networks require extensive training sets, we chose to rely on feature engineering, implementing two logistic regression models in TensorFlow to achieve the desired capabilities. We train the models in Keras and serve the trained models to run under TensorFlow.js in the browser.
- The payment page classification model detects when the customer is on a payment page, so that the Eno browser extension can be popped up. This model takes as input a set of features corresponding to a web page and produces as output whether the page is a payment page (yes or no). The features are constructed by examining the web page’s document object model (DOM). The features are based on text and HTML attributes appearing within the page’s <title> and <head> elements and near those elements. To determine whether some text is near an element, we use the DOM to access the pixel coordinates of the text and element as rendered by the browser on the customer’s screen. We use tf-idf weighting, which weights each term (word or HTML attribute) according to the term frequency—the number of times the term appears in the corpus—offset by the document frequency—the number of documents in the corpus containing the term.
- The payment field classification model classifies input fields within the payment page, so that the Eno browser extension can automatically fill in the appropriate payment information. This model takes as input a set of features corresponding to an <input> or <select> element and produces as output whether the element is a card number field, card security code field, or expiration date field. This model uses HTML attributes of the <input> or <select> element, as well as text near the element based on pixel coordinates.
Compared to using rules and patterns, using machine learning models on text, HTML attributes, and pixel coordinates can more reliably and resiliently identify payment pages and payment fields. Using these models, we can now extend these autofill capabilities to more online sites, more accurately, making VCNs an even easier and less error-prone choice when shopping online.
Using edge machine learning to protect customer data
The power of perseverance and teamwork in improving Eno’s VCN capabilities
This work on VCNs and the Eno browser extension is just one example of how we work machine learning into nearly everything we do at Capital One. I have a unique role at Capital One. My responsibilities include serving on the Eno leadership team, leading the development of innovative applications of machine learning, and increasing the impact of machine learning in the company by working with teams that are creating machine learning applications.
For the Eno web assistant, I worked with a team of engineers largely pulled from the Capital One Technology Development Program (TDP)—a two-year rotational program for recent college graduates looking to start their career as software engineers—to design, train, and implement the desired machine learning feature. Our TDPs are smart, highly motivated, and passionate about making a difference, qualities that were on full display during our work on the Eno browser extension.
I came to Capital One through CODA after double majoring in music and statistics, with a focus in machine learning. Then in CODA I worked on a small, internal project for Capital One Tech College that used natural language processing. Working on the Eno browser extension was amazing, because I and my friends & family could go to the Chrome Store and use the machine learning model I helped build!
I first spent time with the team figuring out how machine learning would help their project. Was there a business case for adding machine learning over rules and patterns? Then we came up with metrics to gauge our success, and we experimented together with different approaches before settling on the models outlined above. This all followed a comprehensive process, because adding machine learning for its own sake doesn’t necessarily help the customer or the business. For example, sometimes it’s better to use rules rather than machine learning. However, in this case it was not.
When it came time to build, each person on the team had specific tasks to fulfill that played to their strengths. This ranged from collecting metrics to improving the model to preparing the code for shipping. The Scaled Agile Framework and Jira were then used to manage the team and track progress. The entire process for developing this feature was iterative and interactive—as opposed to hierarchical and top-down—and involved the input and skills of the entire team.
We built this through divide and conquer. After a few initial passes, the team split the work into parts that individual engineers could handle. As each part progressed, we kept each other updated and adjusted if any one part needed wider support. This project really showed me that I excel at working on architecture and at the edge. In order to bring the project to our customers, I had to make a number of practical decisions about how we could run and ship what we built in an effective, resilient way. I harnessed everything I knew about maintainable code and automated testing to bring it to a production-ready state; and as I formed a picture of how other engineers would want to improve the code in the future, I was able to decide the best way to set the table for them now.
Over the course of the project, the team went from near zero machine learning engineering experience to learning and applying complex machine learning concepts in about three months. Witnessing people work persistently to understand and implement machine learning is perhaps the best part of my job, especially when it opens people up to pursuing machine learning roles full time.
Improving the VCN experience for the Eno browser extension sprang from multiple goals—to use edge machine learning to improve the Eno customer experience, to create a more secure and fraud-resistant way to shop online, to do so with less manual and brittle efforts, and to help develop the machine learning expertise of our employees and feature teams.
This machine learning model makes the Eno browser extension more robust and our VCNs easier and more secure to use. This is just one more example of how Capital One uses machine learning to transform the way we all bank.