## 3 Proposed Method
### Architecture of the Generator  
The primary goal of the generator is to remove the haze from haze images, and, on this basis, to preserve as many detailed features of the haze image as possible and restore the input haze image to a clear and haze-free image. Previous work [53] has shown that the residual connection offers superior advantages: (i) solving the gradient disappearance problem as the network becomes deeper and (ii) facilitating the flow of feature information to improve the representational capability of the network and speed up the convergence of the network. Therefore, this paper designs a generator using the residual connection and deepens both the encoding module and the decoding module of the generator, which can better extract features in haze images, and recover clear and haze-free images with clearer features and better image quality.  
Figure 1: Framework structure of the proposed method. The red boxed area in the bottom-right image indicates the query sample, while the red boxed area in the bottom-left image indicates the positive sample, and the remaining blue boxes indicate negative samples.  
As shown in Figure 2, the input of the generator is a haze image, which is sequentially passed through the encoding module, the residual module, and the decoding module to obtain a clear and haze-free image. The encoding module consists of four convolution units, and each convolution unit consists of a convolutional layer, an Instance Normalization (IN) layer, and a ReLU activation function layer, in which the convolutional layer is a \(3\times 3\) convolutional layer with a step size of 2. The residual module consists of nine residual blocks, and each residual block includes a \(3\times 3\) convolutional layer with a step size of 1, an Instance Normalization layer, and a ReLU activation function layer. The decoding module consists of three deconvolution units and one convolution unit. Each deconvolution unit consists of a \(3\times 3\) deconvolution layer with a step size of 2, an instance normalization layer, and a ReLU activation function layer. The encoding module performs feature extraction on the input haze image, the residual module converts the extracted features into features that match the data distribution of the haze-free image, and the decoding module expands the converted features and inverts them to obtain the haze-free image.  
The specific network structure of the generator is shown in Table 1. The nomenclature in Table 1 is as follows: ReflectionPad denotes reflection padding, Conv denotes the convolutional layer, N denotes the number of channels of the output, K denotes the size of the convolutional kernel, S denotes the size of the step, P denotes zero padding, IN denotes the instance normalization layer, ReLU and Tanh are activation functions, and Deconv denotes the deconvolution layer. For the generator network, we used Instance Normalization in all network layers except for the last layer, as well as reflection padding to avoid artifacts; in the last layer, we used the Tanh activation function to constrain the values of the output tensor to a range of pixel values.  
Figure 2: The specific structure of the generator.