An API for ocular disease detection from fundus images using a deep learning model.
Eyesense is a machine learning project that leverages a pre-trained Xception model to analyze eye fundus images and predict the likelihood of various ocular diseases. The project is exposed as a RESTful API built with FastAPI.
The primary goal is to provide a tool that can serve as a preliminary diagnostic aid, capable of identifying conditions such as cataracts, glaucoma, diabetes-related retinopathy, and more.
- AI-Powered Predictions: Utilizes a deep learning model for accurate disease classification.
- RESTful API: A clean, fast, and documented API for easy integration.
- Dockerized: Containerized for consistent deployment and scalability.
- Cloud-Integrated: Downloads the trained model from Google Cloud Storage on startup.
- Backend: FastAPI, Uvicorn
- ML/DL: TensorFlow, Keras, Scikit-learn, Numpy
- Image Processing: OpenCV, Pillow
- Deployment: Docker, Google Cloud Storage
- Testing: Pytest, HTTPX
- Linting: Flake8
These instructions will help you set up a local copy of the project for development and testing.
- Python 3.10
- Docker
- Google Cloud SDK (for authentication to GCS)
Follow these steps to set up the development environment:
1️⃣ Clone the repository:
git clone https://github.com/caazzi/eyesense.git
cd eyesense2️⃣ (Optional) Create a virtual environment:
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows3️⃣ Install dependencies:
pip install -r requirements.txt4️⃣ Run the Streamlit app:
streamlit run app/app.pyThe application will open in your default browser.
To ensure the project is working correctly, run the test scripts using:
pytest tests/These tests verify the entire workflow, from uploading an image to receiving a prediction.
Example:
def test_prediction():
img = load_test_image("data/example_images/eye.jpg")
result = model.predict(img)
assert result is not NoneTo maintain clean and consistent code formatting, use Flake8:
flake8 app/ --max-line-length=120To deploy the application on a live server, follow these steps:
- Ensure all dependencies are installed in the production environment.
- Run
streamlit run app/app.pyinside a cloud server or container. - Configure Streamlit sharing or deploy using services like Heroku, AWS, or Google Cloud.
- TensorFlow/Keras - Machine learning framework
- Streamlit - Web application framework
- OpenCV - Image processing library
Please read COLLABORATION.md for details on our code of conduct and submission guidelines.
Claudio Azzi - @caazzi
Erika Chang - @erika-chang
George Silva - @gbs1234
Joao Sales - @masalesvic
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Thanks to the open-source community for their amazing tools 🔧
- Shoutout to researchers advancing AI in healthcare 📢
- Special thanks to contributors & testers 🫂