Step 2 of 6
Data Preprocessing
Every photo is turned upright, resized to one standard size and cleaned of noise.
2.1
Auto orientation
Photos from the open web arrive tilted — by the camera, or by how the person was holding their head. Auto orientation corrected each image to a consistent upright alignment across the dataset.
It removes a difference that has nothing to do with strabismus, so the models compare eyes rather than camera angles.

2.2
Resizing
Every photo came in at its own size. All of them were resized to 227 × 227 pixels, the input size the models expect.
A fixed size means every image carries the same amount of detail into the network, and the network's first layer can be built for exactly that shape.

Original · 477 × 133 px, and every photo differs

227 × 227 px, for every photo
2.3
Denoising
Photos collected from the web carry camera grain and compression artifacts. A denoising pass cleaned them up before training, improving clarity so the models see the eye rather than the noise.
We used OpenCV's non-local means filter. It replaces each pixel with an average of similar-looking patches from across the image, which removes grain while keeping sharp edges — like the rim of the iris — intact.

