# Adaptive Neural-Network-Based Lossless Image Coder with Preprocessed Input Data
## 2 Scientific Background  
### Note on Lossless Image Coding Techniques  
Modern lossless image coding methods usually consist of two stages: data preprocessing and entropy coding. Of course, preprocessed data are not quantized; the decoded image is identical to the original one. Preprocessing consists of linear or non-linear data prediction, before prediction error is calculated; see Section 2.3. Prediction errors tend to have the Laplace distribution, better prediction, stronger values concentration around zero, and potentially more efficient coding by some entropy method in the second stage.  
There are two basic classes of method: forward prediction and backward prediction. In the case of forward prediction, predictor parameters are optimized with respect to the general properties of the image before its actual coding. The simplest techniques use either one or a small set of fixed predictors; their construction is based on the knowledge of what the typical properties of a pixel surrounding are. The optimization reduces to a decision regarding which predictor is the best for the approximation of the currently coded pixel, e.g., JPEG-LS [1] and CALIC [4] work in this way. In the case of more advanced methods, coder parameters are optimized for the currently processed image. Information regarding the parameters is sent to the decoder in the message header. The coder efficiency grows with its complexity, and hence, with greater header size. As happens in general, we have here an effect of diminishing returns, and there is an obvious trade-off between header size and coder performance [5; 7; 26; 27; 28]. The techniques are time asymmetric; coding time is longer than the decoding time, sometimes much longer. In some situations, this is an advantage, as often an image is coded once and then decoded several times.  
In the case of backward prediction, both coder and decoder work on already coded data; information needed for coding is also available for the decoder, and header information is not needed. The decoder repeats the coding process; hence, the methods are time symmetric. In this way, the coder complexity is not restricted; moreover, the predictor parameters can be optimized separately for each coded pixel. At the start of the coding (and decoding) process, only a few preceding pixels are known; hence, there is the problem of optimal coder initial settings. This is particularly important when the predictor operates on a particularly large number of pixels. Taking all this into consideration, there is a wide range of coders with respect to their complexity. There are simple coders, like CoBALP [29; 30; 31], medium complexity ones, like RLS [32] and OLS [12; 33; 34; 35], and the most advanced ones, such as EM-WLS [12].  
At first, Artificial-Neural-Network-based coders were backward prediction ones, AdNN [13; 14; 15], but there were also ones based on Cellular Neural Networks [36] or Fuzzy Neural Networks [37]. The deep-learning approaches are obviously forward prediction coders [17; 23; 38]. In contrast to \"classical\" advanced forward prediction methods, ANN settings are not optimized for the currently coded image, but for a set of exemplary ones, which have strongly reduced sizes: \(32\times 32\) or \(64\times 64\) pixels. Still, without hardware support, their learning process is very time-consuming, although run only once. There are also hybrid techniques; in [39], an ANN codes pixel estimates obtained using a lossy BPGcoder. In [40], an image is divided into subimages, then the first subimage is coded using JPEG-XL, while a deep-learning-based technique codes the remaining ones (LC-FDNet).