# Intelligent Monitoring of Tunnel Fire Smoke Based on Improved YOLOX and Edge Computing
## 2 Feature Processing for Tunnel Flame Smoke Image
### Image Adjustment Based on Gamma Correction  
In accordance with the 'Highway Tunnel Lighting Design Rules' and local regulations, the standard brightness level within a tunnel does not exceed 10 candela/m\({}^{2}\) (cd/m\({}^{2}\)), whereas on a sunny day, the external brightness often exceeds 10,000 candela/m\({}^{2}\)[40]. The dataset utilized in this experiment is collected from the internet and is primarily intended for tunnel scenes. However, a significant portion of the images in the dataset originates from well-illuminated daytime scenes, which slightly deviates from the distribution in the final application scenario. To address this variation, it becomes necessary to adjust the images in the training set portion of the dataset by reducing their overall brightness and enhancing contrast. Consequently, this paper employs gamma correction technology to process the training set images. Gamma correction is a commonly used technique in digital image processing for adjusting the brightness and contrast of images. This method relies on the human visual system's perception of brightness and aims to render images more accurately and naturally on display devices. In gamma correction, a non-linear transformation is applied to the pixel values of an image to adjust its brightness and contrast. This transformation takes the form of a power function, typically controlled by a parameter known as the gamma value. In digital image processing, the commonly used gamma value is 2.2, determined experimentally to ensure accurate color and brightness representation on displays. If the image's gamma value differs from that of the display, gamma correction is necessary to achieve the correct color and brightness. Gamma correction finds applications in various image processing tasks such as image enhancement, color correction, and image compression, and is commonly used in fields like television, film, and video games to ensure optimal image presentation on diverse display devices. Therefore, this paper applies gamma correction to a portion of the training dataset images, reducing overall brightness and enhancing contrast. The gamma correction formula is as follows:  
\[\text{Img}=\text{Img}^{\frac{1}{\text{Gamma}}} \tag{6}\]  
From our experiments, we observed that if the gamma value is set too high, it leads to an overly heightened image contrast, which can result in the loss of crucial features, such as the color of smoke. This becomes evident when the color of the smoke area becomes excessively dark, approaching pure black. To preserve the original image characteristics without excessive alteration, we have selected the gamma value based on the mean grayscale value of the image. Figures 2 and 3 illustrate the gamma-corrected images:  
As apparent from the figures above, the gamma correction has led to brighter night scenes while slightly reducing overall brightness during the day. Moreover, the color of the smoke has become darker. This adjustment enhances the consistency of the dataset's distribution with real-world scenarios, thereby increasing the detection challenge and improving the model's generalization capacity to some extent.  
Figure 3: Night image correction effect.  
Figure 2: Effect of daytime image correction.