# A secret message, hidden in plain sight. You can’t see it, but an AI model can.

By Ben Paget · 15 Nov 2026 · https://electricsheep.id/thoughts/ghostframe/

> Ghostframe nudges a photo's pixels until a frozen model's embeddings spell out an encrypted message. How it works, how well it holds up, and its limits.

Live demo: https://ghostframe.electricsheep.id/

Vector embeddings had been on my “I should really understand this” list for a while. So I recently went down a rabbit hole trying to understand them a bit better.

To keep it short, an image embedding is the list of numbers a model uses to describe a picture. Each number captures something the model learned to notice (a texture, an edge, a shape...), and similar-looking pictures end up with similar lists.

Then, I wondered: could you subtly shift the pixels in a picture in such a way that those numbers could spell out a message of your choosing? Turns out you can! Researchers have published versions of the idea since 2018.

It's not a new field; so I spent the rest of the rabbit hole on narrower questions: if I hide a message, can a stranger with the same public model and the passphrase reliably read it back? How little can you change the pixels and still get the message back every time? Does it still work on photos it has never seen, on a plain CPU?

Ghostframe is where I ended up.

> [!slides] The short version, in 8 slides.
> ![Slide 1: Antonello da Messina's Portrait of a Man, c. 1475, a man in a red cap, with one eye magnified. There's a secret message hidden in this painting. You can't see it. An AI can.](/img/thoughts/ghostframe/slides/slide-1.webp)
> ![Slide 2: He's been posing since 1475. Now he's carrying a secret. Each pixel moved by 2 shades at most, out of 256, too subtle for the naked eye to notice. The original and the version with the message look the same.](/img/thoughts/ghostframe/slides/slide-2.webp)
> ![Slide 3: Each square gets an embedding. The picture is cut into squares, and an AI describes each square with numbers, its embedding: it's how an AI 'sees'. One square, around his eye, and a slice of its real embedding: 0.016, 0.013, −0.007, 0.012…](/img/thoughts/ghostframe/slides/slide-3.webp)
> ![Slide 4: Then the pixels get a tiny nudge. Each square holds 16 bits of the message, as 1s and 0s, and the pixels change very slightly until the AI's numbers for that square give them back. The message: “The man in the red cap knows the code. Meet him in Room 4 at closing time.” This square's 16 bits: 1011110101101011. 80 squares leave room for a 79-character message; Long mode fits 494, with slightly bigger nudges.](/img/thoughts/ghostframe/slides/slide-4.webp)
> ![Slide 5: Locked with a passphrase. To read it you need the image file, the passphrase and the same public AI (MobileNetV3-Small, unchanged). With all three, the message comes back; without the passphrase, only scrambled bytes.](/img/thoughts/ghostframe/slides/slide-5.webp)
> ![Slide 6: Then a stranger reads it back. The image, the passphrase and the same public AI give back the message exactly. The test was run on photos it had never seen, with 3 messages each: every one came back exactly.](/img/thoughts/ghostframe/slides/slide-6.webp)
> ![Slide 7: What breaks it. Resizing, cropping or saving as JPEG loses the message, and most chat apps do one of these. A detector can also tell a message is there. It's an experiment, not a privacy tool.](/img/thoughts/ghostframe/slides/slide-7.webp)
> ![Slide 8: Hide a message in your own photo, at ghostframe.electricsheep.id. Ben Paget, electricsheep.id.](/img/thoughts/ghostframe/slides/slide-8.webp)

## How Ghostframe works

It hides a short encrypted message in a photo. It nudges the pixels, by at most 2 levels out of 255 per channel (8 in Long mode), until a frozen, off-the-shelf model (MobileNetV3-Small, with its ImageNet weights) describes each tile of the photo with numbers that spell out the message. Reading it back needs the PNG, the passphrase and the same public model (you don't need the original photo).

Each of the 80 tiles has fixed public directions in the model's 576-number embedding space, and the sign of each projection is one bit. The message is encrypted (scrypt, AES-256-GCM) with Reed-Solomon parity on top, and the encoder runs gradient descent through the model on the rounded 8-bit pixels.

![Five steps from left to right: the message (74 bytes, up to 79), its encrypted bytes, the bits laid out 16 per tile across 80 tiles, gradient descent through the model on the gridded portrait, and the marked PNG, which looks the same. Before saving, the encoder decodes the PNG like a stranger would; if that fails, it writes nothing.](/img/thoughts/ghostframe/how-it-works.webp "In Subtle mode: at most ±2 levels per channel.")

## Does it hold up?

The method isn't new: [Fernandez et al. (2022)](https://go.electricsheep.id/ghostframe-fernandez) and [Kishore et al. (*Fixed Neural Network Steganography*, 2022)](https://go.electricsheep.id/ghostframe-kishore) are close to this concept. What I wanted to see was if it would hold up reliably outside of a research paper.

So I added a preregistered benchmark on an ordinary CPU, with the pass/fail rules committed before the test photos were encoded: 123/123 held-out trials decoded for both modes (Subtle and Long), on 41 photos that were never used for tuning.

![123 out of 123 trials decoded exactly, in each mode, by a separate decoder on a plain CPU: 41 photos at 1280 px, never used for tuning, times 3 encrypted messages. Subtle holds up to 79 bytes at ±2 levels and encodes in a median 19 seconds; Long holds up to 494 bytes at ±8 levels in a median 33 seconds. Zero failures in 41 photos still allows a per-photo failure rate of up to about 7%.](/img/thoughts/ghostframe/results.webp)

## Try it

You can hide a message in your own photo on [the Ghostframe demo](https://ghostframe.electricsheep.id/). It runs one encode at a time on a single CPU container, so "Hide" is capped at 50 a day for the whole site. To try lots of photos, you can run it locally: [the code is on GitHub](https://go.electricsheep.id/ghostframe-code), under the MIT licence.

## The downsides

A resize, a crop or saving the pic to JPEG destroys the message, which is what most messaging apps do. It also doesn't hide that a message is there: a simple detector separates every marked photo from its original.

![Four versions of the marked portrait. Resized: message lost. Cropped: message lost. Saved as a JPEG: message lost, almost always, even at quality 95. Run through a detector: flagged as marked, with the contents still encrypted.](/img/thoughts/ghostframe/downsides.webp)

> [!closer]
> Reminder: it's an experiment, not a privacy tool.
