# StegNet: Mega Image Steganography Capacity with Deep Convolutional Network
## 3 Convolutional Neural Network for Image Steganography
### Trading Accuracy for Capacity  
Traditional image steganography algorithms mostly embed hidden information as it is or after applying lossless transformations. After decoding, the hidden information is extracted as it is or after the corresponding transformations are applied. Therefore, empirically speaking, it is just as file compression methods, where lossless compression algorithms usually cannot outperform lossy compression algorithms in capacity.  
We need to think in a \"lossy\" way in order to embed almost equal amount of information into the cover. The model needs to learn to compress the cover image and the hidden image into an embedding of high-level features and converts them into an image that appears as similar as the cover image, which comes to the vital idea of trading accuracy for capacity.  
Trading accuracy for capacity means that we do not limit our model in reconstructing at a pixel-level accuracy of the hidden image, but aiming at \"recreating\" a new image with most of the features in it with a panoramic view, i.e., the spider in the picture, the pipes' position relatively correct, the outline of the mountain, etc.  
In other words, the traditional approaches work in lossless ways, which after some preprocessing to the hidden image, the transformed data is crammed into the holes prepared in the cover image. However, StegNet approach decoded image has no pixel-wise relationship with the hidden image at all, or strictly speaking, there is no reasonable transformation between each pair of corresponding pixels, but the decoded image as a whole can represent the original hidden image's meaning through neural network's reconstruction.  
In the encoding process, the model needs to transform from a low-level massive amount of pixel-wise information into some high-level limited sets of featurewise information with an understanding of the figure, and come up with a brand new image similar to the cover apparently but with hidden features embedded. In the decoding process, on the contrary, the model is shown only the embedded figure, from which both cover and hidden high-level features are extracted, and the hidden image is rebuilt according to network's own comprehension.  
As shown in Figures 5 and 6, StegNet is not applying LSB-like or simple merging methods to embed the hidden information into the cover. The residual image is neither simulating random noise (LSB-based approach, see Figure 7) nor combining recognizable hidden image inside. The embedded pattern is distributed across the whole image and even magnified 5 to 10 times, the residual image is similar to the cover image visually which can help decrease the abnormality exposed to the human visual system and finally avoid to be detected.  
Figure 4: Receptive Field of Convolutional Neural Network.  
Figure 5: Residual image histograms shows that the residual error is distributed across the images. **(a)** Residual between cover and embedded; **(b)** Residual between hidden and decoded.  
Figure 6: StegNet residual images “\(\times\)05” and “\(\times\)10” are the pixel-wise enhancement ratio.  
Figure 7: 3-bit LSB residual images “\(\times\)05” and “\(\times\)10” are the pixel-wise enhancement ratio.  
The residual image is computed via  
\[R(I_{1},I_{2})=\frac{|I_{1}-I_{2}|}{\max|I_{1}-I_{2}|}, \tag{4}\]  
and the magnification or the enhancement operation is achieved via  
\[E(I,M)=\text{clip}(I\cdot M,0,1), \tag{5}\]  
where \(I\) takes residual images, which are effectively normalized to \([0,1]\) and \(M\) is the magnification ratio, which 5 and 10 are chosen visualize the differences in this paper.