# A Multi-Step Image Pre-Enhancement Strategy for a Fish Feeding Behavior Analysis Using Efficientnet
## 2 Methodology
### Multi-Step Image Pre-Enhancement Strategy
#### 2.3.2 Multi-Metric Driven CLAHE and Unsharp Masking  
In aquatic environments, illumination is often uneven, leading to areas within images that are either too dark or too bright, with indistinct details. Contrast Limited Adaptive Histogram Equalization (CLAHE) [39; 40; 41] enhances the clarity of these regions by improving the contrast within local areas. Unlike conventional histogram equalization, CLAHE limits the extent of contrast enhancement to prevent issues of excessive enhancement, resulting in more natural contrast improvements and clearer details, particularly in areas of low contrast. Underwater environments typically exhibit low contrast, especially in turbid waters or situations marred by suspended particulates causing poor visibility. CLAHE effectively enhances local contrast, rendering the boundaries of fish, food particles, and the surrounding environment more discernible. The application of CLAHE in this study fundamentally achieves the fine-tuning of contrast through a series of sequential operational steps, reflecting its practical operability as an image enhancement tool. Its key steps can be summarized as follows:  
1. Histogram Clipping: If the value of a histogram bin exceeds a predefined contrast limit, the excess is uniformly distributed across other bins. This step prevents any single pixel value from becoming overly prominent, thereby avoiding unnatural image effects. 2. Histogram Equalization: The clipped histogram is equalized using the Cumulative Distribution Function (CDF). The equalization formula is typically as follows: \[S_{k}=\sum_{i=0}^{k}P_{i}\] (2)  
In the context of Equation (2), \(S_{k}\) represents the pixel value after equalization, and \(P_{i}\) denotes the probability the pixel level \(i\) in the original histogram. This step redistributes pixel values, making the brightness distribution of the image more uniform and enhancingthe overall contrast of the image. It prevents any particular pixel value from becoming too prominent, which could result in unnatural image effects. Specifically, this formula calculates the value of each pixel in the new image to ensure that the overall contrast enhancement is more natural and uniform. As illustrated in Figure 5, the specific algorithmic design process highlights two primary adjustable parameters within CLAHE: clipLimit and tileGridSize. clipLimit: This parameter controls the threshold for histogram clipping. It determines the extent of contrast enhancement within each small block. If clipLimit is set lower, the contrast enhancement will be milder, which will help reduce noise but may not sufficiently enhance the image contrast. If clipLimit is set higher, the contrast enhancement will be stronger, which could introduce more noise or create unnatural image effects. tileGridSize: This parameter determines how many small blocks (tiles) the image is divided into for individual histogram equalization. TileGridSize is typically represented by two values (width and height). Smaller tile sizes can provide more detailed local enhancement effects but may result in visible artifacts at the tile borders. Larger tile sizes might lead to less noticeable local enhancement but can offer a more uniform overall effect. To ensure that image enhancement enhances detail while maintaining color authenticity and overall visual harmony, this study improves upon the traditional CLAHE algorithm by proposing the Multi-Metric-Driven Contrast Limited Adaptive Histogram Equalization (mdc) algorithm. This includes an integrated image quality assessment mechanism to optimize the enhancement process, ensuring that clarity is improved without compromising color fidelity. As demonstrated in Figure 5, the enhancement workflow involves the conversion to the LAB color space, independent processing of the luminance channel, and quality control based on PSNR and SSIM indices, thus achieving a balance between visual effect and technical standards. The main process is as follows:  
1.