# Multi-Module Combination for Underwater Image Enhancement
## 3 Proposed Method
### Color Deviation Detection Module  
In turbid water, deep water, or low-light environments, the scattering and wavelength attenuation of suspended particles can lead to color deviations. Different scenes are corrected using various color compensation methods to obtain high-quality underwater images. This process not only conserves computational resources by preventing the unnecessary processing of non-color-biased images, but it also ensures that certain images resemble terrestrial images due to the clarity of the seawater. The algorithm analyzes the features of the image by examining the digital image itself. Specifically, the texture information of the image is incorporated into the projection factor \(K\)[19]. A crucial step in detecting color deviation involves converting the input image from the RGB color space to the Lab color space. This conversion process begins by transforming the RGB data into the XYZ color space through a linear transformation, which serves as an intermediate step. The XYZ color space possesses device-independent characteristics, providing a standardized basis for color representation in the subsequent conversion. Once the XYZ values are obtained, the XYZ color space is mapped to the Lab color space through a nonlinear transformation. This mapping aligns more closely with the characteristics of human visual perception and facilitates the subsequent analysis of color deviation. By analyzing both non-color and color images, [PERSON] et al. [19] found that color bias is closely related to the mean and distribution characteristics of the image's chromaticity. If the chromaticity distribution in the 2D histogram is more concentrated around the Lab chromaticity coordinates, the image exhibits a color bias. A higher mean value of chromaticity indicates a greater degree of color bias, whereas a lower mean value suggests that the color bias is less pronounced. Consequently, the offset coefficient \(K\) is employed to quantify the degree of color deviation in an image. \[d_{a}=\frac{\sum_{i=1}^{H}\sum_{j=1}^{W}a(i,j)}{H\times W} \tag{1}\]  
\[d_{b}=\frac{\sum_{i=1}^{H}\sum_{j=1}^{W}b(i,j)}{H\times W} \tag{2}\]  
\[D=\sqrt{d_{a}^{2}+d_{b}^{2}} \tag{3}\]  
\[M_{a}=\frac{\sum_{i=1}^{H}\sum_{j=1}^{W}\lvert a(i,j)-d_{a}\rvert}{H\times W} \tag{4}\]  
\[M_{b}=\frac{\sum_{i=1}^{H}\sum_{j=1}^{W}\lvert b(i,j)-d_{b}\rvert}{H\times W} \tag{5}\]  
\[M=M_{a}\times M_{b} \tag{6}\]  
The expression for the offset coefficient \(K\) is given below:  
\[K=\frac{D}{M} \tag{7}\]  
In the equation above, a and b represent the chromaticity components of the Lab color space, indicating the chromaticity deviation from the mean value. \(H\) denotes the height of the image and \(W\) denotes the width of the image. \(D\) denotes the average color deviation of the image and \(M\) denotes the center distance of the image. The offset coefficient \(K\) is utilized to assess the presence of color deviation in the image. Consequently, it is essential to establish an appropriate threshold value to determine whether color deviation exists in underwater images. In this section, several underwater images are selected for testing, and the corresponding \(K\) values for each image are presented in Figure 3.  
The \(K\)-value of each image in Figure 3 indicates that a more severe color deviation corresponds to a larger \(K\)-value. Images with a \(K\)-value of less than 1.0 exhibit the least color deviation. The UIEB dataset [6] comprises a diverse collection of real underwater images sourced from open access websites and various research papers. This dataset includes 890 real underwater images that represent a wide array of water types, such as near-shore, deep-sea, and turbid waters, under different lighting conditions and typical degradation types. The reference images were generated using 12 classical enhancement algorithms and were subjectively evaluated by 50 volunteers to ensure alignment with human visual preferences.