# Improved Color Attenuation Prior for Single-Image Haze Removal
## 3 Proposed Algorithm
### New Data Preparation Method for Training Depth Estimator  
The training data consisting of hazy images and their corresponding ground truth depth maps are required to correctly learn the coefficients \(\theta_{0}\), \(\theta_{1}\), and \(\theta_{2}\) in Equation (14). Unfortunately, the acquisition of an accurate depth map is extremely difficult since there is no reliable means to obtain the scene depth. Therefore, [PERSON] et al. [20] used a synthetic database to train their proposed linear model. The training data preparation phase can be described in four steps: (i) collecting the haze-free images from image-sharing services like Google Images or Flickr; (ii) generating random depth maps with the standard uniform distribution on the open interval (0, 1); (iii) generating a random global atmospheric light with its value between 0.85 and 1.0; (iv) substituting these variables into the atmospheric scattering model to calculate the synthetic hazy images. Then, the saturation and value channels of these hazy images are used as input data, while the random depth maps are employed as known responses in the supervised learning strategy. Three coefficients in Equation (14) were learned by maximizing the natural logarithm of the likelihood using the stochastic gradient ascent algorithm. [PERSON] et al. [20] also provided a detailed flowchart showing mathematical expressions for both calculating the partial gradients and updating the coefficients. Figure 3 depicts this data preparation procedure.  
Our training data is constructed according to the procedure illustrated in Figure 3 on 500 haze-free images of \(500\times 400\) uniform size, in which a noticeable improvement in generating random depth maps has been made. To solve the problem that existing pseudo random number generators cannot  
Figure 3: Data preparation procedure employed in CAP.  
Figure 2: Block diagram of the proposed Improved Color Attenuation Prior (ICAP).  
guarantee a uniform distribution, we adopted the enhanced equidistribution [29; 30]. Figure 4a shows the histogram of 200,000 random numbers, corresponding to a \(500\times 400\) depth map, drawn from the standard uniform distribution on the open interval (0, 1). The numbers are distributed almost uniformly in view, but the standard deviation of the numbers is still greater than zero. Figure 4b is the histogram of the numbers after being modified by the enhanced equidistribution. The current distribution is mostly uniform and is, theoretically, close to the uniform distribution. Preparing training data for CAP's linear model using the depth maps drawn from the enhanced equidistribution further improves the CAP performance, proven in our previous work [29; 30]. Regarding the learning strategy, since the stochastic gradient ascent algorithm is considerably slow, we utilize the mini-batch gradient ascent algorithm with the following hyper-parameters: the global learning rate of 1e-5; the batch size of 3 images; and the epoch number of 1000. The best result we obtained is that \(\theta_{0}=0.180069\), \(\theta_{1}=1.014740\), and \(\theta_{2}=-0.734965\). These parameters will be used for the evaluation in Section 4.