Refnd: Preventing Data Leakage in Relational Datasets

Learn how Refnd uses HNSW graphs to create realistic data splits, preventing over-optimistic ML evaluations. Open-source Python package.

viernes, 24 de julio de 2026 • 3 min read • Q2BSTUDIO Team

Nuevo enfoque para splits en machine learning sin fuga de información

In the world of machine learning applied to biochemical data, one of the most underestimated problems is information leakage due to the relational structure of datasets. When training models with data that share ancestors, modifications, or similar properties, traditional splits (random, temporal, or scaffold-based) fail to properly isolate relationships, inflating performance metrics and creating false expectations. This phenomenon, known as relational data leakage, is especially critical in areas such as drug discovery, antimicrobial peptide prediction, or protein design. The scientific community has sought more robust splitting methods, but until now they lacked a solid theoretical foundation and scaled at best quadratically.

This is where Refnd comes in, a new splitting algorithm that leverages a proximity graph built in loglinear time using the Hierarchical Navigable Small World (HNSW) structure. Refnd is based on the concept of the Relational Generative Process (RGP), a mathematical formalization that explains why relational structure arises in biochemical datasets. Instead of assuming independence between samples, RGP models how entities relate through transformations, mutations, or syntheses, generating implicit clusters. Refnd uses this information to produce splits that respect the natural boundaries of the data, preventing nearby samples in the relational space from ending up in separate training and test sets.

Validation on an antimicrobial peptide dataset showed that Refnd splits yield lower but far more realistic evaluation metrics than traditional splits. This implies that models trained with conventional splits may be overestimating their generalization ability. For companies working with sensitive or proprietary data in biotechnology, pharmaceuticals, or agrochemistry, adopting a method like Refnd is not just a matter of accuracy, but of cybersecurity and compliance: inadvertent information leakage can lead to wrong research decisions or even expose intellectual property.

From a software development perspective, implementing Refnd in production environments requires integrating it with data pipelines, cloud storage, and monitoring systems. Here, Q2BSTUDIO offers expertise in custom software and cloud AWS/Azure to build robust infrastructures that incorporate these algorithms. For example, it is possible to deploy a service that computes Refnd splits on datasets hosted in Amazon S3 or Azure Blob Storage, using serverless functions or containers, and then feed AI models trained on those clean splits. The combination of AI and advanced splitting methods like Refnd yields more reliable models, reducing the risk of overfitting and improving transfer to real-world data.

Furthermore, Refnd’s ability to work with any dataset arising from a relational generative process (protein sequences, molecular structures, small compounds, nucleotide sequences, etc.) makes it a cross-cutting tool. R&D departments can benefit by standardizing how they evaluate their predictive models. Integrating Refnd with BI/Power BI platforms allows visualization of split distributions and monitoring of data quality before training, providing transparency to business teams.

But implementing cutting-edge technology is not enough without proper guidance. Q2BSTUDIO not only develops the software but also advises on adopting AI agents that automate split selection, leakage detection, and alert generation for potential biases. An agent could, for example, review each new incoming dataset, apply Refnd, and notify the team if the traditional split produced significant leakage. This kind of automation, deployed on cloud AWS/Azure, ensures that best practices are maintained without constant manual intervention.

In summary, relational data leakage is a silent but devastating obstacle to the reliability of machine learning models. Refnd offers a theoretically grounded, scalable, and practical solution. Companies wishing to adopt this approach can rely on Q2BSTUDIO to integrate it into their existing systems, either through custom software development or by leveraging cloud services on AWS and Azure. Investing in advanced splitting methods not only improves model accuracy but also protects data integrity and strategic decision-making.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.