AEGIS — Predicting Shortages. Optimizing Supply. Explaining Every Decision.

Inspiration

In a healthcare supply emergency, the problem is not always that resources do not exist. Sometimes, resources are available but distributed inefficiently.

One hospital may face an urgent shortage while another has sufficient inventory. A warehouse may have available supplies but limited transportation capacity. Even when a logistics coordinator knows where supplies are needed, deciding how to distribute scarce inventory fairly across an entire network is mathematically challenging.

We built AEGIS (Adaptive Emergency Governance & Intelligent Supply) to explore a central question:

What if emergency supply allocation could be predictive, mathematically optimized, and explainable — rather than purely reactive?

AEGIS is a decision-support prototype that forecasts medical consumable demand, evaluates supply constraints, optimizes distribution, and explains the resulting decisions through an interactive web application.

What It Does

AEGIS models a synthetic regional healthcare supply network consisting of:

  • 20 healthcare facilities across four clinical-priority tiers.
  • 3 regional warehouses supplying the network.
  • 3 medical consumable categories.
  • 60 potential warehouse-to-hospital transportation corridors.

Its workflow combines four capabilities.

1. Predict demand before shortages occur

AEGIS uses XGBoost forecasting models and historical demand features to estimate future medical supply requirements.

Rather than relying exclusively on a single prediction, the system also displays uncertainty intervals, helping users understand where future demand may vary.

2. Optimize scarce resources

AEGIS uses mathematical optimization to determine how inventory should be allocated across facilities while accounting for:

  • Available warehouse stock.
  • Vehicle carrying capacity.
  • Transportation constraints.
  • Shipment and route costs.
  • Clinical-priority shortage penalties.
  • Minimum service coverage requirements.

Its two-stage stochastic mixed-integer linear programming model evaluates demand uncertainty across multiple scenarios.

The system also supports deterministic optimization and heuristic allocation baselines for comparison.

3. Explain the decisions

An optimization result is only useful when decision-makers can understand it.

AEGIS provides two distinct forms of explainability:

Forecast explainability: TreeSHAP identifies which model features influence predicted demand.

Allocation explainability: Constraint-based diagnostics explain why shipments are assigned to particular facilities, including inventory limitations, route costs, and service coverage requirements.

An optional grounded AI narrative layer translates verified model outputs into readable explanations. When an external AI provider is unavailable, deterministic explanations remain accessible.

4. Test disruptions before they happen

AEGIS includes an interactive Scenario Lab and Stress Testing workspace.

Users can simulate conditions such as:

  • Sudden increases in medical supply demand.
  • Warehouse inventory losses.
  • Reduced transportation capacity.
  • Vehicle payload restrictions.
  • Stricter minimum service coverage requirements.

The application then evaluates how these changes affect allocation feasibility, shortages, transportation requirements, and modeled costs.

How We Built It

AEGIS combines machine learning, operations research, and full-stack software engineering.

Machine learning: Python, XGBoost, pandas, NumPy, and scikit-learn support demand forecasting, feature engineering, and model evaluation.

Optimization: SciPy's HiGHS mixed-integer programming solver powers deterministic and two-stage stochastic resource allocation.

Explainability: SHAP explains forecasting outputs, while optimization-specific diagnostics describe resource allocation decisions.

Backend: Python APIs expose network data, forecasts, optimization runs, and explanations.

Frontend: Next.js, React, TypeScript, and interactive SVG visualizations provide a responsive decision-intelligence workspace.

Verification: Automated tests, numerical checks, benchmark audits, and browser-based end-to-end testing help validate the implementation.

The network uses synthetic facility data and illustrative coordinates. We deliberately present it as a synthetic network rather than misrepresenting it as real hospital geography.

Results and Evidence

We compared AEGIS's two-stage stochastic optimization against deterministic optimization, demand-priority greedy allocation, and proportional rationing.

On the previously audited 16 common-feasible synthetic benchmark instances, the mean modeled objective values were:

Allocation policy Mean modeled objective
Two-stage stochastic MILP $278,058
Deterministic MILP $448,459
Demand-priority greedy $458,674
Proportional rationing $467,643

These results represent a synthetic optimization objective, including modeled shortage penalties and logistics costs. They do not represent actual hospital expenditure or demonstrated real-world savings.

The comparison uses only instances where all four policies were feasible. Other experimental subsets and infeasible cases are documented separately to avoid misleading comparisons.

In the interactive application, users can inspect solver status, facility-level coverage, active transportation routes, allocation quantities, cost components, and model explanations.

Challenges We Faced

Making stochastic optimization mathematically correct

The optimization model needed to account for uncertain demand without allowing decisions made before uncertainty is revealed to depend on future information.

We addressed this through a two-stage formulation that separates initial allocation decisions from scenario-dependent shortage outcomes.

Comparing algorithms fairly

An early benchmark audit exposed an important issue: infeasible runs and unmatched experimental subsets could distort aggregate comparisons.

We corrected the evaluation methodology by distinguishing feasible instances, reporting matched comparisons, and explicitly documenting infeasibility.

This was one of the most valuable lessons of the project: an impressive metric is meaningless unless its evaluation methodology is defensible.

Explaining optimization without misusing SHAP

SHAP explains predictive model behavior, not the mathematical reasons behind an optimization decision.

We therefore implemented separate forecasting and allocation explanation mechanisms.

Building a usable interactive network

The application needed to display hospitals, warehouses, active routes, shortage risks, and selected facilities without overwhelming the user.

We built a responsive synthetic network map with facility selection, route highlighting, zooming, filtering, and synchronization across the dashboard and scenario tools.

Accomplishments We're Proud Of

  • Built an integrated forecasting and resource allocation system rather than an isolated machine learning model.
  • Implemented a two-stage stochastic optimization engine with explicit fairness and feasibility constraints.
  • Developed an interactive decision workspace with network maps, charts, and scenario controls.
  • Separated forecast explainability from optimization explainability.
  • Added reproducible stress tests and auditable scientific benchmarks.
  • Designed the application to remain functional without paid generative AI access.
  • Preserved human oversight: AEGIS recommends allocations but does not autonomously dispatch medical supplies.

What We Learned

AEGIS reinforced three important lessons.

First, prediction alone does not solve an operational problem. Forecasts become more valuable when they inform decisions under real constraints.

Second, optimization must account for fairness, feasibility, and uncertainty — not merely minimize a single cost figure.

Third, trustworthy AI requires more than accurate models. It requires reproducible evaluation, clear limitations, interpretable outputs, and meaningful human oversight.

What's Next

Our next steps are to:

  1. Validate the approach using authorized, real-world logistics datasets.
  2. Extend the network model to account for changing road availability and travel times.
  3. Explore robust optimization under more complex disruptions.
  4. Add role-based workflows and approval records for logistics coordinators.
  5. Evaluate the system with domain experts before any operational healthcare use.

AEGIS is currently a research and decision-support prototype built on synthetic data. It is not clinically validated and must not be used for real medical allocation without appropriate validation and oversight.

Our vision is to make complex emergency supply decisions more transparent, reproducible, and resilient.

Built With

Share this project:

Updates

Submission history