ASTRA OS (Assessment Tool for Rapid Ophthalmic Screening) is a compact and affordable cataract pre-screening system designed to improve access to early eye health assessment through edge AI technology. Built around a Single Board Computer (SBC), specifically a Raspberry Pi, the system performs real-time cataract analysis locally without relying on cloud connectivity, making it suitable for deployment in rural, low-resource, and connectivity-limited environments.
The device uses a close-range camera module. These images are processed directly on the Raspberry Pi using a lightweight deep learning model trained to identify signs of lens opacity associated with cataracts. By running inference entirely on-device, ASTRA OS preserves user privacy, reduces latency, and ensures reliable operation even without internet access.
To improve usability and accessibility, ASTRA OS provides a dekstop-accessible web interface that allows users or healthcare workers to view the live camera feed, capture eye images, and receive rapid screening results in real time. The system architecture is designed to be portable, cost-effective, and easy to operate, enabling wider adoption in community health programs, temporary medical camps, and underserved regions.
The project combines embedded systems, computer vision, and edge AI into a practical healthcare-oriented solution that demonstrates how SBC-based intelligent devices can support early ophthalmic screening. Through its offline capability, affordability, and ease of deployment, ASTRA OS aims to contribute toward more accessible preventive eye care and earlier detection of cataract-related vision problems.
Problem StatementCataracts remain one of the leading causes of visual impairment and blindness worldwide, affecting more than 65 million people globally. Despite being treatable, many cataract cases are diagnosed too late due to limited access to early screening services, particularly in rural and underserved communities. Studies and healthcare reports indicate that up to 95% of severe vision loss cases can be prevented through early detection and timely medical intervention, highlighting the importance of accessible ophthalmic screening systems.
Early diagnosis plays a critical role in reducing the progression of cataracts and improving treatment outcomes. However, access to ophthalmic screening services remains limited in many regions because of expensive medical equipment, shortages of eye care specialists, and inadequate healthcare infrastructure. In low-resource environments, patients often need to travel long distances to reach clinics or hospitals capable of performing proper eye examinations.
Existing AI-assisted medical screening solutions frequently depend on cloud-based processing and stable internet connectivity. While these systems can provide accurate analysis, they are often impractical for deployment in remote areas where internet access is unreliable or unavailable. In addition, transmitting sensitive medical image data to external servers may introduce concerns related to privacy, latency, and operational cost.
To address these issues, ASTRA OS was developed as a compact SBC-based cataract pre-screening device that performs real-time image analysis locally using edge AI technology. By leveraging Raspberry Pi hardware, computer vision, and lightweight deep learning inference, the system aims to provide accessible, privacy-friendly, and cost-effective ophthalmic screening without relying on cloud infrastructure.
Proposed SolutionASTRA OS was developed as a compact and affordable cataract pre-screening device powered by edge AI technology. The system performs rapid preliminary cataract assessment locally on a Raspberry Pi without relying on cloud processing or internet connectivity.
The device uses a close-range camera module to capture eye images, which are processed directly on the Raspberry Pi using a lightweight deep learning model trained for cataract detection. The AI model was developed using TensorFlow Keras and optimized for embedded inference on SBC hardware. The system analyzes lens opacity indicators and generates real-time screening results while maintaining low latency and data privacy through fully offline processing.
ASTRA OS integrates embedded computing, computer vision, and a Flask-based desktop-accessible web interface into a portable and user-friendly screening solution. Users or healthcare workers can access the live camera feed, capture eye images, and view screening results directly through a local web browser. The software pipeline uses Python, OpenCV for image processing, TensorFlow Keras for AI inference, and Flask as the local web server framework running on the Raspberry Pi. By combining SBC-based edge computing and offline AI inference, ASTRA OS provides a low-cost, portable, and accessible solution for rapid cataract pre-screening in low-resource environments.
1. Data Acquisition from KaggleThe dataset used in this project was obtained from the Kaggle Cataract Image Dataset, which was specifically created to support practical deep learning applications for cataract detection using direct eye images. Unlike many existing cataract datasets that primarily contain medical reports rather than ophthalmic images, this dataset provides image-based samples suitable for computer vision and AI model training.
The dataset consists of two classification categories: Cataract and Normal eye conditions. A total of 491 training images and 121 validation images were used during the model development process. The images were organized into separate class folders to enable supervised learning using TensorFlow Keras image generators.
Before training, the dataset underwent several preprocessing and preparation stages to improve model performance and compatibility with embedded inference on Raspberry Pi hardware. The preprocessing pipeline included image resizing, normalization, and class labeling. The images were resized into a consistent input dimension suitable for the convolutional neural network architecture used in the project.
2. Dataset Preparation on Google ColabThe dataset preparation process was conducted using Google Colab to simplify model development and provide access to cloud-based GPU acceleration for deep learning training. Since the dataset was hosted on Kaggle, direct dataset integration was performed using the Kaggle API and a Kaggle authentication JSON file (kaggle.json).
The Kaggle API credentials were first configured in the Google Colab environment by creating a local Kaggle directory, copying the authentication file, and setting the required file permissions for secure access.
!mkdir -p ~/.kaggle
!cp kaggle.json ~/.kaggle/
!chmod 600 ~/.kaggle/kaggle.jsonAfter authentication was configured, the cataract image dataset was downloaded directly from Kaggle using the Kaggle API command line interface. The downloaded dataset archive was then extracted into the Colab working directory for further preprocessing and training.
!kaggle datasets download -d nandanp6/cataract-image-dataset
!unzip cataract-image-dataset.zip3. Image Preprocessing and Data AugmentationThe dataset preprocessing stage was implemented using TensorFlow Keras ImageDataGenerator in Google Colab. All images were resized to 150 × 150 pixels to match the input requirements of the lightweight CNN model used for Raspberry Pi deployment.
To improve model generalization and reduce overfitting, several data augmentation techniques were applied to the training dataset, including rotation, shifting, zooming, shearing, and horizontal flipping. Pixel normalization was also performed by rescaling image values to the range of 0–1.
train_datagen = ImageDataGenerator(
rescale = 1./255.,
rotation_range = 20,
width_shift_range = 0.1,
height_shift_range = 0.1,
shear_range = 0.1,
zoom_range = 0.1,
horizontal_flip = True
)The dataset was then loaded using flow_from_directory for automatic batching and class labeling during TensorFlow Keras model training.
train_generator = train_datagen.flow_from_directory(
'processed_images/train',
batch_size = 32,
class_mode = 'categorical',
target_size = (150, 150)
)4. Model Architecture and TrainingThe cataract classification model was developed using TensorFlow Keras with a lightweight Convolutional Neural Network (CNN) architecture optimized for embedded deployment on Raspberry Pi hardware. The model uses multiple convolutional layers with ReLU activation functions to extract visual features from eye images, followed by max pooling layers for dimensionality reduction.
To improve model stability and reduce overfitting, Batch Normalization and Dropout layers were applied throughout the network architecture. Fully connected dense layers were added at the final stage to perform binary classification between cataract and normal eye conditions.
model = Sequential()
model.add(tf.keras.layers.InputLayer(input_shape=(150, 150, 3)))
model.add(Conv2D(filters=64, kernel_size=(3, 3), activation='relu'))
model.add(Conv2D(filters=64, kernel_size=(3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(BatchNormalization())
model.add(Dropout(0.3))The model was compiled using the Adam optimizer with binary crossentropy as the loss function and accuracy as the evaluation metric.
model.compile(
optimizer='adam',
loss='binary_crossentropy',
metrics=['accuracy']
)Several training callbacks were implemented to improve training efficiency and model performance, including ReduceLROnPlateau for adaptive learning rate adjustment and EarlyStopping to prevent overfitting by restoring the best model weights.
reduce_lr = ReduceLROnPlateau(
monitor='val_loss',
factor=0.2,
patience=5,
min_lr=0.001
)
early_stopping = EarlyStopping(
monitor='val_loss',
patience=10,
restore_best_weights=True
)The model was trained for up to 50 epochs using the prepared training and validation datasets in Google Colab.
history = model.fit(
train_generator,
validation_data=validation_generator,
epochs=50,
callbacks=[reduce_lr, early_stopping, callbacks]
)The trained TensorFlow Keras model was evaluated using a confusion matrix to analyze the classification performance between the Cataract and Normal classes. The evaluation results indicate that the model was able to classify most eye images correctly while maintaining balanced performance across both categories.
The confusion matrix visualization shows the distribution of correct and incorrect predictions generated during testing. This evaluation helps measure the reliability of the lightweight CNN model before deployment on Raspberry Pi hardware for real-time cataract pre-screening.
The evaluation results demonstrate that the model is capable of performing cataract classification with stable prediction behavior while remaining lightweight enough for embedded edge AI deployment.
5. Model Deployment on Raspberry PiAfter the training process was completed in Google Colab, the trained TensorFlow Keras model was exported in .h5 format for deployment on the Raspberry Pi.
model.save('cataract_detection_model.h5')The exported model file was then transferred to the Raspberry Pi and loaded locally for real-time cataract inference using TensorFlow Keras.
model = load_model("cataract_detection_model.h5")6. Web-based Interface DevelopmentA lightweight web-based interface was developed using Flask to simplify interaction between users and the ASTRA OS device running on the Raspberry Pi. The interface can be accessed directly through a desktop browser connected to the same local network, enabling practical and user-friendly operation without requiring additional software installation.
The ASTRA OS interface was developed using lightweight web and computer vision technologies to support real-time cataract screening on Raspberry Pi hardware. The system was designed to provide responsive local access while maintaining efficient offline operation.
- Flask: Local web server framework for handling routing, AI inference requests, and browser communication.
- HTML/CSS: Frontend interface for displaying the live camera feed and screening results.
- OpenCV: Real-time camera streaming and image processing on the Raspberry Pi.
The ASTRA OS web interface was developed using Flask, OpenCV, and TensorFlow Keras to enable real-time cataract pre-screening directly on Raspberry Pi hardware. The system operates through a local Flask server that manages camera streaming, image capture, AI inference, and result visualization through a desktop-accessible browser interface.
The workflow begins when the user accesses the ASTRA OS interface through a desktop browser connected to the Raspberry Pi local network. Flask handles all routing and communication between the frontend interface and backend AI pipeline.
OpenCV continuously captures frames from the connected camera module and streams them in real time through the /video_feed endpoint. Each frame is processed using Haar Cascade classifiers for face and eye detection. After detecting the eye region, the system extracts the Region of Interest (ROI) from the upper facial area for cataract analysis. The extracted eye image is then preprocessed by resizing it to 150 × 150 pixels, normalizing pixel values, and converting the image into a TensorFlow-compatible input tensor.
The model performs local inference and generates a prediction between Normal and Cataract classes along with a confidence score. The prediction result is then returned through Flask as a JSON response and displayed on the desktop web interface.
The ASTRA OS web application was developed using Flask with a structured project organization to separate backend processing, frontend interfaces, AI models, and captured image storage. This structure simplifies system maintenance, deployment, and integration on Raspberry Pi hardware.
astra/
├── static/
│ ├── asset/
│ └── captures/
├── templates/
│ ├── index.html
│ ├── live.html
│ └── result.html
├── app.py
└── cataract_detection_model.h5Main Structure Description
- static: Stores application assets and captured eye images.
- templates: Contains Flask HTML pages for the dashboard, live monitoring, and result display.
- app.py: Main Flask application that handles camera streaming, image processing, AI inference, and routing.
- cataract_detection_model.h5: Trained TensorFlow Keras model used for cataract classification on Raspberry Pi.
Dashboard Interface
The dashboard serves as the main landing page of ASTRA OS. This interface provides system navigation and introduces the user to the cataract screening workflow. The page was designed with a simple and responsive layout to improve usability during deployment on Raspberry Pi devices.
Live Detection Interface
The live detection page provides real-time camera monitoring using OpenCV streaming integrated with Flask. Users can view the live camera feed, monitor eye positioning, and capture images for cataract screening. Haar Cascade face and eye detection are performed continuously before image acquisition.
To improve usability and simplify operation during real-time screening, image capture can be triggered either by pressing the capture button on the interface or by pressing the “0” key on the keyboard for faster hands-free interaction during testing and monitoring.
Result Interface
The result page displays the captured eye image along with the AI prediction result generated by the TensorFlow Keras model. The interface presents the classification output between Normal and Cataract, including the confidence score from the inference process.
An online demonstration version of the ASTRA OS interface was also developed to showcase the system workflow and user experience through a web browser environment.
This demo version was created for presentation and demonstration purposes only.
The actual ASTRA OS system is designed to operate locally on Raspberry Pi hardware using a Flask-based local server architecture. Running the system locally provides several advantages, including lower latency, offline accessibility, improved reliability in low-connectivity environments, and better privacy protection since medical image data remains on-device without cloud transmission.
9. Enclosure & Mechanical Design (additional)To improve portability and hardware integration, an enclosure system was implemented for the ASTRA OS device. A dedicated Raspberry Pi enclosure was used to protect the SBC hardware and provide a cleaner overall system assembly during operation.
In addition, a custom camera holder was designed to securely position the camera module for stable eye image acquisition during cataract screening. The holder helps maintain consistent camera alignment and improves usability during real-time monitoring.
The ASTRA OS system was evaluated through both AI model training validation and real-time hardware performance testing on Raspberry Pi hardware. The evaluation process focused on measuring model learning behavior, inference responsiveness, and SBC resource utilization during offline cataract screening.
AI Model Evaluation
The TensorFlow Keras CNN model was trained for up to 50 epochs using the prepared cataract image dataset in Google Colab. During training, the model demonstrated progressive learning improvements, with training accuracy increasing steadily throughout the training process.
The model achieved training accuracy above 84%, indicating that the CNN architecture was capable of learning relevant visual features associated with cataract detection while remaining lightweight enough for embedded deployment.
To improve model stability and reduce overfitting, the training process utilized:
- Data augmentation
- Batch normalization
- Dropout regularization
- Early stopping
- Adaptive learning rate reduction
The final trained model was successfully deployed and executed on Raspberry Pi hardware for real-time offline inference.
Hardware Performance Testing
Hardware testing was performed directly on the Raspberry Pi to evaluate inference speed, system responsiveness, temperature stability, and resource utilization during real-time cataract screening.
The testing results showed that ASTRA OS was capable of maintaining stable real-time performance with:
- Average inference time between 170–230 ms
- Real-time processing at approximately 24–26 FPS
- Stable operating temperature around 54–56°C
- Low standby CPU utilization
- Efficient memory consumption during inference
These results indicate that the lightweight TensorFlow Keras model can operate efficiently on SBC hardware while maintaining responsive real-time cataract pre-screening performance.
The overall evaluation demonstrates that ASTRA OS is capable of delivering practical offline cataract screening with lightweight AI inference, stable hardware operation, and responsive real-time performance on Raspberry Pi devices.
Pilot TestingThe pilot testing phase was conducted to evaluate the real-time functionality, usability, and hardware performance of the ASTRA OS system on Raspberry Pi hardware. The testing process involved live camera monitoring, eye detection, image capture, and offline AI inference using the deployed TensorFlow Keras model.
Potential ImpactASTRA OS has the potential to improve access to early cataract screening through a portable and affordable edge AI system running on Raspberry Pi hardware. By providing offline real-time screening, the system can help users perform preliminary eye assessments without depending on internet connectivity or expensive medical equipment.
The device can support rural clinics, community healthcare programs, and low-resource environments where access to ophthalmic screening services is still limited. Its lightweight and easy-to-use design also allows healthcare workers to perform rapid cataract pre-screening more efficiently.
Limitations & Challenges- Limited dataset diversity may affect model generalization across different eye conditions and image variations.
- Lighting conditions and camera positioning can influence image quality and prediction consistency.
- Raspberry Pi hardware limitations restrict the use of larger and more computationally intensive AI models.
- Real-time performance depends on camera stability and environmental conditions during image capture.
- The system is designed for preliminary cataract pre-screening and does not replace professional medical diagnosis.
- Improve camera optics and illumination for more consistent eye image acquisition.
- Add alignment assistance features to help users position their eyes more accurately during screening.
- Expand the dataset with more diverse ophthalmic images to improve model accuracy and generalization.
- Develop mobile application integration for easier monitoring and accessibility.
- Optimize and evaluate more advanced lightweight AI models for better real-time performance on SBC hardware.
- Add screening history and data logging features for healthcare monitoring purposes.
ASTRA OS demonstrates how edge AI and Single Board Computer technology can be integrated into a compact and affordable cataract pre-screening system. By combining Raspberry Pi hardware, TensorFlow Keras-based AI inference, OpenCV image processing, and a Flask web interface, the system is capable of performing real-time offline cataract screening in a portable and user-friendly form.
The project shows that lightweight embedded AI solutions can support accessible preliminary eye health assessment, particularly in low-resource and connectivity-limited environments. Through its offline capability, responsive performance, and practical deployment design, ASTRA OS aims to contribute toward more accessible and efficient preventive ophthalmic screening.
We believe that quality education and healthcare are fundamental rights for everyone. Through ASTRA OS, we hope technology can help bridge accessibility gaps and support broader access to early eye health screening, especially for communities with limited medical resources and infrastructure.
SEE YOU ON THE NEXT PROJECT! :)








_oEIHZUR32Y.jpg)




Comments