Strabismus Detection Module
Description
Strabismus Detection Module is a fully open-source diagnostic system developed for the preliminary screening and visual rehabilitation of patients with ocular misalignment (strabismus). The system integrates computer vision and deep learning into a portable, low-cost embedded solution that runs entirely on a Raspberry Pi 4, requiring no specialized clinical hardware. The software is implemented in Python using PyQt5 for the graphical interface, OpenCV for image acquisition and preprocessing, and TensorFlow Lite for lightweight neural inference. It incorporates a NASNetLarge-based convolutional model optimized for binary classification (strabismus vs. normal), supported by a graphical interface that guides the user through image capture, automated analysis, and PDF report generation. A gamified visual rehabilitation module is activated in positive cases, offering dynamic ocular fixation exercises adjustable in pattern, speed, size, and color. The hardware includes a 3D-printed chin rest designed in SolidWorks to ensure standardized facial alignment during image acquisition. All mechanical parts are provided in both CAD (.SLDPRT, .SLDASM) and printable STL formats, and the electronic schematic is available in Fritzing format (.fzz), showing the basic wiring between the Raspberry Pi, camera, display, and power supply. All source code, including the GUI logic (main.py), multilingual support (translations.py), trained model (Modelos/NASNETLARGE.tflite), and necessary classifiers (Clasificadores/), is provided under the GNU General Public License v3.0. Hardware designs (CAD, STL, and schematic files) are distributed under the CERN Open Hardware Licence v2 – Strongly Reciprocal (CERN-OHL-S v2.0). This system has been validated on a proprietary dataset and through real-time testing with clinically diagnosed patients, achieving 96.30% accuracy. Its modular design and open licensing promote replicability, customization, and future expansion by the research and education communities.
Files
Steps to reproduce
The data used in this study were obtained through a two-phase approach involving (1) the compilation of a proprietary dataset of facial images and (2) real-time validation with a clinically diagnosed subject. The image dataset was acquired under controlled conditions using a generic USB webcam connected to a Raspberry Pi 4 running Raspberry Pi OS. Images were captured with the patient seated and stabilized using the 3D-printed chin rest included in the physical system, ensuring consistent frontal alignment and reducing head movement during acquisition. Each image was manually labeled based on clinical diagnosis, and the dataset consisted of 27 images: 26 from individuals previously diagnosed with strabismus and 1 from a control subject with normal ocular alignment. Although this dataset is intentionally imbalanced, it was sufficient for functional validation of the embedded system and end-to-end workflow testing. Images were captured using the built-in camera module of the developed application (implemented in Python with PyQt5), which includes a graphical interface for selecting between facial and ocular capture modes. OpenCV was used for real-time image processing, including grayscale conversion and detection of facial and ocular regions using Haar cascade classifiers. For model inference, the input images were preprocessed and resized to 331×331 pixels, then passed through a NASNetLarge-based convolutional neural network converted to TensorFlow Lite format (.tflite) for efficient on-device inference on ARM-based hardware. The software also generates PDF diagnostic reports and activates a visual treatment module in cases where strabismus is detected. Ethical considerations were observed, and a signed informed consent form was obtained from the participant involved in the real-time testing. The consent document is included as supplementary material in the project repository. The complete data acquisition and inference workflow, including scripts, trained model, and resources used during testing, are included in the /software/src/ directory of the open-source repository, enabling full reproducibility and independent verification by other researchers.
Institutions
- Universidad Surcolombiana
- Corporacion Universitaria del Huila
- Universidad de la Rioja