← Latest papers
💻 computer science

Brazilian-PHI: Benchmarking Checksum-Validated Recognizers for CPF, CRM, CNS, CNPJ, RG, CEP, and Phone in Portuguese Clinical Text

This paper introduces Brazilian-PHI, the first benchmark for detecting seven types of Brazilian personal health information in clinical text, demonstrating that custom Presidio recognizers with checksum validation significantly outperform default tools and large language models in accuracy, latency, and compliance with LGPD requirements.

Original authors: Igor Eduardo

Published 2026-08-21
📖 4 min read☕ Coffee break read

Original authors: Igor Eduardo

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the digital age of healthcare, a patient's medical record is more than just a story of illness and recovery; it is a dense tapestry of personal details that must be protected by law. In Brazil, a specific regulation known as the General Data Protection Law treats health information as a particularly sensitive category, requiring that any computer system handling these notes must first strip away anything that could identify a specific person. This process, called de-identification, is the gatekeeper that allows artificial intelligence to learn from medical data without violating privacy. However, the task is far from simple. Brazilian medical notes contain a unique set of identification codes—numbers for tax records, medical licenses, health cards, and business registrations—that follow strict, complex formats. Unlike simple names or addresses, many of these codes include mathematical checks, much like a security seal, that prove the number is real and not just a random string of digits. If a computer system misses these codes or mistakes a harmless number for a private one, the consequences can be severe, ranging from massive fines to the loss of patient trust.

A researcher named Igor Eduardo set out to solve a specific gap in this field: there was no standard test to see how well different computer tools could find these seven specific Brazilian identification codes within medical text. While tools existed for English or Spanish, they often failed when faced with the unique structure of Brazilian data. To test this, the researcher created a large collection of 500 fake medical notes. These notes were carefully crafted to look real, containing the seven types of identification codes mixed in with hundreds of other numbers that look similar but are harmless, such as medication dosages or hospital facility codes. The goal was to see which method could find the real private codes without getting confused by the harmless ones. The study compared three different approaches: a standard, out-of-the-box software tool, a powerful artificial intelligence model that learns from vast amounts of text, and a custom-built version of the software that was specifically taught to recognize Brazilian formats and perform the mathematical checks on the numbers.

The results revealed a clear divide between how different technologies handle structured data. The custom-built software, which was programmed to look for the specific shapes of Brazilian codes and verify their mathematical seals, performed perfectly. It found every single instance of the seven identification types in the test notes and made no mistakes, correctly ignoring all the harmless numbers that looked similar. In contrast, the standard, unmodified software failed to find most of these codes because it simply did not know what to look for, achieving a very low success rate. The artificial intelligence model, while impressive in its ability to understand language, struggled with the strict rules of these numbers. It found most of the codes but made a few errors, confusing some harmless facility codes with private identification numbers. Crucially, the AI could not perform the mathematical verification that proves a number is valid; it could only guess based on patterns, which is why it occasionally made mistakes that the custom software avoided entirely.

Perhaps the most striking finding was not just about accuracy, but about speed. The custom software processed each medical note in less than ten microseconds, a timeframe so short it is almost instantaneous. The artificial intelligence model, however, took over eight hundred milliseconds to process the same note. This means the custom tool was roughly eighty thousand times faster than the AI. To put this difference in perspective, if the AI were a person reading a page aloud, the custom tool would be a machine that could read the entire library in the time it takes that person to read a single sentence. This massive difference in speed suggests that for the specific job of scrubbing private numbers from medical records, relying on the slow, expensive AI is impractical for large-scale use. The study concludes that the best approach is a hybrid one: using fast, rule-based tools to catch the strict, mathematical codes, and saving the powerful, flexible AI for finding the more complex, unstructured details like names and addresses. This combination offers the speed and reliability needed to protect patient privacy while still allowing advanced technology to improve healthcare.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →