we are recognizing the disease, not the person.
If you're training a computer vision model with only images and no auxiliary information then a randomized sampling should be enough to prevent the model from over fitting on x-ray scans taken on the same person.
If images from the same person exist in both subsets, the problem will be easy, and not reasonable, from a practical point of view. Do you agree?
Only partially. The aim of a test set is to allow you to quantify how well your model will perform on a real use case. Which is close but not the same as making the problem as hard as possible in testing phase.
Also, it is not necessarily true that having 20 examples from the same person in the training set will lead to high accuracy on even 1 single test instance coming again from the same person. This is because those training instances might contain bias (like many tumors on the left side of the scan rather than the right side).
This is why I personally would go for the following splitting approach:
- sample from the whole dataset a small group of people (for example top n people with fewest amount of scans). Let's call this set between groups test set.
- sample per person (from the remaining data) 70% training instances and 30% test instances. Let's call it within groups test set.
During validation I would then perform the following checks:
- metrics calculation (precision, recall, f-score, i.e the whole package) on the between group test performed as usual.
- metrics calculation per person (or clusters of people, paying attention in keeping the clusters the same at every validation step) on the within groups test set.
The second check is the most interesting. Of course there will be some random variation in the performance, but if the model will start performing better on some specific clusters of people that might be a hint that the model is learning some confounding variables probably related to the presence of really similar scans or other bias. testing only on the between groups will not let you to draw that conclusion.