This project is organized into modular components for easy reuse and development of different neural network applications.
The core neural network implementation that can be used as a foundation for any pattern recognition task.
Contents:
NeuralNet.py- The foundational neural network with forward/backpropagationREADME.md- Documentation for the foundational network.gitignore- Version control configuration
Use this when: You want to build a new neural network application from scratch.
A complete medical diagnosis system built on top of the foundational neural network.
Contents:
- All medical diagnosis source files (20+ files)
- Training architecture diagram
- Complete documentation
- Demo scripts
- Requirements file
Use this when: You want to run or extend the medical diagnosis system.
- Copy the
foundational_brainfolder - Rename it to your project (e.g.,
image_recognition_model) - Import and extend the base neural network:
from NeuralNet import initialize_network, train_network
- Navigate to
medical_diagnosis_model/ - Create virtual environment and install dependencies
- Run
python enhanced_medical_system.py
Each folder is self-contained with all necessary dependencies:
# Work on medical diagnosis
cd medical_diagnosis_model/
python enhanced_medical_system.py
# Start a new project
cp -r foundational_brain/ my_new_model/
cd my_new_model/
# Begin development...PythonNeuralNet/
├── foundational_brain/ # Core neural network
├── medical_diagnosis_model/ # Medical application
└── future_model/ # Your next project
This modular structure allows you to:
- Keep models separate and organized
- Reuse the foundational code
- Develop multiple applications in parallel
- Easily share specific models without unnecessary files
medical_diagnosis_model/
backend/
app.py # FastAPI app: /api/v2/diagnose, /export, /adaptive/*
security/jwt_dep.py # OIDC/JWT scaffold (feature-flagged)
selector/eig_selector.py # EIG ranking util (math-only)
configs/
clinical_schema.yaml # Clinical data mappings (scaffold)
training.yaml # Training/optimizer toggles (scaffold)
data/
case.schema.json # JSON Schema for clinical cases
dictionaries/ # Canonical symptoms/diseases
samples/ # Example JSONL dataset
validate_cases.py # Schema validator CLI
tests/
test_api_phase1.py # API TestClient expected primaries
test_selector.py # EIG selector unit test
phase_1_backend/ # cURL-based test harness & outputs
tools/
sanity.py # Modular sanity CLI (data/tests/api/export/rate/adaptive/suite)
versions/
v1/, v2/ # Model implementations and demos
exports/ # Generated reports (gitignored)
models/ # Saved models (dev artifacts)
diagnosis_history/ # Session logs (gitignored)
README.md # Usage + Auth
NEXT_STEPS.md # Roadmap & acceptance criteria
-
Completed
- Data scaffolding:
data/case.schema.json,data/dictionaries/*,data/samples/*,data/validate_cases.py - Backend phase 1:
/diagnose,/exportendpoints; CORS; API key auth; request logging; rate limiting - Security scaffold: OIDC/JWT dependency (
backend/security/jwt_dep.py) behindMDM_AUTH_MODE=oidc - CI: GitHub Actions runs dataset validation and unit tests via sanity CLI
- Adaptive (alpha):
/api/v2/adaptive/{start,answer,finish}+ EIG selector; sanity CLI coverage
- Data scaffolding:
-
Pending (next)
- Synthetic generator → emit JSONL to schema (
medical_training_generator.pyrefactor) - Golden set (100 curated cases) with rationale/certainty
- Data quality tests (sanity rules, leakage, balance) and
DATA_CARD.md - Metrics & calibration module (AUROC/AUPRC/F1, reliability/ECE)
- Batch scoring CLI (
backend/tools/batch) and outputs - Adaptive end-to-end unit tests (FastAPI TestClient)
- RAG PoC (knowledge/, index/, retriever/generator)
- Frontend adaptive mode; persistence/workers; deployment
- Synthetic generator → emit JSONL to schema (
# From medical_diagnosis_model/
python tools/sanity.py data
python tools/sanity.py tests
python tools/sanity.py api --auto-start --api-key devkey
python tools/sanity.py export --auto-start --api-key devkey
python tools/sanity.py rate --auto-start --api-key devkey --count 140 --expect-over-limit
python tools/sanity.py adaptive --auto-start --api-key devkey
python tools/sanity.py suite --auto-start --api-key devkey --with-api --with-export --with-rate --with-adaptive