Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ph4ntom_drv (0.35)#74

Merged
YassineYousfi merged 6 commits into
commaai:masterfrom
hypery11:phantom_drive
May 3, 2026
Merged

ph4ntom_drv (0.35)#74
YassineYousfi merged 6 commits into
commaai:masterfrom
hypery11:phantom_drive

Conversation

@hypery11

@hypery11 hypery11 commented May 2, 2026

Copy link
Copy Markdown
Contributor

submission name:

ph4ntom_drv

upload zipped archive.zip

archive.zip

report.txt

=== Evaluation config ===
  batch_size: 16
  device: cpu
  num_threads: 2
  prefetch_queue_depth: 4
  report: submissions/ph4ntom_drv/report.txt
  seed: 1234
  submission_dir: submissions/ph4ntom_drv
  uncompressed_dir: comma_video_compression_challenge/videos
  video_names_file: comma_video_compression_challenge/public_test_video_names.txt
=== Evaluation results over 600 samples ===
  Average PoseNet Distortion: 0.00047053
  Average SegNet Distortion: 0.00065074
  Submission file size: 321,311 bytes
  Original uncompressed size: 37,545,489 bytes
  Compression Rate: 0.00855791
  Final score: 100*segnet_dist + √(10*posenet_dist) + 25*rate = 0.35

does your submission require gpu for evaluation (inflation)?

yes (CPU also works, ~5 min)

did you include the compression script? and want it to be merged?

yes

additional comments


You don't need to preserve the video. You need to preserve what the network sees.

Here's a frame from the original 35.8 MB dashcam video, next to our 321 KB reconstruction — a 111× reduction.

They look nothing alike. One is a dark highway at night. The other is... some kind of turquoise painting?

But look at the bottom row:

segnet_comparison

Top: Original vs. our reconstruction. Bottom: SegNet's predictions on both — 99.9% class agreement. Road, sky, lane markings, vehicles — all in the right place. SegNet literally can't tell the difference.

The insight is simple once you see it: the scoring formula rewards semantic fidelity, not perceptual fidelity. So we built a generator that speaks SegNet and PoseNet's language, and ignores everything else.


What's in the box

The entire minute of video is stored as three files totaling 321 KB:

pipeline

A 5-class mask and coordinate grid go into the generator. Out come two frames that look surreal but contain the exact semantic structure of the originals.

graph LR
    subgraph A["321 KB Archive"]
        M["mask.obu.br<br/>219 KB"]
        W["model.pt.br<br/>89 KB"]
        P["pose.npy.br<br/>13 KB"]
    end

    subgraph G["Generator · 118K params"]
        direction TB
        T["SharedMaskDecoder<br/>mask + coords → features"]
        MLP["PoseMLP<br/>6D → 64D"]
        F2["Frame2Head"]
        F1["Frame1Head + FiLM"]
    end

    M -->|"600 masks"| T
    P -->|"600 pose vectors"| MLP
    W -->|"FP4 weights"| G
    T --> F2 --> FR2["Frame 2"]
    T --> F1
    MLP -->|"γ, β"| F1 --> FR1["Frame 1"]
Loading
File What Size How
mask.obu.br SegNet class maps, 384×512, 600 frames 219 KB AV1 raw OBU (libaom crf50, cpu-used 0, single keyframe) + Brotli
model.pt.br Depthwise separable generator, 118K params 89 KB FP4 quantized (4-bit, per-block scales) + Brotli
pose.npy.br PoseNet 6-DOF vectors, 600 pairs 13 KB float32 + Brotli

Only Frame 2's mask is stored — Frame 1 is generated from the same mask plus a pose vector. This halves the mask video size compared to encoding both masks.

The generator uses FiLM conditioning (Feature-wise Linear Modulation): the pose vector gets projected to γ and β, which shift and scale the feature maps. This completely replaces optical flow — and it turns out a learned 64-dim affine transform compresses much better than an explicit flow field under FP4 quantization.


Score anatomy

score_breakdown

Component Value Weighted Share
SegNet distortion 0.00065 0.065 19%
PoseNet distortion 0.00047 0.069 20%
Rate 0.00856 0.214 61%
Total 0.35

Rate dominates. SegNet and PoseNet are nearly zero. The mask video alone is 219 KB — that's where the bits go.

The obvious next step is neural mask compression. AV1 is doing its best, but 5-class segmentation maps have very specific structure (large contiguous regions, predictable class co-occurrence) that a learned codec could exploit far more aggressively. I expect this could cut mask size in half, pushing the score toward 0.25.

leaderboard


Training: teaching a tiny network to fool two bigger ones

You can't just train this end-to-end and expect convergence. A 118K-param generator trying to simultaneously minimize SegNet CE + PoseNet MSE under FP4 quantization will just oscillate.

The fix is curriculum:

Stage 1: ANCHOR (400 ep)        ████████████████████░░░░░░░░░░ trunk + frame2 only, seg loss
Stage 2: ANCHOR BOOST (80 ep)   ████░░░░░░░░░░░░░░░░░░░░░░░░░░ 49× weight on misclassified pixels
Stage 3: FINETUNE (320 ep)      ░░░░░░░░░░░░░░████████████████░ frame1 + pose, trunk frozen
Stage 4: JOINT (160 ep)         ░░░░░░░░░░░░░░░░░░░░░░████████ everything, all losses
Stage 5: MICRO (120 ep)         ░░░░░░░░░░░░░░░░░░░░░░░░░░████ final pose polish
                                ─────────── 1,080 epochs ───────────

Each stage switches to QAT (fake-quantize with STE) in its second half, so the weights learn to be FP4-robust rather than being surprised by it at export time. EMA averaging (decay 0.99) smooths checkpoint selection.

One thing that took me embarrassingly long to figure out: the training forward pass must match the eval pipeline exactly. Eval does interpolate up (384→874) → round → clamp → interpolate down (874→384). If you skip the round/clamp in training, you get a ~15% gap between your proxy score and real eval. The diff_round trick (round in forward, straight-through in backward) fixes this.


The failures that got us here

Attempt Score What went wrong
AV1 codec tuning (GOP, CRF, ROI) 0.83 Conventional codecs hit a wall — they can't optimize for SegNet specifically
mask2mask replica (optical flow, 309K params) 2.39 Optical flow is high-entropy under FP4. PoseNet was 40× worse than training proxy
FP32 training → post-hoc FP4 ~1.5 Weights that weren't trained with quantization noise just explode on export
Baseline dims (c1=56, c2=64) 0.38 Works, but leaves headroom on distortion

The mask2mask failure was instructive. I spent a week on it, trained for 1000 epochs, and the pose generalization gap was catastrophic. The problem is that explicit flow fields are dense 2D signals — every pixel has dx/dy — and FP4 can't preserve them with enough precision. FiLM collapses that same inter-frame information into a 64-dim vector, which is inherently more compressible.


Why wider helps

Config Params Model SegNet Pose Rate Score
c1=56, c2=64 88K 67 KB 0.00102 0.00062 0.00796 0.38
c1=64, c2=80 118K 89 KB 0.00065 0.00047 0.00856 0.35

+34% parameters → −37% SegNet error, −24% PoseNet error, +7.5% rate.

The wider channels matter most for depthwise separable convolutions specifically. With depth_mult=1, the depthwise layer is per-channel — wider channels mean more independent spatial filters. The SegNet improvement concentrates at semantic boundaries (road/sky edges, lane marking borders), which is exactly where class disagreements happen.


118K parameters. 321 kilobytes. 111× compression. One minute of driving, distilled into what a neural network actually needs to see.

Neural semantic compression: 118K-param depthwise FiLM generator
that reconstructs frames from SegNet masks + PoseNet pose vectors.
321 KB archive, 111x compression ratio.
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

Thanks for the submission @hypery11! 🤏

A maintainer will review your PR shortly.

To run the evaluation, a maintainer will trigger the eval workflow with your PR number.

@github-actions github-actions Bot requested a review from YassineYousfi May 2, 2026 19:59
@hypery11 hypery11 changed the title phantom_drive (0.35) ph4ntom_drv (0.35) May 2, 2026
@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

Eval Failed: ph4ntom_drv

Job failed

View logs

@YassineYousfi

Copy link
Copy Markdown
Collaborator

can you add your deps in your submission folder instead of project level?

@YassineYousfi

Copy link
Copy Markdown
Collaborator

same as other PRs, please host the assets somewhere else, I would like to keep the repo lightweight

@hypery11

hypery11 commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both — reverted pyproject.toml change and moved deps install to inflate.sh. Removed assets from the repo, images are hosted on release assets now. Ready for re-eval whenever you get a chance.

Comment thread pyproject.toml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you revert this?

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

Eval Failed: ph4ntom_drv

Job failed

View logs

@hypery11

hypery11 commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

Synced pyproject.toml with master (brotli was already added by quantizr's merged PR). The previous eval failure was due to brotli not being in the uv environment. Should be fixed now — ready for re-eval.

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

Eval Results: ph4ntom_drv

=== Evaluation config ===
  batch_size: 16
  device: cuda
  num_threads: 2
  prefetch_queue_depth: 4
  report: submissions/ph4ntom_drv/report.txt
  seed: 1234
  submission_dir: submissions/ph4ntom_drv
  uncompressed_dir: /home/runner/work/comma_video_compression_challenge/comma_video_compression_challenge/videos
  video_names_file: /home/runner/work/comma_video_compression_challenge/comma_video_compression_challenge/public_test_video_names.txt
=== Evaluation results over 600 samples ===
  Average PoseNet Distortion: 0.00060144
  Average SegNet Distortion: 0.00076640
  Submission file size: 321,311 bytes
  Original uncompressed size: 37,545,489 bytes
  Compression Rate: 0.00855791
  Final score: 100*segnet_dist + √(10*posenet_dist) + 25*rate = 0.37

@YassineYousfi YassineYousfi merged commit c78a592 into commaai:master May 3, 2026
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown

Eval Failed: ph4ntom_drv

Job failed

View logs

@YassineYousfi

Copy link
Copy Markdown
Collaborator

@hypery11 Congratulations on making it onto the leaderboard! I hope you had fun competing in the challenge and learned something new along the way. If you are looking for a job or internship, please email [email protected] with a link to this PR. See you in the next challenge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants