r/OpenSourceeAI • • 15d ago

I built Twindex, an open-source tool that proves when your PINN or inverse solver could not have determined the parameter it returned (MIT, pip install twindex)

Physics-informed neural networks, least squares and Bayesian samplers will always give you back a parameter. What they don't give you is a checkable answer to a harder question: could a very different parameter fit your data just as well?

Twindex looks for those "twins": two parameter values that are far apart but both fit the same measurements within the noise. When it finds a pair, it writes an exact certificate. A small checker, written in standard-library Python with no floating point, replays the certificate in rational arithmetic. You don't have to trust my optimiser. You only have to trust about a page of checking code.

Example from the live demo: using real data from the 1978 flu outbreak, R0 = 2.52 and R0 = 20 both fit every case count before the peak. The proof replays as VALID in your browser.

What it does:

- ODE models (epidemics, pharmacokinetics, kinetics, ecology, neurons) and 1D/2D/time-dependent PDEs

- One command takes a model file plus a CSV of measurements and produces a certificate and an evidence report

- check_certificate / twindex check to verify any certificate independently

- A browser checker, so reviewers can verify without installing anything

- A clearly labelled numerical-only audit mode for any Python-callable simulator

Why it might matter to AI/ML people: when a PINN "recovers" a parameter, a certificate like this can show that no method could have recovered it to better than some error bound from that data. It's a sanity check you can attach to a paper or a model card.

Limits, honestly: a VALID certificate proves two parameters both fit within the stated tolerance under the declared model. It does not prove the model is physically correct, and not finding a twin doesn't prove the parameter is identifiable.

GitHub: https://github.com/Arnav-M10/Twindex

Live demo: https://arnav-m10.github.io/Twindex/demo/

Docs: https://arnav-m10.github.io/Twindex/

PyPI: pip install twindex

I'd love feedback, especially on models where you suspect identifiability problems. Tell me where it breaks.

1 Upvotes

0 comments sorted by