Spaces:
Sleeping
Sleeping
๐งฌ Biological Network Analyzer
An intelligent assistant for analyzing biological networks from text or image input. This app can extract reaction networks from uploaded diagrams using Gemini Vision API, parse them into graph structures, and generate:
- ๐ ODEs (Ordinary Differential Equations)
- ๐งฎ Jacobian matrices
- ๐ Cyclic dependency checks
- ๐ Graph stats (edges, variables)
All via a Gradio-based conversational interface.
๐ Features
- ๐ค Text input (e.g.
A + B -> C, C <-> D) - ๐ผ๏ธ Image input (upload scanned or digital diagrams)
- ๐ง Google Gemini API integration to extract text-based reactions from images
- ๐งช ODE system generation using mass-action kinetics
- ๐ง Jacobian matrix computation via symbolic algebra (SymPy)
- ๐ Cycle detection and variable/edge counting
- ๐ค LLM-based fallback Q&A via
flan-t5-base - ๐จ Customizable Gradio theme (e.g.
Soft,Glass, etc.)
๐งฐ Tech Stack
| Component | Technology |
|---|---|
| Frontend UI | Gradio |
| LLM Query | Flan-T5 |
| Image-to-Text | Gemini API (Vision multimodal API) |
| Graph Parsing | NetworkX |
| Symbolic Math | SymPy |
๐ฅ๏ธ Running the App on your device
โ Prerequisites
- Python โฅ 3.8
- Install dependencies:
pip install gradio transformers networkx sympy google-generativeai python-dotenv pillow
- Set your Gemini API key in a
.envfile:
GEMINI_API=your_api_key_here
โถ๏ธ Run
python your_script.py
Or use inside a Google Colab notebook for instant testing.
๐ท Example Inputs
Text:
A + B -> C, C <-> D, D -> E
Image:
- Upload PNG or JPG of a biological reaction network
- Gemini will parse it automatically
๐ Future Additions
- Export ODEs/Jacobian as LaTeX/PDF
- Stoichiometry & reaction rate customization
๐งโ๐ฌ Author
Built by [Devansh] for a project on LLM-based Equation Discovery from Biological Networks.
๐ License
MIT License
title: Network Analyzer emoji: ๐ฆ colorFrom: green colorTo: green sdk: gradio sdk_version: 5.35.0 app_file: app.py pinned: false
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference