De-Identification, Privacy, and Regulatory Compliance for Research Data
HIPAA Safe Harbor and Expert Determination methods, GDPR requirements, institutional review board (IRB) considerations, and how to build datasets that are both useful and compliant.
Every dataset in this knowledge base began as somebody's medical record. Before you can use it for research, and long before you can share it, you need a legal basis for using it and a way of making sure that the people in it can't be identified by those who have no business knowing.
This article describes the main rules in the United States and Europe, with a note on Canada, and then the practical business of de-identifying medical images, which is harder than it looks. This is not legal advice, I am not a lawyer, if I was I'd still not be your lawyer, and anyway I'd probably be doing wills in a small town somewhere. Your institution's privacy office and ethics board make the actual decisions, and you should talk to them before you extract anything.
Two questions
Am I allowed to use this data? That is a matter of ethics approval, consent or a waiver of consent, and, in Europe, a lawful basis for processing.
How must the data be protected? That is where de-identification, access control and data agreements come in.
The United States: HIPAA
HIPAA's Privacy Rule governs "protected health information" held by health care providers, insurers and their contractors. Data that has been de-identified according to the rule is no longer protected health information, and the rule stops applying to it. There are two ways to get to this state..
Safe Harbor
There are eighteen listed types of identifier that you have to look for and remove. These include the obvious ones (names, medical record and social security numbers, phone numbers, email and street addresses, full-face photographs) and some that are a bit less obvious:
- All elements of dates other than the year, where the date relates to the individual. Birth date, admission date, and the date of the scan.
- Ages over 89, which must be grouped as "90 or older."
- Geographic units smaller than a state. The first three digits of a ZIP code can be kept if the area they cover holds more than 20,000 people.
- Device identifiers and serial numbers, biometric identifiers, and a final catch-all: any other unique identifying number, characteristic or code.
Safe Harbor is popular because it is a checklist. Its cost is the dates - exact intervals between scans, age in months for children and anything seasonal are lost unless you take steps to preserve them, which are described below.
Expert Determination
A person with appropriate statistical expertise analyses the dataset and documents that the risk of re-identifying anyone is very small. This route lets you keep things Safe Harbor forbids, such as exact dates or finer geography, if the expert concludes the risk is still low. It costs money though, and the conclusion applies to that dataset in that context. Most projects collect more data as the research marches on.
The IRB
In the US, research involving human subjects is governed by the Common Rule and overseen by institutional review boards. For a retrospective AI study the board will want to know what data you are taking, why you need each element, who will see it, where it will be stored, whether it leaves the institution, and what happens to it afterwards.
Work on data that is truly de-identified may be judged not to be human subjects research, or to be exempt. It's best to get that determination from the board in writing. Journals often ask for it.
Think ahead about scope. If the approval says the data will be used to study one disease at one institution, then sharing it with a collaborator, using it for a second project or publishing it as an open dataset are all outside the approval. If any of those are possible, ask for them at the start. Amending a protocol later is slow, and re-consenting patients is usually impossible.
Europe: GDPR
GDPR starts from a different place. Under GDPR, data is either personal data or anonymous. Data from which names and numbers have been removed while a key exists somewhere that could link it back is "pseudonymised," and pseudonymised data is still personal data, with the whole regulation applying. Most research datasets that an American would call de-identified are pseudonymised in GDPR terms, because the hospital keeps the key.
Anonymous data is outside GDPR, but the bar for exemption is pretty high. Identification must not be possible by any means reasonably likely to be used, by anyone. There is no checklist equivalent to Safe Harbor.
So in practice European research data is just handled as personal data, which means you need:
- A lawful basis for processing, and, since health data is a "special category," one of the specific conditions that permit processing it. Consent is the most obvious and strongest condition. Scientific research with appropriate safeguards is another, and how that works depends partly on national law, so it differs between member states.
- Data minimisation. Collect what the research question needs and no more.
- Usually a data protection impact assessment, since large-scale processing of health data is high risk by definition.
- A legal mechanism for any transfer outside the European Economic Area, such as standard contractual clauses. Sending European scans to a US cloud region is a transfer.
The EU AI Act adds obligations concerning the training data of high-risk AI systems, a category that includes most AI medical devices (see 6.11 International Regulatory Frameworks).
Canada
Health information is regulated mainly by the provinces, under laws such as Ontario's PHIPA and Alberta's Health Information Act, with federal law covering commercial organizations. Research goes through a research ethics board applying the Tri-Council Policy Statement (TCPS 2). The approach resembles the American one in relying on board approval and waivers of consent for retrospective work, but there is no Safe Harbor list. De-identification is judged by the risk of re-identification in context.
De-identifying medical images
A DICOM study has a bunch of tags that are obviously patient information, but in reality identifiable patient data can be stashed in a thousand other places.
The header. PII can be in free-text fields such as the study description or comments, into which technologists type whatever is useful ("pt John S., fall from ladder"), and private tags, which are vendor-specific fields with undocumented contents. The DICOM standard includes a de-identification specification, the confidentiality profiles in Part 15, which lists what to do with each attribute and defines options for keeping things research needs. There are free tools that implement it, such as the RSNA's Clinical Trial Processor.
The pixels. Ultrasound images routinely have the patient's name and date burned into the image itself. So do screenshots, scanned documents, secondary captures and dose reports stored as images, and some older radiographs. You need to detect and mask the text, which is at the moment a pretty manual process.
The face. A head CT or MRI contains the patient's face, which, since it can be rendered by standard software, counts as PII. In a 2019 study, Christopher Schwarz and colleagues at the Mayo Clinic reconstructed faces from the research MRI scans of 84 volunteers and gave them to commercial face-recognition software along with photographs. The software matched 70 of them. The fix is defacing or skull-stripping software, which removes or blurs facial features, and which can interfere with models that use those regions, so test for that.
The reports. Radiology and pathology reports are free text full of names, dates and places. Automated scrubbing of free text is imperfect, and reports that will be shared need a manual check of at least a sample.
The unusual patient. A rare disease, a distinctive implant, an unusual injury that made the local news: any of these, together with an approximate date and a hospital, can identify someone though no listed identifier remains.
Keep what the research needs
Zealous de-identification can wreck a dataset. Plan for these before the data is extracted, because afterwards it is too late.
A consistent pseudonym per patient. Every study from one patient must get the same new ID, or you can't keep a patient's studies on one side of the training and test split (see 3.2 Training, Validation, and Test Sets), and you can't do anything longitudinal.
Intervals. Shift all of a patient's dates by one random offset chosen for that patient. That way you can maintain the interval between the initial scan and any follow-ups without revealing the actual birthdate.
Age, to the precision you are allowed, and sex. You generally need them to describe the cohort and to report performance in subgroups (see 7.2 Demographic Fairness).
Scanner manufacturer, model, software version and acquisition parameters. Most automatic de-identifier deletes these along with everything else, and then nobody can check performance by scanner (see 2.6 Multi-Site and Multi-Device Data).
Site (as a code).
The linking key, if the ethics approval permits one, kept at the source institution and never with the research copy. It is the only way to add outcomes later or to comply with a withdrawal. It's the most useful and flexible mechanism but eeping it means the data is only pseudonymised, with the GDPR consequences above.
If the model may become a product
Consent and approvals given for research don't automatically cover commercial development. If there is any chance the work will be spun out or licensed, check that the ethics approval and the data agreements allow commercial use, and that the agreement with each contributing site says who may use the data and the resulting model. Sorting this out after the model works is much harder than before.
Regulators will also want to know where the training and test data came from (see 6.7 Good Machine Learning Practice). So although it's annoying it's good to strive to keep good records: what was extracted, when, under which approval, and how it was de-identified.
Key takeaways
- Permission to use data and protection of data are separate questions. De-identification doesn't replace ethics review.
- HIPAA offers Safe Harbor (remove eighteen identifier types, including all dates but the year) and Expert Determination (a documented statistical judgment). Limited data sets with a data use agreement are a practical middle route.
- Under GDPR, coded data with a key held anywhere is pseudonymised and still personal data. You need a lawful basis, safeguards and a mechanism for transfers out of Europe.
- Medical images carry identifiers in free-text and private header fields, in burned-in pixels, in reports, and in the face on a head scan.
- Plan to keep consistent patient pseudonyms, date intervals, age, sex, site and scanner metadata. Losing them damages the research.
- De-identification reduces risk without eliminating it. Combine it with access control and data use agreements.
- Ask for the approvals you will need later, including sharing and commercial use, at the start.
What to read next
- 2.6 Multi-Site and Multi-Device Data: The Generalization Challenge: why you will want to share data across sites
- 2.8 Synthetic Data and Data Simulation: generated data as a privacy measure, and its limits
- 7.6 Ethical Frameworks for AI in Healthcare: consent and governance more broadly
- 8.3 Interoperability: DICOM, HL7 FHIR, and Integration Standards: what is in a DICOM file
- 9.4 Sharing Code, Data, and Models: releasing a dataset responsibly
This article is part of the AI in Clinical Research Knowledge Base.