<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Perfiostechblog - Medium]]></title>
        <description><![CDATA[Perfios Software Solutions is India’s largest SaaS-based B2B fintech software company empowering 1000+ FIs to take informed decisions in real-time. Headquartered in Bangalore, India. - Medium]]></description>
        <link>https://medium.com/perfiostechblog?source=rss----5cadffea05ca---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Perfiostechblog - Medium</title>
            <link>https://medium.com/perfiostechblog?source=rss----5cadffea05ca---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:29:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/perfiostechblog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Navigating the New Frontier: The Rising Threat of AI-Generated Content and the Future of eKYC in…]]></title>
            <link>https://medium.com/perfiostechblog/navigating-the-new-frontier-the-rising-threat-of-ai-generated-content-and-the-future-of-ekyc-in-2d1bb109f705?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/2d1bb109f705</guid>
            <category><![CDATA[identity-verification]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[deepfake-detection]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-fraud-prevention]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 06:19:45 GMT</pubDate>
            <atom:updated>2025-06-11T06:19:45.471Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Navigating the New Frontier: The Rising Threat of AI-Generated Content and the Future of eKYC in Fintech</strong></h3><p><strong>Author: Sumanth BS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TH3NusYIUtPfLPHtc1iWDQ.png" /></figure><p>In today’s fast-paced fintech landscape, establishing trust through effective electronic Know Your Customer (eKYC) processes is crucial. These processes help verify customers’ identities, prevent fraud, and ensure compliance with regulatory standards. But as artificial intelligence (AI) continues to advance, so do the methods fraudsters use to exploit digital identity systems. One of the most alarming challenges? The rise of AI-generated content, which can create hyper-realistic fake documents and videos, posing a severe threat to traditional eKYC systems.</p><p>Imagine this: Generative AI models like FLUX.1 are capable of creating documents that look just like the real thing — think fake government IDs, bank statements, and even hospital bills. And let’s not forget Runway AI, which can produce videos that seem to feature actual customers. These technological marvels are now tools for fraudsters, making it easier than ever to bypass conventional detection methods.</p><p>With fintech companies racing to scale, it’s clear that the old ways of eKYC may no longer cut it. So, how can we adapt and safeguard the system? Let’s dive into the future of eKYC and explore the innovative solutions that can combat these emerging threats.</p><h3>AI Threats: A Game of Cat and Mouse</h3><p>Reports highlight a global rise in deepfake content, with significant growth observed in North America and the Asia-Pacific region. India is ranked among the top 10 most affected countries, emphasizing the growing need for effective countermeasures. [1]</p><p>The stakes are high, and fraud is evolving at breakneck speed. Picture a fraudster expertly crafting a convincing fake bank statement or using a deepfake video to present themselves during a video KYC session. Without advanced checks in place, both the document and the video could glide through the verification process, granting access to sensitive financial services.</p><p>In 2024, a multinational corporation faced a ₹207 crore loss due to an advanced deepfake scam. The fraud involved a finance employee being duped into approving fraudulent transactions after a video call with what appeared to be the company’s CFO and other team members, all of whom were convincingly fabricated using deepfake technology. [2]</p><p>By 2027, generative AI is predicted to dramatically increase the risk of fraud, which could cost banks and their clients up to $40 billion. To combat this escalating threat, institutions should increase their spending in developing more agile fraud teams. [3]</p><p>As reported, deepfake cases in India have surged by 550% since 2019, with generative AI increasingly exploited for financial fraud, identity theft, and political manipulation. This alarming trend calls for robust and advanced KYC systems leveraging cutting-edge technologies to safeguard against such threats. [4]</p><p>Below are examples of deepfake content, showcasing the potential for manipulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*aPlrrByvpeN0mYrm" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*lcLK7EFFU6WbotqQ" /></figure><p>But fear not! Here’s how fintech companies can turn the tables.</p><h3>Next-Gen eKYC: Innovative Approaches to Counter AI- Driven Fraud</h3><p>Fintech companies are up against fraudsters, and the best defense is to fight fire with fire. To tackle the challenges posed by AI-generated fraud, fintech firms can leverage advanced AI</p><p>technologies that don’t just play catch-up — they take the offensive.</p><h3>Smart Document and Video Verification</h3><p>Gone are the days when basic visual checks could guarantee the integrity of documents. Today’s fraudsters can whip up fake documents that are nearly indistinguishable from the real deal. But here’s the game-changer: advanced deep learning models can analyze documents at a pixel level, uncovering inconsistencies that the naked eye might miss.</p><h3>Key Features:</h3><ul><li><strong>Pixel-Level Analysis: </strong>AI scrutinizes every pixel, detecting subtle alterations that indicate forgery.</li><li><strong>Multi-Modal Verification: </strong>Combine document checks with video verification to ensure the person presenting the document is, in fact, who they say they are.</li><li><strong>Metadata Inspection: </strong>The AI can dig into a document’s metadata for signs of tampering — because sometimes, the smallest details reveal the biggest lies.</li><li><strong>Characteristic Matching: </strong>Each ID submitted has its own set of unique characteristics, such as fonts, colors, and layout patterns. The AI can check if these features align with known authentic documents, instantly flagging discrepancies that may indicate forgery.</li></ul><p>Imagine instantly flagging a suspicious document by analyzing pixel patterns, detecting odd font styles, and ensuring that all identifying features align perfectly with the official specifications. That’s the power of advanced AI!</p><h3>Real-Time AI-Powered Video KYC</h3><p>With tools like Runway AI, even what you see can be manipulated. Fraudsters can create videos that look legit, making video KYC a risky affair. Enter AI-powered video KYC — our superhero in this saga!</p><h3>Key Features:</h3><ul><li><strong>Behavioral Analysis: </strong>AI monitors facial expressions, gaze direction, and voice modulation to spot deepfake videos.</li><li><strong>Synchronization Checks: </strong>The technology ensures that the audio and video align perfectly, keeping fraudsters on their toes.</li><li><strong>Anomaly Detection: </strong>If the user’s behavior during the video doesn’t match expectations — like unusual nervousness — flags are raised.</li></ul><p>Imagine having an AI-powered assistant that can tell if someone is trying to pull a fast one on you, all in real-time. This isn’t just verification; it’s a digital watchdog!</p><h3>Dynamic Anomaly Detection: Your Smart Security Guard</h3><p>Fraudsters are clever, but AI is smarter. Dynamic anomaly detection systems act like vigilant security guards, continuously learning and adapting to new fraud tactics.</p><h3>Key Features:</h3><ul><li><strong>Machine Learning Algorithms: </strong>These systems utilize unsupervised learning to identify new fraud patterns without predefined rules.</li><li><strong>Continuous Learning: </strong>The AI evolves, staying one step ahead of emerging threats.</li><li><strong>Cross-Reference Analysis: </strong>By comparing user behavior against a broader dataset, these systems can spot inconsistencies or deviations from typical patterns.</li></ul><p>Picture this: A fraudster submits a fake hospital bill, but the system notices something off — perhaps the interaction speed is unusually quick or the typing patterns don’t match typical user behavior. The AI catches it before it even gets a chance to cause trouble!</p><h3>Real-World Scenarios: Lessons Learned from Fraud Attempts</h3><p>Now, let’s take a moment to reflect on what could happen without proper checks. Imagine this: A fraudster submits a seemingly authentic bank statement and sails through the onboarding process. Without advanced AI tools, this fake document could grant access to sensitive financial services, leaving a trail of chaos in its wake.</p><h3>Stopping Fraud in Its Tracks</h3><p>Here’s how a savvy fintech company could flip the script. By employing deep learning models, they could analyze that bank statement for pixel irregularities or odd font styles that signal something’s off. With AI on their side, they can stop fraudsters before they even think of getting through the door.</p><p>In another scenario, consider a fraudster using deepfake technology for video KYC. They present a convincing video of themselves holding their ID, trying to pass verification.</p><p>However, an AI-powered system catches those subtle signs — strange facial movements or awkward audio sync — leading to a red flag that keeps fraudsters at bay.</p><h3>Blockchain: The Future’s Promise, Not Yet Reality</h3><p>While blockchain technology holds the promise of enhancing eKYC through immutable records, its widespread adoption is still a work in progress. Imagine a world where every bank statement or ID is securely logged on a blockchain — an impenetrable record of verification history. Sounds ideal, doesn’t it? But we’re not quite there yet.</p><h3>Current Limitations:</h3><ul><li><strong>Scalability: </strong>Many blockchain solutions struggle to keep pace with the high transaction volumes typical in fintech.</li><li><strong>Integration Complexity: </strong>Existing systems may require significant overhauls to incorporate blockchain technology, which can be a heavy lift.</li><li><strong>Regulatory Hurdles: </strong>With regulators still defining the rules around blockchain usage, uncertainty looms over its adoption.</li></ul><h3>A Multifaceted Approach: Layered Authentication for Maximum Security</h3><p>So, how do fintech companies truly safeguard against AI-generated fraud? By embracing a layered authentication approach. This means combining various technologies to create a comprehensive defense strategy.</p><ul><li><strong>AI-Powered Document Verification: </strong>Deep learning models ensure the integrity of submitted documents by detecting pixel-level inconsistencies.</li><li><strong>AI-Powered Video KYC: </strong>Real-time video analysis tools help detect deepfakes or fraudulent KYC submissions by monitoring micro-expressions and behavior patterns.</li><li><strong>Behavioral Analytics: </strong>AI tracks user behavior throughout the eKYC process, flagging any suspicious activity or unusual interaction patterns.</li><li><strong>Blockchain (Future): </strong>Immutable records could secure the entire verification history, making fraud detection more robust once implemented.</li></ul><p>This multifaceted strategy ensures that even if one method falls short, others will step in to catch fraudulent activities.</p><h3>Embracing the Future of eKYC in Fintech</h3><p>The rise of AI-generated fraud presents challenges, but it also opens doors for fintech companies to innovate and protect their systems. By integrating cutting-edge technologies into their eKYC processes, businesses can not only secure their platforms but also foster trust with their customers.</p><p>As we look ahead, the key will be adaptability. By leveraging AI-driven solutions, fintech companies can turn the tide against fraud and ensure that their eKYC processes remain robust and resilient. In this evolving battlefield of fintech, staying one step ahead isn’t just an option — it’s a necessity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d1bb109f705" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/navigating-the-new-frontier-the-rising-threat-of-ai-generated-content-and-the-future-of-ekyc-in-2d1bb109f705">Navigating the New Frontier: The Rising Threat of AI-Generated Content and the Future of eKYC in…</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Application Serviceability]]></title>
            <link>https://medium.com/perfiostechblog/application-serviceability-ea19af29afcc?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/ea19af29afcc</guid>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[configurability]]></category>
            <category><![CDATA[operational-excellence]]></category>
            <category><![CDATA[customer-experience]]></category>
            <category><![CDATA[serviceability]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 10:09:29 GMT</pubDate>
            <atom:updated>2025-06-03T10:10:49.768Z</atom:updated>
            <content:encoded><![CDATA[<p>Author : Narayanan P Iyer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ii0TWrzs_Lo3omt-Twv04Q.png" /></figure><h3>The Background and Motivation</h3><p>We live in an era where we expect a high quality of service, whether it be during shopping at a store or dining at a restaurant. Today, the term <strong><em>Quality Service</em></strong> is getting replaced by <strong><em>Customer Experience</em>.</strong> Businesses however struggle to provide such customer experiences. A Serviceability Framework supported by an aligned mindset can be the key to unlocking the ultimate Customer Experience.</p><p>In this blog, we take a short tour of Serviceability where the focus is first on understanding it in the context of a <strong><em>B2B SaaS application </em></strong>as these applications pose increased Serviceability challenges. We will also look at a solution framework that encapsulates the Best Practises towards Serviceability, with some practical examples from the Perfios Suite.</p><h3>What is Serviceability ?</h3><p><strong><em>Serviceability</em></strong> generally refers to the <strong><em>ease, speed and continuity</em></strong> with which a deployed application can be <strong><em>monitored, maintained, and kept up-to-date,</em></strong> without impacting its reliability and availability.</p><h3>B2B SaaS Applications</h3><p>The Serviceability expectations from B2B SaaS applications are higher because of the deep impact they have on the business operations and profitability. These applications are complex and vary significantly by user, thereby calling for very effective configuration and customization. Any downtime in these applications causes severe impact to the underlying business. Data protection is also of paramount importance in these applications</p><h3>The Serviceability Challenges</h3><p>The following are some of the key challenges faced by B2B SaaS providers :</p><p>● <strong><em>Serviceability is generally an After-thought</em></strong></p><p>Today, in many of the cases, the serviceability factors are identified as an afterthought, i.e. after the product or solution goes live. This is like putting a band-aid on an existing wound without ensuring preventive steps upfront to avoid the wound.</p><p>● <strong><em>Lack of Application Modularity</em></strong></p><p>○ Features, Products, and Solutions are built in a coupled manner, propagating even a single fault to larger parts of the application. This hampers the speed and quality of service.</p><p>○ Change in one part of the application requires the entire application to be redeployed / restarted</p><p>● <strong><em>Hard to Configure and Customize</em></strong></p><p>○ Application Configuration is very complex in many scenarios, thereby resulting in too many changes and/or misconfigurations.</p><p>○ Most Configuration changes require the application to be restarted, which results in additional downtime</p><p>● <strong><em>Lack of Efficient and Effective Monitoring Metrics and Tools</em></strong></p><p>○ <em>Either no monitoring tools are used, or there are a plethora of tools with a maze of metrics, or the tools are not used effectively , thereby resulting in key problems going unnoticed</em></p><p>○ <em>In many cases, the right metrics are available, but they are not effectively funneled for further action. In other words, alerting , troubleshooting and issue resolution cadence are not spelt out clearly</em></p><p>● <strong><em>Troubleshooting is a Pain</em></strong></p><p>○ Effective traces , logs and metrics are not available thereby slowing down or precluding effective troubleshooting</p><p>○ For larger or complex applications, the amount of information to be consumed and collated from the traces, logs and metrics is huge. The metrics tools are not effectively used, leading to painful troubleshooting</p><p>● <strong><em>Lack of Continuous Improvement based on Feedback</em></strong></p><p>○ Feedback from the users is not collected effectively and / or not passed on to the downstream systems for automated learning or manual incorporation into the application. This acts as a deterrent to an agile and continuously improving system</p><p>● <strong><em>Standard Operating Procedures not established</em></strong></p><p>○ Software application development is a complex system of humans and self learning systems continuously striving towards improving the outcomes for the business. Every actor needs to play their role in a timely manner and deliver to the key Service Level Agreements, to ensure that the ecosystem stays on track towards its goals. Today’s scenario is a far cry away from this ideal state.</p><p>● <strong><em>Long Turnaround Time For Issue Resolution</em></strong></p><p>○ Even for minor customizations and fixes, it takes a long time, thus pointing to inefficient operational systems and / or a weak application design</p><p>The <strong><em>Lack of Serviceability</em></strong> results in increased application downtime, unreliable applications , large turnaround time for fixes, and complex customizations, thereby resulting in <strong><em>Decreased</em> <em>Business Profitability</em> and <em>Growth</em></strong>.</p><h3>The Perfios Serviceability Framework</h3><p>The Perfios Serviceability Framework (PSF) can help build a base for effective Serviceability and consequent <strong><em>Operational Excellence</em></strong>. The tenets of this framework form part of the key architectural guidelines at Perfios</p><h3>Make Serviceability a Top Class Citizen</h3><p>Serviceability should not be an after-thought. The technical design should explicitly include the specifications for serviceability. For example, customization and configuration hooks should be enabled in the design itself. Time needs to be invested upfront and cutting corners to speed up delivery should be avoided. <strong><em>Serviceability by Design</em></strong> is the need of the hour.</p><h3>Do not Ignore the Fundamentals</h3><p>While developing the application, the <strong><em>functional , performance, scalability and reliability</em></strong> needs should be clearly identified, understood and documented, across all stakeholders.</p><h3>Keep them Modular</h3><p>A clear separation of concerns while designing the modules, helps in localizing problems and their subsequent fixes, thereby enabling a better and faster maintenance cycle.</p><h3>Log Them and Catch Them</h3><p>One should always add sufficient, clear and standard log messages. Appropriate error handling should also be incorporated.</p><h3>Always Available</h3><p>Downtimes should be minimized with lean deployments, dynamic restarts and failover clustering considerations.</p><h3>Standardize the Core , and Make it Easy to Configure and Customize</h3><p>One should use standard libraries and frameworks and provide intuitive configuration and customization hooks</p><h3>Document the Knowledge</h3><p>Clear and complete knowledge base of the product is a key enabler. Documentation should be centralized and easy to read, with access provided to the relevant stakeholders.</p><h3>Insure your AI models with a graceful Fallback</h3><p>In the cases where AI models are employed and the turnaround time for model retraining is high, temporary fallback mechanisms should be made available for the customer to get quick responses. As a result, their business continuity will be maintained.</p><h3>Keep it Safe and Secure</h3><p>Redaction of PII (Personally Identifiable Information), Security Audits, Data Retention and Secure Authentication mechanisms should be well-implemented.</p><h3>Test Well</h3><p>The application should be testable and have a streamlined process and team for testing the application. Regression test coverage is a must. If you don’t know what existing functionality can break with a change, serviceability will be impacted highly as the customer will either experience a large turnaround time or an unreliable product or both</p><h3>Version the Releases</h3><p>Versioning can help rollback of changes as needed without keeping the application in an inconsistent state</p><h3>Monitoring and Diagnostics</h3><p>● The right measures should be defined and implemented using appropriate metrics to aid effective monitoring and alerting.</p><p>● The focus should be on bringing the application back to its steady state, rather than spending too much time on Root Cause Analyses.</p><h3>Automatic Feedback, Learning and Improvement</h3><p>Feedback from the Customer aids in improving the AI and rule-based models of the application.</p><h3>Standard Operating Procedures</h3><p>● The operational teams should be well-structured with clear responsibility and accountability laid out for the Level 1,Level 2 and Level 3 support.</p><p>● The chain of responsibility should be well documented and communicated. Effective triaging and tracking should be set up.</p><h3>Examples from Perfios</h3><h3>The Implementation</h3><p>● <em>Serviceability by Design is a key architectural guiding principle at Perfios. The aspects of traceability , modularity and customization etc. are baked into the design proactively. Design Reviews are done in the right spirit and investment is made in training teams to understand the importance of upfront holistic design.</em></p><p>● <em>For one of the flagship products at Perfios, to counter downtime issues,failover clustering was introduced and this is now the norm across most products and is a company level architecture guiding principle.</em></p><p>● <em>To ensure continuous measurability, standard tools like ELK were used to implement monitoring and alerting systems for all key products. As a result, a problem is detected at its root and mostly at pre inception stage and warning signals sent.</em></p><p>● <em>In one of the Perfios products, the core framework functionality which was duplicated at many places , was decoupled into separate core engineering modules. This was done across all key products where there was coupling.</em></p><p>● <em>Observability and Traceability was implemented in many Perfios products to ensure that the end to end path taken by every transaction can be traced accurately and completely. This is again a core guiding principle</em></p><p>● <em>The AI models for core Perfios features provide a rule based fallback mechanism. This helps quick turnarounds for customer issues and at the same time, enables the eventual holistic solution.</em></p><p>● <em>The continuous integration and deployment setups were verified to identify inefficiencies and bottlenecks, and targeted refactoring was done to enable lean and fast deployments. Refactoring is a continuous initiative and done proactively at Perfios</em></p><p>● <em>All Perfios products redact the PIIs to maintain data privacy and there are stringent and streamlined security audits in place. A centralized authentication system ensures that the best security is provided in a standard and scalable manner.</em></p><p>● <em>Perfios applications include a feedback loop design, by default, which improves the application in real time.</em></p><p>● <em>Perfios products have the SOPs clearly documented with the SLAs. The engineering, QA, Devops, Customer Success, and Customer Support teams work collaboratively and in adherence to the SLAs, enabling a seamless customer experience</em></p><p>● <em>A standard customization framework that can help scale the products with domain intuitive rule configurations and customizations, was developed. Products have started onboarding to this platform and this has sped up customizations.</em></p><h3>The Obstacle is the Way</h3><p>The path towards serviceability is ridden with its own challenges. First and foremost — tools, technology and processes can get us to a certain distance, but what is more important is the mindset of the people involved in the transformation. There has to be a shared mindset that understands the benefits of serviceability. For example , developing the frameworks and implementing the tooling for serviceability requires time and effort, and organizations need to invest in the same. A wishy-washy approach will leave the business in a worse situation than from where they embarked on this journey. However, once these obstacles are surmounted, the business can reap the benefits of effective serviceability. At Perfios, there were, and have been several such challenges, but there exists a united mindset and that has helped the team march towards its goals of Serviceability.</p><h3>Conclusion</h3><p><strong><em>The Perfios Serviceability Framework</em></strong> encapsulates the best practices from years of Software Leadership and Implementation Experience, which helps keep Customer Experience a core criterion throughout the application lifecycle. Effective Serviceability starts with its proactive incorporation into design. Lean and continuous deployment and high availability ensure that the customers never face downtime . The customer is assured that the issue will be fixed before she notices it, and in case the customer reports an issue, there is a quick resolution. If the resolution takes time for valid reasons, the customer is informed in advance. Care is taken for effective planning and prioritization and to set correct expectations with customers. Serviceability is the modern day medicine for Customer Escalations. Are you ready to L<strong><em>ead and take the Leap</em></strong> from Stressful Customer Escalations to <strong><em>Wow Customer Experiences</em></strong> ? Then embrace <strong><em>Application Serviceability </em></strong>using<strong><em> Perfios Serviceability Framework </em></strong>as a guide !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea19af29afcc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/application-serviceability-ea19af29afcc">Application Serviceability</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing enterprise-grade distributed systems in fintech]]></title>
            <link>https://medium.com/perfiostechblog/optimizing-enterprise-grade-distributed-systems-in-fintech-068a1a1ac663?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/068a1a1ac663</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[enterprise]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[fintech]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Thu, 29 May 2025 09:02:11 GMT</pubDate>
            <atom:updated>2025-05-29T09:02:11.065Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qyUx6WT8vSHLNOrOG3x8FA.png" /></figure><p>Enterprise grade applications are large software systems that are designed for use in business or government environments and are mission critical. These systems are characterised by high scalability, high security, extensive and complex integrations, regulatory compliant, built-in analytics, comprehensive support and maintenance. What also sets them apart is that not always would the choice of our technology be approved by the enterprise. In one of our client’s cases, Cassandra was not an approved technology and we had to refine our architecture.</p><p>Growth in volumes over a period of time leads to significant impact to scale in such systems. Despite following the common best practices, the system starts to choke in production and needs deep analysis to get to the root of the problem. We will be categorizing the pain areas into the following major heads 1) Database 2) Network Latency 3) Application latency 4) Infrastructure 5) Profiling (analyzing heap dumps, thread dumps) 6) Observability</p><p>A lot of considerations here will be similar to any distributed system at scale, but through this blog we aim to highlight how these challenges get amplified when working within the enterprise confines of financial institutions and banks.</p><h3>1. Database</h3><p>Enterprise applications usually consist of multiple databases including both SQL (traditional RDBMS) and NoSQL supporting structured and unstructured data. Tuning can depend on the flavor chosen but there are some common aspects that apply.</p><p>The cascading effect of growing data and volume in databases usually leads to deterioration of throughput in all layers leading up to APIs. As a recommendation database should be the first debugging point to analyze or get to an answer to “Why is my system responding slow?”</p><p>Another aspect of many enterprise systems is that usually a large database is shared across multiple applications and vendors. It can become even more difficult to isolate problematic queries.</p><p>The Automatic Workload Repository (AWR) is a tool in Oracle databases that can help identify performance issues by capturing detailed database activity data. Some common focus areas for debugging db related performance issues are given below. These are, by no means exhaustive, but in our experiences a lot of db issues can be debugged by application developers and we highlight them here:</p><p>● <strong>Review SQL Queries </strong>: SQL queries ordered by execution time and CPU time should be looked into for performance optimization. The section “SQL Statistics” is very helpful. As an application developer, always get the query execution plan for the newly introduced queries from the production database beforehand.</p><p>● <strong>Full Table Scans:</strong> Growing volume in an enterprise can easily render query plans ineffective over time. Look for the query execution plan and identify if full table scan is being performed on one or more tables then we need to apply indexes to limit search time for relevant data. There might be scenarios where FTS shows up despite proper indexing. We ran into this problem with one of the leading national banks and this <a href="https://richardfoote.wordpress.com/category/full-table-scans/">link</a> provide some additional considerations to be made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*cAvzGKpxT0yy8pF22svcLw.png" /></figure><p>● <strong>enq: TM — contention event</strong> — Waits indicate there are unindexed foreign key constraints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*ytw-4mJYEiqHkXxsX6HzAw.png" /></figure><p>● <strong>Blocking session and inactive session count</strong> — These stats can be gathered periodically from the database.</p><p>● <strong>Data archival and purging </strong>— Financial Enterprises Data (specially banking data) is kept for an average of seven years, or longer in some places. This includes bank statements, accounting records, deposit slips, taxes, payroll, purchase orders, and employee expenses reports. With growing numbers of records it becomes essential to keep a tap on database performance as queries response will be impacted while working on large datasets. It is essential that we partition data according to day/month/year etc and keep moving it out from transactional db to some other backup store. Consider this early in DB design and think of strategies like soft or hard delete, time duration by when old data can be purged or moved to archival storage.</p><h3>2. Network Latency</h3><p>Network latency is another very important factor which can contribute to the delay in data transfer. Enterprise grade financial systems might communicate with a lot of internal and external APIs. A typical example of these APIs can be NSDL (National Securities Depository Limited), PAN over internet, core banking system (CBS) hosted on premise. The challenge system will face is that the front end application cannot move to the next page unless you get a valid required response as most of these calls might be synchronous.</p><p>An enterprise platform we had deployed in one the bank premises was integrated with 50+ external API’s. One of the issues we identified was that external API traffic was getting routed via the DR (Disaster Recovery) region. Due to additional network hops, sudden spikes in latency were observed for these APIs during peak load window. As the enterprise systems normally share the network components (e.g. load balancers, network bandwidth) and data centers, it is a good idea to ensure all the required services are deployed in the same region to avoid network latencies. While this may seem like a natural requirement for any system in general, the point here is to not make assumptions about the network routes and deployments of dependent services in an enterprise setup. It is best to test all the assumptions and make required adjustments.</p><p>There are several other optimization techniques to overcome these hurdles. These can include caching, minimizing data size (including compression) but still monitoring of the network adds immense value and should be given a priority. Using synthetic monitoring checks like network bandwidth saturation, packet drop will help in averting and analyzing the problems beforehand. The objective is not to recommend any tool but new Relic, datadog, dynatrace can do the job. Even command line linux tools like traceroute, MTR (delay, drop and connectivity), Iperf (speed, performance) can give quick and meaningful insights.</p><p>Similarly keep a close track of call amplification and avoid too frequent API calls or too many database calls.</p><h3>3. Application Latency</h3><p>There can be many areas internal to the enterprise application that may impact its performance. Problems can be unique (we will like to hear more from our readers) however below areas might help in debugging the root cause. Some of the steps taken by us:</p><p><strong>Database optimization</strong>: DB related issues already discussed in section 1</p><p><strong>API optimization:</strong> We started with top 10 heavily used and top 10 slow APIs. We studied their overall response latency, throughput, code complexity, response payload sizes. We repeated this over a period of time. We could convert a lot of sync calls to async in a transaction e.g. sending customer notification, updating state in database etc. APIs used to upload or download documents were moved to different services with controls on thread pools, etc. Proper timeouts were added in all external facing API’s after studying average/max/min latencies etc. We could remove a lot of redundant calls. The question that arises here is as to why were these not planned earlier itself and why was there a change done retrospectively. The point being that the in-house systems at large enterprises can evolve over a period of time and the communication from the enterprise may not be very proactive. It can render some of the initial design considerations wrong. The deterioration in the core banking system might be gradual making it even more difficult to identify the root cause later.</p><p><strong>Configuration review:</strong> Overall system configuration was revisited for all microservices thread pools, database connection pool, API gateway routing pool, JVM Xms and Xmx values (running multiple nodes or processes with smaller JVM footprint), redis configurations, etc.</p><p>One important learning was to avoid using default values and fine tune every required parameter as per the need.</p><p><strong>Mocking Enterprise Dependencies:</strong> Enterprise systems interact with external system APIs. Building a test lab with service virtualization of these external API’s i.e. returning mock response can be a life saver. These mocked endpoints can add some latency, drop connections abruptly, etc. A lot of API level issues which occur due to high concurrency or volume can be debugged and tackled beforehand by running performance tests using tools like Jmeter, ab (apache benchmark) etc. One can mock core banking systems, external systems such as Government systems, etc. and those can be helpful in being able to roll out changes quickly.</p><p><strong>Logging cleanup:</strong> At times it’s just overlooked but 4% to 5% performance improvement was seen by analyzing and looking closely at what’s logged in e.g. stack traces, inside most frequently used methods, information which was not meaningful etc. Again, this requires careful reasoning with the teams within the enterprise who can be paranoid about saving every log, every metric till eternity to handle some unforeseen compliance or audit issues. A separate persistent mechanism (such as NoSQL or another) can instead be used to save rolled up data rather than the entire logs of applications.</p><h3>4. Infrastructure right sizing</h3><p>Let’s start with the problem we had at hand. Our deployed distributed platform was running multiple microservices on multiple VM’s, a cluster of SQL and NoSQL databases, caching solutions and was decently handling the throughput and volume. We were informed by one customer (a big financial organization) that in the next few months incoming traffic will increase by 3x. And if there is a need to upsize the infrastructure, then it has to be called out to them in advance. Such unplanned tasks can happen in any mission critical financial systems. What approach will you take? Simple option is 3x of CPU and memory of what you have or are there better ways to calculate it. One of them is benchmarking in a lab environment by simulating the possible traffic but at times it’s not easy.</p><p>One of the very handy mathematical formula is Little’s law which we also used for sizing the infra based on current traffic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*MmOwSam4NnA8VLW-QswrKQ.png" /></figure><p>An example : If 1000 requests on average are received each second and on an average it takes 0.25 seconds to process, then request concurrency a service has to handle is ~1000*0.25 = 250 requests/sec. This exercise needs to be done for all services and a good point to start is with the ones interacting with external API endpoints.</p><p>This approach is not the silver bullet, other possible areas also need to be analyzed e.g. If concurrency is also going to increase then you have to size the service which is the first point of contact, disk size of storage solutions by estimating increase in data size, IOPS needs to be closely looked at, by what factor database reads and writes will increase etc.</p><h3>5. Profiling</h3><p>To put it simply, code profiling really makes life of developers easier as most of the time focus is on business logic and non-functional aspects are given least priority. High memory footprint and leaks have a domino effect on large scale enterprise systems. Even if a single piece starts showing an issue it could bring down the entire system if not properly handled or designed. Consider the case of an enterprise system written in Java. A lot of tools are available to help profile and debug different problems. Let us talk about 2 key tools.</p><p><strong>5.1 Thread Dump</strong></p><p>A thread dump is a snapshot that gives a picture of everything that an application is doing at the instance it is captured. It is a collection of stack traces, one for each thread that’s running in the instance. Every high-level language will have its own way of taking threads snapshot, in our case it was Java. So thread dump for us gives a snapshot of the current state of java running processes.</p><p><strong>Utility :</strong> Helpful in analyzing the CPU spikes.</p><p><strong>Command to take thread dump:</strong></p><p>First check which process is taking up max cpu using:</p><p><strong>top -n1 -b -H</strong></p><p>Use the above pid to take the dump</p><p><strong>jstack -l {pid} &gt; {file-path-for-dump}</strong></p><p>Java threads have clearly defined <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr034.html">states</a>.</p><p>Case 1 : When CPU utilization is very high, focus on threads in RUNNABLE state</p><p>Case 2 : When CPU usage is very low focus on threads BLOCKED state</p><p>Usually 2–3 thread dumps should be taken with a gap of 10–15 seconds. This will help in identifying long running threads.</p><p>One interesting finding that we observed during our analysis of thread dump was that there were several threads in the Blocked state. The thread dump pointed to the Rest Template which allows 2 concurrent api hits by default. The other threads kept waiting in a blocked state. Once we increased the Rest Template configuration count, the new thread dump showed a very small number of blocked threads as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*f5_ZmoOd3w31RYVL8x2pmQ.png" /></figure><p>There are some tools e.g. VisualVM that can analyze these dumps and plot the transitive dependency graphs to detect any deadlocks.</p><p><strong>5.2 Heap Dump</strong></p><p>A Heap dump is a snapshot of the objects and threads occupying the memory of JVM.</p><p><strong>Utility :</strong> Helpful in analyzing the instances of memory leak that leads to Out Of Memory (OOM) crashes.</p><p><strong>Command to take heap dump:</strong></p><p>One of the ways of automatically taking the heap dump on OOM by configuring additional JVM argument :</p><p><strong>-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=&lt;/path/to/dumpfile&gt;</strong></p><p>Once a dump file is created, then it should be analyzed for memory leaks. There are some free and paid tools like Eclipse Memory Analyser, Visual VM, Yourkit etc</p><p>The below snapshot is from Visual VM that shows all the objects present in heap when the dump was taken. We can see for a few of the classes like the highlighted one (Agent class), around 3.4 million objects were present, this was the cause of memory leak. We fixed the query that was loading these objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*SMPTuJxW0fLZIVuNnCa2zQ.png" /></figure><h3>6. Observability</h3><p>Observability helps in answering very important and meaningful questions like “How much time is spent by a transaction end to end when request is flowing through multiple microservices, database layer, caching layer, external end points etc.“, “What’s the average latency of each microservice for p99 or p95”, “Which is critical time windows or any patterns of burst load that is throttling the system”, “Are there any dependent services due to which there is a cascading impact on other”, “Any third party API’s have started timing out or intermittently introducing latency” etc.</p><p>To gauge not only this but many other parameters in near real time, observability metrics are a lifeline for debugging any system and getting to the root cause. One can use any open source tool like Opentelimetry or a licensed one like ELK-APM. We have been using ELK-APM to answer some of these heavy weighted and important questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*igDHdLzv0Pj6PDt49jIkwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7SejK073pZvoVhguW-Jwlg.png" /></figure><p><em>The first graph details dependency latency &amp; throughput in the time window being monitored. The second graph is a snapshot of a transaction trace to analyze how much time is spent and where.</em></p><p>In our case we have been using ELK-APM to monitor the overall system performance. It provides a quick bird eye view of all microservices health and throughput, database health and any long running queries, caching services health and throughput, incoming and outgoing traffic rate, spiking or burst of traffic, third party API endpoints availability and latency, transactional errors, HTTP status codes being returned etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*-EmqD-oh6oh5Gop6Za4OSA.png" /></figure><p><strong>Conclusion</strong></p><p>Every enterprise system is unique as it might be solving a different business problem and having to adapt to different deployment strategies. Architecture of such systems evolve with business needs and are required to work within the constraints imposed by the enterprise systems (such as stability and limitations of the core banking systems) that they interface with. They can be further challenged due to evolving needs of the enterprise, their changing priorities and external dependencies. Scaling and evolving such systems can lead to a lot of learning which is what we have attempted to bring forth in our blog. We have captured learnings around various tiers and taken Java enterprise systems as an example. We are sure that a lot of you have had learnings which are similar to ours. Do share yours as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=068a1a1ac663" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/optimizing-enterprise-grade-distributed-systems-in-fintech-068a1a1ac663">Optimizing enterprise-grade distributed systems in fintech</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTML Page Change Detector: Monitoring And Alerting System]]></title>
            <link>https://medium.com/perfiostechblog/html-page-change-detector-monitoring-and-alerting-system-33c21e4b57b7?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/33c21e4b57b7</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[dynamic-content]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Tue, 20 May 2025 08:41:16 GMT</pubDate>
            <atom:updated>2025-05-20T08:41:16.176Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Authors — Mukul Kumar</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65tfokhw9qc4BBEd1jff6w.png" /></figure><p>1. <strong>Introduction</strong></p><p>Web scraping has become an essential technique for businesses and developers to extract, analyze, and use data from websites. Whether it’s for gathering market data, competitive analysis, or aggregating information from multiple sources, the integrity of the scraped data is crucial. However, websites frequently change their structure, and even a minor change in the HTML can break the scripts or lead to incorrect data extraction.</p><p>This is where the HTML Page Change Detector steps in, offering a robust solution to monitor and alert developers when such changes occur, ensuring that the web scraping process continues smoothly.</p><p>In this blog, we will explore how the HTML Page Change Detector can be leveraged to enhance web applications by identifying HTML changes in real time, helping developers maintain accurate and reliable scripts.</p><p><strong>2. The Importance and Need for an HTML Page Change Detector</strong></p><p>Web scraping relies heavily on the structure of HTML pages. A scraper works by identifying and extracting specific data from web pages using selectors such as XPath, CSS selectors, or regular expressions. However, when the HTML structure of a target website changes, even slightly, it can lead to:</p><ul><li><strong>Broken scripts:</strong> The XPath or CSS selectors may no longer point to the correct elements, causing the scraper to fail.</li><li><strong>Inconsistent data:</strong> If the HTML change is clever (like renaming an element ID), the scraper might miss important data or extract incorrect information.</li></ul><p>When developers regularly scrape data from multiple sources, manually checking for changes in their HTML is not practical. An HTML Page Change Detector automates this process by continuously monitoring web pages and alerting developers as soon as any structural changes are detected. This allows developers to take quick action and update their scripts before any significant data loss occurs.</p><p>Key Benefits:</p><ul><li><strong>Active monitoring:</strong> The detector helps maintain data accuracy by tracking changes in HTML.</li><li><strong>Early alerts:</strong> Developers receive notifications about HTML changes, allowing them to update the script before results are affected.</li><li><strong>Reduce maintenance time:</strong> Automating the monitoring process saves developers from manually checking for changes, letting them focus on high-priority tasks.</li></ul><p><strong>3. How the HTML Page Change Detector Works</strong></p><p>The core functionality of the HTML Page Change Detector is its ability to compare two versions of a web page’s HTML code and detect differences. It uses XPath, a language for navigating through elements and attributes in an XML document (or HTML). By comparing the structure of the page via XPath, it identifies changes in:</p><ul><li>Content (text, images)</li><li>Attributes (classes, IDs)</li><li>Table schemas (column names)</li><li>Forms and interactive elements (input fields, buttons)</li></ul><p>Here’s how the tool works step-by-step:</p><ul><li><strong>Initial Baseline Scan:</strong> The detector first scans the entire HTML document of the web page and creates an XPath-based map of its structure. This serves as a baseline for future comparisons.</li><li><strong>Scheduled Monitoring:</strong> The system periodically scans the web page to check for any changes in HTML. Developers can configure the frequency of these scans, depending on how dynamic their website is.</li><li><strong>Change Detection:</strong> When a difference is detected, the system compares the new HTML structure to the baseline. This includes detecting any added, removed, or modified elements based on XPath in JSON format.</li><li><strong>Categorization of Changes:</strong> The tool categorizes changes based on elements, attributes, and tables.</li><li><strong>Alert Generations:</strong> Once a significant change is detected, the system sends an alert to the relevant developers or teams. These alerts can be customized based on the severity of changes, reducing unnecessary notifications for low-impact modifications.</li><li><strong>Version Control and Historical Tracking:</strong> The detector also keeps track of the different versions of the HTML it monitors. This allows us to compare current and previous versions of changes.</li></ul><p><strong>Workflow Diagram:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/0*laURufwtPBrsA7ns" /></figure><p><strong>Categorization of changes:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/0*CIu9mGcwptz-QyNY" /></figure><p>In the above example, changes are categorized based on elements, attributes, and tables.</p><p><strong>XPath Comparison Example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SfauGxAw-y5vj4pl" /></figure><p>In the above example, The XPath ‘//table[@id=”product-list”]’ identifies a table by its attribute, and the scripts compare the current version of the page to an earlier version. If any changes are detected in the table (like table added, table removed, column added or column removed), the tool alerts the developers.</p><p><strong>HTML Changes comparison:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/0*dTHBM6MkH6H_jpwA" /><figcaption>Version-1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/0*OIbLccgDu9bqduql" /><figcaption>Version-2</figcaption></figure><p>In this example, both versions of the HTML page have side headed table, version-1 has 5 columns (“IE Code”,” Name”,” Address”,” IEC Status”,” CIN”) and version-2 has 6 columns (“IE Code”,” Name”,” Address”,” IEC Status”,” CIN”,”GSTIN”).</p><p><strong>4. Alert and Notifications:</strong></p><p>One of the most powerful features of the HTML Page Change Detector is its customizable alerting system. After detecting a change, the tool generates a detailed report outlining what changed, where it changed, and how it impacted the page. The notification is then sent to the appropriate team members, ensuring timely action.</p><p>Key features of the alert system:</p><ul><li><strong>Customizable thresholds:</strong> Developers can set thresholds for what they consider a “significant” change, preventing alert fatigue from minor or inconsequential modifications.</li><li><strong>Real-time alerts:</strong> Notifications are sent as soon as a change is detected, allowing teams to respond quickly.</li><li><strong>Detailed reports:</strong> Each alert includes a detailed comparison of the old and new HTML structures, highlighting the exact differences.</li></ul><p><strong>5. Conclusion</strong></p><p>The HTML Page Change Detector is a powerful tool for web scraping, offering automated monitoring of target websites’ HTML structures to detect changes in real-time. Whether you are scraping e-commerce sites, news aggregators, or financial platforms, this tool helps maintain the accuracy and reliability of your scraping tasks by identifying and alerting you to any critical changes.</p><p>By integrating the HTML Page Change Detector into our scraping workflow, we can proactively manage and maintain scripts, ensuring that our data extraction remains stable and efficient even as target websites evolve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33c21e4b57b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/html-page-change-detector-monitoring-and-alerting-system-33c21e4b57b7">HTML Page Change Detector: Monitoring And Alerting System</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One System to Process Them All]]></title>
            <link>https://medium.com/perfiostechblog/one-system-to-process-them-all-ac591fe16d5b?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/ac591fe16d5b</guid>
            <category><![CDATA[process]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[technews]]></category>
            <category><![CDATA[bulk-processing]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 03:50:50 GMT</pubDate>
            <atom:updated>2025-04-29T03:50:50.592Z</atom:updated>
            <content:encoded><![CDATA[<h3>Abstract — One Ring to Rule Them All</h3><p>Author: Ubaid Qureshi</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YDT54EJBpUFsEd_lKC_Ew.png" /></figure><p>In today’s data-driven landscape, Fintechs in B2B firms grapple with increasing challenges. Scaling bulk job processing while managing diverse client<a href="https://en.wikipedia.org/wiki/Service-level_agreement"> service level agreements (SLA)</a> is particularly complex. These challenges often result in inefficiencies, delays, and operational bottlenecks. At <a href="https://www.perfios.com/index.php"><strong>Perfios</strong></a>, we address these issues with a <strong>Centralized Bulk Job Processing Unit. </strong>This system delivers seamless, multi-tenant workflows designed for financial operations. It optimizes resource utilization by dynamically provisioning infrastructure and adaptively managing concurrency. This framework unifies diverse business unit requirements into one robust, scalable, and tech-independent solution, akin to the <a href="https://middle-earthcinematicuniverse.fandom.com/wiki/One_Ring">One Ring</a> of efficiency and control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*k1mPKyKmG_W5mR_KiflLaw.png" /></figure><h3>Problem Statement — The Shadow Over Middle-earth</h3><p><em>Like the Fellowship, the problem we face is complex, multifaceted, and requires diverse talents and strategies. It is an epic challenge that demands careful navigation, teamwork, and the right tools to succeed.</em></p><p>Processing diverse documents like PDFs, scanned images, government IDs, and financial reports is central to automation in the BFSI sector. Applications span lending, fraud detection, and regulatory compliance. These workflows rely heavily on accurate data extraction and validation to support hundreds of use cases. Solutions include aggregating data from multiple sources like government APIs, customer documents, private reports, etc while employing tools for parsing, <a href="https://en.wikipedia.org/wiki/Extract,_transform,_load">ETL</a>, and reporting. Scaling these processes for bulk operations introduces challenges like managing diverse SLAs, high computational loads, and cost optimization. FinTechs like Perfios are at the forefront of creating solutions tailored to address these challenges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*X9HpstIpxnVqYBxx-BX5Xg.png" /></figure><h3>Proposed Solution — The One Ring to Rule Them All</h3><p><em>Much like the One Ring’s central role in unifying the various forces of Middle-earth, our proposed solution brings together all the necessary components, strategies, and technologies into one unified force to address the challenge at hand.</em></p><p>A centralized processing unit is designed to operate without being constrained by specific infrastructure, programming languages, or technical stacks. Essentially functioning as Infrastructure as a Service (IaaS). BUs (Business Units) can register their jobs or workflows along with predefined constraints and seamlessly execute them, with the required infrastructure provisioned dynamically on demand.</p><p>This infrastructure is shared across multiple BUs enabling different teams or clients to utilize the same resources. As a result, optimal resource utilization is fostered for critical or time-sensitive jobs, the system can dynamically adjust priority levels and quota allocations. This ensures timely completion without starving other jobs. High-priority jobs are completed faster, while lower-priority ones continue to execute efficiently.</p><p>In scenarios where no competing jobs are present, the entire infrastructure can be deleted to maintain efficiency and cost-effectiveness, the system incorporates mechanisms for graceful degradation, ensuring smooth scaling down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*R_BoGax2Hkk1RrvJEk2lTA.png" /></figure><h3>Prioritization and Quota Computation — The Steward’s Dilemma</h3><p>In a bulk job processing unit, jobs can vary significantly in size, with some having hundreds of requests and others handling hundreds of thousands. Managing these effectively demands a robust queuing and prioritization system to ensure fairness, efficiency, and optimal resource utilization.</p><p>All job requests are placed in a queue, and prioritized based on their urgency and infrastructure needs. While API-based and asynchronous workflow requests do not require infrastructure provisioning, processing-intensive jobs necessitate the allocation of dedicated resources.</p><p><strong>Cyclical Processing and Quota Allocation</strong>: The system operates in cycles, processing requests from all active jobs during each cycle. An intelligent algorithm allocates a dynamically calculated quota per job. The quota computation algorithm considers the following factors:</p><ul><li>Client Priority and Sensitivity: High-priority and sensitive jobs are allocated more requests per cycle, ensuring quicker processing.</li><li>Waiting Time: Jobs with longer waiting times are allocated increasing quotas to prevent delays and maintain SLAs.</li></ul><p>To prevent resource starvation, quotas are capped to ensure that no single job dominates the system. Low-priority jobs are always guaranteed a minimum allocation, avoiding neglect.</p><p><strong>Trade-offs in Quota Management</strong></p><ul><li>Allocating quotas for every job can increase the overall cycle time, potentially delaying the processing of new incoming jobs.</li><li>Capping quotas can slow down super-priority jobs to prevent the starvation of lower-priority ones.</li></ul><p>The system balances these trade-offs by carefully tuning its algorithms to minimize disruptions.</p><p>For jobs requiring additional infrastructure, It automatically triggers internal APIs to deploy resources based on predefined templates. These templates are customized to match specific job requirements, enabling.</p><h3>Adoptive Concurrency Control — You shall not Pass</h3><p>When multiple job requests are submitted simultaneously to the same source, it is critical to manage how many are processed in parallel to avoid overloading system resources or external services. This is where adaptive concurrency control plays a vital role.</p><p>We have simplified some constructs found in general-purpose compute cluster managers like Mesos and introduced purpose-specific mechanisms such as adaptive concurrency control.</p><p><strong>Concurrency Limits</strong>:</p><p>Each job is assigned predefined concurrency limits at the time of creation. These limits dictate the maximum number of requests that can be processed in parallel for a given job.</p><p><strong>Quota Management</strong>:</p><p>Even if a job has pending quotas, new requests are not processed until an active concurrency slot is freed. This ensures that system resources are not overwhelmed.</p><p><strong>Dynamic Request Handling</strong>:</p><p>Once a request is completed, the system immediately pulls the next request from the queue for processing, maintaining smooth and uninterrupted workflow execution</p><h3>IaaS — Smith of the Valar</h3><p>Processing jobs often demand either parallel processing for faster completion or high-memory single instances for resource-intensive tasks. To optimize costs and performance, our system integrates intelligent infrastructure provisioning with support for both spot instances and on-demand instances.</p><p>Cost Optimization Strategies</p><ul><li>Spot Instances: Ideal for fault-tolerant and idempotent jobs, as these instances are cost-effective and can be scaled up or down easily.</li><li>On-Demand Instances: Necessary for jobs that are not fault-tolerant, ensuring reliability even in critical workflows.</li></ul><p>We built a centralized service for dynamic infrastructure provisioning using <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">boto3</a> for AWS. When a job is initiated, the system checks for active resources. If available, the job enters the priority queue. If not, the service provisions resources dynamically using predefined templates to minimize delays. Templates are registered in advance to specify job-specific resource needs, including CPU, memory, disk size, and scalability preferences, ensuring efficient and seamless processing.</p><p><strong>Scalability Features</strong>:</p><ul><li>Supports vertical scaling for high CPU and memory requirements.</li><li>Leverages horizontal scaling for parallel processing using Kubernetes pods.</li></ul><p><strong>Language</strong> <strong>and Technology Independence</strong>:</p><ul><li>All application and OS dependencies are encapsulated in container images from ECR registries.</li><li>This abstraction allows jobs to run on any tech stack or operating system, e.g., Python, Java, Linux, or Windows.</li><li>Responsibility for creating container images lies with the respective technical teams.</li></ul><h3>Orchestration — The Threads of Fate</h3><p>It empowers business strategy teams to create new products and offerings by seamlessly integrating APIs and services from multiple business units (BUs) on the fly. This flexibility allows organizations to respond quickly to market demands, customer needs, and emerging opportunities, without being constrained by rigid infrastructure or siloed operations.</p><ul><li><strong>Orchestration Framework</strong>: Using a robust orchestration framework like Netflix Conductor/OSS, the system ensures that interdependent tasks, APIs, and workflows are executed in the correct sequence, respecting dependencies and business logic.</li><li><strong>Task Dependencies</strong>: Coordinating tasks that depend on the completion of others, ensuring that workflows progress smoothly without errors or delays.</li><li><strong>Error Handling and Retries</strong>: In the event of a task failure, the orchestrator triggers automatic retries, handling exceptions gracefully and ensuring the workflow continues without manual intervention.</li><li><strong>Parallel Execution</strong>: Where possible, the orchestrator enables parallel execution of independent tasks, significantly reducing overall processing time and improving system efficiency.</li><li><strong>Dynamic Reconfiguration</strong>: One of the key strengths of this orchestration system is its ability to dynamically reconfigure workflows. As new APIs or services are developed, they can be plugged into existing orchestrations or entirely new workflows can be created without downtime. This ensures that businesses can scale and evolve their products in real-time, staying competitive in fast-moving industries.</li><li><strong>Business Agility</strong>: This orchestration model enhances the agility of BUs (business units) by enabling them to offer custom solutions tailored to specific client needs. Teams can combine various services such as <a href="https://www.perfios.com/post/a-superior-way-to-conduct-business-due-diligence">KSCAN</a>, <a href="https://perfios.ai/in/industries/insurance/">InsureTech</a>, or third-party data integrations into a unified offering with minimal development overhead.</li></ul><h3>Conclusion — The Dawn of a New Age</h3><p><em>All we have to decide is what to do with the time that is given us. The time is now. You may choose to take the road that leads to victory, but it is long and fraught with peril..</em></p><p>Almost all BUs face the above-mentioned challenges or variations of similar challenges, yet many develop custom solutions to meet their individual needs. This blog aims to present a foundational approach that was developed at Perfios to address these requirements with a single solution while minimizing infrastructure costs.</p><p><strong><em>“One system to streamline them all, one framework to scale them, one engine to process them all, and in the efficiency, deliver them.”</em></strong><em><br>- me</em></p><p><strong><em>“One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.”</em></strong></p><p><em>- J.R.R. Tolkien’s The Lord of the Rings. It is part of the inscription on the One Ring in the story.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac591fe16d5b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/one-system-to-process-them-all-ac591fe16d5b">One System to Process Them All</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Achieving QA Excellence: Best Practices and Innovative Approaches at Perfios]]></title>
            <link>https://medium.com/perfiostechblog/achieving-qa-excellence-best-practices-and-innovative-approaches-at-perfios-fc3845df734b?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/fc3845df734b</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[qa-best-practices]]></category>
            <category><![CDATA[root-cause-analysis]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 09:48:02 GMT</pubDate>
            <atom:updated>2025-04-15T09:48:02.264Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LVXc0jH_dh5UiUtVdJXjRQ.png" /></figure><p><strong>Author: Manpreet Kaur Mankoo</strong></p><p>Mumbai, the city that never sleeps, is humming with excitement. Fans are preparing for the opportunity to grab seats at the Coldplay concert, one of the most highly anticipated events of the year. The sale is about to go live on a leading Indian ticketing platform, and millions are anxiously waiting to hit that ‘buy’ button. However, as the countdown hits zero, excitement quickly transforms into dejection. Fans who registered early find themselves further back in the queue than those who registered later. Now that’s a bass drop the users didn’t see coming! The app crashes mid-booking. Pages load slower than a Monday morning, and some fans find themselves logged out just as they reach the checkout. For many, this wasn’t just a frustrating experience, it was the heartbreak of a missed opportunity.</p><p>This real-life incident is a powerful reminder of why <strong>Quality Assurance (QA)</strong> is so critical. When QA is mismanaged, it’s not just glitches we are dealing with, it’s the entire user experience, reputation, and business at stake.</p><p>At <strong>Perfios</strong>, with a growing base of <strong>1000+ clients</strong> across <strong>18 countries</strong>, delivering flawless user satisfaction and experiences is not just a goal, it’s a necessity. As a tech-first company in the heavily regulated BFSI sector, now expanding into healthcare, commerce, and payment gateways, the stakes are high. A single QA error can impact multiple industries, millions of users, and years of trust.</p><p>That’s why we have a <strong>holistic QA strategy</strong> that is proactive, comprehensive and technical that goes beyond traditional testing. With a focus on creating platform products that are industry and geography-agnostic, <strong>we ensure our products not only meet but also exceed expectations.</strong> Here’s how we do it:</p><p>____________________________________________________________________________</p><h3>1. Adopting a Shift Left Approach &amp; Proactive Risk Management:</h3><h3>Traditional Approach &amp; Challenges:</h3><p>Traditionally, QA gets invited to the development party a little late, like showing up after the cake is cut. By that point, bugs are already baked into the system, raising costs and stress levels, and leading to missed risks.</p><h3>Perfios’ Approach &amp; Value Add:</h3><p>At Perfios, we shift-left. Meaning QA doesn’t get a last-minute invite, we help plan the party from day one. By reviewing requirements, assessing risks early, and planning tests, we catch bugs before they can steal the spotlight. This approach helps in prevention of bugs, <strong>keeps the project on track, reduces rework, and saves everyone a headache and some serious cash.</strong></p><h3>Key Risk Management Approaches:</h3><ul><li><strong><em>Regular Risk Assessments:</em></strong></li></ul><p>We constantly scan for risks like a radar, looking out for issues with scalability, privacy, compliance, or project scope creep — the silent killer of deadlines.</p><ul><li><strong><em>Contingency Planning:</em></strong></li></ul><p>We create backup plans for risks, because it’s always better to have a Plan B ready when things go sideways.</p><ul><li><strong><em>Real-Time Monitoring:</em></strong></li></ul><p>Our tools monitor the system 24/7, catching problems before they turn into fire drills.</p><ul><li><strong><em>Risk Mitigation through RCA:</em></strong></li></ul><p>For every incident, we dig deep with a Root Cause Analysis (RCA) using the <strong>5 Whys</strong> <strong>technique </strong>because if you only treat the symptoms, the problem will come back with a vengeance.</p><h3>2. Forming a Comprehensive Test Strategy and Using Innovative Testing Techniques:</h3><h3>Traditional Approach &amp; Challenges:</h3><p>In many setups, testing feels like playing hide-and-seek with bugs, except the bugs win. Narrow focus leads to incomplete coverage and missed bugs that love to fester in production.</p><h3>Perfios’ Approach &amp; Value Add:</h3><p>At Perfios, our testing strategy is more like detective work — no bug escapes unnoticed. We have got a <strong>thorough plan that leaves no corner untested</strong>, backed by these key practices:</p><ul><li><strong><em>Requirements Analysis and Design Reviews:</em></strong></li></ul><p>Our QA teams swoop in early, analyzing business needs and tech requirements like Sherlock Holmes, ensuring test plans align perfectly with product goals.</p><ul><li><strong><em>Test Estimates:</em></strong></li></ul><p>We give realistic test estimates early on, so nobody’s struggling for time or resources. After all, nobody likes last-minute surprises, especially in testing!</p><ul><li><strong><em>Innovative Test Case Design:</em></strong></li></ul><p>We get creative with our test cases, making sure they are as sharp as they are effective:</p><p><strong><em>Mind Mapping:</em></strong> A brainstorming method that catches all the corner cases, even the ones hiding under the rug.</p><p><strong><em>Pairwise Testing:</em></strong> Reducing test cases while still covering all combinations. Think of it as the test-case diet plan: leaner but just as strong.</p><p><strong><em>Risk-Based Testing:</em></strong> We focus on high-risk areas first, because why wait for the big bugs to bite?</p><p><strong><em>Data-Driven Testing:</em></strong> Using real-world data to test, because nothing reveals a bug faster than actual user behavior.</p><ul><li><strong><em>Cross-Platform &amp; Types of Testing:</em></strong></li></ul><p>We test across all devices and browsers, making sure the app works smoothly everywhere, from QA to production, through smoke, sanity, regression, API using Postman, UI, mobile and even database testing.</p><ul><li><strong><em>Non-Functional Testing:</em></strong></li></ul><p>We focus on the heavy lifting — performance, load, and usability <strong>using JMeter, Gatling, Grafana dashboard</strong> — so our apps run like a well-oiled machine, even under pressure.</p><ul><li><strong><em>Test Automation:</em></strong></li></ul><p>After each release, we run regression tests to keep bugs from sneaking back in. Automation does the heavy lifting, speeding things up with tools, libraries, and practices like:</p><p><strong>a. Selenium, RestAssured</strong> <strong>&amp;</strong> <strong>Appium libraries </strong>for Browser, API and Mobile app test automation</p><p><strong>b. TestNG &amp; Maven</strong> for unit testing and dependency/build management</p><p><strong>c. GitLab &amp; GitLab Pipelines/Jenkins</strong> for version control and Continuous Integration (CI)</p><p><strong>d. AssertJ, Jackson, Lombok &amp; Owner libraries</strong> for eliminating repetition, enhancing readability and easier maintenance</p><p><strong>e. </strong>SonarLint, coding best practises &amp; design principles like POM (Page Object Model), DRY (Don’t Repeat Yourself), SRP (Single Responsibility Principle), KISS (Keep It Simple, Stupid), OCP (Open/Closed Principle), YAGNI (You Aren’t Gonna Need It), Separation of Concerns (SoC)</p><p><strong>f. Allure Reports</strong> for providing real-time insights into test results and trends.</p><p>For a practical reference, follow the given GitHub sample projects for most of the above-mentioned tools, libraries, and practices:</p><ul><li><a href="https://github.com/ManpreetKaurMankoo/cbh-web-test-automation"><strong>https://github.com/ManpreetKaurMankoo/cbh-web-test-automation</strong></a></li><li><a href="https://github.com/ManpreetKaurMankoo/RestAssuredTests_TestNGGitHubActionsDocker"><strong>https://github.com/ManpreetKaurMankoo/RestAssuredTests_TestNGGitHubActionsDocker</strong></a></li><li><strong><em>Innovative Manual Testing Practices:</em></strong></li></ul><p>And just when automation thinks it has covered everything, our manual testers dive in for some exploratory testing, finding the sneaky bugs that like to play hide-and-seek.</p><ul><li><strong><em>Demo &amp; Feedback Loops:</em></strong></li></ul><p>Once testing is done, we present our findings to stakeholders, gather feedback, and refine the work because no one likes surprises at the end.</p><h3>3. Applying Analytical and Critical Skills at All Levels:</h3><h3>Traditional Approach &amp; Challenges:</h3><p>QA sometimes follows instructions like they are baking a cake — step by step, no questions asked. But unlike baking, this approach can miss key ingredients for improvement, leading to some seriously undercooked solutions.</p><h3>Perfios’ Approach &amp; Value Add:</h3><p>At Perfios, our QA engineers are more like detectives than bakers. We foster a culture of critical thinking, where questioning is encouraged. Our QA experts embrace first-principles thinking, breaking down problems to their core and asking all the “what ifs” and “why nots” that no one else dares to. We don’t just think outside the box — we question if the box even needs to exist. We ask some essential questions like:</p><ul><li>“Why is this change needed?”</li><li>“What areas does it impact?”</li><li>“Why does this happen?”</li><li>“What’s the real user experience?”</li></ul><p>We dive deep, connect the dots, and ensure the product is not only <strong>functional </strong>but also <strong>smooth, reliable, and perfectly in tune with business goals.</strong></p><h3>4. Making Use of Data-Driven Insights:</h3><h3>Traditional Approach &amp; Challenges:</h3><p>Traditional QA can sometimes feel like trying to find a needle in a haystack — without knowing if the needle even exists. Relying on assumptions instead of real data is like playing a guessing game with production issues.</p><h3>Perfios’ Approach &amp; Value Add:</h3><p>At Perfios, we prefer our needles (and issues) clearly visible, thanks to our data-driven approach. By analyzing user behavior, system logs, and historical data, we predict performance and <strong>focus on critical areas</strong>. For instance, in our VKYC product, we test on the most commonly used client devices and browsers.</p><h3>Key Elements of Our Data-Driven Approach:</h3><ul><li><strong><em>Analyzing Test Failures:</em></strong></li></ul><p>When things break, we channel our inner Sherlock Holmes and dig into the failure patterns to uncover deeper code issues.</p><ul><li><strong><em>Preparing Test Data:</em></strong></li></ul><p>We craft test cases using real-world data, so our testing isn’t just thorough, it’s like reenacting the customer’s journey.</p><ul><li><strong><em>Focusing on High-Risk Areas:</em></strong></li></ul><p>Our data-driven insights help us zero in on high-risk areas, making us efficient — like a GPS that actually knows the shortcuts!</p><ul><li><strong><em>Tracking QA Metrics:</em></strong></li></ul><p>We track metrics like defect density and test coverage using <strong>ReportPortal</strong>, ensuring our testing is more science, less guesswork.</p><h3>5. Establishing a Culture of Quality, Communication &amp; Collaboration, and Aligning with Agile &amp; Continuous Practices:</h3><h3>Traditional Approach &amp; Challenges:</h3><p>In traditional setups, testing can feel like the emergency brake in a sports car — often engaged too late, causing the ride to be a bumpy one.</p><p>Communication often happens in silos, turning team collaboration into a game of charades, and support is reactive, like a fire drill that comes too late to stop the flames.</p><h3>Perfios’ Approach &amp; Value Add:</h3><p>At Perfios, QA isn’t the emergency brake; it’s the turbo boost! We integrate QA early in the agile process, from product backlog planning to sprint planning and reviews, using tools like JIRA, Slack, and Agile boards for smooth collaboration. We make quality everyone’s responsibility, fostering a culture where every team member owns it, much like keeping the bathroom clean at a party! This continuous focus on quality helps our products remain reliable and meet user expectations.</p><p>Our QA team excels in clear, proactive communication, sharing insights, offering suggestions, raising concerns, and documenting every step like it’s an epic saga, and continuously gathering feedback to drive improvements. Post-deployment, our support doesn’t stop — we run sanity tests, monitor performance, and address client concerns faster than a DJ takes requests, ensuring minimal downtime and maximum product reliability.</p><h3>6. Creating Robust Documentation &amp; Knowledge Sharing:</h3><h3>Traditional Approach &amp; Challenges:</h3><p>Documentation often feels like that mysterious black hole — what goes in is never seen again, leading to knowledge gaps within teams that rival the Bermuda Triangle.</p><h3>Perfios’ Approach &amp; Value Add:</h3><p>At Perfios, we believe in clear documentation to future-proof our solutions and reduce team dependencies. Every phase of testing is thoroughly documented, from requirement clarifications to test plans, execution results, and QA sign-offs <strong>using Confluence and JIRA</strong>. Think of it as our treasure map — X marks the spot where all the information is!</p><p>We also document product knowledge, covering business, technical, and testing aspects with detailed user journeys and screenshots. <strong>This ensures seamless knowledge sharing, minimizes back-and-forth, and strengthens cross-functional collaboration.</strong></p><p><strong>____________________________________________________________________________</strong></p><p>Looking ahead, QA at Perfios will continue to evolve — like a caterpillar turning into a butterfly. We are investigating AI-driven testing for generating test cases and data, predicting defects, and executing tests intelligently. This will lead to smarter test coverage and faster release cycles — because who wouldn’t want their bugs squashed before they even hatch? <strong>Stay tuned for updates on our advancements in this area!</strong></p><p>As we continue to expand globally and diversify into new industries &amp; segments, our commitment to quality will only deepen — like a fine wine that gets better with age. We understand that as our products reach new industries and geographies, the risks grow and so do the expectations. Our vision for the future of QA at Perfios is not just about preventing failures; it’s about <strong>building reliable, secure, scalable, innovative and user-centric products</strong> <strong>that set the benchmark for excellence.</strong></p><p>In this ever-changing world of tech, one thing remains constant i.e. <strong>Quality matters.</strong> And as Perfios continues to scale, our QA practices will remain a key differentiator in our success — like a secret ingredient that enhances every dish!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc3845df734b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/achieving-qa-excellence-best-practices-and-innovative-approaches-at-perfios-fc3845df734b">Achieving QA Excellence: Best Practices and Innovative Approaches at Perfios</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pose Detection with YOLOv10]]></title>
            <link>https://medium.com/perfiostechblog/pose-detection-with-yolov10-233b71b0a821?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/233b71b0a821</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[yolov12]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[keypoint-detection]]></category>
            <category><![CDATA[yolov10]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Wed, 09 Apr 2025 09:47:08 GMT</pubDate>
            <atom:updated>2025-04-09T09:48:27.913Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Cyzfnr8AGGKeka1gDUynw.png" /></figure><h3>Authors:</h3><p>Vinit Sarode, Shubham Sinha and Kaushal Jani</p><h3>Our story</h3><p>We at Perfios are constantly researching on developing new solutions to solve complex problems in the BFSI domain. Fast and accurate object detection is at the core of many of our products. The YOLO family of models provides cutting edge object detection capabilities which we leverage in our pipeline and build solutions around it. Our KYC journey, for instance, begins with detecting a face, verifying liveness, and then proceeding to face recognition. The initial and crucial step in this process is detecting the face and its pose. Similarly, in OCR workflows, detecting a personal identification card and determining its orientation is foundational. Pose detection, therefore, is a fundamental component of our workflows at Perfios.</p><p>We have explored the various versions of the YOLO family of models (such as YOLOv5, YOLOv8). A recent development of YOLOv10 has faster postprocessing and efficient architecture as compared to its older versions. But the drawback of this new model is the lack of pose detection feature which is essential in our applications. In this blog, we are introducing pose detection features in the YOLOv10 framework to improve latency and performance of our face recognition and document digitisation workflows.</p><h3>What is pose detection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*n08WU-5323YuOvIdK-MjUw.png" /><figcaption>(ref <a href="https://www.linkedin.com/pulse/perform-pose-estimation-using-computer-vision-vatan-gupta/">link</a>)</figcaption></figure><p>In simple terms, pose estimation is identifying the special coordinates called key-points from a given input image. As shown in the above figure, human body joints, facial features are the key-points. Technically, an AI algorithm has to learn physical representation of these key-points from a large pool of annotated images and later predict these key-points on new unseen images.</p><p>YOLOv10 Architecture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*mjK7jIlY8WfaktXoIVjzWw.png" /><figcaption><a href="https://docs.google.com/document/d/1tWrB8mR6gNs3pL0A-bCaLIJYWLEJRjto8gh9F64qb-o/edit?tab=t.0#heading=h.cwo0ote8twk6">YOLOv10</a> Architecture</figcaption></figure><p>What is NMS (Non-maximum suppression)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*HqIShX6RVMB1hKjxoNR4eg.png" /><figcaption>(ref <a href="https://medium.com/analytics-vidhya/non-max-suppression-nms-6623e6572536">link</a>)</figcaption></figure><p>Previous versions of the YOLO family predict multiple bounding boxes for an object in a given image. NMS algorithm is used to filter one bounding box from multiple predictions. The above image shows the predictions of the YOLO model before NMS compared to after NMS. NMS is a post-processing step. Refer to additional details for the <a href="https://docs.google.com/document/d/1tWrB8mR6gNs3pL0A-bCaLIJYWLEJRjto8gh9F64qb-o/edit?tab=t.0#heading=h.xj7nm57mzc5q">algorithm</a>.</p><p>YOLOv10 Training Pipeline:</p><p>Generally, how we train is how we infer. Older yolo uses TAL (Task Aligner)(<a href="https://arxiv.org/pdf/1912.02424#page=5">ref1</a>, <a href="https://www.computer.org/csdl/proceedings-article/iccv/2021/281200d490/1BmEvqSJIEE">ref2</a>) to give multiple (mostly k=10) positive boxes for a single ground truth bounding box. This simplifies model objective, provides strong supervision and faster convergence, with a cost of NMS during inference.</p><p>In v10, we have one2many and one2one heads. We jointly train both heads with backbone and neck. In one2many it assigns more than 1 positive box, while in one2one it assigns only 1 positive box per ground truth. Hence, during training the model learns features and gets supervision from one2many head. During inference we exclude the one2many head and only consider one2one head’s output. This head has already learned to predict a single bounding box per ground truth. Therefore, NMS is not required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bSxt5tKxYF5E4I5Hwj-mKw.png" /></figure><p>As you can see in the image, it uses the same Loss function over both heads. In one2many we kept (the positive sample per ground truth) k=10 whereas in one2one we kept k=1.</p><p>It uses binary cross entropy for classification, CIOU (complete iou loss) and DFL (distributed focal loss) for regression(predicting the bounding box).</p><h3>Post-processing (without NMS)</h3><p>In YOLOv10, we employ 2 detection heads named as:</p><ul><li>one2many</li><li>one2one head</li></ul><p>The one2many head trains similarly to previous versions of Yolo esp. YOLOv8 where multiple detections per ground truth are used to calculate the loss therefore leading to multiple box detections per object.</p><p>But the new addition i.e. the one2one head is trained in a way where only one prediction that matches best with the ground truth box is used to calculate the loss.</p><p>Empirically, it shows that this head learns to detect only one box per object.</p><p><strong>Currently it lacks the pose detection feature !!</strong></p><h3>Our addition in architecture for pose detection</h3><h3>Architecture addition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/184/1*c3LJbKZGQc19Uug6Sj9D7A.png" /></figure><p>We replaced the v10Detect head with our v10Pose head which does both box detection and keypoint detection.</p><h3>YOLOv10-Pose Training Pipeline</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1Z_L8dvr6NCJZbyHITxPA.png" /></figure><p>In addition to v10detect we added one2many and one2one keypoints heads and called it v10pose.</p><p>Same as YOLOv10, during training along with both detection heads we jointly train one2many and one2one keypoints heads with poseloss. At Inference we exclude one2many head and only use one2one key points head’s output as keypoints prediction.</p><h3>Experiments</h3><h3>Face keypoints detection</h3><ul><li><strong>Dataset description</strong></li></ul><p>We use WiderFace dataset for this experiment which has bounding boxes of face and 5 key-points for eyes, nose and mouth. The dataset is split as 80% data for training and 20% for validation. There are approximately 12646 images in the training dataset and 3162 images in the validation set.</p><ul><li><strong>Use Cases</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*txx60PP5GUaoWUIfqIquYw.png" /></figure><p>Face detection &amp; pose estimation is the first step in the pipeline of face recognition. We detect the bounding box &amp; 5 key-points of the face. Later we crop and align the face in a 112x112 sized image using the predicted key-points. This is an important preprocessing step for face recognition as it aligns the eyes, nose and mouth at a fixed position making it easy to compare with other faces. In simple terms, it is a normalization of the face image.</p><ul><li><strong>Experiment Setup</strong></li></ul><p>We trained the YOLOv10 nano model with our addition of a pose detection branch using WiderFace dataset. All images were resized to 640x640 by maintaining the aspect ratio and applied data augmentations like rotation, horizontal flip, translation and scaling were used. It was trained for 80 epochs with a batch size 8 and used SGD optimizer with an initial lr of 0.01.</p><ul><li><strong>Results</strong></li></ul><p>In the figures below, we show the results of our yolov10-pose model trained using the WiderFace dataset. The first column shows the original image, the second column shows the Ground Truth annotation and the last column shows the model’s predictions. The first row shows an image with a single face and the remaining two rows show an image with multiple faces in it. Our model is capable of detecting multiple faces and their key-points in an image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSoVIBnLo68rtFsisrXRzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGzbY-_g2rnuN06rZShxXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iN4Z6BuzR00K6ROhK8-LUA.png" /></figure><p>Below image shows the results of the YOLOv10-Pose model on an unseen PID card image. Our new model is able to detect the face and key-points successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y8yNt1wrzZ0obGd5ILdEjg.png" /></figure><p>This table below shows the latency of the yolov5-face model vs yolov10 model. Both the models predict bounding boxes as well as 5 key-points and are trained on WiderFace dataset. We can clearly see that YOLOv10-pose has a better latency as the post-processing step (NMS) is not required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*Kx8MEtR4eU0Hw50XrMO4ww.png" /></figure><h3>Coco Human Pose</h3><p>-<strong>Dataset description</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*AJ8feo4Xmr0ycDvS9o43AA.png" /><figcaption>(ref <a href="https://www.kaggle.com/datasets/awsaf49/coco-2017-dataset">link</a>)</figcaption></figure><p>We have used the dataset provided with the “COCO 2017 Keypoint Detection Task”. The dataset provides images of people in uncontrolled scenarios with each person annotated with a bounding box and and a maximum of 17 key points describing the pose the person.</p><p>The key points are labeled as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RRYoODncI7mmrpnx_DR8VA.png" /></figure><p>The dataset that we used is divided into 2 parts:</p><ul><li>Train2017 (training set) containing 56599 images</li><li>Val2017 (validation set) containing 2346 images</li></ul><p><strong>Use Cases</strong></p><ul><li>Pose detection can help in gym training to analyze a person’s posture and help in correcting it or planning exercises accordingly.</li></ul><p><a href="https://medium.com/@pawelkapica/using-pose-estimation-algorithms-to-build-a-simple-gym-training-aid-app-ef87b3d07f94">https://medium.com/@pawelkapica/using-pose-estimation-algorithms-to-build-a-simple-gym-training-aid-app-ef87b3d07f94</a></p><ul><li>Pose transfer in generative modeling where a person’s pose is transferred onto another person’s image or a 3D model to mimic the source pose. It can be used for robotics, AR/VR, gaming and visual effects in cinema.</li><li>In sports athletes’ pose can be analyzed for effective performance analysis and training sessions.</li></ul><p><strong>Experiment Setup</strong></p><p>We trained YOLOv10 on the training set by resizing images into 640x640 dimensions and applied many random augmentation techniques like color jitter, blurring, cropping, affine transformation, horizontal and vertical flipping.</p><p>We used the nano version of YOLOv10 which is the smallest model in the v10 series and have used pretrained weights from the YOLOv10 detection model to load weights for the backbone of the network. The head is kept with raw initialized weights.</p><p>During training we have used a batch size of 16, which ran for 100 epochs on T4 GPU for 30 hours.</p><p><a href="https://docs.google.com/document/d/1tWrB8mR6gNs3pL0A-bCaLIJYWLEJRjto8gh9F64qb-o/edit?tab=t.0#heading=h.2qg803gxoz9i">Training logs</a></p><ul><li><strong>Results</strong></li></ul><p>Qualitative comparison of ground truths and predictions of YOLOv10 pose model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_ouYnYRJoC2XfxiXIqWCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lLnYOTGQT2qTLh68YFxZsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAENILrKQL1XSv624LqNyg.png" /></figure><h3>Comparison with YOLOv8</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*HrHHq2bBzGXUVJM0DderMw.png" /></figure><h3>Conclusion</h3><p>We have trained YOLOv10 with an additional pose estimation module on WiderFace and COCO datasets. These are our initial experiments where we have demonstrated the potential of accommodating pose-estimation in the YOLOv10 framework (NMS-free model).</p><p>Further the metrics and loss graphs show that there is a potential for better results if trained/fine-tuned for more epochs. Since there is still scope for improvement, there are some obvious cases where the model has failed to give proper results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8tHLwFWtqC5KmdUIw4zqcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91FsHBcRPhhCKPLs-AowrA.png" /></figure><p>The YOLO framework has continued to advance, with the latest version being YOLO12.</p><p>It uses an attention-centric approach rather than the classical CNN based approach in previous versions. This, along with other network architectural improvements, allow it to be more accurate with fewer parameters while maintaining real time inference speeds. <br>The potential use of the NMS-free approach for object and pose detection with YOLO12 will be explored in future research.</p><h3>Additional Details</h3><h3>Model architecture (YOLO — v8 vs v10)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*ZV6vU63pIxyh2bIIveFdGQ.png" /><figcaption>YOLOv8 Architecture</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*mjK7jIlY8WfaktXoIVjzWw.png" /><figcaption>YOLOv10 Architecture</figcaption></figure><h3>YOLOv10 architecture improvements over YOLOv8:</h3><p><strong>Lightweight classification head:</strong> In YOLOv8, it was found that classification head has 5.9G flops while regression head has 2.64G flops(yolov8-s)(<a href="https://arxiv.org/pdf/2405.14458#page=5">link</a>), for the model performance point of view regression has higher weightage hence YOLOv10 researchers decided to reduce the classification head capacity. Convolution layers were changed to 3 * 3 depth separable convolution and 1*1 pointwise convolution and there were 2 such layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*K763G8wmLOfSlqeA39XLAw.png" /><figcaption>(ref <a href="https://www.sciencedirect.com/science/article/pii/S0168169918318696">link</a>)</figcaption></figure><p><strong>Spatial-channel decoupled downsampling (SCDown):</strong> To reduce spatial dimensions in YOLOv8 3 * 3 strided conv with stride=2 with num filter=2c were used. In YOLOv10, researchers first applied point wise conv to make 2c channels then apply 3 * 3 depth wise separable conv to downsample spatial dimensions.</p><p><strong>Rank-guided block design (CIB):</strong> YOLOv8 used the same conv block for all stages after analyzing redundancy in YOLOv8 across the scales. YOLOv10 replaces conv with CIB(compact inverted block) block which uses less parameters hence there will be less redundancy in params with same performance.</p><p><strong>Enlarge Receptive Field:</strong> In deeper C2fCIB layer kernel size was changed from 3*3 to 7*7 To enhance the receptive field, YOLOv10 authors chose to do it at a deeper level to trade off between performance gain and I/o and flops usage.</p><p><strong>Partial Self Attention(PSA):</strong> Self attention gives higher modeling capability with cost of O(n2) so in YOLOv10, only at stage 4 spatial dimensions are reduced and they apply PSA at this level. In PSA first output of pointwise convolution was split into two part,one part is fed into MHSA(Multi Head Spatial Attention) and the other is concatenated after output of FFN using point wise convolution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*rcE_MkGLxbA3dNa65HX4tA.png" /><figcaption>(ref <a href="https://arxiv.org/abs/2405.14458">link</a>)</figcaption></figure><h3>NMS Algorithm</h3><ol><li><em>Define a value for IOU_Threshold.</em></li><li><em>Sort the bounding boxes in a descending order of confidence.</em></li><li><em>Loop over all the boxes, starting first with the box that has the highest confidence.</em></li><li><em>Calculate the IOU of the current box, with every remaining box that belongs to the same class.</em></li><li><em>If the IOU of the 2 boxes &gt; IOU_Threshold, remove the box with a lower confidence from our list of boxes.</em></li><li><em>Repeat this operation until we have gone through all the boxes in the list.</em></li></ol><h3>Experiment’s metrics and losses</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*OkF97o0Kq6LTugKD50H9RQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*x5EpCIP-X3pp3myU-_VWmw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=233b71b0a821" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/pose-detection-with-yolov10-233b71b0a821">Pose Detection with YOLOv10</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Test to Rule them All — Hypothesis Testing Simplified]]></title>
            <link>https://medium.com/perfiostechblog/one-test-to-rule-them-all-hypothesis-testing-simplified-45ba651627ff?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/45ba651627ff</guid>
            <category><![CDATA[sampling-distribution]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[permutation-test]]></category>
            <category><![CDATA[hypothesis-testing]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Thu, 03 Apr 2025 04:23:19 GMT</pubDate>
            <atom:updated>2025-04-03T04:23:19.119Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>One Test to Rule them All — Hypothesis Testing Simplified</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_7GL01NecKvv0K1-Uru5cA.png" /></figure><p><strong>Author: Syed Mohd Bilal Arif</strong></p><p><strong>Motivation</strong></p><p>Hypothesis testing is a very popular and handy tool for decision making across a wide variety of fields. In marketing analytics one studies whether there is meaningful difference in response from specific channels of advertisement like mobile, web or print. Pharma companies run clinical trials to determine drug efficacy. UX teams run A/B tests to decide upon specific things like color and placement of widgets. The applications are as widespread as they are old.</p><p>Despite being so popular, its application and interpretation is equally contentious to say the least. With opinions ranging from how this is (incorrectly) taught in introductory statistics curricula or to push for less reliance on anachronistic and often unrealistic assumptions. In these two part blog posts, we first describe that all hypothesis testing essentially boils down to ‘ONE SINGLE TEST’ and the burdensome ways to satisfy unrealistic statistical assumptions and need to remember hundreds of tests are really not needed. In part two we will focus on some of the common mistakes prevalent in applying hypothesis testing to real world scenarios and why those make the conclusions unreliable.</p><p><strong>Overview</strong></p><p>We frequently face scenarios in business where decision making involves uncertainty. E.g. Whether a method of teaching makes a difference in students’ performance or running a marketing campaign will translate to increase in sales. The latter can even be broken down to specifics e.g. allocation of marketing spends on different mediums like print, web, mobile etc. should be proportional to ROI from each. Since running these campaigns could be a costly endeavor, the company may run this on a small scale and decide thereafter.</p><p>Hypothesis testing allows us to use the sampled data and infer about the phenomenon at hand by quantifying the uncertainties observed.</p><p>Let’s start by taking the first example: “Whether a method of teaching makes a difference in students’ performances”. We will use it in the rest of the post to highlight the difference between the analytical and arguably more complicated way vs the computation approach and try to persuade readers to not lose heart, as the latter is a saner and logical approach which could be conducted by anyone who knows a little bit of programming.</p><p>Assume two sets of students from a class have been randomly distributed. Group 1 continue their studies as is, but Group 2 is assigned a Subject Matter Expert for Mathematics which devotes 1 hour extra post school. After a month of intervention, a test is conducted and scores from both cohorts are recorded.</p><p>How do we answer then: Whether having an SME improves the scores.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*LFswlV-qyLmcl9OQ6A8yXA.png" /></figure><p><strong>The Analytical Way</strong></p><p>Making a judgment about these kind of problems usually involves following the recipe below (aka the Analytical Method):</p><ol><li>Define Null and Alternative Hypotheses. In this case, the former means there is no difference between the performance of two cohorts and whatever this is, is likely due to chance.</li><li>Define test statistic. This refers to a formula which captures the essence of what we want to measure. In this case, difference in means stands a reasonable choice.</li><li>Calculate the said statistic.</li><li>Compare the value above to a “lookup” table based on ‘sampling distribution’ and make the decision to answer the question.</li></ol><p>Let’s break it down — Traditionally one needs to <strong><em>remember</em></strong><em> what</em> kind of test to use. This time it happens to be the popular t-test for assessing whether difference in means of two samples is statistically significant. The test statistic is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*uWqYCaIkBI5erxUTMX20Jg.png" /></figure><p>where terms in numerator are means of respective samples and in denominators are standard deviations.</p><p><strong>Strike 1</strong>: One is hardly expected to remember this or similar formulae, let alone a plethora of these. Wikipedia lists close to 100 of these (<a href="https://en.wikipedia.org/wiki/Category:Statistical_tests">https://en.wikipedia.org/wiki/Category:Statistical_tests</a>).</p><p>Once the above is computed, it needs to be compared against a benchmark to decide whether the calculated value exceeds it. In this case, the benchmark depends upon <em>sampling</em> distribution i.e. how the test statistic is distributed. Following is the sampling distribution of t-statistic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*_A_wHyDSHZgChqG2q6QZBw.png" /><figcaption>where 𝜈 is degrees of freedom.</figcaption></figure><p>Where degrees of freedom in turn can be estimated by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*lXmWkJrZvmz6J7QiJn-_-Q.png" /></figure><p><strong>Strike 2</strong>: The nightmare continues because so far we have been following a recipe without having much of an idea about what the above formulae stands for and what on earth they have to do to deal with finding the effect of intervention on students’ performance.</p><p>Brave souls however continue their quest and manage to locate the benchmark in a table based on the sampling distribution</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*uYE4d2Y6cIgOw_5k6ONLnQ.png" /><figcaption><a href="https://faculty.washington.edu/heagerty/Books/Biostatistics/TABLES/t-Tables/">https://faculty.washington.edu/heagerty/Books/Biostatistics/TABLES/t-Tables/</a></figcaption></figure><p>Finally, we have managed to compare the calculated value of t-statistic with one located w.r.t degree of freedom (<em>df</em>) and proclaim the intervention works (or not). All of the above, only if the assumption about data holds true e.g. homogeneity of variance and normality.</p><p><strong>Strike 3</strong>: How do one test those assumptions? Will that involve another round of tests like Kolmogorov-Smirnov for testing normality of F-test. When do one start questioning the rationale whether all the above is both necessary and intuitive.</p><p><strong>Simulation to the Rescue: Computational Method</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZmNOG2krcjUl5-7Ww-i8g.png" /></figure><p>The alternative promises a first principle approach to answering the above question which obviates the need to memorize these formulae and is more suited to a procedural way of thinking. The recipe being: we have a fundamental idea about what a null hypothesis or skeptic’s view means — i.e. no difference in mean performance — followed by simulating the matter at hand i.e. difference of means in this case. Finally plotting simulated distribution together with the observed effect — the original difference.</p><p>From the data we know:</p><p>mean (Group 1): 70.9. mean (Group 2): 77.9. Observed difference = 7 marks.</p><p>A skeptic’s view is that this difference is by chance, i.e. tags Group 1 and Group 2 are meaningless and the data may as well come from any of them. So the key idea being — to simulate the distribution of two groups by shuffling the labels multiple times and compute the desired statistic. Following representation lays out the mechanics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*LFswlV-qyLmcl9OQ6A8yXA.png" /><figcaption>Original Samples</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*VfszbJXQWArG1jzFn9JffA.png" /><figcaption>Shuffling Labels</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*b9BHYgRNSrEQxoWvMhXUVg.png" /><figcaption>Rearrange</figcaption></figure><p>The difference in means now stands at 6.5.</p><p>Repeating the above 10,000 times and overlaying the observed effect (orange vertical line)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zkAwtKiWTVAloTovJWGo0w.png" /></figure><p>The orange line denotes that the actual difference lies at the far end of the expected spectrum. This occurs only 0.79% of all repeats. This proportion is popularly known as the p-value (The probability of obtaining the observed values assuming the skeptic’s argument is correct). Due to this being so low, it stands to reason that the introduction of SME has a positive effect on performance of Group 2 students.</p><p>Caveats: One requirement for this method to give reliable results is that the original samples need to be representative. Data collection error will be replicated during permutations hence no antidote for an ill designed experiment. Furthermore, in case of non-independent observations, we need to take extra care while shuffling.</p><p><strong>Conclusion</strong></p><p>We could have concluded the same via the analytical method. However the simulation approach forces us to think about the right question and at the same time lessens the burden of worrying about the myriad assumptions (which often are not true) and the need to remember formulae for complex sampling distributions. It could be argued the original methods were and still are important, but with the increased computational power, simulations like these are cheap and provide a clear understanding of how a phenomenon is modeled.</p><p>The above methodology of permutation resampling can also be extended to categorical data e.g. to test whether two discrete sets are part of the same distribution. Measures like TVD (Total Variation Distance) can be used as a test statistic.</p><p>The field of resampling statistics is exciting with more techniques beyond permutation like bootstrap are applicable to hypothesis testing. They have been well studied in statistical literature and have sound theoretical reasoning as to why they work.</p><pre>group1 &lt;- c(<br>  78L, 75L, 64L, 69L, 80L, 72L, 55L, 52L, 49L, 69L, <br>  71L, 78L, 90L, 84L, 81L, 71L, 64L, 69L, 77L, 70L<br>)<br>group2 &lt;- c(<br>  80L, 83L, 72L, 74L, 85L, 74L, 69L, 69L, 79L, 81L, <br>  95L, 92L, 82L, 77L, 71L, 60L, 78L, 83L, 74L, 80L<br>)<br><br>diff_mean &lt;- rep(0, 10000L) # simulating 10,000 times<br><br>for(i in seq_along(diff_mean)) {<br>  # pick 10 from group 1<br>  selected_g1 &lt;- sample(x = seq_along(group1), size = 10, replace = F)<br>  # pick 10 from group 2<br>  selected_g2 &lt;- sample(x = seq_along(group2), size = 10, replace = F)<br>  <br>  # shuffle labels and rearrange<br>  new_group1 &lt;- c(<br>    group1[setdiff(seq_along(group1), selected_g1)],group2[selected_g2]<br>  )<br>  <br>  new_group2 &lt;- c(<br>    group2[setdiff(seq_along(group2), selected_g2)],group1[selected_g1]<br>  )<br>  <br>  diff_mean[i] &lt;- mean(new_group2) - mean(new_group1)<br>}<br><br>hist(diff_mean, freq = FALSE, col = &quot;lightblue&quot;)<br>abline(v = mean(group2) - mean(group1), col = &quot;orange&quot;, lwd = &quot;3&quot;)<br><br>p_value &lt;- sum( diff_mean &gt; (mean(group2) - mean(group1)))*100/10000<br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45ba651627ff" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/one-test-to-rule-them-all-hypothesis-testing-simplified-45ba651627ff">One Test to Rule them All — Hypothesis Testing Simplified</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Mask on Truth: A Deep Dive into the Threat of Deepfakes]]></title>
            <link>https://medium.com/perfiostechblog/the-mask-on-truth-a-deep-dive-into-the-threat-of-deepfakes-1475a858ee43?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/1475a858ee43</guid>
            <category><![CDATA[financial-fraud]]></category>
            <category><![CDATA[deepfake-detection]]></category>
            <category><![CDATA[identity-theft-prevention]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[deepfakes]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Wed, 26 Mar 2025 05:57:01 GMT</pubDate>
            <atom:updated>2025-03-26T05:59:00.509Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQaSiqhojOolJp78GKtzRA.png" /></figure><p>Author: Manav Kaul</p><p>Seeing is believing. For ages, this proverb has stood the test of time. Our understanding of reality often relies on our perception — we see, we hear, and therefore we believe. But what if all of this were to change in a single day? Imagine a world where everything you see, hear and trust is a lie.</p><p>Unfortunately, that world may not be a distant dystopia but a near reality. Welcome to the age of deepfakes, where artificial intelligence has made it possible to create fake videos, audio recordings and images that are nearly indistinguishable from reality.</p><p>This ability to reshape the world through imagination and technology has the potential to revolutionize art and even society from entertainment and education to activism and advocacy. But at the same time it opens the gates for the dissemination of misinformation, the erosion of trust in institutions and the exploitation of individuals.</p><p>The stakes are higher than ever. With <a href="https://www.linkedin.com/posts/perfios_whats-different-about-our-deepfake-detection-activity-7295048448532262912-6e8u">deepfakes</a>, the very fabric of our reality is under attack. The consequences of losing trust in what we see and hear digitally are catastrophic. It’s no longer just about weighing the benefits of innovation against the risks of misuse — it’s about the survival of our shared reality.</p><p>As we delve into the dark side of deepfakes, we must confront the unprecedented challenges they pose to our society. The future of truth itself hangs in the balance. Will we be able to adapt to this new reality, or will we succumb to the chaos of a world where nothing is as it seems?</p><h3>The Dark Side of Deepfakes</h3><p>The advent of deepfakes reminds me of Plato’s Allegory of the Cave which warns of a world where people mistake shadows for truth. In the digital age, deepfakes serve as those shadows, they spoof reality so convincingly that even the wise amongst us may get fooled. As deepfakes evolve, they threaten to trap humanity in a “digital cave,” where discerning truth from falsehood becomes an almost insurmountable challenge.</p><p>The moral implications of this technology are equally alarming, like Kant argued moral actions must respect the inherent dignity of individuals and should be universally applicable. But deepfakes fundamentally thrive on deception. Consider the famous case where an employee was tricked into siphoning off $35 million to a fake supplier by a group of fraudsters using deepfake to impersonate the company’s CEO. The incident perfectly illustrates its potential to manipulate trust, violate autonomy and inflict significant harm on individuals and organizations.</p><p>A society overrun with deepfakes risks undermining the foundational elements of integrity and meaningful relationships. For instance, non-consensual deepfake pornography has caused irreparable harm to women. Victims of these malicious creations suffer emotional distress, reputational damage and a profound sense of violation</p><p>Beyond individual harm, deepfakes jeopardize the collective trust that underpins institutions. Imagine courtrooms, journalism or even family conversations where evidence can no longer be trusted because reality itself is suspect.</p><p>Is it all bad then? If yes, why not strike it down?</p><p>At its core, this is just a tool to anonymizing or impersonating oneself.</p><p>Which brings us to the important question-</p><h3>Is the desire for anonymisation and impersonation inherently immoral?</h3><p>It’s essential to examine the underlying motivations and morality of desiring anonymity or assuming someone else’s identity, before writing off Deepfakes as completely immoral</p><p>This desire is not new, however the underlying motivations have varied widely throughout history and have also inspired leaders and literature globally.</p><p>Three fundamental motivations underlie the desire for anonymity and impersonation:</p><ol><li>The need for protection and survival</li><li>The pursuit of power and control</li><li>The quest for pushing limits of art</li></ol><p>Disguises and anonymity were means of protection of individuals against persecution, violence, and tyranny, allowing people to cope with anarchic conditions and oppressive rule in ancient societies and literature globally. Take the famous example of Robin Hood and his Merry Men who lived in hiding and used the anonymity of Sherwood Forest to protect themselves from the tyranny of Prince John and the Sheriff of Nottingham. Stories like these show how anonymity enabled people from oppressed classes to bypass rigid hierarchies temporarily</p><p>While anonymity has historically served as a shield for the oppressed, it has also been wielded as a sword by oppressors, who have exploited its power to manipulate, deceive and maintain control. The ability to impersonate allowed ill intended individuals to control narratives and manipulate others.</p><p>Anonymity has challenged perceptions of originality and the value of art and encouraged viewers to engage with the work based on its artistic merits rather than its creator’s fame the way Leonardo often used to leave his works unsigned or partially anonymous, allowing the art to speak for itself rather than being tied to his persona</p><p>In the end, the morality of anonymity and impersonation is a complex question which depends on the intentions of the disguiser. Philosophically as Nietzsche would have pointed out your truth is just a construct shaped by interpretations rather than objective reality. Deepfakes could be seen as the ultimate manifestation of this idea: they blur the line between what is real and what is a creation, reflecting how “truths” are shaped and reshaped and in the hands of ill intended individuals it can cause a lot of chaos and damage to the society.</p><p>As we navigate the blurred lines between truth and fabrication, it becomes important to address how society is responding to this issue. While the technology itself is neither inherently good nor evil, its applications shape the moral and practical implications. The question now shifts from “what is possible” to “how do we manage the possible?” In this light, examining the practical measures being taken by institutions, governments and technology companies provides a clearer picture of how we can safeguard trust and reality in this evolving landscape.</p><p>And more importantly, we have been in the age of accelerated technological advancement, have we never encountered anything like deepfake before</p><h3>Did deepfake open Pandora’s box in the age of surveillance?</h3><p>While technology has made it exceedingly easy for applications to track, identify, and fingerprint individuals, their preferences, and movements, paradoxically, technology also offers solutions for anonymizing oneself and evading such surveillance.</p><p>Technology allows applications to track IP Address, hence people for years have been using VPN and proxy connections.</p><p>Technology allows applications to track location, hence people have been using GPS Spoofing/ mock location settings and software.</p><p>Technology allowed applications to identify devices, hence people have been using emulators or rooting their devices.</p><p>Even with faces, people have been using photoshop and face swap technology for years to spoof or alter their faces. The only problem was these solutions to alter the face either would not work in real time video streams or would perform very poorly. This is where deepfake became a very disruptive technology where you could create or swap, highly realistically faces in real time. While it did not open any Pandora’s box in helping individuals anonymise or impersonate others but it has made it far more easier and accessible than it ever was before.</p><h3>Is the deepfake threat real?</h3><p>The deepfake threat is very real and very concerning. Deepfake related identity attacks have increased by <a href="https://www.biometricupdate.com/202311/deepfakes-ato-now-entrenched-as-top-id-fraud-trends">a whopping 1530%</a> in the APAC region in 2023.</p><p>As time passes, we can expect to see an increase in the number of players offering deepfake creation services that are faster, cheaper and more accessible. This is due to the competition in the startup ecosystem to build Deepfake creation solutions. As a result, there will be a massive spike in scams and frauds that happen through deepfakes than what we see even today and beyond what many of us can fathom.</p><p>Imagine getting a call from your colleague in distress asking you for 40000 rupees, to learn that the person never called you. It was a fraudster who used GenerativeAI to clone the audio of the colleague and called you. This is what happened in<a href="https://www.ndtv.com/india-news/kerala-man-loses-rs-40-000-to-ai-based-deepfake-scam-heres-what-it-is-4217841"> Kerala back in July 2023</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQKwWSBihINJyaXZF3XwJw.png" /></figure><h3>How does Deepfake work?</h3><p>Deepfakes are built through a ML model known as Generative Adversarial Networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Dk0JYdG69AZQmH0fD_ctRg.png" /></figure><p>What is this GAN and how deepfakes are able to generate new faces and voices? Furthermore how is this so much superior than its widely used predecessor? I will go further and ask how is their performance so superior compared to classic face swap solutions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wbb4Ju_5_O2DENpNaD0Qfg.png" /></figure><h3>Impact of Deepfakes on Financial Institutions</h3><p>The financial sector relies heavily on identity to operate. This is because where money is involved, it is crucial to know who is transferring money, who is holding it, who is taking out loans, and who is receiving funds for the better security of everyone as it helps prevent financial scams, money laundering, terrorist funding and other illegal activities that exploit the financial system.</p><p>This means that wider adoption and improved quality of deepfakes has huge implications for the financial sector. Imagine a fraudster doing Video KYC using your Aadhaar details and during the onboarding process he looks, talks exactly like you. His face matches with the one pulled from eKYC and the individual is issued a personal loan but as per the bank, the income tax department and RBI, the money has been given to you when you neither received it nor needed it but now they expect you to clear the loans taken in your name.</p><p>Deepfake attacks can take different forms-</p><ol><li>Identity Theft- The above mentioned scenario is of identity theft, Deepfake can be used to impersonate individuals in your onboarding solutions. In fact there were <a href="https://www.statista.com/chart/31901/countries-per-region-with-biggest-increases-in-deepfake-specific-fraud-cases/">65000 identity theft attempts</a> in India involved the use of deepfakes.</li><li>Social Engineering Attacks- Deepfake can enable social engineering attacks on FIs, one of the popular example for same was from Hong Kong where a firm got defrauded 200 Crores rupees because of deepfake imposter acting as CFO scammed an employee to siphon off that amount</li><li>Account Takeovers- Deepfakes can enable attackers to authorize fraudulent transactions or take over financial accounts.</li><li>Synthetic Identity — As you can create hyper realistic yet non existent faces and voices it can be used with forged documents to create synthetic identities and open accounts with fraudulent intent</li><li>Faking Existence of the dead — There are various usecases where financial institutions rely on taking selfies and detecting liveliness to ensure customers are alive and issue annual Digital certificates of liveliness. In cases of advanced deepfakes, individuals will be able to create deepfake of dead account holders and defraud the financial institution</li><li>Money Laundering — By opening bank accounts impersonating others or using synthetic identity. Deepfake enables criminals an opportunity to distribute their money in multiple accounts and launder the amount</li></ol><h3>How can Financial Institutions protect themselves?</h3><p>A multifaceted approach combining cutting edge technology and behavioural science is needed to combat deepfakes.</p><p>Financial institutions must use cutting edge solutions created to directly address deepfake dangers since they cannot afford to rely only on traditional approaches</p><p>Perfios is leading in this space by its revolutionary solution which can help FI determine if the person they see is real or deepfake</p><p>Below are several key countermeasures:</p><ol><li>Camera Injection Detection -</li></ol><p>● Incase the video or image that is being processed is taken in real time or streamed then we can detect any sudden injections of images into the stream that do not originate from the camera itself</p><p>● Metadata associated with the camera stream such as timestamps, geolocation and device information can provide valuable insights into the authenticity of the captured content. These signals can be further scrutinized and triangulated to understand inconsistencies or discrepancies that might suggest tampering or manipulation</p><ol><li>Digital Forensic -</li></ol><p>Incase the content is video or image we can do the following</p><p>● <strong>Face Artifacts Analysis</strong>:</p><p>○ A very strong Pixel-Level Inconsistencies detection model is trained by Perfios to identify irregularities at the pixel level, including mismatched lighting, artifacts from compression, and unnatural textures.</p><p>○ The model splits images into small patches for localized analysis, looking for inconsistencies in texture and lighting.</p><p>● <strong>Frequency Domain Analysis</strong>:</p><p>○ During our RnD, we learnt that deepfakes often leaves detectable traces in the frequency domain</p><p>○ We analyze the Fourier Transform of the image to spot unnatural frequency patterns</p><p>○ You can more details on this approach in this <a href="http://arxiv.org/pdf/2003.08685">research paper</a></p><p>● <strong>Illumination and Shadow Analysis:</strong></p><p>○ We compare the directionality and intensity of lighting in the face region versus the background, the mismatches indicate attempts of tampering typically done by AI generated image or deepfake</p><p>○ You can analyze shadows, highlights and reflectivity properties using Lambertian surface assumptions.</p><p>Incase the content is audio we can do the following</p><p>● <strong>Lip-Sync Consistency Analysis</strong></p><p>○ Models can extract lip landmarks from video frames using models like MediaPipe or Dlib.</p><p>○ Align phonemes from the audio signal with lip movements using forced alignment tools like Gentle or Kaldi.</p><p>○ Use Dynamic Time Warping to measure alignment errors between phoneme timing and lip movements</p><ol><li>Behavioral Biometrics checks</li></ol><p>● A key factor, especially during onboarding is that the fraudulent individual will use deepfake in order to mask their real identity, so they will use made up names, made up details or stolen information which they would probably do not recall themselves</p><p>● While deepfakes enable individuals to assume multiple identities one reality of life these fraudsters have to continue to live with is that although they can generate numerous faces using deepfake technology it is almost impossible for them to operate multiple smartphones simultaneously at scale</p><p>● This means they are forced to either</p><p>○ Use a virtual device or tamper with existing device or</p><p>○ Risk reusing same device across all these synthetically created identities</p><p>● Here at Perfios we have built <a href="https://perfios.ai/in/products/trustarmour/">TrustArmour</a> which is designed to help FIs in solving for precisely the same-</p><p>○ It looks at at the level of familiarity exhibited by how user behaves with onboarding form, we can assess risk of someone hiding identity</p><p>○ It assesses how many different faces have tried to open account on the same device, from the same location, network to detect fraud rings using very advanced deepfake and opening multiple accounts</p><ol><li>Liveliness Check</li></ol><p>● Active Liveness — It is a method that requires the customer to record a brief video clip while simultaneously reading out a OTP</p><p>○ Face Artifact analysis of Digital forensics can be used here</p><p>○ Users are required to read out a randomly generated OTP as part of the active liveness verification process</p><p>● Gesture Liveness — It is a method of verifying the authenticity of a user’s identity by requiring them to perform specific physical gestures during the verification process. There are several types of gestures covered in our solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*bXbN2kc0J9ZOC8qa6r9hTQ.png" /></figure><p>● The likelihood of a fraudster’s deepfake video correctly mimicking three randomly selected gestures from a set of say 12 is only 0.075%.</p><h3>Conclusion</h3><p>The labyrinth of human progress often has technology walking that tightrope of liberation and exploitation. Deepfakes represent both the potential for a new form of creative expression and the risk to our notion of trust and authenticity. It challenges us on some very basic questions about identity, reality, and the very nature of truth.</p><p>While the moral questions surrounding deepfakes are significant, they demand practical and immediate solutions in areas where exploitation poses critical threats. Perfios is at the forefront of this fight, offering cutting-edge technologies that detect and mitigate deepfake threats effectively. As we confront the challenges posed by deepfakes, let us transform this existential crisis into an opportunity for ethical growth and innovation. Join Perfios in leading this transformation — partner with us to create a safer and more secure future. Together, we can ensure technology serves humanity, amplifying our values and protecting what matters most.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1475a858ee43" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/the-mask-on-truth-a-deep-dive-into-the-threat-of-deepfakes-1475a858ee43">The Mask on Truth: A Deep Dive into the Threat of Deepfakes</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embracing Reactive Programming: Optimizing Cloud, Database, and Web Operations]]></title>
            <link>https://medium.com/perfiostechblog/embracing-reactive-programming-optimizing-cloud-database-and-web-operations-36e16913ded9?source=rss----5cadffea05ca---4</link>
            <guid isPermaLink="false">https://medium.com/p/36e16913ded9</guid>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[web-operations]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Perfios Technology Blogs]]></dc:creator>
            <pubDate>Wed, 19 Mar 2025 06:40:34 GMT</pubDate>
            <atom:updated>2025-03-19T06:40:34.732Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iXuYR9waouLBYAmkqFZyuA.png" /></figure><p><strong>Author: Aravind Suresh</strong></p><p>In the modern Java ecosystem, asynchronous processing is becoming crucial for achieving high performance and scalability.</p><p>Developers often choose between traditional and reactive approaches, especially in large-scale systems. Here, we explore how reactive programming optimizes database interactions, minimizes latency, and maximizes resource utilization, enhancing application responsiveness and throughput through non-blocking I/O and reactive streams.</p><p>We will see use cases of AWS S3 With Reactive Support, Reactive Database interactions using ReactiveMongoTemplate, and network calls using the Spring WebClient, comparing their performance to the traditional counterparts, namely AWS S3, MongoTemplate, and RestTemplate for network calls.</p><p>We’ll deep-dive into the technical aspects of these implementations, non-blocking, event-driven architectures, how they’re leveraged in a few Perfios products at scale, and how they enhance scalability and performance in these applications.</p><p>We will gain insights into building highly responsive and resilient systems for today’s data-intensive environments.</p><h3>What is the need for Reactive Programming?</h3><p>In modern applications, multiple asynchronous events, such as network requests, database operations, etc., must be handled. These operations may take time, and we don’t want to block the program’s execution while waiting for them.</p><p>You send a request to an external system. You wait for the response but don’t want to halt everything else in the system.</p><p>In traditional imperative programming, you’d typically block and wait for each task to finish, which could be more efficient when handling multiple tasks simultaneously and serving many requests.</p><p>Reactive programming solves this by allowing non-blocking execution and handling multiple tasks concurrently without waiting for each to finish.</p><p>When we explored Reactive Programming, JDK 21, which introduced the concept of Virtual Threads, was not released. As a result, we decided to use JDK 17 with Reactive Programming for our exploration.</p><p>Let’s start with a few prerequisites before delving deeper!</p><p><strong>What is Context Switching, and why is it Expensive?</strong></p><p>Imagine you’re working on a complex project and need to use multiple IDEs. First, you’re coding in Cursor (It’s the new popular IDE in town). Then, halfway through writing a function, you’re told to stop and switch to IntelliJ IDEA. After you’ve set that up and started getting into the flow, someone says, now jump to PyCharm for some Python debugging. And right as you open the debugger, they shout back to the Cursor IDE for more code generation.</p><p>Every time you switch IDEs, you must adjust your mindset to the specific IDE tooling. That mental shift alone is draining.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*xiS8OrDvZzN8Xx6wYbKIaA.jpeg" /></figure><p>Q: What is the primary IDE you use for your daily work?</p><p>A thread is the fundamental unit that the CPU uses for execution. It consists of a Thread ID, an execution context like a stack, a set of registers, and a program counter.</p><p>Concurrency is inherently limited by the number of cores available on the host machine. Scaling beyond this is constrained by factors like the fact that Java and other popular runtimes like Python create threads mapped to operating system threads, which imposes overhead and limits the effective use of additional threads.</p><p>By default, each thread has 512 KB/1MB of stack space, depending on the JVM runtime whether it is active or idle. Even if this configuration can be fine-tuned, we still face limits on the number of threads we can create, primarily due to Memory constraints.</p><p>Even if memory weren’t a limiting factor, we would still be limited by how quickly the JVM instructs the Operating System to switch between threads and bound by this constraint.</p><h3>Presenting the Cornerstone of Reactive Programming, the Event Loop</h3><p>Imagine you’re WFH and decide to order food from a food ordering service. These are the steps involved:</p><p>1. Choose a restaurant and place your order</p><p>2. Track the status of your food</p><p>3. Place a second order with Swiggy</p><p>4. Rate the meal afterward</p><p><strong>Task 1: </strong>You browse the app, select a restaurant and choice of food, and place your order. Once the order is confirmed, this task is marked as completed.</p><p><strong>Task 2: </strong>You wait for the restaurant to prepare the order and mark this task as pending.</p><p><strong>Task 3: </strong>You place a separate food order through the app and mark it as pending.</p><p>While the orders are getting ready, you carry on with your work.</p><p>You receive a notification that your first order is ready. You mark Task 2 as completed and get ready for the delivery. Shortly after, the second food order arrives. You receive it and mark Task 3 as completed.</p><p>Once your food arrives, you have your meal and rate your experience in the app. Task 4 is now complete.</p><p>Now that the above example is clear, it highlights a key limitation of the existing Thread per Request model. Let’s explore this further and see how Reactor Netty and the concept of Event Loops address this issue.</p><p><strong>Thread Per Request Model:</strong></p><p>In the Servlet world, incoming requests are packaged and placed into a holding pattern, awaiting their turn to be picked up and processed by available worker threads.</p><p>This means that you keep tracking your food order until it arrives.</p><p>This introduces inefficiencies and limitations regarding scalability and resource utilization.</p><p><strong>What is Netty?</strong></p><p>Reactor Netty embraces an event-driven architecture centered on EventLoops to handle incoming requests.</p><p>This fundamental architectural difference enables Netty to achieve impressive performance in scenarios involving high concurrency or long-lived connections.</p><p><strong>EventLoop:</strong></p><p>Just as Swiggy handles multiple requests (receiving orders from customers, placing orders with the restaurant, sending notifications to customers, and coordinating with the delivery partners), Netty’s Event Loop is essentially a non-blocking I/O thread, similar to what the Java NIO provides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2rrskGOSmtZ-PqMhdPhhZw.png" /></figure><p>A channel is a nexus to a network socket or component capable of I/O operations such as read, write, connect, and bind.</p><p>These channels handle incoming requests on the server side and send outgoing requests from the client.</p><p>Once registered, an EventLoop will handle all the I/O operations for a Channel. Typically, several EventLoops run continuously and are managed by an EventLoopGroup. Each EventLoop manages multiple Channels.</p><p>EventLoopGroup allows for the registration of channels that get processed for later selection during the event loop.</p><p>Before getting started on how some technical challenges faced at Perfios were solved using Reactive Programming, let’s examine Mono and Flux.</p><p><strong>Mono and Flux 101</strong></p><p>A Mono is a Publisher that represents a single or empty value. A Flux is a Publisher that emits 0 to many values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_EkGM0U9s_5azuOYhRhCQ.gif" /><figcaption><strong>Mono and Flux 101</strong></figcaption></figure><h3>Report Generation using a blocking approach:</h3><p>One of the solutions developed in Perfios focuses on enquiring about the customer’s current balance, leveraging the India Stack’s Account aggregator framework to check if the borrower can meet the obligation. This report is generated in a CSV format containing a few lakh daily transactions (~6–7 lakhs).</p><p>We noticed a significant spike in CPU and memory usage during the generation of this report. Analyzing the thread dumps, we felt the issue could be with the CSV library being used. We tried changing this to an alternative to see if this solved the problem, but this was not the case.</p><p>Upon further investigation, we isolated the issue to the database query used by MongoTemplate. The library usage led to higher memory and CPU utilization and OutOfMemory errors during the load tests.</p><p>The synchronous behavior of MongoTemplate caused thread blocking during the execution of database queries, which resulted in delays when fetching data. This led to slower report generation times and strained system performance, leading to out-of-memory exceptions.</p><p>Upon further investigation, it was found that Java Streams are not supported on the MongoTemplate level since Spring Data MongoDB is still compatible with Java 6. Streams were introduced as part of Java8.</p><p>One way to solve this is by using Spring Data’s Specific support for streams. Regular MongoTemplate performs blocking I/O operations, which can lead to thread exhaustion and higher latency under heavy load.</p><p>This can impact the application’s responsiveness and scalability and tie up threads, especially when multiple database operations are executed in sequence. Scaling applications that rely on this approach can become challenging.</p><p>Let’s see how this problem is solved:</p><h3>The case for report Generation using the Reactive MongoTemplate:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*RGmP4o5myMjMGY4U9rU9Ow.png" /></figure><p>When the <strong>flatMap</strong> operator is invoked, it transforms or switches to another stream immediately and asynchronously.</p><p>The <strong>publishOn </strong>operator offloads document processing to a bounded elastic thread pool. This pool is suitable for I/O-bound tasks and can handle many concurrent tasks without blocking the main thread.</p><p>Once the stream is subscribed, the reactive pipeline is started.</p><p>On comparison between the two, the memory consumption during report generation reduced by ~85% (from 4 GB of heap space to around 200 MB after the optimization), and considerable CPU utilization reduction of around 40%.</p><p><strong>Performance improvements and differences Summary:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*EdTjdKqHeANFhgJZozxO1w.png" /></figure><p>Q: Have you ever encountered performance bottlenecks in your applications? How did you address them?</p><h3>Before going to our subsequent use case of Reactive Programming, here’s a brief introduction to Asynchronous IO</h3><p>With a traditional, synchronous approach, you might constantly check the stock price yourself on a Stockbroker app, refreshing the screen repeatedly to see if there’s any change.</p><p>With asynchronous IO, you create a simple alert in Kite. You enter the target price (&lt;= 750 Rs) for the particular stock and then work on other tasks. When the stock price hits the target, the stockbroker notifies you, and you can act accordingly.</p><p>This way, you’re not spending time continuously checking, only getting notified when the criteria are met.</p><h3>The need for Reactive S3:</h3><p>The limitation in the AWS SDK for Java 1.11.x version is that although it offers asynchronous variants of service clients, these clients still rely on a managed thread pool on top of synchronous clients. This means each request requires its dedicated thread from the pool, resulting in higher thread consumption and potentially limiting the application’s concurrency, especially when handling a large number of requests.</p><p>In contrast, the AWS SDK for Java 2.x version addresses this limitation by adopting a nonblocking SDK architecture built on <strong>Netty </strong>to support true nonblocking I/O that implements high concurrency across a few threads.</p><h3>Traditional S3 Vs Reactive S3:</h3><p>Here’s a traditional or synchronous way of uploading files to the S3 bucket using the Amazon S3 Client:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DoRrpjqNq_l8LJxS7d4LJA.gif" /><figcaption><strong>Blocking S3 Client</strong></figcaption></figure><p>The thread on which the above code is executed remains idle while waiting for network I/O, which is an inefficient use of system resources.</p><p>As shown below, the calling thread isn’t blocked, and we are waiting for the file upload to be complete. This means that the application can handle more concurrent uploads with fewer resources.</p><p>The Amazon S3 PutObject asynchronous operation uses AsyncRequestBody, an adaptation of the reactive stream interfaces. This ensures that even streaming data to AWS is a nonblocking operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*TAp5aV_ZarrmLHAJ4XEBew.png" /></figure><p>We’ve shared a performance metrics comparison highlighting the benefits after transitioning to Reactive S3 with non-blocking I/O.</p><h3>Comparison of Performance Metrics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*b8oaMwnzLGy2-EBeH6juYQ.png" /></figure><p>We’ll conclude this section by discussing epoll and its importance in the context of Reactive Programming.</p><p>When you open a file on your computer, the operating system creates a special record for it, keeping track of important information about it.</p><p>If you have 100 files open, the OS will create 100 records, which are stored in a part of the system called the kernel.</p><p>A unique number identifies each record. This number is known as a file descriptor.</p><p><strong>epoll</strong> (event poll) is a Linux-specific system call that efficiently manages multiple file descriptors. It’s an optimized version of the traditional poll system call designed to scale to a large number of concurrent connections.</p><p>Instead of frequently checking whether file descriptors are ready for I/O, it allows a process to monitor all of them at once. When one or more file descriptors are ready for I/O, it sends a notification, allowing the process to handle the event without frequent polling.</p><p>The <strong>reactor-http-epoll</strong> threads are responsible for processing I/O events for multiple channels in a non-blocking manner.</p><p>Q: Before reading this blog, how familiar were you with reactive programming?</p><h3>Limitations of RestTemplate:</h3><p>Blocking operations require the calling thread to wait until the operation is completed. RestTemplate, which is part of the Spring Framework, has this limitation, as shown in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EHrCa6TX6TK_7VTykv8iFA.gif" /><figcaption><strong>Limitations of Rest Template</strong></figcaption></figure><p>As of Spring Framework 5, RestTemplate has been deprecated, and the WebClient is recommended as its alternative. RestTemplate limits systems that require high-throughput, low-latency capabilities.</p><p>Let us see how its counterpart, the Spring WebClient, addresses this limitation.</p><h3>Spring WebFlux and Spring WebClient:</h3><p>Spring WebFlux is a reactive programming framework in the Spring ecosystem designed for building non-blocking, asynchronous web applications. It was released in the Spring Framework 5.0 version.</p><p>The WebClient is a reactive, non-blocking HTTP client that is part of the Spring WebFlux module, which supports reactive programming in Spring.</p><p>WebClient uses Spring’s EventLoops to execute logic and is configured to share EventLoop resources with the server by default. Thus, incoming and outgoing requests are handled by the same EventLoopGroup.</p><p>One of the workflows developed in Perfios involves orchestrating a few internal Perfios services and generating a report through the Perfios Bank Statement Analyzer. This report is then downloaded and shared with the clients to support their specific use cases.</p><p>We decided to refactor this workflow and migrate it from RestTemplate to WebClient. The workflow is responsible for the following:</p><p>● An external client system initiates the request, triggering a transaction that generates a report tailored to the user’s use case.</p><p>● The WebFlux Inbound Adapter (WF) is the entry point for handling incoming HTTP requests. It is part of a reactive framework (such as Spring WebFlux) that allows for non-blocking and asynchronous communication.</p><p>● The Webflux inbound adapter is built on top of Spring WebFlux. It does not block the thread when a request is received.</p><p>● Instead, it wraps the incoming request in a Mono or Flux and transforms it into a message that can be processed asynchronously in the downstream pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYQWNlTkdIxryuW0Cb4ldA.gif" /></figure><p><strong>Report Generation Workflow with WebClient</strong></p><p>● The Report Download Service invokes the external client system to generate the report. Once the report is received, the service triggers the File Upload Client to upload the report to S3. Finally, the service notifies the external client system that the report is ready.</p><p>● The Report Download Reactive Client makes the network call to an internal Perfios service responsible for generating the report database or API. The reactive client ensures that the call is asynchronous and non-blocking.</p><p>● The File Upload Reactive Client (S3) is responsible for uploading the downloaded report file to a cloud storage service. This, too, works asynchronously, ensuring that file upload requests do not block the main processing flow.</p><p>● The Report Download Service notifies the Client system that the report is ready for Download.</p><h3>Performance Results from Load Testing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cAy-bhSx7LYGGL6ONu3IbQ.png" /></figure><p>● Upon comparing the two approaches, we observed a significant reduction in memory consumption after the rewrite using the Reactive pipeline while maintaining the transactions per second (TPS).</p><p>● As a result, we were able to reduce our cloud server costs.</p><p>● As seen above, the endpoint maintains its performance. It has minimal latency even at ~28K transactions per minute, showcasing its capacity to handle concurrent requests with minimal resource usage and reduced blocking.</p><p><strong>Comparison of Performance Metrics</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*pwNhPoKWTTBQ5gYkfqa9EQ.png" /></figure><p><strong>Conclusion</strong></p><p>The use cases for reactive programming addressed specific limitations and bottlenecks in the current system, such as handling unexpected spikes in memory, reducing high memory and CPU footprint, and mitigating the impact on cloud server costs and vertical scaling of servers.</p><p>After thoroughly assessing the available alternatives, we finalized exploring and adopting its reactive variants. After extensive functional and load testing, we concluded that this solved our problems in the existing Perfios production system.</p><p>We developed a plan to deploy these systems to the Perfios production environment, where they have performed as expected since their rollout.</p><p>In conclusion, transitioning from traditional blocking I/O to non-blocking, event-driven architectures helped us evolve in our ability to build highly responsive, resilient, and scalable systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36e16913ded9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/perfiostechblog/embracing-reactive-programming-optimizing-cloud-database-and-web-operations-36e16913ded9">Embracing Reactive Programming: Optimizing Cloud, Database, and Web Operations</a> was originally published in <a href="https://medium.com/perfiostechblog">Perfiostechblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>