Medical AI lab · Note de-identification ·
De-identifying a clinical note: interactive demo
Removing names is not enough to de-identify a clinical note. In this demo simple rules at the default strictness catch 6 of the 13 identifiers in a fictional discharge note, including 3 of 4 names and both the ID and phone number, but none of the address, the two towns, the occupation or a unique event. Those indirect details are what re-identify a patient, so de-identification has to be measured per identifier type on your own notes.
In one line: Default rules catch 6 of 13 identifiers in the demo note: the names and numbers are caught, the address, both towns, the occupation and a unique event are missed.
These demos are illustrative. Every signal, image, patient and note is synthetic and fictional, generated and scored in your browser, and every number shown is computed from that synthetic data. They show general principles, not the performance of any real model, product or project, and none of them is a medical device.
Nothing is uploaded. No patient data is used.
Clinical data de-identification / free text
Names are easy. The rest re-identifies.
What this shows: simple rules catch titled names and ID numbers early; dates, places and rare details such as an unusual job or a unique event need more, and turning the rules up also removes doses, drug names and ordinary words.
Run the detector
Rules switched on
Fictional discharge note
13 annotated identifiersGreen: identifier caughtRed: identifier missedAmber: over-redacted
Synthetic data · fictional note · illustrative · not a medical device
Free-text notes, letters and reports before they reach analysts, vendors or language models. Measure missed identifiers and over-redaction on your own notes and languages; de-identification lowers disclosure risk but is not a guarantee of anonymity.
What this experiment models
One fictional note in three versions, with a ground-truth annotation of 13 identifiers: names, dates, an ID number and a phone number (all zeros), an address and towns, and two rare details. The detector is a list of regular expressions and word lists, switched on in five levels. An identifier counts as caught when at least half of its characters are redacted; a redaction that touches no identifier counts as over-redaction. Real systems combine rules with trained models and human review.
The principle
How it works
The note contains 13 annotated identifiers: four names, two dates, an ID number and a phone number (both all zeros), a street address, two towns, an occupation and a unique event. The detector is a stack of regular expressions and word lists in five levels: titled names and ID numbers; then phone numbers, numeric dates and a short list of first names; then month-name dates, addresses, towns and capitalised words; then any number and a longer name list; and finally occupations and every capitalised word.
Names and ID numbers are caught early. Dates written in words, addresses and towns need more rules. Hebrew has no capital letters, so a name without a title is missed until it is on a list, and the list then also removes ordinary words that double as names, such as the Hebrew word for age. The occupation is caught only at the strictest level, the unique event never is, and doses, lab values and drug names are over-redacted along the way.
Lists of identifier types, such as the HIPAA Safe Harbor list, are a starting point. Measure missed identifiers and over-redaction on your own notes and languages, and keep in mind that de-identification lowers disclosure risk but does not guarantee anonymity. See clinical data de-identification.
Worked example
A set of notes that looks de-identified
Picture a team preparing discharge notes for a research dataset or for use with a language model. They write rules for the obvious identifiers: ID numbers, phone numbers, numeric dates, names that follow a title and a short list of first names. They spot-check a few notes, see the patient names replaced and decide the notes are safe to share.
The demo’s default settings are that pipeline: the English note at strictness 2 (Basic). The fictional note has 13 annotated identifiers. The detector catches 6 of 13, misses 7 and over-redacts 0. By type it catches 3 of 4 names, 1 of 2 dates and 2 of 2 for ID and phone, but 0 of 3 for address and towns and 0 of 2 rare details.
The seven misses are the street address, both towns, the date written with a month name, a relative’s first name that is not on the list, the patient’s occupation and a unique event in his history. The last two are the most telling. An unusual job and a one-off event, next to a home town, can point to one person without any name at all.
Turning the strictness up helps, at a price. At level 3 the detector catches 11 of 13 and over-redacts 2 items, a drug name and a hospital department. At level 5 it catches 12 of 13 and over-redacts 16, including both doses, the troponin value and a drug name, so the note is losing the clinical content it was kept for. The unique event is never caught at any level. In Hebrew at the default level the result is also 6 of 13.
The correct practice is to measure, not spot-check. Annotate a sample of your own notes, in each language and note type you handle. Report the share of identifiers caught per type, and count over-redaction as well. Combine rules with a trained model and human review for the categories rules cannot reach. Treat what remains as residual risk to be managed with access controls and data-use agreements. De-identification lowers disclosure risk; it does not guarantee anonymity.
Checklist
What to check in your own project
- Do you have an annotated sample of your own notes, in each language and note type, to measure against?
- Is the share of identifiers caught reported per identifier type, not as one overall figure?
- Is over-redaction measured, and do doses, lab values and drug names survive?
- Are indirect identifiers covered: rare occupations, unique events, relatives’ names, small places?
- Are scripts without capital letters, mixed-language notes, abbreviations and typing errors handled?
- Which controls stay in place after de-identification (access limits, agreements, review), given that no method removes all risk?
Related: our clinical data de-identification service, the wiki page on medical AI validation, and the demos on patient-level data leakage and Dice score vs clinical error.
FAQ
Common questions
How do I measure how well clinical notes are de-identified?
Annotate a sample of your own notes, in each language and note type, and score the pipeline against it: the share of identifiers caught per type, and the number of clinical items removed by mistake. In the demo the default rules catch 6 of 13 identifiers and over-redact 0, and stricter rules catch more while removing doses and drug names. One overall percentage hides which types are missed.
Can a patient be identified from a note without their name?
Yes. An unusual occupation, a unique event, a home town and a date can point to one person in combination. In the demo note the default rules catch 3 of 4 names but none of the address, the two towns, the occupation or the unique event, and the unique event is never caught at any strictness level.
How do I de-identify Hebrew clinical notes?
The same approach applies: rules for fixed-format identifiers such as ID and phone numbers, word lists or a trained model for names and places, and measurement against an annotated sample. Hebrew has no capital letters, so rules that rely on capitalisation do not transfer. In the demo the Hebrew note at the default level also scores 6 of 13.
What is de-identification of clinical notes?
De-identification means finding the details in a note that could identify the patient or other people, and removing them or replacing them with placeholders or realistic substitutes. It covers direct identifiers such as names, ID numbers and contact details, and indirect ones such as dates, places and rare personal details.
Is removing names enough to de-identify a clinical note?
No. Dates, addresses, towns, occupations and unusual events can identify a person, especially in combination. In this demo the default rules catch 3 of the 4 names in the fictional note but only 6 of its 13 identifiers, and miss the address, both towns, the occupation and a unique event.
Which identifiers have to be removed from medical records?
That depends on the law and policy that apply to the data. A widely used reference is the HIPAA Safe Harbor list of 18 identifier types, which includes names, small geographic units, dates other than the year, contact details and record numbers. Other frameworks ask whether a person is reasonably identifiable instead of giving a fixed list. This is general information, not legal advice.
Can regular expressions de-identify clinical text?
They work well for identifiers with a fixed format, such as ID numbers, phone numbers and numeric dates. They do poorly on names without a title and on free-text details, and stricter rules start to remove clinical content. In this demo the strictest setting over-redacts 16 items in the English note and still misses one identifier. Practical systems combine rules with trained models and human review.
Medical AI lab
More demos
All fourteen demos on one page: the medical AI labClinical data de-identification →