"I have data on 500 patients, we can train a model." We hear this sentence very often. Once the actual process begins, however, most researchers run into unexpected obstacles. This is because the distance between raw clinical data and ML-ready data is far greater than it appears.
Why Isn't Hospital Data "Ready"?
Hospital information systems are designed for clinical care, not for research. These two purposes produce data structures that conflict with each other.
The same diagnosis may have been coded differently by different residents. Laboratory values may have come from different devices, with different reference ranges. Imaging data may have been acquired with different protocols, from different device manufacturers. Patient follow-up information may have been kept in different formats across different outpatient clinics.
These inconsistencies are not solved by "cleaning" alone. Each one requires the judgment of someone who understands the clinical context and has both technical and medical competence.
KVKK and Anonymization: More Complex Than You Think
Deleting the patient's name and national ID number is not enough. This is "pseudonymization," not true anonymization.
Rare diagnoses, a specific age-sex-location combination, a distinctive clinical course, and their combination can make a patient re-identifiable in a small dataset. This is known as the k-anonymity problem and creates high risk in terms of KVKK.
DICOM files carry additional risk. Patient information embedded in the header, patient names written into the image itself (burned-in annotation), and timestamps: unless all of these are systematically cleaned, anonymization cannot be considered complete.
Missing Data: The Real Problem Is the Pattern, Not the Amount
Every clinical dataset has missing data. The real question is this: is the missingness random, or systematic?
If certain lab values are more often missing for severely ill patients, because those patients were admitted to intensive care and routine tests could not be performed, then this missingness is not random. This is a "missing not at random" (MNAR) situation, and if mismanaged, the model becomes systematically biased.
Filling in with a simple average (mean imputation) can make this situation even worse. Advanced methods such as multiple imputation, MICE, or model-based imputation may be needed, and which method is appropriate should be decided based on the structure of the data.
Data Leakage: The Hardest Error to Notice
Data leakage, information leaking from the training data into the test data, is one of the most common and least noticed methodological errors in AI studies.
If a patient-level split has not been performed, different visits from the same patient can fall into both the train and the test set. The model "memorizes" that patient and performance appears higher than it really is.
If normalization or imputation was done using information from the test set, real-world performance drops. In time-series data, if future data was used, the model shows a clinically impossible performance.
Where Do People Get Stuck in This Process?
Researchers struggle most at these points: bringing data from different sources into a common format. The different export formats of each hospital system. Understanding the pattern of the missing data. Verifying that anonymization has been done completely. Making the train/validation/test split methodologically correct.
Each of these can be a project on its own. A model trained without all of them being done correctly will not work as expected in a real clinical setting.
To plan your clinical data preparation process together, request a free 30-minute consultation.
Where Do People Get Stuck Most in This Analysis?
- The data in your Excel files is coded inconsistently, and you lose 30% of your observations during the cleaning process.
- You performed KVKK-compliant anonymization but did not keep an audit trail, and the ethics committee may question it.
- You are trying to merge data from different sources but the patient ID matching does not hold.