Inspiration
The human tear is more than just a lubricant; it is a complex biological fluid containing markers for systemic health. Microscopic analysis of tear ferning (the patterns formed as tears desiccate) offers a non-invasive window into the body. However, manually interpreting these intricate, fractal-like crystals is highly subjective and requires expert training. We were inspired to digitize this process, creating an objective "digital biopsy" of the tear film.
What it does
CrystaLens (formerly Crystal) is an automated diagnostic pipeline that classifies tear film microscopy images into five categories: Diabetes, Glaucoma, Multiple Sclerosis, Dry Eye (Suche Oko), and Healthy (ZdraviLudia). It uses a dual-engine approach, analyzing both the mathematical "texture" of the crystals and the deep visual hierarchies within the images to provide a high-confidence diagnostic suggestion.
How we built it
We built a multi-stage hybrid AI pipeline:
Preprocessing: We implemented a custom duplicate detection script using SSIM (Structural Similarity Index) to ensure dataset integrity.
Classical ML Engine: We extracted over 100 handcrafted features, including GLCM (texture), Hu Moments (shape), and Gabor Filters (frequency), feeding them into a Soft-Voting Ensemble of Random Forest, SVM, and Gradient Boosting.
Deep Learning Engine: We utilized EfficientNet-B0 (via PyTorch) to capture complex features that manual extraction might miss.
Hybrid Fusion: We developed a Late Fusion module that averages the class probabilities from both engines, significantly boosting the weighted F1-score and reducing false negatives.
Analytics Suite: A comprehensive reporting tool generates t-SNE visualizations, confusion matrices, and feature importance charts to make the "black box" of AI more interpretable for clinicians.
Challenges we ran into
Class Imbalance: Certain conditions had significantly fewer samples. We addressed this by integrating SMOTE (Synthetic Minority Over-sampling Technique) into our classical training pipeline and using stratified cross-validation.
High Intra-Class Variability: Tear crystals can look different depending on the drying environment. We overcame this by using Test-Time Augmentation (TTA) during prediction to ensure the model stayed robust across different rotations and scales.
Feature Alignment: Aligning the predictions from the CNN (which processes raw pixels) with the Classical ML (which processes CSV-based features) required building a robust indexing system based on file paths.
Accomplishments that we're proud of
Hybrid Accuracy: Achieving a higher F1-score through ensemble fusion than either the CNN or Classical ML could achieve alone.
Explainability: We successfully mapped specific mathematical features (like "Gabor energy" and "Edge density") to disease states, providing a "why" behind the AI's decision.
Scalable Architecture: The project is modularized so that new diseases or image types can be added with minimal code changes.
What we learned
We learned that in medical imaging, "Deep Learning" isn't always a silver bullet. Handcrafted texture features still hold immense value, especially when data is limited. We also deepened our understanding of Late Fusion and the importance of t-SNE in validating whether a model has actually learned to distinguish between similar-looking pathologies.
What's next for Crystal
Clinical Validation: Testing the model on a fresh, blind set of samples from different microscopy hardware.
Web Interface: Developing a user-friendly dashboard where practitioners can upload a .bmp file and receive an instant PDF report.
Mobile Integration: Exploring whether smartphone-mounted microscopic lenses can provide high-enough quality images for on-the-go screening.
Log in or sign up for Devpost to join the conversation.