network_analyzer / README.md
devansh152's picture
Update README.md
ff8599b verified
|
raw
history blame
2.54 kB

๐Ÿงฌ 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 .env file:
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