PIONEERS

Groundbreaking Blockchain OS Projects Biometrics & Machine Learning

A series on the Web2 and Web3 pioneers on The Blockchain OS.

Cartesi Foundation
Cartesi

--

Groundbreaking Blockchain OS Projects: Biometrics & Machine Learning

Introducing Marcus Souza, Software System Engineer at Locus Software. With a naturally curious mindset, an open heart, and OpenCV, he’s constantly testing what he can achieve with The Blockchain OS. While looking at ways to push its abilities to the very limit, he’s created a series of tests — and in the process, seems to be making a fairer world, bettering biometrics implementation, and looking to prevent fraudulent ID usage. Take a look at how he’s paving the way for developers with The Blockchain OS:

Challenging the Blockchain OS

So when I was onboarded to The Blockchain OS, I started following Cartesi’s documentation of a simple Echo DApp. Instead of stopping at just what the documentation outlined, I did some simple processing on it. This way, I could get further acquainted with it and challenge the technology — I was curious to see what would happen.

I started thinking, how can I work with machine learning and blockchain? The first approach was to classify the iris flower dataset using KNN (k-nearest neighbors algorithm) and then implement the classification using Python.

When that worked out successfully, I wanted to explore more! I created a Titanic DApp that collects input data (such as age, gender, etc.) to predict if a person would survive something as epic as the sinking of the Titanic. For that, I used traditional tooling to train a model and then a library called m2cgen (Model 2 Code Generator) to convert this model to pure Python code, which also seemed to work out great.

So next, I started using OpenCV, exploring it to process biometric data from fingerprints and use the extracted features to feed a classifier trained to identify fraudulent fingerprints. I think bringing Machine Learning to the blockchain is essential, so let me explain further.

The problem with biometrics

Biometrics are pieces of information we can use to identify ourselves, such as our fingerprints, face, and voice. Biometric data can be used in systems such as banks and mobile phones — like when you unlock your phone with your face or fingerprint!

In Brazil, for instance, it’s common to have fingerprint control to start and end work, especially in public institutions. Whenever a public servant arrives at work, they enter their fingerprint to validate they’re starting work. And when they go home, they do the same. But there’s a lot of fraud with that. With a keychain of silicone fingerprints, it means everyone can fake the clocking in and out. ​But we can train a machine learning model to recognize the fake silicon prints against the live fingerprint stored on the blockchain — it’s pretty high-level stuff, and you need to do a massive number of live thumbprint readings together with the fake ones to train the model. In the end, the machine learning algorithm is thoroughly trained and can finally validate the authentic workers from the fakers.

Why bring OpenCV to blockchain?

Let’s say we apply OpenCV to process satellite images and monitor deforestation. And then, a collection of municipalities receive extra funds for increasing their forests or penalties for decreasing them. We can check via satellite imaging that the forest in area A increased by 15% or in area B, which fell by 3%. Putting this data on the blockchain makes it transparent for everyone, meaning no one can argue about it. It would mean the municipalities couldn’t complain about not getting rewarded or their penalties. Everything would be securely stored on the blockchain for them to check.

OpenCV is a well-known open source project with lots of use cases. It runs inside every mobile phone and camera. OpenCV is a C library that I ported to the Cartesi Machine. While the tricky part was cross-compiling it to a different platform, it wasn’t impossible (I had lots of support from the Cartesi team). The most astonishing thing in the process was when I started using the Docker toolchain image provided by Cartesi. Everything I needed to cross-compile was there, and it began to work. ​For the biometrics application, we used C++ with OpenCV to extract the features of the fingerprints. These features are then fed into a Python program that decides whether it’s a fake fingerprint or a real one.

Cross-compiling

Cross-compiling can be tricky; imagine a program built on your machine. It knows the instructions and checks that it can support everything as it runs. But with cross-compiling, you have to run that program in a different architecture — and figuring out the correct parameters to build the program correctly can be a real challenge. So I used the Cartesi Toolchain Docker image, which already has the tooling tuned for the other environment I needed. Everything was already correctly configured on this Docker image. I simply put the code inside this container, and it compiled everything to all the correct parameters running inside the Cartesi Machine.

Pioneering blockchain technology

All this makes me the blockchain pioneer within my web development company, Locus Software! With more and more interest in the blockchain industry, we’ve finally found a new partner in our blockchain project to take care of the frontend part. People inside and outside of our company are interested in the topic.

It’s hard for many developers to visualize the blockchain and its benefits — 99% of the Brazilian market are Web2 developers, which also makes Locus Software pioneers in our local market.

Onwards and upwards

Next, I want to tackle the gaming segment — to try things we have in Web2, and bring those over to Web3. With a decentralized game, for instance, I’d use the Unity game engine and try to integrate that into the blockchain using The Blockchain OS. ​In Unity, some languages can be used to express the game logic, such as C#. I don’t think C# has been tested on The Blockchain OS, so it would be a great challenge to push the boundaries again!

Want to hear more stories from developers building on The Blockchain OS? Check out the decentralized puzzle-RPG, Aetheras co-founders Teddy and Denis are creating:

About Locus Custom Software

Locus Custom Software is a global full-service company offering creative design and software development services and digital solutions. Working daily to create value for their customers’ businesses through creative and innovative digital services.

About Marcus Souza

Marcus Souza is from Paudalho, Pernambuco — Brazil, where he works as a Software Engineer at Locus Custom Software. MSc. at the Federal University of Pernambuco, he has eight years of experience with Technology, focusing on Machine Learning and computer vision, and recently interested in blockchain and game development.

About Cartesi

The Blockchain OS is a decentralized layer-2 infrastructure that supports Linux and mainstream software components. For the first time, developers can code scalable smart contracts with rich software tools, libraries, and the services they’re used to, bridging the gap between mainstream software and blockchain.

Cartesi is enabling millions of new startups and their developers to use The Blockchain OS and bring Linux applications on board. With a groundbreaking virtual machine, optimistic rollups, and side-chains, Cartesi paves the way for developers of all kinds, to build the next generation of blockchain apps.

Welcome to The Blockchain OS, home to what’s next.

Follow Cartesi across official channels:

Telegram Announcements | Telegram | Discord (Development Community)| Reddit | Twitter | Facebook | Instagram | Youtube | Github | Cartesi Improvement Proposal (CIP) | Website

--

--