Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Packing for a short window
Imagine taking thousands of photos on a trip but being allowed to upload only a few hundred each evening, through a slow connection that is open for ten minutes. You would delete the blurry and fogged-up ones, shrink the rest a little, and upload the best first. A satellite faces the same problem every orbit: the camera fills memory with images, many of them covered by cloud, and the radio link to the ground opens only briefly. Doing the sorting and shrinking onboard decides how much useful science actually gets down.
Near-lossless coding with an error bound of 4 DN: compression ratio 1.99, every pixel within 4 DN, mean NDVI error 0.0041. The sensor noise is 6 DN.
M4-5 study, seed 0: a quarter of the raw volume can be downlinked per pass. Lossless coding of busy 16 × 16 tiles gains only about a third, so the big wins come from deciding onboard what not to send (cloud screening) and from bounded-error compression; ranking by value per bit gets every fire down.
In Exercise 2, compression alone delivered about a third of a pass’s scientific value; screening, bounded-error compression and ranking by value per bit together delivered 96%.
- 1. The main bottleneck for many Earth-observation satellites is…
- 2. Images that are mostly cloud are usually…
- 3. Onboard processing helps by…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Downlink budget: the bits a satellite can send during its contacts with ground stations; often far below what its instruments produce.
- Cloud screening: classifying images or tiles as cloudy onboard so they can be discarded or deprioritized; by fixed spectral tests or learned models.
- Spectral indices: ratios of bands such as NDVI (vegetation) and NDSI (snow, which is bright in visible light but dark in the shortwave infrared).
- Lossless compression (CCSDS 121.0): predict each sample, map residuals to non-negative integers, and Rice-code them in small blocks.
- Near-lossless compression (CCSDS 123.0-B-2): quantize prediction residuals so that every sample is within a set error bound.
- Prioritization: ordering data for downlink by estimated value per bit; a knapsack problem.
- Single-event upset (SEU): a bit flipped in memory or a register by an energetic particle.
- Triple modular redundancy (TMR): keep three copies and take a bitwise majority vote; EDAC memories use error-correcting codes for the same purpose.
- 1. CCSDS 121.0 codes prediction residuals with…
- 2. Near-lossless compression guarantees…
- 3. Triple modular redundancy repairs an upset by…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.An onboard pipeline in miniature
Exercise 1.
- 16 × 16 tiles in four bands (blue, red, near infrared, shortwave infrared) stored as 12-bit numbers, with vegetation, soil and water, clouds of varying thickness, optional snow and occasional fires, plus 6 DN of sensor noise.
- A logistic-regression cloud screen on five tile features and a fixed rule (blue brighter than 0.4 and a snow index below 0.5).
- Rice coding of previous-pixel residuals, closed-loop near-lossless DPCM with error bound e, a shortwave-infrared fire test, and greedy selection by value per bit.
Practice.
- Validate onboard models on scenes they were not trained on: seasons, snow, deserts, sun glint; a learned screen can fail on a surface its fixed-rule ancestor handled.
- Set the compression error bound against the sensor noise, and check the products scientists compute (indices, detections), not only pixel error.
- Tune thresholds against the downlink budget, not for accuracy alone.
- Assume bits will flip: protect weights and parameters with error-correcting memory, redundancy and periodic scrubbing, and test the model with injected upsets.
- Keep the raw-data path: let the ground override screening and request anything still stored.
def near_lossless(x, e): # one row; error bound e
r = [x[0]]; q = []
for v in x[1:]:
d = v - r[-1] # predict from the RECONSTRUCTED value
k = sign(d) * ((abs(d) + e) // (2 * e + 1))
q.append(k); r.append(r[-1] + k * (2 * e + 1))
return r, q # q is Rice-coded- 1. A learned screen trained without snow should be checked…
- 2. A sensible near-lossless error bound is…
- 3. Model parameters in orbit should be…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Rice coding. A non-negative integer m is sent with parameter k as ⌊m/2ᵏ⌋ in unary, a stop bit, and its k low bits: ⌊m/2ᵏ⌋ + 1 + k bits. Rice codes are Golomb codes with a power-of-two parameter and are optimal for geometric distributions, which prediction residuals roughly follow; choosing k per block of 16 samples adapts to local activity. Signed residuals d are first mapped to m = 2d for d ≥ 0 and −2d − 1 for d below 0. A single edge in a block forces a large k for all its samples, which is why busy small tiles compress poorly.
Closed-loop near-lossless coding. Quantizing the residual d with step 2e + 1, q = sgn(d)⌊(|d| + e)/(2e + 1)⌋, leaves an error of at most e. Predicting from the reconstructed rather than the original previous sample keeps the decoder in step, so errors never accumulate along a row. Fewer distinct residual values mean shorter Rice codes; the gain grows slowly with e.
Screening. Fixed tests use physics: clouds are bright and white in visible bands, snow is bright in the visible but dark in the shortwave infrared. Thin clouds and bright surfaces break simple thresholds. Learned screens use more cues and are more accurate on familiar scenes, but they extrapolate unpredictably to surfaces absent from training.
Selection. With values vᵢ, sizes sᵢ and capacity C, choosing tiles to maximize total value is a 0/1 knapsack problem. Taking items in decreasing vᵢ/sᵢ is optimal when items may be split and close to optimal when items are small relative to C, as tiles are relative to a pass.
Radiation. An upset flips one bit. In a float32 parameter, a mantissa bit changes it by a relative amount of at most one half, and usually far less; an exponent bit can multiply or divide it by a huge factor. Majority voting over three copies corrects any number of flipped bits confined to one copy.
- 1. Rice code length for m with parameter k is…
- 2. Near-lossless coding predicts from reconstructed values so that…
- 3. Greedy selection by value per bit is optimal when…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.In one pass with a downlink for a quarter of the raw data volume, how much of the scientific value reaches the ground with compression alone, and how much with onboard screening and prioritization?
History.
- R. Rice (1979) at JPL developed the adaptive coding scheme that CCSDS standardized for lossless space data compression in 1997 (121.0); CCSDS 123.0 added predictive multispectral and hyperspectral compression in 2012 and a near-lossless mode in 2019.
- NASA’s EO-1 flew the Autonomous Sciencecraft Experiment from 2004 (S. Chien and colleagues): onboard classifiers spotted floods, fires and volcanic activity and replanned observations.
- Z. Zhu and C. Woodcock (2012) published Fmask, a widely used rule-based cloud mask for Landsat.
- ESA’s Φ-sat-1 (2020) ran a convolutional network on an Intel Myriad 2 to discard cloudy hyperspectral images onboard (G. Giuffrida and colleagues, 2021). On Mars, AEGIS selects rock targets for the rovers’ instruments without waiting for the ground (R. Francis and colleagues, 2017).
Exercise 2.
- The screen is trained on 2,000 tiles; a pass captures 2,000 new tiles, and the downlink can carry 25% of their raw volume (12,288 bits each).
- Value: 1 for a mostly clear tile, 0 for a mostly cloudy one, 20 for a tile with a fire. Tiles are sent in capture order except by the knapsack strategy, which ranks by estimated value per bit.
Seed 0 (total value 2,148: 1,008 clear tiles and 57 fires; screen accuracy 0.980):
| strategy | tiles sent | clear tiles | fires | value | share |
|---|---|---|---|---|---|
| raw, in order | 500 | 277 | 13 | 530 | 0.247 |
| lossless, in order | 668 | 366 | 16 | 677 | 0.315 |
| cloud screening + lossless | 658 | 629 | 31 | 1,231 | 0.573 |
| screening + near-lossless e = 4 | 968 | 922 | 50 | 1,894 | 0.882 |
| value per bit (knapsack) | 985 | 959 | 57 | 2,067 | 0.962 |
Seeds 1 and 2: shares 0.224 and 0.223 (raw), 0.337 and 0.353 (lossless), 0.594 and 0.596 (screening + lossless), 0.891 and 0.845 (near-lossless), 0.967 and 0.975 (knapsack, all 65 and 57 fires sent).
In Exercise 1 (seed 0, 3,000 test tiles) the learned screen scored 0.9727 against 0.8307 for the fixed rule; on scenes with snow, 0.8127 against 0.8473. Lossless coding reached a ratio of 1.336; near-lossless with e = 1, 2, 4, 8 reached 1.600, 1.760, 1.985 and 2.288.
Findings.
- Sending in capture order delivered 22% to 25% of the value raw and 32% to 35% with lossless compression; screening raised that to 57% to 60%, and bounded-error compression to 84% to 89%. Ranking by value per bit delivered 96% to 98% and every fire, in all three seeds.
- The learned screen beat the fixed rule by 12 to 14 points on familiar scenes but lost to it on snow (0.79 to 0.81 against 0.84 to 0.85), in every seed.
- Lossless coding of these busy 16 × 16 tiles gained only a factor of 1.34; edges inside Rice blocks force large parameters.
Onboard processing in practice
- Earth observation: missions screen clouds, detect fires, ships or floods onboard and send alerts within minutes; Φ-sat-1 and Φ-sat-2 run neural networks on low-power accelerators.
- Planetary missions rank and compress data for scarce deep-space links, and rovers choose science targets autonomously (AEGIS).
- Hardware: radiation-tolerant processors and FPGAs with EDAC memory, or commercial accelerators protected by redundancy and scrubbing; models are deployed with the runtimes of topic M4-4 under the power limits of topic M4-3.
References
- R. F. Rice (1979). “Some practical universal noiseless coding techniques.” JPL Publication 79-22.
- CCSDS 121.0-B (1997–2020). “Lossless data compression.” Blue Book.
- CCSDS 123.0-B-2 (2019). “Low-complexity lossless and near-lossless multispectral and hyperspectral image compression.” Blue Book.
- S. Chien and colleagues (2005). “Using autonomy flight software to improve science return on Earth Observing One.” Journal of Aerospace Computing, Information, and Communication.
- Z. Zhu and C. E. Woodcock (2012). “Object-based cloud and cloud shadow detection in Landsat imagery.” Remote Sensing of Environment.
- G. Giuffrida and colleagues (2021). “The Φ-Sat-1 mission: the first on-board deep neural network demonstrator for satellite Earth observation.” IEEE Transactions on Geoscience and Remote Sensing.
- R. Francis and colleagues (2017). “AEGIS autonomous targeting for ChemCam on Mars Science Laboratory: deployment and results of initial science team use.” Science Robotics.