📷 Identify 📚 Library 🗺 Map 📓 Journal 📄 Docs ℹ About
huggingface-expert · Claude Code Skill

The Botanical Intelligence Pipeline

End-to-end ML inference for plant identification, medical entity extraction, chemical compound detection, and evidence-based Q&A — entirely local, entirely private.

6 ML Models
14k Plant Species
41 Entity Types
100% Local
01

The Pipeline

Five-stage inference chain from photograph to evidence-backed botanical report.

Concept Architecture
📷
Photo Input
Camera / upload
344 MB
🌿
Plant ID
PlantNet ViT
image-classification
713 MB
Medical NER
41 entity types
token-classification
6.3 GB
📚
BioGPT QA
PubMed evidence
text-generation
Results
Species + entities
+ evidence report
BPMN 2.0 Process Diagram
USER INPUT INFERENCE GATE Start ? Image? Identify Plant PlantNet ViT yes Enter Plant Name manual input no KB Lookup herb_library.py Medical NER 41 entity types BioGPT Evidence PubMedQA check_resources.py RAM + disk + model size gate GREEN YELLOW RED = HALT End
Model task Decision / gate Sequence flow Resource check
02

Models

Six components — five ML models and one safety gate script.

Vision 344 MB

PlantNet ViT

janjibDEV/vit-plantnet300k

Vision Transformer trained on the Pl@ntNet-300K dataset. Identifies approximately 14,000 plant species from photographs with high accuracy.

image-classification Apache-2.0
NER 713 MB

Medical NER

blaze999/Medical-NER

Extracts 41 medical entity types from text: medications, diseases, dosages, procedures, lab values, and more.

token-classification MIT
Chemistry 290 MB

ChemicalDetect

OpenMed/ChemicalDetect

Identifies active chemical compounds and molecular entities in botanical and pharmacological text descriptions.

token-classification Apache-2.0
QA 6.3 GB

BioGPT PubMedQA

microsoft/BioGPT-Large-PubMedQA

Large language model fine-tuned on PubMed literature. Answers yes/no/maybe questions about clinical evidence for herbal compounds.

text-generation MIT
NER 508 MB

Biomedical NER

d4data/biomedical-ner-all

General-purpose biomedical named entity recognition. Extracts diseases, chemicals, genes, species, and cell types from literature.

token-classification Apache-2.0
Safety Script

Resource Gate

scripts/check_resources.py

The load-bearing rule. Every model download and every model load MUST pass through this gate. Returns green, yellow, or red based on available RAM and disk space.

check_resources.py Never bypassed
03

Herb Index

Reference catalogue of key medicinal herbs supported by the pipeline.

🌿

Stinging Nettle

Urtica dioica
Leaves, root, seeds
BPH/prostate support, seasonal allergies, anti-inflammatory, iron-rich nutritive tonic.
quercetin, beta-sitosterol, scopoletin, histamine
🌼

Chamomile

Matricaria chamomilla
Flower heads
Sleep aid, anxiety relief, digestive calming, anti-inflammatory skin wash.
apigenin, bisabolol, chamazulene, matricin
🌻

Dandelion

Taraxacum officinale
Root, leaves, flowers
Liver tonic, gentle diuretic, digestive bitter, blood sugar support.
taraxacin, inulin, luteolin, chicoric acid
🍇

Elderberry

Sambucus nigra
Berries, flowers
Cold and flu remedy, immune support, antiviral activity, fever reduction.
anthocyanins, quercetin, rutin, sambucol
🎵

Valerian

Valeriana officinalis
Root
Insomnia treatment, anxiety reduction, muscle relaxant, nervous system sedative.
valerenic acid, isovaleric acid, GABA modulation

St John's Wort

Hypericum perforatum
Flowering tops
Mild-to-moderate depression, nerve pain, wound healing, antiviral.
hypericin, hyperforin, flavonoids, xanthones

Yarrow

Achillea millefolium
Aerial parts, flowers
Wound staunching, fever management, digestive aid, menstrual regulation.
achilleine, azulene, camphor, tannins
🍃

Plantain

Plantago major
Leaves, seeds
Wound poultice, insect bite relief, cough and bronchial support, drawing agent.
aucubin, allantoin, mucilage, tannins

Hawthorn

Crataegus monogyna
Berries, leaves, flowers
Heart tonic, blood pressure regulation, circulatory support, antioxidant.
vitexin, oligomeric proanthocyanidins, quercetin
🌴

Saw Palmetto

Serenoa repens
Berries
BPH/prostate support, 5-alpha reductase inhibition, urinary flow improvement.
fatty acids, phytosterols, beta-sitosterol, lauric acid
04

Usage Guide

How to invoke the pipeline via Claude Code, CLI scripts, or direct Python.

Via Claude Code

Ask Claude Code in natural language. The skill auto-discovers, gates, downloads, and runs the right model.

natural language
# Identify from a photo
"Identify this herb from my photo at ~/garden/IMG_4021.jpg"

# Look up medicinal properties
"What are the medical uses of stinging nettle?"

# Run full pipeline on a name
"Run the herb pipeline on Matricaria chamomilla"

# Evidence-based question
"Is there clinical evidence for valerian treating insomnia?"

Herb Pipeline Direct

Call the herb pipeline script directly for batch or automated processing.

bash
# Full pipeline: identify + NER + evidence
.venv/bin/python3 scripts/herb_pipeline.py \
  --image ~/photos/herb.jpg

# Pipeline from name (skip image classification)
.venv/bin/python3 scripts/herb_pipeline.py \
  --name "Urtica dioica"

# Output as JSON
.venv/bin/python3 scripts/herb_pipeline.py \
  --name "chamomile" --json

Individual Scripts

Each pipeline stage is a standalone script you can invoke independently.

bash
# Search HuggingFace Hub
.venv/bin/python3 scripts/search.py "medical NER"

# Inspect a model's metadata
.venv/bin/python3 scripts/inspect.py blaze999/Medical-NER

# Gate check before download
.venv/bin/python3 scripts/check_resources.py --model-size 713

# Download a model
.venv/bin/python3 scripts/download.py blaze999/Medical-NER

# Run inference
.venv/bin/python3 scripts/run.py blaze999/Medical-NER \
  --text "Nettle leaf extract 500mg daily"

Installation

Bootstrap the environment and run a smoke test.

bash
# 1. Clone or enter the project
cd bacon-ai-huggingface

# 2. Run the installer (creates .venv, installs deps)
bash install.sh

# 3. Smoke test: medical NER demo
bash examples/medical_ner_demo.sh

# 4. Verify the venv
.venv/bin/python3 -c "import transformers; print('OK')"

Resource Gate — The Load-Bearing Rule

Every download and every model load must pass through scripts/check_resources.py first. The gate returns one of three verdicts: GREEN (proceed), YELLOW (warn, allow with caution), or RED (halt, insufficient resources). This rule is never bypassed without explicit user authorisation.