# Attention-Based Mechanism and Adversarial Autoencoder for Underwater Image Enhancement
## 2 Materials and Methods
### Feature Fusion Module  
Considering the need to perform underwater image enhancement with a focus on regions containing severe image degradation areas [24], we have designed a feature fusion module capable of adaptively selecting image features. This module processes both RGB image features and RMT image features by employing convolutional layers with different receptive fields. The selective utilization of these diverse features enhances the network's ability to identify and address regions with significant image degradation, contributing to more effective underwater image enhancement. The RMT image serves as a representation of the physical laws governing underwater optical imaging. Higher pixel values within the RMT image indicate more severe degradation in the corresponding positions of the RGB image, necessitating a greater emphasis on the enhancement process. Leveraging the RMT image to guide the RGB image enhancement enables differentiation in the significance of various regions, thereby facilitating adaptive enhancement with varying degrees of emphasis. Training deep neural networks for RMT map estimation poses a challenge due to the unavailability of practical ground truth RMT maps for the input underwater images. To address this issue, we adopt the commonly used underwater image restoration algorithms' image imaging model [25], which represents the quality-degraded image as follows:  
Figure 6: Feature attention module. \[Ic(x)=Jc(x)\otimes T(x)\oplus Ac(x)\otimes(1-T(x)) \tag{7}\]  
Let \(x\) represent the coordinate of any pixel in the color image, where \(c\in(\mathrm{R},\mathrm{G},\mathrm{B})\) refers to the three color channels R, G, and B, respectively. \(Ic\) corresponds to the image captured directly underwater, while \(Jc\) denotes the ideally clear image. \(Ac\) represents the ambient background light intensity in the R, G, and B channels. \(T(x)\) represents the medium transmittance of each pixel point, which signifies the percentage of radiation that arrives at the camera after reflection in the medium, relative to the scene radiation. This value indicates the degree of quality degradation in different regions. Drawing inspiration from the dark channel prior [9], the DCP (Dark Channel Prior) method seeks the minimum value in the RGB channel for each pixel \(x\) within the local region \(\Omega(x)\) centered at \(x\). In other words, we have \(J_{\mathrm{DCP}}^{\mathrm{RGB}}(x)=\underset{y\in\Omega(x)}{\min}\left[ \underset{c\in(\mathrm{R},\mathrm{G},\mathrm{B})}{\min}Jc(y)\right]\). For an unfogged image of an outdoor ground surface, \(J_{\mathrm{DCP}}^{\mathrm{RGB}}(x)\) typically approaches zero because, in the local facets (represented by units of \(\Omega(x)\)), at least one of the three color channels generally contains a low-intensity pixel. In the context of Equation (7), the term involving \(Jc\) is rounded off due to its proximity to zero, and this enables the estimation of the medium transmittance, denoted as follows:  
\[\widetilde{T}_{\mathrm{RGB}}(x)=1-\underset{y\in\Omega(x)}{\min}\left[ \underset{c\in(\mathrm{R},\mathrm{G},\mathrm{B})}{\min}\frac{Ic(y)}{Ac}\right] \tag{8}\]  
Additionally, it can be expressed as follows:  
\[\widetilde{T}_{\mathrm{RGB}}(x)=\underset{c,y\in\Omega(x)}{\max}\left[1-\frac {Ic(y)}{Ac}\right]=\underset{c,y\in\Omega(x)}{\max}\left[\frac{Ac-Ic(y)}{Ac}\right] \tag{9}\]  
According to the Beer-Lambert law of light attenuation, the transmittance is commonly expressed as an exponential decay term. \[\widetilde{T}(x)=e^{-\beta d(x)} \tag{10}\]  
where \(d\geq 0\) is the distance from the camera to the radiating object, and \(\beta\) is the spectral volume attenuation coefficient, ensuring that \(\widetilde{T}\geq 0\). In cases where Equation (10) results in a negative number (i.e., \(Ac<Ic(y),\forall y\in\Omega(x)\)), the value of \(\widetilde{T}\) becomes negative, making the use of Equation (8) inaccurate. To address this issue, an estimation algorithm [26] based on prior information is employed to obtain the influence of the medium transmittance map.