Final pipeline: 248/248 frames solved, refusal-retry, 27x faster search
Bring the portfolio up to the final thesis pipeline and results:
- Refusal-retry with significance-aware stopping (inference_full –retries), recovering every first-attempt refusal.
- Neighbour-list third-star search (triangle_id), 27x faster star identification with identical results on all 248 evaluation frames.
- Results for the 120-frame test split (120/120, median 7.79”) and 128 frames from 8 unseen sectors (128/128, median 7.33”), 0 false locks, with per-frame CSVs and metrics generated by summarize_results.py.
- Fix the CD de-rotation: for TESS (det CD > 0) the rotation angle is atan2(CD21 - CD12, CD11 + CD22). The previous angle doubled the rotation instead of removing it, so the roll parameter moved the sky in the wrong sense and inflated the reported errors (e.g. 8.98” instead of the true value). New test checks every pose parameter against the rigid sky rotation of the synthesized WCS. The legacy conversion script is removed.
- Regenerated demo artefacts (16/16, median 6.93”), figures, README, RESULTS and PROJECT_DESCRIPTION.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Star Tracker: lost-in-space spacecraft attitude from real NASA TESS images
Given one photo of the sky and nothing else, which way is the spacecraft pointing? This project answers that on real images taken in orbit by NASA’s TESS satellite, with no initial guess, no gyroscope and no star labels. A U-Net finds the stars and measures their positions to a fraction of a pixel. Classical geometry (triangle matching, RANSAC, Wahba’s problem, plate solving) then works out the full 3-axis attitude. Every answer is checked, so the system either returns the right answer or refuses.
🎯 Try the live interactive demo →
Walks through every pipeline stage with the real numbers (detections, triangle, plate solve, quality gate, final attitude) on 16 TESS images. Replay mode renders in about 5 seconds; Live mode runs the full search.
Results
End-to-end lost-in-space attitude on 248 real TESS frames: the held-out test split, plus 8 TESS sectors that played no part in training or model selection.
Per-frame results for all 248 frames are in
Results/full_test_per_frame.csvandResults/unseen_sectors_per_frame.csv. The summary metrics are infull_test_metrics.jsonandunseen_sectors_metrics.json. More tables are in RESULTS.md.How it works
The neural network only does step 1. Everything after it is geometry that can be checked, which is why a wrong identification cannot slip through quietly.
Engineering highlights
1. Learned detection improves accuracy through centroid precision. With everything else held fixed and true star matches supplied, swapping the classical peak finder for the U-Net improves the attitude error from 6.0″ to 4.6″ (23% better). The gain comes from more precise star positions, not from finding more stars.
2. Found and fixed a failure mode that only appears on real data. At first, 7 of the 248 frames were refused. In every case the search had locked onto a false pattern in Carina, the densest part of the Milky Way, where random stars line up by chance. The quality gate caught all 7 (residuals of 9–12 px against 0.1–0.2 px for correct answers), so no wrong attitude was returned. Diagnosis showed that the true answer would have scored more matches. The search had stopped too early because it counted raw matches. The fix compares each candidate with the number of matches expected by chance in that part of the sky: every correct lock is at least 7.4× above chance, and every false one is at most 3.6×. With a 5× threshold, all 7 frames are recovered at the first retry with normal accuracy (0.13–0.17 px residual).
3. Lens distortion matters at the edge of a 12° field. A plain pinhole model hid 200–1000″ residuals at the field corners, because TESS needs a 6th-order SIP distortion polynomial. With known star matches the error looked fine (4.6″), but the blind pipeline failed on every image. Applying the SIP correction before projection fixed it.
4. 27× faster star identification, identical results. Profiling showed that almost all the time went into searching the catalogue for the third star of each triangle, not into the neural network. Restricting that search to precomputed neighbour lists cut the median frame time from 211 s to 9.4 s. All 248 frames return the same attitude, the same number of iterations and the same number of attempts as before.
5. Tested the textbook extra check and reported what it actually did. The classic Pyramid 4th-star check changed nothing on clean frames (117–118 / 120 in every variant), and the textbook version would have vetoed 69% of true triangles. It only helps when many false stars are injected (+12 frames at +0.5× contamination), and it never prevents a false lock that the residual gate would not already catch.
Detector comparison
Centroid quality with known star matches (
--use-gtprotocol, 120 test images):HRNet comes within 0.2″ of the U-Net with half the parameters, which suggests that detector architecture is not the main accuracy bottleneck.
Try it
Requires Python ≥ 3.10.
Interactive Streamlit walkthrough
Opens at http://localhost:8501. Pick one of the 16 bundled TESS images and press Run pipeline. Every stage shows its real intermediate values: body vectors, the triangle-angle table, plate-solve iterations, and the final attitude compared with the reference.
End-to-end batch run
This writes one JSON file per image and prints the solve rate and error statistics. On the bundled 16-frame demo set it solves 16 / 16, median 6.93″, with 0 false locks.
--retries 0turns off the refusal-retry.Visualisations
Tests
The tests cover the attitude geometry (including a check that every pose parameter moves the sky exactly as the scored rotation says), the published result tables, and the Streamlit replay. They run on every push in GitHub Actions.
Repository layout
The full 800-image dataset, the FITS archives and the HRNet weights stay with the research project. This repository carries what is needed to run the demo, read the code and audit the published numbers.
Tech stack
ML: PyTorch (U-Net and HRNet heatmap regression, weighted-MSE loss, sub-pixel centroiding). Geometry: NumPy, SciPy (SVD, nonlinear least squares), quaternions, gnomonic projection. Astronomy: Astropy (FITS, WCS, SIP distortion), Hipparcos catalogue. Algorithms: RANSAC, Wahba’s problem, triangle matching with chirality check, significance-aware stopping. Tooling: Streamlit, Matplotlib, pytest, GitHub Actions, SLURM GPU cluster.
Limitations
Acknowledgements
NASA’s TESS mission and the TICA team for the public full-frame images. ESA’s Hipparcos mission for the reference star catalogue.
Author
Temur Kuchkorov, Master’s thesis project, 2025–2026. Email · LinkedIn
License
MIT, see LICENSE.