Overview of My Submission

Fin PEN is an AI powered fintech app used to analyze customer invoice receipt images in realtime, allowing business owners to better understand client spending habits.

The app receives customer invoice receipt images in realtime, captures the receipt's data, and analyses the captured results to better understand customer spending habits.

Fin PEN's system architecture is split into 3 core units, image, analysis and storage.

The app uses Redis' queuing system to receive, track and process requests and RedisJSON to store the analyzed data.

Fin PEN's system design looks like below.

Fin PEN’s System Design Architecture:

Fin PEN’s System Design Architecture

Fin PEN’s UI.

Fin PEN’s UI

Fin PEN’s Graph UI.

Fin PEN’s Graph UI

Fin PEN in Film

How Fin PEN works:

Fin PEN's system architecture is split into 3 core units, image, analysis and storage. The app uses Redis' queuing system to receive, track and process requests and RedisJSON to store the analyzed data.

A client takes a picture of their invoice receipt and uploads it to the app. The app receives the image upload and captures the receipt's data. The data captured is added to Redis' queuing system where it awaits processing. After the processing is complete the analyzed data is stored into the RedisJSON database.

The data analyzed is then retrieved from the RedisJSON database and a graph is plotted to depict client spending habits, for example on what days the client spent the most amount of money and on what product.

Fin PEN is an acronym for Financial Payment Integration Network (Fin PEN).

Running the app:

Download or clone Fin PEN: https://github.com/VakinduPhilliam/FinPEN

Install Node.JS, Redis, and Memurai (For Windows Users) on your PC.

Install Python3 (And install python dependencies, OpenCV (CV2) and PyTesseract).

Install Pip8 or greater (for managing python dependency installations).

Install Tesseract (used for image text extraction). Also go to your ‘routes/analyzer.py’ file and update the ‘pytesseract’ configuration variable pytesseract.pytesseract.tesseract_cmd to reflect where the tesseract files are installed and located on your PC.

Unzip the Fin PEN project and install the NPM dependencies.
In the command line terminal of the project folder, install npm dependencies.

npm install

Then install python dependencies (Make sure to have pip8 or greater installed).

npm run pyinstall

Then run the project:

npm start

If the run was successful, you should see the message "Fin PEN started successfully on Port 6006" in your console.

Open your browser and visit 'http://localhost:6006'.

The Fin PEN User Interface will look like below.

Fin PEN User Interface:

Fin PEN User Interface

Upload Invoice Receipts for Analysis:

Now let’s analyze an invoice receipt.

Take a photo of an invoice receipt, (or use one found inside the downloaded ‘demos’ folder) and upload it to Fin PEN for analysis.
Fin PEN will start processing the receipt (this could take several minutes).

The Fin PEN app will capture its data, analyze the results and plot a graph displaying the results of the analysis.

The Fin PEN Graph of the analysis will look like below.

Fin PEN User Interface with Analyzed Data Graph:

Fin PEN User Interface with Analyzed Data Graph

Redis at work:

Fin PEN’s design architecture leverages the power of Redis queuing mechanism for efficiently managing processing requests and RedisJSON for data storage.

Queuing Requests

Fin PEN uses redis for queuing user upload requests. This ensures efficient management and processing of receipt photos uploaded to the system.

The redis queue worker implementation looks like below.


const queueWorker = new Queue('queue_worker', {
    limiter: {
        max: 5000, // Limit the queue to a maximum of 5000 jobs per 10 seconds
        duration: 10000
        },
    redis: {
        host: "127.0.0.1",
        port: "6379",
        password: ""
      }    
});

Enter fullscreen mode Exit fullscreen mode

Handling Data

The data extracted from an individual invoice receipt image is in JSON format and will look something like below.

It’s the kind of data that is stored into the RedisJSON Database.


[{
    "logs":{
        "image":"0.20608087643787876.png",
        "timestamp":"8/13/2022"
        },
    "results":{
        "Price":4500,
        "Tax":409,
        "Total":4909
        }
}]

Enter fullscreen mode Exit fullscreen mode

How Fin PEN stores data:

Fin PEN predominately uses the ‘JSON.SET’ command to store data to RedisJSON.


await jsonCache.set(receipt:{receiptImageName}, {extractedReceiptJSONData});

Enter fullscreen mode Exit fullscreen mode

E.g,


await jsonCache.set(‘receipt: 0.4213453345.png’, ‘[{"logs":{"image":"0.20608087643787876.png","timestamp":"8/13/2022"},"results":{"Price":4500,"Tax":409,"Total":4909}}]’);

Enter fullscreen mode Exit fullscreen mode

How Fin PEN reads data:

Fin PEN predominately uses the ‘JSON.GET’ command to read data from RedisJSON.


await jsonCache.get(receipt:{receiptImageName}, {variableKeyword});

Enter fullscreen mode Exit fullscreen mode

E.g


const value = await jsonCache.get(‘receipt: 0.4213453345.png’, “results”);

Enter fullscreen mode Exit fullscreen mode

Redis Performance:

The rate of read and write operations performed on the load per second is higher than when using plain JSON or other NoSQL databases. Also the average execution delay is minimized.

Submission Category:

MEAN/MERN Mavericks

Language Used

Node.js,
JavaScript,
Python.

Link to Code

GitHub logo VakinduPhilliam / FinPEN

Fintech app.

Fin PEN (Financial Payment Elevation Network):

Fin PEN is an AI powered fintech app used to analyse customer invoice receipt images in realtime, allowing business owners to better understand client spending habits.

System Architecture:

Fin PEN's system architecture is split into 3 core units, image, analysis and storage. The system uses Redis' queuing system to receive, track and process requests and RedisJSON to store the analyzed data A client takes a picture of their invoice receipt and uploads it to the app, the app receives the image upload and captures the receipt's data, the data captured is added to Redis' queuing system where it awaits processing. After the processing is complete the analyzed data is stored into the RedisJSON database. The data analyzed is then retrieved from the RedisJSON database and a graph is plotted to depict client spending habits.

Fin PEN System Design Architecture:

Fin PEN System Design Architecture

Fin PEN User

View on GitHub

Additional Resources / Info

IMPORTANT!

Make sure to install Tesseract (used for image text extraction). Then go to your ‘routes/analyzer.py’ file and update the ‘pytesseract’ configuration variable pytesseract.pytesseract.tesseract_cmd to reflect where the tesseract files are installed and located on your PC.


  • Check out Redis OM, client libraries for working with Redis as a multi-model database.
  • Use RedisInsight to visualize your data in Redis.
  • Sign up for a free Redis database.
Logo

Redis社区为您提供最前沿的新闻资讯和知识内容

更多推荐