---
title: Cascaded Hiding Network (HNet) Overview
url: https://www.emergentmind.com/topics/cascaded-hiding-network-hnet
type: topic
---

# Cascaded Hiding Network (HNet) Overview

Searching arXiv for the provided HNet-related papers and closely related terminology.
Cascaded Hiding Network (HNet) denotes a neural hiding component or hiding-oriented network organization in which concealed functionality is embedded within an apparently ordinary image-processing pipeline. In the explicit box-free watermarking formulation, HNet is cascaded after a task network and before watermark extraction, so that the released image is visually similar to the task output while carrying a recoverable mark. In the closely related “hiding data hiding” formulation, a single shared deep network behaves in an HNet-style manner by openly performing style transfer while secretly acting as both data embedder and extractor under different paired inputs. Across these formulations, the defining idea is not only to hide payloads in images, but also to hide the existence or operational role of the hiding mechanism itself [2507.18034], [2102.06826].

## 1. Conceptual scope and nomenclature

In the box-free watermarking setting, the protected system is a cascade of three components: **GNet**, which performs the image task itself; **HNet**, which embeds the watermark into the GNet output; and **ENet**, which extracts the watermark from the marked output. The pipeline is
$$
b_i = \mathrm{GNet}(a_i), \qquad
b_i' = \mathrm{HNet}(\mathrm{Concat}(b_i,\delta)), \qquad
\hat{\delta} = \mathrm{ENet}(b_i').
$$
Here, \(a_i \in A\) is the input image, \(b_i \in B\) is the processed but unmarked output from GNet, \(b_i' \in B'\) is the final marked output released by the system, and \(\delta\) is the watermark image. The paper further defines the externally exposed black-box service as
$$
\mathrm{ONet} = \mathrm{GNet} + \mathrm{HNet}.
$$
Within this terminology, HNet is the actual watermark embedder, whereas GNet produces the semantic or content transformation and ENet verifies watermark presence [2507.18034].

The 2021 “hiding data hiding” framework does not explicitly use the name HNet, but it is described as a **single shared deep network** that behaves like a **multi-purpose, cascaded hiding network**. The proposed DNN \(F_w\) is trained so that, with input \((x,y)\), it performs style transfer; with input \((c,m)\), it performs data embedding; and with input \((s,r)\), it performs data extraction. In that formulation, the hiding functions are camouflaged as an ordinary task, namely style transfer. This suggests that “Cascaded Hiding Network” can refer not only to an explicit post-task watermarking module, but also to a shared hidden-functionality network whose visible behavior masks covert embedding and recovery capabilities [2102.06826].

## 2. Cascaded operational forms

The most explicit cascaded form occurs in box-free watermarking, where HNet is inserted after the task network. The user or attacker observes only the final marked image \(b_i'\), not the intermediate task output \(b_i\). This separation is central to the security claim of box-free watermarking: the watermarking mechanism is hidden inside ONet, and the unmarked image is never directly exposed [2507.18034].

The HDH formulation realizes a different but structurally related cascade. The same network \(F_w\) is applied twice in sequence:
$$
(c,m)\xrightarrow{F_w} s \xrightarrow{F_w(\cdot,r)} m.
$$
The first application creates a stego image \(s = F_w(c,m)\), and the second application reconstructs the secret from the stego image and a trigger image:
$$
m = F_w(s,r) = F_w(F_w(c,m),r).
$$
This is an implicit two-stage hidden pipeline in which embedding and extraction are both internalized by the same parameter set \(w\). The paper emphasizes that task selection is controlled by the second input image: the style image \(y\) selects style transfer mode, the binary secret image \(m\) selects embedding mode, and the trigger image \(r\) selects extraction mode. A fully black image, with all pixels equal to zero, is used as the default trigger, and the paper states that without it the network will not recover the secret reliably [2102.06826].

These two operational forms differ in decomposition. The box-free watermarking literature separates the task model, hiding model, and extractor into GNet, HNet, and ENet. The HDH framework does not split the hiding system into separate encoder and decoder modules; instead, one encoder-decoder backbone doubles as an embedding generator, an extraction reconstructor, and a style-transfer synthesizer. A plausible implication is that “cascaded” in HNet-related work can denote either explicit model composition or sequential re-use of a shared model under mode-selecting inputs [2102.06826].

## 3. Architecture and data representation in the HNet-style HDH formulation

The HDH network \(F_w\) is inspired by **U-Net**, but modified for the hiding-data-hiding purpose. Its input consists of **two images concatenated channel-wise**, for example \(128\times128\times3\) plus \(128\times128\times3\) to produce \(128\times128\times6\). The encoder/down-sampling path uses several convolution layers to reduce the feature map to \(1\times1\times512\), and the decoder/up-sampling path uses transposed convolutions to restore the image size to \(128\times128\times3\). Down-sampling layers use **LeakyReLU**, up-sampling layers use **ReLU**, batch normalization is used except in the first down-sampling layer, and dropout is used in the first two up-sampling layers. Unlike standard U-Net, no max-pooling and no cropping are used, because preserving information is important for extraction [2102.06826].

For style transfer, the network computes
$$
z = F_w(x,y),
$$
where \(z\) should have the content of \(x\) and the style of \(y\). For data embedding, it computes
$$
s = F_w(c,m),
$$
where \(s\) is the stego image and should remain visually close to the cover \(c\) while still allowing full recovery of \(m\). For data extraction, it computes
$$
m = F_w(s,r).
$$
Because the same backbone is reused in all three modes, the encoder learns different feature couplings depending on input pairing: content-style fusion in style transfer, secret-bit injection in embedding, and trigger-conditioned secret reconstruction in extraction [2102.06826].

The secret data \(m\) is represented as a binary image made of disjoint \(N \times N \times 3\) blocks, each carrying one secret bit. If the bit is 0, all pixels in the block are set to 0; if the bit is 1, all pixels in the block are set to 1. The actual payload length is
$$
\text{AL} = \frac{128}{N}\times \frac{128}{N}.
$$
Since the final layer uses \(\tanh\), output values lie in \([-1,1]\). Decoding is performed blockwise by averaging each block and assigning bit 1 if the average is greater than 0, and 0 otherwise. This yields a direct blockwise bit recovery mechanism [2102.06826].

## 4. Training objectives and optimization

The HDH model is trained jointly on style transfer and hiding/extraction. For style transfer, the network output is trained against a ground-truth style-transferred image \(z_g\) with
$$
L_1 = \mathbb{E}_{x,y,z_g}\frac{\|F_w(x,y)-z_g\|_1^1}{M},
$$
where \(M\) is the number of elements in \(z_g\). For cover \(c\), secret \(m\), and trigger \(r\), the embedding-plus-extraction loss is
$$
L_2 = \mathbb{E}_{c,m,r}\frac{\|F_w(c,m)-c\|_1^1}{M}
+ \alpha_1\cdot \frac{\|F_w(F_w(c,m),r)-m\|_1^1}{M}.
$$
The first term preserves visual similarity between stego and cover, and the second term reconstructs the secret accurately. The total loss is
$$
L = L_1 + \alpha_2\cdot L_2,
$$
with default values \(\alpha_1=\alpha_2=1\). Training is performed in a **multi-task joint manner**: for each batch, the style transfer task, embedding task, and extraction task are performed, and the network parameters are then updated. The optimizer is **Adam** with learning rate \(0.0001\), \(\beta_1=0.9\), \(\beta_2=0.999\), and batch size 1 [2102.06826].

In box-free watermarking, the defender jointly trains **HNet, D, and ENet**, while **GNet is pretrained and frozen**. The joint loss is
$$
\mathcal{L}_\text{Joint} = \beta_1 \mathcal{L}_\text{Fidelity} + \beta_2 \mathcal{L}_\text{Mark} + \beta_3 \mathcal{L}_\text{Adv},
$$
with
$$
\mathcal{L}_\text{Fidelity} = \sum_i \mathrm{MSE}(b_i', b_i),
$$
$$
\mathcal{L}_\text{Mark} = \sum_i \left[\mathrm{MSE}(\hat{\delta}, \delta) + \mathrm{MSE}(\mathrm{ENet}(e_i), \delta_0)\right],
$$
$$
\mathcal{L}_\text{Adv} = \sum_i \left[\log(\mathrm{D}(b_i)) + \log(1-\mathrm{D}(b_i'))\right].
$$
The fidelity term forces \(b_i'\) to look like \(b_i\), the mark term ensures watermark extraction from marked images and all-white output on unmarked or random images, and the adversarial term makes marked and unmarked outputs hard to distinguish [2507.18034].

## 5. Reverse engineering, attack models, and security limitations

The strict black-box threat model in the 2025 study grants the attacker query access to the cloud API, observation of only the released marked outputs \(b_i'\), and no knowledge of the HNet architecture, HNet weights, ENet, or the intermediate output \(b_i\). The removal objective is
$$
\mathrm{Remove}(a_i, b_i') = b_i.
$$
A successful attack either recovers the unmarked image \(b_i\) or produces an output whose ENet-extracted watermark is no longer the target \(\delta\). The attacks rely on specially crafted query inputs \(b_j\) that approximately satisfy \(\mathrm{GNet}(b_j)\approx b_j\), described as an “identity transformation” assumption. Examples given are rain-free images for deraining GNet and masked or minimally transformed inputs for image generation or editing [2507.18034].

The first attack learns an inverse operator for HNet. From curated queries, the attacker obtains approximate direct HNet samples \((b_j,b_j')\) and trains \(\mathrm{HNet}^{-1}\) with
$$
\mathcal{L}_{\text{Removal}} = \sum_j \mathrm{MSE}\left(\mathrm{HNet}^{-1}(b_j'), b_j\right).
$$
The paper characterizes this attack as simple, intuitive, query-based, and effective at removing the watermark, but also states that it yields unsatisfactory image quality relative to the original \(b_i\) because the inverse mapping is hard to learn in a nonlinear, high-dimensional setting [2507.18034].

The second attack exploits the **equivalent additive property** of box-free model watermarking. The marked output is written as
$$
b_i' = b_i + \delta_{bi}',
$$
where \(\delta_{bi}'\) is the additive equivalent or latent representation of the watermark. The paper motivates this with a first-order Taylor expansion around \(\delta=0\) and verifies the approximation empirically by feeding the residual \(b_i'-b_i\) to ENet:
$$
\mathrm{ENet}(\delta_{bi}') = \delta.
$$
Instead of inverting HNet, the attacker trains a forward surrogate
$$
\mathrm{SNet} \approx \mathrm{HNet}
$$
with
$$
\mathcal{L}_{\text{Surrogate}} = \sum_j \mathrm{MSE}\left(\mathrm{SNet}(b_j), b_j'\right),
$$
and then estimates
$$
\hat{b}_i = a_i - \left(\mathrm{SNet}(a_i) - b_i'\right).
$$
The paper argues that this forward-surrogate approach is better than inversion because it avoids the ill-conditioned inverse mapping, directly models the embedded residual, and reconstructs the unmarked image more faithfully [2507.18034].

Empirically, both attacks achieved
$$
\mathrm{SR}_{\text{Remove}} = 1.000
$$
across all eight reported settings, corresponding to **100% watermark removal success** against both victim systems—\(\mathrm{V}_{\mathrm{Wu}}\) from Wu et al. (2020) and \(\mathrm{V}_{\mathrm{Zhang}}\) from Zhang et al. (2024)—on both image deraining and image generation or text-image-to-image editing via Stable Diffusion. The forward-HNet attack was consistently better in image quality, with the best reported fidelity reaching **34.69 dB PSNR** for \(\mathrm{V}_{\mathrm{Zhang}}\) in deraining, and with MS-SSIM exceeding \(0.990\) in that setting. The ablation study further shows that if the attacker does not bypass GNet and instead trains on ordinary \((a_i,b_i')\) pairs, \(\mathrm{HNet}^{-1}\) can remove watermarks only with severe quality degradation, while forward HNet fails to remove the watermark properly and instead mixes in source content [2507.18034].

## 6. Security interpretation, robustness measures, and neighboring terminology

The HDH framework shifts the security objective from merely hiding payloads in images to hiding the **very presence of data-hiding tools** by making sender and receiver appear to use ordinary style-transfer processing. The paper also discusses **adversarial training** with Gaussian noise to improve robustness, the use of **error-correcting codes** if needed, and security testing using **XuNet steganalysis**. In that formulation, the covert capability is concealed behind a benign application, and the style-transfer behavior is the visible cover for the hidden functions [2102.06826].

The 2025 attack paper reaches the complementary conclusion that cascading HNet after GNet does **not** make box-free watermarking secure under black-box API access. Its practical defense suggestion is **API query screening / identity-transformation detection**, for example by comparing input \(a_i\) and output \(b_i\) by Euclidean distance and, if they are too similar, returning \(a_i\) or issuing a warning. This suggests that HNet security depends not only on invisibility of the mark in \(b_i'\), but also on the difficulty of isolating HNet behavior through query design [2507.18034].

A common source of terminological confusion is the distinction between **HNet** and **Hidden Network (HNN)**. “HALO-CAT: A Hidden Network Processor with Activation-Localized CIM Architecture and Layer-Penetrative Tiling” concerns **HNN** processing, not a Cascaded Hiding Network. In that literature, a network is initialized with random weights, a sparse binary supermask selects a useful subnetwork, and HALO-CAT accelerates this HNN-style inference with **Layer-Penetrative Tiling (LPT)** and an **Activation-Localized (AL) computing-in-memory** architecture. The paper explicitly states that this is not a separate “Cascaded Hiding Network” model; the nearest analogue to “cascaded” is deep cross-layer execution or layer-fused scheduling. This distinction is important because HNN in the HALO-CAT sense is a hardware-software co-design target for inference acceleration, whereas HNet in the hiding literature is a concealment or watermark-embedding mechanism within an image-processing pipeline [2312.06086].

Source: https://www.emergentmind.com/topics/cascaded-hiding-network-hnet