# Local Differential Privacy Image Generation Using Flow-Based Deep Generative Models
## 3 Materials and Methods
### Preliminary for GLOW  
The probability distribution from which images arise is complex and difficult to handle. Thus, flow-based deep generative models (DGMs) [13; 15; 16] transform this probability distribution into more manageable distributions, e.g., the elementwise independent normal distribution, by requiring the neural network to be bijective. Specifically, using the change of variables formula, we obtain the following:  
\[\log p(\mathbf{x})=\log p(\mathbf{z})+\log\left|\frac{\partial\mathbf{z}}{ \partial\mathbf{x}}\right|, \tag{1}\]  
where \(\mathbf{z}\) is a random variable vector that follows a Gaussian distribution independent for each element, and \(\mathbf{x}\) is a random variable vector sampled from the probability distribution to which images belong. During this transformation process, the logarithm of the determinant appears with respect to the neural network. To efficiently compute this, the neural network is decomposed and represented as a product of functions where the determinant is easy to compute. Specifically, we define the relationship between \(\mathbf{z}\) and \(\mathbf{x}\):  
\[\mathbf{z} = G_{\mathbf{\theta}}^{-1}(\mathbf{x}), \tag{2}\] \[= g_{K}^{-1}\circ g_{K-1}^{-1}\cdots g_{1}^{-1}(\mathbf{x}), \tag{3}\]  
where \(G_{\mathbf{\theta}}^{-1}\) is a trainable (parameters \(\mathbf{\theta}\)) invertible map between a probabilistic distribution of images and a tractable probabilistic distribution (elementwise independent normal distribution in our settings) and \(g_{K}^{-1}\cdots g_{1}^{-1}\) are decomposed functions. Using Equation (1), the flow-based DGMs maximize the average logarithm likelihood of training images (\(\mathcal{L}\)) during training:  
\[\mathcal{L}=\frac{1}{|\mathcal{D}|}\sum_{i}^{\mathcal{D}}\log p (\mathbf{x}_{i}), \tag{4}\]  
where \(\mathcal{D}\) represents image dataset, \(\mathbf{x}_{i}\) indicates an image in the dataset, and \(|\mathcal{D}|\) is number of images in the dataset. After the training, the flow-based DGMs can generate fake but realistic images using Equation (3) (sampling) and can explicitly compute the value of the probabilistic density function of images using Equation (1) (density estimation).  
GLOW [13] is one of the flow-based DGMs. The deep network in GLOW recursively contains the actnorm, coupling, and permutation layers. The actnorm layer normalizes the data. The coupling layer contains deep convolutional neural networks while it guarantees the invertibility of the layer. The permutation layer ensures that processing in coupling layers affects all the elements of data and is implemented using \(1\times 1\) convolution. Moreover,  
\begin{table}
\begin{tabular}{l c c} \hline \hline
**Set** & **Normal** & **Abnormal** \\ \hline \(\mathcal{S}_{\text{normal}}^{\text{train}}\) & 7808 & 0 \\ \(\mathcal{S}_{\text{mixture}}^{\text{train}}\) & 6553 & 6631 \\ \(\mathcal{S}_{\text{unknown}}^{\text{test}}\) & 1358 & 13,863 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Composition of datasets. \(\mathcal{S}_{\text{normal}}^{\text{train}}\) and \(\mathcal{S}_{\text{mixture}}^{\text{train}}\) share 6529 normal CXR images.  
GLOW adopts a multiscale architecture, which can contain multiple deep networks of different recursive levels. This approach can reduce memory requirements and computational costs without significant compromise to image quality. For a detailed understanding of GLOW, we refer the reader to [13].