Next Article in Journal
A Machine Learning Approach for Predicting and Mitigating Pallet Collapse during Transport: The Case of the Glass Industry
Previous Article in Journal
Exploring Marine-Based Food Production: The Challenges for a Sustainable and Fast Biotechnology-Based Development
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Enhancing the Image Pre-Processing for Large Fleets Based on a Fuzzy Approach to Handle Multiple Resolutions

by
Ching-Yun Mu
1,* and
Pin Kung
2
1
College of Construction and Development, Feng Chia University, Taichung 40724, Taiwan
2
GIS Research Center, Feng Chia University, Taichung 40724, Taiwan
*
Author to whom correspondence should be addressed.
Appl. Sci. 2024, 14(18), 8254; https://doi.org/10.3390/app14188254
Submission received: 23 July 2024 / Revised: 29 August 2024 / Accepted: 11 September 2024 / Published: 13 September 2024

Abstract

:
Image pre-processing is crucial for large fleet management. Many traffic videos are collected by closed-circuit television (CCTV), which has a fixed area monitoring for image analysis. This paper adopts the front camera installed in large vehicles to obtain moving traffic images, whereas CCTV is more limited. In practice, fleets often install cameras with different resolutions due to cost considerations. The cameras evaluate the front images with traffic lights. This paper proposes fuzzy enhancement with RGB and CIELAB conversions to handle multiple resolutions. This study provided image pre-processing adjustment comparisons, enabling further model training and analysis. This paper proposed fuzzy enhancement to deal with multiple resolutions. The fuzzy enhancement and fuzzy with brightness adjustment produced images with lower MSE and higher PSNR for the images of the front view. Fuzzy enhancement can also be used to enhance traffic light image adjustments. Moreover, this study employed You Only Look Once Version 9 (YOLOv9) for model training. YOLOv9 with fuzzy enhancement obtained better detection performance. This fuzzy enhancement made more flexible adjustments for pre-processing tasks and provided guidance for fleet managers to perform consistent image-enhancement adjustments for handling multiple resolutions.

1. Introduction

In recent years, the Internet of Vehicles (IoV), combined with machine-learning technology, has been booming, creating diverse applications in intelligent transportation. Machine-learning methods can be applied to image-processing tasks, such as image classification, annotation, pre-processing, and object detection, thereby enhancing accuracy and efficiency. Machine learning is crucial to the development of artificial intelligence (AI) technologies, and deep learning is a subset of machine learning. AI can enhance the efficiency of traffic management. Even geospatial artificial intelligence (GeoAI) combines AI and geographic techniques to explore and apply sensor networks in cities to reduce traffic congestion [1,2,3,4,5]. Among the key technologies, sensors are the primary tools for gathering video data to monitor vehicle conditions. Sensor systems can play a crucial role in providing video data for intelligent transportation management [6,7]. Currently, many fleet management systems involve managers dispatching personnel to review and monitor events as they occur. However, many of the images have low resolutions with poor-quality images, resulting in managers not conducting further analysis [8,9,10]. Most image-processing research mainly focused on observing road conditions and pedestrian traffic, with few studies addressing cases of front cameras installed in large vehicle fleets. Therefore, this paper proposes an improved pre-processing method in large fleet operations.
In the current intelligent transportation applications, commonly used sensors include: (1) closed-circuit television (CCTV) for detecting traffic violations and vehicle flow, and (2) vehicle front cameras for monitoring external traffic conditions. Many previous studies focused on transportation research using CCTV. CCTV is widely applied in many different intersections and roads to monitor traffic conditions and is also used to monitor traffic violations, such as running red lights and speeding [2,6,11,12,13,14,15,16]. However, the disadvantages of CCTV include a limited field of view, as cameras typically only cover a fixed range. If a vehicle accident occurs outside of this range, it cannot be captured. Additionally, when lighting is poor or at a distance, the camera’s image quality cannot be sufficient to identify front objectives. Moreover, the previous study had discussed using CCTV to determine red light running violations [16], and this has evolved into a popular topic in technology-driven law enforcement. Although traffic lights look small, they can still be used in conjunction with stop lines to determine if a vehicle has run a red light. In the context of vehicle CCTV, mobile lenses are suitable for fleet management due to their convenience. In practice, vehicles do not install cameras that monitor the ground, making it difficult to determine if a vehicle has crossed a stop line. Thus, this paper focused on front image pre-processing and analyzed the impact of the pre-processing on the traffic lights.
This paper collected the mobility videos installed by a front camera in large vehicles; the front camera is more flexible and can reflect real traffic conditions. The managers usually choose cheaper cameras. Since the camera equipment collected in practice was varied in resolution, the video images will directly affect the training results. Humans may not always be able to see clearly, let alone machines making accurate judgments. In past research [5], a vehicle with a larger size and obvious features, such as its body shape, is easier to identify even when the image has low resolution. The size of traffic lights is smaller than vehicles. Under poor image conditions, traffic lights are small and difficult to recognize. Therefore, this paper proposed image enhancement using fuzzy to improve the pre-processing problem to handle multiple resolutions. The comparison of CCTV and mobility cameras is shown in Table 1.
The traffic light is small on a video screen. Increasing data for training can be one option. When the dataset contains unclear images, filtering and refining are necessary, especially for those with lower resolutions. Therefore, we focused on image pre-processing, which is an integral part of machine learning that makes the original image more suitable for subsequent analysis and application. Different applications and tasks may require different pre-processing steps. Image pre-processing is a series of processing steps performed on image data before applying machine learning or computer vision tasks. The purpose of these steps is to improve image quality, reduce noise, and improve interpretability, thereby making subsequent model training and analysis. Finally, this paper will focus on the detection results of the enhanced images.
This paper is organized as follows. Section 2 provides a literature review of OpenCV, pre-processing, and fuzzy methods. In Section 3, we developed a new fuzzy enhancement method to handle multiple resolutions with poor-quality images in large vehicle fleets. Section 4 provides comparison results and analyses. Section 5 shows the discussion, and Section 6 provides the conclusions.

2. Literature Review

With the development of machine-learning technology, computer vision plays a crucial role in the transportation industry. Computer vision can use sensors and fuzzy logic to enable computers to analyze image data, with applications in image classification and object detection in intelligent traffic systems [17]. When using computer vision technology to process images, pre-processing methods are employed to reduce image noise and adjust brightness, which enhances the images and improves the accuracy of recognition and detection tasks. OpenCV (Open-Source Computer Vision Library) provides a rich set of image-processing tools and libraries for fleet management and applications [18]. OpenCV has supported functions such as GPU acceleration to improve the computing performance of image processing and supports the deployment of models, allowing developers to customize models to meet specific image-processing needs. By combining OpenCV, support vector machines (SVM), histograms of oriented gradient (HOG), and deep learning, developers can more easily implement and apply various computer vision technologies to fleet management [18,19,20]. In addition, Pillow is for basic image-processing tasks, whereas OpenCV provides more extensive capabilities for complex computer vision applications. In practice, a combination of Pillow and OpenCV can achieve a wider range of image-processing tasks [21]. In previous literature, many studies have focused on single-resolution images, often using very clear images. However, in actual fleet images, various resolutions are involved. This study proposed an improved method to handle the problem of multiple resolutions. The following will review the literature on pre-processing tasks and previous studies on fuzzy-based image enhancement.

2.1. Pre-Processing Tasks

Many traditional studies focused on image pre-processing techniques, such as RGB color conversion integrating mean filtering, median filtering, and Gaussian filtering to reduce noise and improve the visibility of features. RGB can be used to select a specific area in the original image for adjustment and then replace the original image, like a patching method, which is less like naturally adjusting the entire image. These methods were used to smooth images, reduce noise, and improve the visual quality of images in vehicle management for classification and number plate cases [22,23,24], but the adjusted image is either focused on a single object or has many objects without being affected by multiple resolutions.
The previous image-enhancement processing can help increase the diversity and scale of training data, thereby preventing overfitting. Histogram equalization (HE) is a representative enhancement technique in both academic and practical applications, and many improved methods of HE have been developed. Moreover, feature extraction in image processing for vehicle cases can be accomplished using different algorithms, such as SIFT and SURF. Extracting relevant corners or edges can simplify the vehicle or object data and make the model more efficient and accurate. Local binary patterns (LBP) are often used to capture important information that is sensitive to lighting and rotation conditions. HOG pays more attention to the information in the image, so it is used to detect objects inside the image [9,25,26,27,28]. Improve training accuracy by generating powerful feature-extraction methods for processing complex images.
Past image pre-processing research has covered many aspects, from basic filter applications to feature extraction. Image-enhancement methods generate data for machine-learning models. Data augmentation can reduce the need for large image datasets and decrease reliance on model training. If the video quality is poor, it will be difficult for the algorithm to find information and provide better performance [29]. Pre-processing is the most important for supervised machine-learning algorithms. The amount of training data grows exponentially with the input space dimensions.
The traditional histogram equalization (HE) used the cumulative distribution function (CDF) to convert a color image into a grayscale image and was widely applied to many previous studies [30,31,32,33]. A histogram can denote that the brightness distribution of pixels in an image can illustrate the brightness and contrast. When the peaks of the histogram skew towards the left, it indicates a darker image, whereas when the peaks are concentrated towards the right at 255, it indicates a brighter image. Histogram equalization adjusts the range of pixel brightness distribution and allows the originally concentrated pixel brightness values in a certain area to be distributed more evenly across the entire range, therefore improving the visual appearance of the image. However, if all data are processed uniformly, it may increase the contrast of background noise.
In contrast-enhancement research, the previous techniques used logarithmic, piecewise linear processing gray-scale conversion, and histogram equalization based on uniformly distributed gray-level histograms, bi-histogram equalization (BHE), and multi-scale adaptive histogram equalization [34,35]. With the expansion of computer vision applications, researchers have begun to focus on how to improve the contrast of images to enhance the details in the images. Color correction plays an important role in imaging, so researchers are beginning to explore how to perform automatic color correction to resolve color issues caused by lighting changes or sensor differences. By using image enhancement, the contrast, brightness, and color balance of the image can be adjusted to improve the visual quality of the image, thereby improving image quality and making it more suitable for model training. Using pre-processing tasks, models can be trained to identify and reduce noise in images, thereby improving image clarity and object recognizability.

2.2. Fuzzy-Based Image Enhancement

Fuzzy logic is to handle the imprecision and uncertainty of information. Fuzzy systems consist of three subsystems: fuzzifier, inference system, and defuzzifier. They employ fuzzy set theory, which includes various rules defined in a linguistic information-set format using If-then-Else constructs. The fuzzy method can be used to handle uncertainty, imprecision, and vagueness in data and decision-making processes. The fuzzy method, which incorporates fuzzy rules and membership functions, is applied to model complex relationships between input and output variables.
Fuzzy was a useful method to deal with image problems with various applications. Fuzzy inference uses fuzzy logic to map inputs to outputs that achieve image-quality enhancement and reduced computational complexity [36], and it involves F-transform, which is used to deal with image compression [37] and image enhancement [38]. In the studies of fuzzy logic-based applications, the focus was on image enhancement. Shakeri et al. [39] determined the number of sub-histograms based on the peaks enables contrast enhancement without compromising the image. Joshi and Kumar [40] used the fuzzy method to enhance the contrast of the low resolution. Based on the fuzzy method, the enhanced images are obtained by equalizing using a histogram-weighting method [41], histogram equalization (HE) method [42], bi-histograms [43], linear regression [44], and neural network [45]. More advanced methods were used to enhance images by adaptive gamma transform [46], structural information for homogeneous background images [47], and image sub-division and quadruple clipped adaptive histogram equalization (ISQCAHE) [48]. The fuzzy technique exhibits lower error and retains brightness better compared to the traditional methods [49]. The comparison demonstrates that fuzzy enhancement outperforms HE, adaptive histogram equalization (AHE) [50,51,52], further studies on features, and weight adjustment to handle low-contrast images [53,54,55,56,57]. The above studies focused on handling broad aspects of image processing and did not explore further multiple-resolution videos. Although the above methods have been used to improve images, these were not suitable, especially in practice where the composition of mobility vehicle videos is relatively complex and is affected by the trucks driving in the surrounding environment of the road or alley. Therefore, this study proposed improving the enhancement method to adjust parameters for handling moving images with multiple resolutions.

3. Methodology

This paper emphasized the importance of pre-processing and proposed an improved method to overcome moving image enhancements with multiple resolutions. Appropriate pre-processing can enhance the quality of original images by reducing unnecessary information and noise to solve poor image problems. Resolution refers to the detail an image can display, and it is measured in pixels, which specify the dimensions of the image in terms of width and height. Image enhancement can improve the clarity of images, making them easier to identify and analyze reliably. Traditionally, the basic method involved adjusting the RGB colors. When the image quality was acceptable, directly adjusting the RGB colors effectively enhanced the visual appearance of the image. By adjusting the red, green, and blue colors, contrast, brightness, and color balance can be improved without the need for complex processing.
The popular pre-processing method was histogram equalization [5,33]. Histogram equalization was a widely used pre-processing method for images, focused on improving their quality. Histogram equalization was also used to adjust the distribution of pixel intensities to enhance poor images, making details more visible. When image quality was poor, a flexible adjustment method was chosen based on specific situations to achieve optimal image-enhancement results.
The fleet images were greatly affected by changes in road lighting, and we considered proposing a more flexible approach to handle different resolutions. Fuzzy logic introduced fuzzy sets into logical operations so that inferences and judgments were no longer only true or false but could include intermediate fuzzy values. Fuzzy inference is a reasoning process based on fuzzy logic, usually using a fuzzy rule base and fuzzy inference engine. Therefore, a flexible fuzzy enhancement method was adopted to effectively enhance poor image quality.
Since color comprised various shades for distinction, it was less likely to be misjudged [58]. Raju and Nair [59] proposed a fast and efficient fuzzy, which was transferred to other color spaces that handled low contrast and low bright color images. In previous studies, there have been discussions on two methods for adjusting image brightness. The first involved converting RGB to grayscale using multiplication followed by addition, which results in faster computational performance. The second method adjusted brightness and contrast, utilizing the linear function. When there was a lot of noise in the images of traffic lights, it may still interfere with the judgment results, as only black and white colors were used for judgment [60,61,62]. Based on the above conception, color conversion allowed for more parameter adjustments during image enhancement. In practice, fleet managers monitored multiple color video feeds, as grayscale images that display shades of gray, ranging from black to white, without any color are not suitable.
The key solution lies in pre-processing. The proposed fuzzy enhancement method increased image contrast and suppressed noise using OpenCV [63]. In the past, the biggest challenge encountered in research was that the truck videos received from sensors were under insufficient light. When using the OpenCV packages for testing, erroneous results still occurred. Using the concept of weighting, fuzzy theory provided appropriate weight value fuzzification variables, so that through weight value adjustment, an improved and corrected value was obtained, which can subsequently be used to improve the original identification and poor training results and enhance video-feature judgment.
The study discussed two types of images, including (1) images of the front view, and (2) images containing traffic lights. Therefore, all images contain traffic lights. Figure 1 is the flowchart, using three methods to enhance images. There are six steps as follows.
Step 1
This study collected the front camera video data from large fleets.
Step 2
The video is split into individual images, and all images contain traffic lights.
Step 3
This study conducted pre-processing tasks for image adjustment, including (i) direct RGB adjustment, (ii) histogram equalization with RGB and CIELAB conversion, and (iii) proposed fuzzy enhancement with RGB and CIELAB conversion, which belonged to the pre-processing task. The proposed fuzzy enhancement with brightness adjustment was optional.
The most direct methods adjust RGB colors, which can produce unsuitable images. CIELAB is a flexible color model method used for adjusting color values. As CIELAB space was independent of light sources and devices, it processed at speeds comparable to RGB. There were three components for CIELAB color space [64]. CIELAB can be denoted as Lab, and L denotes luminance, a is the range from red to green, and b is the range from blue to yellow. Among all color spaces, CIELAB mode can express the most abundant colors, exceeding RGB mode. CIELAB color space was designed to closely mimic human vision, focusing on providing a consistent perceptual experience. Based on the images used in [64,65], there were no complex situations involving multiple light effects and different resolutions compared to our large fleets study. Thus, this study conducted the appropriate designs and adjustments in Section 4. The purpose of the CIELAB color space was to mimic human vision, ensuring that the Euclidean distance between two colors corresponds to their perceived difference. Using OpenCV, the cvtColor function can be used to convert between CIELAB and RGB images.
For the proposed fuzzy enhancement to solve multiple resolutions, this study provided detailed descriptions. First, we considered using the Gaussian function since the Gaussian function is continuous and smooth, which provides better tolerance to image noise. The fuzzy process used the Gaussian function for image enhancement. We converted the input image from the RGB color space to CIELAB, which represents the most complete color model describing all the colors visible to the human eye and visual perception. The previous study considered that fleet images directly used RGB processing, which limited the ability to adjust color corrections. When images are collected from a camera lens with poor image quality, using CIELAB can provide a more effective method for corrections. Second, in the process of fuzzification, to avoid adjusting excessively dark near 0 or over bright near 255, this study set pixel intensity as the midpoint at 128. Through designed fuzzy inference rules, the output fuzzy set was computed. In the final defuzzification stage, the output fuzzy set was processed using the learning method and normalized. After these color-correction procedures, the result was converted back to RGB. According to [66], the contrast and brightness adjustments
g ( x ) = α f ( x ) + β
where α denotes control contrast that is the gain and β denotes bias parameters that are the brightness, f ( x ) is the source image pixels and g ( x ) is the output image pixels. The concept of Equation (1) suggests that, in this study, modified fuzzy enhancement is denoted as α f ( x ) and brightness adjustment as β. This study considered α as equaling 1. Since the fuzzy enhancement has already been completed using the function f(x), the adjustment of the fuzzy enhancement weights was not considered. β (Brightness) is a constant. Therefore, the proposed method can be simply rewritten as
F u z z y   e n h a n c e m e n t + B r i g h t n e s s   A d j u s t m e n t
After fuzzy enhancement, if the fleet manager considered that the overall image brightness was increased, brightness adjustment was considered a tuning mechanism. Brightness adjustment was optional and was potentially not necessary, depending on the image situation.
Step 4
To evaluate the front images and traffic lights, this study used mean squared error (MSE) and peak signal-to-noise ratio (PSNR) evaluation metrics to compare methods of histogram equalization and fuzzy.
Step 5
This study labeled the traffic lights, including green, red, yellow, and green left turn, from the images.
Step 6
This study employed You Only Look Once version 9 (YOLOv9) for model training. During the training process, the validation set is used to evaluate the model’s performance. Image pre-processing is performed to produce a good training model. This study compared the performance of the original model training with the enhanced image model training by providing three performance-evaluation indicators: (i) observing the impact of epoch on model results, (ii) using validation data to assess the trained model, and (iii) observing changes in the confusion matrix.
Step 7
After completing the model training, testing is conducted to evaluate the model’s detection performance.
This study described three main evaluation metrics: The first metric is to calculate the MSE between the original image and the enhanced image. A smaller MSE value indicates better performance. The second was to use the PSNR, which was a metric used to measure the quality of videos. The PSNR is expressed as
P S N R = 10 × log 10 P e a k   S i n g n a l   S q u a r e d M S E
where the peak signal is the maximum possible value of the original signal and MSE. A larger PSNR value indicates better image quality. The third metric, which includes three sub-evaluation indicators, was used to observe the impact of the image pre-processing on model training. This study provided the performance of the YOLO training model with fuzzy enhancement added to improve the originally poor-quality images. The quality of images impacted traffic light training and classification accuracy. We used a pre-processing method designed to enhance the performance of the proposed method, aiming to increase the number of annotations for training images under the limited large vehicle videos. Common evaluation metrics used include precision, recall, and [email protected]. The previous study used YOLO version 4 (YOLOv4) to build the vehicle models [5]. YOLO has currently been developed to version 9, and the authors of YOLOv9, YOLOv7, and YOLOv4 are from the same team. YOLOv9 was also released in 2024 [67,68]. Thus, the traffic light images were improved for annotations, then YOLOv9 was adopted for model training, achieving enhanced image data that can be effectively utilized. Finally, this paper summarizes the novelty of the findings. This study proposed Equation (2), which provided flexibility in adjusting images. This paper utilized fuzzy enhancement to deal with images from different vehicles and conducted research on the combined effects of images of the front view for large fleets and multiple-resolution images of traffic lights. With limited fleet image data, this study provides guidance for fleet managers to perform consistent image-enhancement adjustments. This study provided a more flexible range outside of 0 to 255 to handle extreme cases of images being too dark or too bright. Through the inference of the fuzzy knowledge base, the study infers adjustments like AI for the fleet system, enabling the control of front-view images and traffic light signals for managing drivers. In addition to the primary image pre-processing, this study also incorporates YOLOv9 to further examine the impact of enhanced images on the model. In the future, continuous improvements can be made by incorporating more image data into fuzzy enhancement, contributing to large fleet management.

4. Results

There are three main pre-processing tasks for comparisons, including direct RGB adjustment, histogram equalization with RGB and CIELAB conversion, and proposed fuzzy enhancement with RGB and CIELAB conversion. This paper collected video data from cameras installed on moving large vehicles (i.e., trunks) and used Python and the OpenCV library to automate the extraction of a specific number of frames per second from the video data that included multiple image resolutions. We collected daytime video data of large vehicles between 2023 and 2024. This included 25 trucks and a total of 417 videos as detailed in Table 2. Each video was approximately 10 minutes long. The majority of collected large vehicle videos represented driving on normal roads. We labeled traffic light images from the limited video data. This study used 1837 images, with 1480 for training data (65.34%), 357 for validation data (15.76%), and 428 for testing data (18.90%).
Generally, common resolutions include Ultra High Definition (Ultra HD), Full High Definition (Full HD), High Definition (HD), Standard Definition (SD), and Low Resolution. According to the collected video data from large vehicle fleets, the commonly used cameras had resolutions below Full HD. This was because most fleet managers considered costs. The managers chose color videos, and vehicles had different camera installations, resulting in varying resolutions. This study used the Python Imaging Library (PIL) package to determine the resolution category based on width and height in Table 3. The total training data were 1480, with 1447 belonging to HD, 16 belonging to SD, and 17 belonging to low resolution in Figure 2. There were 16 SD and 17 low resolution that had poor image quality compared to HD.
In actual deliveries, the drivers usually chose to take the route with green lights and the smoothest flow. Due to time constraints for every deployment of tasks, drivers often tried to avoid red lights to prevent delays. Fleet managers were also concerned about the number of times drivers ran red lights. This sparked an interest in traffic lights, and the objects were also considered from full front images to small traffic lights. Based on data information in Table 2, the total image data was 1837, with 1480 for training and 357 for validation. In this study, all 1837 collected images contain traffic lights, with classes including green, red, yellow, and green left turn lights. The number of annotations included 1073 for green, 579 for red, 157 for yellow, and 28 for green left turn in Figure 3. According to the traffic light image annotations, the number of annotations was greater than red lights, yellow, and green left turns. According to the number of traffic lights, it is necessary to add annotations to these four lights.
This study selected the most challenging poor-quality images from among 33 with resolutions smaller than HD as an example. This study required addressing the pre-processing through image enhancement. Image pre-processing involved adjusting images to fixed width and height dimensions and reducing the size of the image. If images were cropped, some information could be lost. Due to three different resolutions, this study resized all images to the same width and height size (1:1). In practice, fleet managers usually observed the color images and adjusted their light and contrast. With one low-resolution case from 33 as an example, to adjust images using RGB factors, the R factor provided was 0.8, the G factor was 1.0, and the B factor was 0.8 as an example in Figure 4. The advantages of RGB conversion were that it was simple, its relative ease of color-mixing calculations, and that it allowed for the adjustment of the final color exhibition. However, as shown in Figure 4, the limitation of RGB was that it was difficult to make localized adjustments. The result of RGB was for global adjustments and was not suitable for this low-resolution case.
Based on image color conversion using the cvtColor function from OpenCV, the image was first converted from RGB to CIELAB, and then from CIELAB back to RGB. Histogram equalization on the L channel was used to enhance the image and adjusted the intensity distribution of the image to make the histogram more uniform. Compared to histogram equalization, fuzzy enhancement on the L channel had a more flexible scale adjustment using (L − Lmin/Lmax − Lmin) × (255 − 0). For the 33 poor-quality images, there were no extremely bright images. At first, we considered very bright (VB), slightly bright (SB), bright (B), dark (D), slightly dark (SD), very dark (VD), and extremely dark (ED). According to the description from Section 3, this study used the Gaussian membership function to handle different resolutions. The negative −0.5 was used to reverse the direction of the exponent, thereby forming the Gaussian distribution of e x p 0.5 × x m e a n s t d e v 2 . We set the input as x [ 45 ,   300 ] . The abbreviation for pixel intensity value is PV. VB denoted the mean was 255, B denoted the mean was PV + (255 − PV)/2 and SB denoted the mean was PV + (255 − PV)/8. Since the images did not have extremely bright cases, we added moderately bright (MB), which denoted the mean was 150 to adjust the parameters of the membership functions to meet the expected fuzzy logic requirements. These standard deviations (stdev) were (255 − PV)/8. SD denoted the mean was 5PV/8, D denoted the mean was PV/2, and VD denoted the mean was 0. Since the images did not have many extremely dark areas, we adjusted the mean to keep the extremely bright (EB) curve short. These standard deviations (stdev) were PV/8. We used the median 128 value for PV that was from 0 (darkness) to 255 (brightness), and we used the probability density function value of the Gaussian distribution. The input function is shown in Figure 5, and fuzzy inference based on trial and error is shown in Table 4. Due to the multiple resolutions in the collected fleet images, and some of which had poor quality, this study calculated the Gaussian distribution values and provided a more flexible range outside of 0 to 255 to handle extreme cases of images being too dark or too bright. Then, the L channel from CIELAB was normalized to adjust the values back to the 0-to-255 range. This study performed defuzzification using the centroid method with the pixel intensity range set to [ 45 ,   300 ] , while normalization is an important step in data processing, which is to transform [ 45 ,   300 ] into [ 0 ,   255 ] .
When the data had low-light images in Figure 4, CIELAB can be used to adjust for fuzzy enhancement. As shown in Figure 6, the adjustments of fuzzy are better than HE with one low-resolution case as an example. In Figure 6, it can be observed that the image is slightly overexposed using histogram equalization. Using fuzzy enhancement and fuzzy (enhancement) with brightness made the images appear clearer. This study was also attempting to solve the issue of insufficient training due to a lower number of traffic light annotations. Without adequate pre-processing, identifying the lights properly became more difficult, making the labeling process time-consuming.
In Table 5, for image pre-processing, all processed images were resized to the same 360 × 360 size. In comparison with the original image in Figure 4, histogram equalization had a higher MSE performance. β (Brightness) is a constant with a value of 7 used in Table 5. Therefore, the brightness was adjusted to 7. Fuzzy (enhancement) with brightness adjustment obtained the lower MSE and higher PSNR. Histogram equalization did not perform well in multiple resolutions. Joshi and Kumar’s fuzzy [40] considered converting RGB images to grayscale and used to combine Gaussian and trapezoidal functions with the range of pixel values set to [0, 255]. Based on [40], this study incorporated a trapezoidal function defined as T(x, a, b, c, d), where x is the input value and x [ 0 ,   255 ] , while a and d represent the start and end points of the trapezoid, and b and c represent the start and end points of the top platform of the trapezoid. The setting T(x, 0, 0, PV/8, PV/4) was used for extremely dark, T(x, 255 − (255 − PV)/3, 255 − (255 − PV)/6, 255, 255) was used for extremely bright. Moreover, in the Gaussian function, Very Dark (VD) denoted the mean was 0, Dark denoted the mean was PV/2, and Slightly Dark denoted the mean was 5PV/8. These standard deviations (stdev) were PV/8. Slightlybright denoted the mean was PV + (255 − PV)/8, Bright denoted the mean was PV + (255 − PV)/2, and Very Bright denoted the mean was 255. These standard deviations (stdev) were (255 − PV)/8. Fleet personnel can use further different combinations of Gaussian and trapezoidal functions to achieve suitable results. In these cases, using fuzzy for image adjustment was more flexible for handling multiple resolutions.
This study listed 33 poor-quality images in Figure 7 and Figure 8. The MSE values of fuzzy enhancement (Fuzzy) were smaller than the MSE values of histogram equalization (HE). The PSNR values of fuzzy enhancement were higher than the PSNR values of histogram equalization in Figure 8.
This study also assigned the region from the original red-light image from Figure 4 to determine the impact of surrounding lighting on traffic lights in Table 6. We used the same HE and fuzzy parameter settings to observe how much the surrounding light affects the original red-light image. Using histogram equalization methods caused distortion and was affected by light. Based on Joshi and Kumar’s fuzzy [40], the graphical result was shown in Table 6. Fleet managers monitored multiple color video feeds, as grayscale images that display shades of gray without any color are not applicable. In this study, converting color images allows for intuitive adjustments and annotations. The proposed fuzzy method enhanced the traffic light images. After adjustments through fuzzy enhancement with brightness adjusted to 7, the image contours became clearer. In this low-resolution image, the traffic lights were greatly affected by the surrounding light.
Moreover, pre-processing using fuzzy entailed reducing noise in images, thereby enabling more precise feature extraction by the model. This not only reduced the computational loading but also enhanced the accuracy of the model. The pre-processing using the proposed fuzzy enhancement method can be used to increase the variety of training data volume for annotation and better handle variations in lighting. Furthermore, pre-processing using fuzzy can be considered a form of useful enhancement, increasing the diversity of training samples, especially when video data are limited.
Histogram equalization enhancement is a part of classical data augmentation. This study includes Table 6 to illustrate that using histogram equalization enhancement for data augmentation can lead to the appearance of damaged red-light images. If these augmented images are incorporated into YOLOv9 for model training, it could affect the overall performance.
For the training procedure, this study used a desktop PC running Microsoft Windows 11, with an Intel Core i5-9400F CPU at 2.90 GHZ, 32.0 GB of RAM, and the capabilities of NVIDIA GeForce RTX 3080 graphic processing unit (GPU) for accelerated computation via compute unified devices architecture (CUDA). This paper was used to train the traffic lights model using YOLOv9. The training dataset is used to train the model, while the validation dataset is used to evaluate the model’s performance during the training process. Precision measures how many of the positives detected by the model are true positives. Recall measures how effectively the model can detect the actual existing target traffic lights. The YOLOv9 used in this study is based on a PyTorch framework. The training hyperparameters were based on the YOLOv9 default setting, and the results are as follows: the initial learning rate (lr0) is 0.01, the final learning rate (lrf) is 0.01, momentum is 0.937, and weight decay is 0.0005. The warmup is three epochs, with warmup momentum at 0.8 and a warmup bias learning rate at 0.1. The box loss is 7.5, the classification loss is 0.5, and the classification loss power (cls_pw) is 1. The object loss is 0.7, with an object loss power (obj_pw) of 1. The distribution focal loss (dfl) is 1.5, the IoU threshold (iou_t) is 0.2, and the anchor threshold (anchor_t) is 5. The focal loss gamma (fl_gamma) is 0. The HSV hue (hsv_h) is 0.015, the HSV saturation (hsv_s) is 0.7, and the HSV value (hsv_v) is 0.4. The rotation angle (degrees) is 0, translation is 0.1, scale is 0.9, shear is 0, and perspective is 0. The vertical flip probability (flipud) is 0, the horizontal flip probability (fliplr) is 0.5, mosaic is 1, mixup is 0.15, and copy_paste is 0.3.
When training a model using YOLO, the number of epochs is a critical factor influencing its stability and performance. In Figure 9 and Figure 10, the results showed that precision and recall had substantial fluctuation before 500 epochs, but slight fluctuation after 500 epochs indicated better training effectiveness. In Figure 11, mean average precision (mAP), which is the result of averaging the AP for all classes, is to evaluate the performance of models. [email protected] is the mAP calculated with a 0.5 intersection over union (IoU), which is a metric used to measure the overlap between the predicted bounding box and the ground truth box. [email protected] is used in evaluation metrics in object detection tasks and measures the model’s accuracy. [email protected] was stable after 500 epochs.
Although a larger number of epochs tends to stabilize the model, it is evident that the model is affected by three different resolutions. Too many epochs can take a lot of time. Previous studies did not specify how many epochs to set; typically, fewer than 500 is a threshold. Increasing the number of epochs would increase the training time and cost. From this, it is evident that pre-processing needed to be utilized. We enhanced 33 poor-quality images and added these 33-to-1480 data, which were 1513 images using YOLOv9, called YOLOv9 with fuzzy enhancement. Classical data-augmentation methods commonly enhance an image by adjusting its grayscale distribution. The fleet managers analyzed the traffic light images and determined that they need to use the original color images rather than converting them to grayscale. The histogram equalization enhancement, which belongs to classical data, as provided in Table 6. Moreover, while using customized manual and other classical data-augmentation methods, such as contrast, saturation, cropping, and brightness adjustments, for individual images can provide multiple adjustment combinations for model training, eventually yielding better performance, it requires a significant amount of time and resources. This approach is not practical for fleet management, as it would require more manpower, making it unsuitable for practical applications. When we added 33 images after fuzzy enhancement to the original 1480 images, making a total of 1513 images for annotations and model training, Figure 9 shows that the precision results of YOLOv9 with fuzzy enhancement on epoch > 600 is higher than YOLOv9. The same results of recall and the recall results of YOLOv9 with fuzzy enhancement on epoch > 450 are higher than those of YOLOv9 in Figure 10. In Figure 11, as the epoch increased, both YOLOv9 and YOLOv9 with fuzzy enhancement stabilized, with the result of YOLOv9 with fuzzy enhancement reaching above 0.9.
For model training, the results of YOLOv9 with fuzzy enhancement still required more epochs to achieve stability. In this study, we chose a batch size of 8, and YOLOv9 and YOLOv9 with fuzzy enhancement used 800 epochs completed in 17.009 h (YOLOv9) and 17.361 h (YOLOv9 with fuzzy enhancement) using YOLOv9-c (complex). For all classes, YOLOv9 with fuzzy enhancement had the better results for precision, recall, [email protected], and [email protected]:0.95. Figure 12 shows the loss curves for YOLOv9 and YOLOv9 with fuzzy enhancement.
Table 7 mainly discusses the use of validation data to evaluate the trained model. This study listed the validating performance of YOLOv9 and YOLOv9 with fuzzy enhancement. For green, green left, yellow, and red classes, most performances of YOLOv9 with fuzzy enhancement were better. The enhanced 33 poor-quality images had achieved good results.
All collected images in this study contain traffic lights. We proposed a fuzzy method for enhancing fleet image processing by incorporating inference adjustments from the fuzzy rule base. In the future, we will include the collective experience of fleet management personnel to provide consistent parameter enhancement for multiple resolutions. Previously, when using data-augmentation techniques, several personnel were involved in the image-processing task, but each person had their own adjustment for images, which subsequently affected the image management and analysis. Moreover, this paper focused on the image pre-processing of traffic lights to evaluate the addition of enhanced images to the training data under limited image collection and used YOLOv9 for model training. Future research will further examine the impact of running red lights or traffic lights on transportation.
This paper also included a confusion matrix for evaluation in Figure 13. From Figure 13, the trained green, red, and yellow models achieved good results. Since the increase in labeled images was only 33, and the additional labels mainly included green and red lights, there was not a significant difference when comparing the two results. In the future, it will be necessary to collect more video data for image analysis to effectively address this issue.
This paper considered using testing data for the detection comparisons of YOLOv9 with histogram equalization enhancement, YOLOv9, and YOLOv9 with fuzzy enhancement. This study added 428 images for testing and set the confidence score to greater than 0.8 as the threshold for detecting four types of traffic light signals. Histogram equalization enhancement is one of the commonly used classical data-augmentation methods for fleet management personnel. Table 8 shows that YOLOv9 with fuzzy enhancement demonstrated better performance.

5. Discussion

Mobile vehicle video data were greatly influenced by the environment and had variability. These videos were divided into many frames to enable frame-by-frame playback, creating a coherent dynamic effect. Finding usable images and adjusting their quality to increase annotation were necessary for obtaining an effective training model. CCTV data focused their analysis on a fixed area where the environmental impact was minimal. The fixed scene only required software optimization for the impact of traffic lights on fixed positions. However, the changing scenes in this study required a consideration of the clarity of traffic light recognition, as well as the changes in surrounding lighting and objects for appropriate software optimization. The contribution performed mobility data for model training had a wider range of applications not limited to a fixed area. This study analyzed events that occurred after collecting mobility video data. Therefore, this study is a post-analysis. Future research will collect CCTV image data to compare and analyze together.
Due to the poor quality of the collected fleet images, this study provided more flexible image enhancement adjustments using the fuzzy method. This study also considered the option for overall brightness after fuzzy enhancement. Thus, this paper proposed improving image pre-processing using Equation (2). In the future, as more large fleet images are collected, the testing and adjustment of fuzzy enhancement will continue to solve the multiple resolutions in fleet management.
In practice, the different quality of cameras installed in many large vehicles varies, so properly utilizing existing data for annotation is important. With limited data, finding more traffic light data was challenging. Some vehicles frequently traveled through fixed routes where the traffic lights were the same, but the lighting conditions varied daily. Choosing suitable traffic lights manually for annotation took time, thereby improving the original images directly was more effective. YOLOv9 with fuzzy enhancement has demonstrated improved performance in pre-processing fleet images. YOLOv9 exhibits substantial advancements compared to older versions. In further studies, older versions of YOLO can also be used for comparison, as different versions have proven useful for handling various image cases in the literature. The older versions of YOLO performed better in optimizing specific image-processing tasks and offered better compatibility with existing systems.
A limitation of the study is that it did not consider nighttime conditions, as well as adaptive parameters and brightness adjustments. Moreover, based on the equipment limitation, the car kits using 4G and its bandwidth cannot transmit full HD video back. In the future, the equipment will be upgraded to 5G, which has high-speed and low-latency characteristics and is expected to make the video return full HD or higher quality. However, this would require additional expenditure to purchase equipment. In practice, not every large vehicle fleet had the budget to install the same equipment. Therefore, using pre-processing is still the best solution. Further work will collect more video data and add more adjusted images to enhance the training model.

6. Conclusions

In practice, when large fleets were driving on the road, the collected images often encountered multiple resolutions. To avoid having personnel adjust images based on individual experience, this study incorporated fuzzy logic into image pre-processing, like integrating expert experience into fuzzy inference. The proposed fuzzy method provided consistent parameter adjustments for images. The contribution of this paper proposed fuzzy enhancement that made pre-processing more flexible to handle multiple resolutions. This proposed fuzzy enhancement with RGB and CIELAB conversion achieved the pre-processing task using PSNR and MSE for evaluation. The proposed fuzzy enhancement and fuzzy enhancement with brightness can improve images with lower MSE and higher PSNR for handling complicated moving images. The fuzzy enhancement and fuzzy enhancement with brightness can also make the traffic light image contours clearer. From the MSE values shown in Table 5 and Figure 7, the fuzzy enhancement and fuzzy enhancement with brightness adjustment (adjusted to 7) demonstrated significant improvement for image pre-processing.
After evaluation, the fuzzy method can be used to enhance large fleet image pre-processing tasks. Next, the focus is on the effect of resolution on the training of traffic light models under the limitation of having a limited number of images. The enhanced 33 images were adjusted using fuzzy enhancement and added to the model training. According to the results of YOLOv9 for traffic lights, there were more than 500 epochs necessary to achieve stability. The YOLOv9 with fuzzy enhancement images obtained better performance, and image enhancement is useful for model training via fuzzy enhancement that can be flexibly adjusted for large fleets to handle pre-processing tasks. YOLOv9 with fuzzy enhancement obtained better detection performance compared to YOLOv9 with histogram equalization enhancement and YOLOv9.

Author Contributions

Conceptualization, C.-Y.M.; Methodology, P.K.; Software, P.K.; Validation, P.K.; Formal analysis, P.K.; Investigation, C.-Y.M.; Data curation, C.-Y.M.; writing—original draft preparation, C.-Y.M. and P.K.; writing—review and editing, C.-Y.M. and P.K.; Visualization, P.K.; Supervision, C.-Y.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by SkyEyes GPS Technology Co., Ltd., and National Science and Technology Council: NSTC 112-2622-M-035-001-.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Acknowledgments

We thank Poopedi Ismael Setswale for proofreading this paper and Chin-Wei Pan for organizing the data.

Conflicts of Interest

The authors declare that this study received funding from SkyEyes GPS Technology Co., Ltd. The funder was involved in providing data sources.

References

  1. Bommes, M.; Fazekas, A.; Volkenhoff, T.; Oeser, M. Video based intelligent transportation Systems—State of the art and future development. Transp. Res. Procedia 2016, 14, 4495–4504. [Google Scholar] [CrossRef]
  2. Orozco, M.C.E.; Rebong, C.B. Vehicular training and classification for intelligent transportation system: A deep learning approach using faster R-CNN model. Platero 2019, 180, 36551. [Google Scholar]
  3. Khan, S.; Adnan, A.; Iqbal, N. Applications of artificial intelligence in transportation. In Proceedings of the 2022 International Conference on Electrical, Computer and Energy Technologies (ICECET), Prague, Czech Republic, 20–22 July 2022; pp. 1–6. [Google Scholar]
  4. Li, W.; Hsu, C.-Y. GeoAI for large-scale image analysis and machine vision: Recent progress of artificial intelligence in geography. ISPRS Int. J. Geo-Inf. 2022, 11, 385. [Google Scholar] [CrossRef]
  5. Mu, C.Y.; Kung, P.; Chen, C.F.; Chuang, S.C. Enhancing front-vehicle training in large vehicle fleet management. Remote Sens. 2022, 14, 1544. [Google Scholar] [CrossRef]
  6. Myagmar-Ochir, Y.; Kim, W. A survey of video surveillance systems in smart city. Electronics 2023, 12, 3567. [Google Scholar] [CrossRef]
  7. Kutlimuratov, A.; Khamzaev, J.; Kuchkorov, T.; Anwar, M.S.; Choi, A. Applying enhanced real-time monitoring and counting method for effective traffic management in Tashkent. Sensors 2023, 23, 5007. [Google Scholar] [CrossRef]
  8. Kalyan, S.S.; Pratyusha, V.; Nishitha, N.; Ramesh, T.K. Vehicle detection using image processing. In Proceedings of the 2020 IEEE International Conference for Innovation in Technology (INOCON), Bangluru, India, 6–8 November 2020; pp. 1–5. [Google Scholar]
  9. Shahriar, M.T.; Li, H. A study of image pre-processing for faster object recognition. arXiv 2020, arXiv:2011.06928. [Google Scholar]
  10. Liu, Y.; Kong, L.; Chen, G.; Xu, F.; Wang, Z. Light-weight AI and IoT collaboration for surveillance video pre-processing. J. Syst. Archit. 2021, 114, 101934. [Google Scholar] [CrossRef]
  11. Eamthanakul, B.; Ketcham, M.; Chumuang, N. The traffic congestion investigating system by image processing from CCTV camera. In Proceedings of the 2017 International Conference on Digital Arts, Media and Technology (ICDAMT), Chiang Mai, Thailand, 1–4 March 2017; pp. 240–245. [Google Scholar]
  12. Kurniawan, A.; Ramadlan, A.; Yuniarno, E.M. Speed monitoring for multiple vehicle using closed circuit television (CCTV) camera. In Proceedings of the 2018 International Conference on Computer Engineering, Network and Intelligent Multimedia (CENIM), Surabaya, Indonesia, 26–27 November 2018; pp. 88–93. [Google Scholar]
  13. Bui, K.-H.N.; Yi, H.; Cho, J. A Multi-Class Multi-Movement Vehicle Counting Framework for Traffic Analysis in Complex Areas Using CCTV Systems. Energies 2020, 13, 2036. [Google Scholar] [CrossRef]
  14. Lee, C.; Kim, H.; Oh, S.; Doo, I. A study on building a “real-time vehicle accident and road obstacle notification model” using AI CCTV. Appl. Sci. 2021, 11, 8210. [Google Scholar] [CrossRef]
  15. Peppa, M.V.; Komar, T.; Xiao, W.; James, P.; Robson, C.; Xing, J.; Barr, S. Towards an end-to-end framework of CCTV-based urban traffic volume training and prediction. Sensors 2021, 21, 629. [Google Scholar] [CrossRef] [PubMed]
  16. Elmitiny, N.; Yan, X.; Radwan, E.; Russo, C.; Nashar, D. Classification analysis of driver’s stop/go decision and red-light running violation. Accid. Anal. Prev. 2010, 42, 101–111. [Google Scholar] [CrossRef]
  17. Ho, G.T.S.; Tsang, Y.P.; Wu, C.H.; Wong, W.H.; Choy, K.L. A computer vision-based roadside ooccupation surveillance system for intelligent transport in smart cities. Sensors 2019, 19, 1796. [Google Scholar] [CrossRef]
  18. Dilek, E.; Dener, M. Computer Vision Applications in Intelligent Transportation Systems: A survey. Sensors 2023, 23, 2938. [Google Scholar] [CrossRef] [PubMed]
  19. Basheer Ahmed, M.I.; Zaghdoud, R.; Ahmed, M.S.; Sendi, R.; Alsharif, S.; Alabdulkarim, J.; Albin Saad, B.A.; Alsabt, R.; Rahman, A.; Krishnasamy, G. A real-time computer vision based approach to training and classification of traffic incidents. Big Data Cogn. Comput. 2023, 7, 22. [Google Scholar] [CrossRef]
  20. Abdel-Aty, M.; Wang, Z.; Zheng, O.; Abdelraouf, A. Advances and applications of computer vision techniques in vehicle trajectory generation and surrogate traffic safety indicators. Accid. Anal. Prev. 2023, 191, 107191. [Google Scholar] [CrossRef]
  21. Clark, A. Pillow (Pil Fork) Documentation. Available online: https://readthedocs.org/projects/pillow/downloads/pdf/latest (accessed on 26 July 2024).
  22. Ng, J.Y.; Tay, Y.H. Image-based vehicle classification system. arXiv 2012, arXiv:1204.2114. [Google Scholar]
  23. Al-Shemarry, M.S.; Li, Y. Developing learning-based preprocessing methods for detecting complicated vehicle licence plates. IEEE Access 2020, 8, 170951–170966. [Google Scholar] [CrossRef]
  24. Shariff, A.M.; Bhatia, R.; Kuma, R.; Jha, S. Vehicle number plate training using python and open cv. In Proceedings of the 2021 International Conference on Advance Computing and Innovative Technologies in Engineering (ICACITE), Greater Noida, India, 4–5 March 2021; pp. 525–529. [Google Scholar]
  25. Puniani, S.; Arora, S. Performance evaluation of image enhancement techniques. Int. J. Signal Process. Image Process. Pattern Recognit. 2015, 8, 251–262. [Google Scholar] [CrossRef]
  26. Beti, I.-A.; Herghelegiu, P.-C.; Caruntu, C.-F. Architectural framework to enhance image-based vehicle positioning for advanced functionalities. Information 2024, 15, 323. [Google Scholar] [CrossRef]
  27. Manana, M.; Tu, C.; Owolawi, P.A. Preprocessed faster RCNN for vehicle training. In Proceedings of the 2018 International Conference on Intelligent and Innovative Computing Applications (ICONIC), Mon Tresor, Mauritius, 6–7 December 2018; pp. 1–4. [Google Scholar]
  28. Park, K.; Chae, M.; Cho, J.H. Image pre-processing method of machine learning for edge training with image signal processor enhancement. Micromachines 2021, 12, 73. [Google Scholar] [CrossRef] [PubMed]
  29. Maharana, K.; Mondal, S.; Nemade, B. A review: Data pre-processing and data augmentation techniques. Glob. Transit. Proc. 2022, 3, 91–99. [Google Scholar] [CrossRef]
  30. Patel, O.; Maravi, Y.P.; Sharma, S. A comparative study of histogram equalization based image enhancement techniques for brightness preservation and contrast enhancement. arXiv 2013, arXiv:1311.4033. [Google Scholar] [CrossRef]
  31. Tanaka, H.; Taguchi, A. Brightness preserving generalized histogram equalization. In Proceedings of the 2020 IEEE Region 10 Conference (Tencon), Osaka, Japan, 16–19 November 2020; pp. 1397–1400. [Google Scholar]
  32. Hapsari, R.K.; Utoyo, M.I.; Rulaningtyas, R.; Suprajitno, H. Comparison of histogram based image enhancement methods on iris images. J. Phys. Conf. Ser. 2020, 1569, 022002. [Google Scholar] [CrossRef]
  33. Dhal, K.G.; Das, A.; Ray, S.; Gálvez, J.; Das, S. Histogram equalization variants as optimization problems: A review. Arch. Comput. Methods Eng. 2021, 28, 1471–1496. [Google Scholar] [CrossRef]
  34. Vijayalakshmi, D.; Nath, M.K. A novel contrast enhancement technique using gradient-based joint histogram equalization. Circuits Syst. Signal Process. 2021, 40, 3929–3967. [Google Scholar] [CrossRef]
  35. Ye, B.; Jin, S.; Li, B.; Yan, S.; Zhang, D. Dual histogram equalization algorithm based on adaptive image correction. Appl. Sci. 2023, 13, 10649. [Google Scholar] [CrossRef]
  36. Pandey, A.K.; Chatla, H.N.; Pandya, M.; Farhan, A.; Rana, A.S. Image edge training using Fuzzy Logic Controller. In Proceedings of the 2023 International Conference on Recent Advances in Electrical, Electronics & Digital Healthcare Technologies (REEDCON), New Delhi, India, 1–3 May 2023; pp. 508–513. [Google Scholar]
  37. Di Martino, F.; Sessa, S. Fuzzy Transform for Image and Video Compression. In Fuzzy Transforms for Image Processing and Data Analysis; Springer: Cham, Switzerland, 2020. [Google Scholar]
  38. Roopaei, M.; Eghbal, M.K.; Shadaram, M.; Agaian, S. Noise-free rule-based fuzzy image enhancement. Electron. Imaging 2016, 28, art00029. [Google Scholar] [CrossRef]
  39. Shakeri, M.; Dezfoulian, M.H.; Khotanlou, H.; Barati, A.H.; Masoumi, Y. Image contrast enhancement using fuzzy clustering with adaptive cluster parameter and sub-histogram equalization. Digit. Signal Process. 2017, 62, 224–237. [Google Scholar] [CrossRef]
  40. Joshi, S.; Kumar, S. Image contrast enhancement using fuzzy logic. arXiv 2018, arXiv:1809.04529. [Google Scholar]
  41. Mirbolouk, S.; Valizadeh, M.; Amirani, M.C.; Choukali, M.A. A fuzzy histogram weighting method for efficient image contrast enhancement. Multimed. Tools Appl. 2020, 80, 2221–2241. [Google Scholar] [CrossRef]
  42. Paul, A.; Sutradhar, T.; Bhattacharya, P.; Maity, S.P. Infrared images enhancement using fuzzy dissimilarity histogram equalization. Optik 2021, 247, 167887. [Google Scholar] [CrossRef]
  43. Paul, A.; Bhattacharya, P.; Maity, S.P. Histogram modification in adaptive bi-histogram equalization for contrast enhancement on digital images. Optik 2022, 259, 168899. [Google Scholar] [CrossRef]
  44. Chaudhary, S.; Bhardwaj, A.; Rana, P. Image enhancement by linear regression algorithm and sub-histogram equalization. Multimed. Tools Appl. 2022, 81, 29919–29938. [Google Scholar] [CrossRef]
  45. Ahmed, M.A.; Althubiti, S.A.; de Albuquerque, V.H.C.; dos Reis, M.C.; Shashidhar, C.; Murthy, T.S.; Lydia, E.L. Fuzzy wavelet neural network driven vehicle training on remote sensing imagery. Comput. Electr. Eng. 2023, 109, 108765. [Google Scholar] [CrossRef]
  46. Zhang, D.; Liu, Y.; Zhao, Y.; Liang, J.; Sun, B.; Chu, S. Algorithm Research on Detail and Contrast Enhancement of High Dynamic Infrared Images. Appl. Sci. 2023, 13, 12649. [Google Scholar] [CrossRef]
  47. Vijayalakshmi, D.; Nath, M.K. A systematic approach for enhancement of homogeneous background images using structural information. Graph. Models 2023, 130, 101206. [Google Scholar] [CrossRef]
  48. Acharya, U.K.; Kumar, S. Image sub-division and quadruple clipped adaptive histogram equalization (ISQCAHE) for low exposure image enhancement. Multidimens. Syst. Signal Process. 2023, 34, 25–45. [Google Scholar] [CrossRef]
  49. Magudeeswaran, V.; Ravichandran, C.G. Fuzzy logic-based histogram equalization for image contrast enhancement. Math. Probl. Eng. 2013, 2013.1, 891864. [Google Scholar] [CrossRef]
  50. Rana, S.B. Performance evaluation of HE, AHE and fuzzy image enhancement. Int. J. Comput. Appl. 2015, 122. [Google Scholar]
  51. Kaur, J.; Kaur, A. Image contrast enhancement method based on fuzzy logic and histogram equalization. Int. Res. J. Eng. Technol. 2016, 3, 3089–3096. [Google Scholar]
  52. Kaur, T.; Sidhu, R.K. Optimized adaptive fuzzy based image enhancement techniques. International Journal of Signal Processing. Image Process. Pattern Recognit. 2016, 9, 11–20. [Google Scholar]
  53. Kumar, M.; Chatterjee, S.; Zhang, W.; Yang, J.; Kolbe, L.M. Fuzzy theoretic model based analysis of image features. Inf. Sci. 2019, 480, 34–54. [Google Scholar] [CrossRef]
  54. Onyedinma, E.; Onyenwe, I.; Inyiama, H. Performance Evaluation of Histogram Equalization and Fuzzy image Enhancement Techniques on Low Contrast Images. arXiv 2019, arXiv:1909.03957. [Google Scholar]
  55. Mayathevar, K.; Veluchamy, M.; Subramani, B. Fuzzy color histogram equalization with weighted distribution for image enhancement. Optik 2020, 216, 164927. [Google Scholar] [CrossRef]
  56. Khan, M.F.; Goyal, D.; Nofal, M.M.; Khan, E.; Al-Hmouz, R.; Herrera-Viedma, E. Fuzzy-based histogram partitioning for bi-histogram equalisation of low contrast images. IEEE Access 2020, 8, 11595–11614. [Google Scholar] [CrossRef]
  57. Kabir, M.; Mobin, J.; Hassanat, A.; Rahman, M.S. Image contrast enhancement using fuzzy technique with parameter determination using metaheuristics. arXiv 2023, arXiv:2301.12682. [Google Scholar]
  58. Tanaka, H.; Taguchi, A. Generalized Differential Gray-level Histogram Equalization. In Proceedings of the 2019 International Symposium on Intelligent Signal Processing and Communication Systems (ISPACS), Taipei, Taiwan, 3–6 December 2019; pp. 1–2. [Google Scholar]
  59. Raju, G.; Nair, M.S. A fast and efficient color image enhancement method based on fuzzy-logic and histogram. AEU-Int. J. Electron. Commun. 2014, 68, 237–243. [Google Scholar] [CrossRef]
  60. Kaur, T.; Sidhu, R.K. Performance evaluation of fuzzy and histogram based color image enhancement. Procedia Comput. Sci. 2015, 58, 470–477. [Google Scholar] [CrossRef]
  61. Jebadass, J.R.; Balasubramaniam, P. Low contrast enhancement technique for color images using interval-valued intuitionistic fuzzy sets with contrast limited adaptive histogram equalization. Soft Comput. 2022, 26, 4949–4960. [Google Scholar] [CrossRef]
  62. Jebadass, J.R.; Balasubramaniam, P. Color image enhancement technique based on interval-valued intuitionistic fuzzy set. Inf. Sci. 2024, 653, 119811. [Google Scholar] [CrossRef]
  63. Color Conversions (OpenCV). Available online: https://docs.opencv.org/4.x/de/d25/imgproc_color_conversions.html (accessed on 22 July 2024).
  64. Phuangsaijai, N.; Jakmunee, J.; Kittiwachana, S. Investigation into the predictive performance of colorimetric sensor strips using RGB, CMYK, HSV, and CIELAB coupled with various data preprocessing methods: A case study on an analysis of water quality parameters. J. Anal. Sci. Technol. 2021, 12, 19. [Google Scholar] [CrossRef]
  65. Fuzzy Logic—Image Contrast Enhancement. Available online: https://www.kaggle.com/code/nguyenvlm/fuzzy-logic-image-contrast-enhancement/notebook (accessed on 22 July 2024).
  66. Changing the Contrast and Brightness of an Image! (OpenCV). Available online: https://docs.opencv.org/3.4.1/d3/dc1/tutorial_basic_linear_transform.html (accessed on 22 July 2024).
  67. Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar]
  68. Wang, C.Y.; Yeh, I.H.; Liao, H.Y.M. YOLOv9: Learning what you want to learn using programmable gradient information. arXiv 2024, arXiv:2402.13616. [Google Scholar]
Figure 1. Flowchart for image enhancement [40].
Figure 1. Flowchart for image enhancement [40].
Applsci 14 08254 g001
Figure 2. Image counts by resolution category.
Figure 2. Image counts by resolution category.
Applsci 14 08254 g002
Figure 3. Label traffic lights data.
Figure 3. Label traffic lights data.
Applsci 14 08254 g003
Figure 4. Using RGB for image conversion.
Figure 4. Using RGB for image conversion.
Applsci 14 08254 g004
Figure 5. Input function.
Figure 5. Input function.
Applsci 14 08254 g005
Figure 6. A comparison of three different image enhancements.
Figure 6. A comparison of three different image enhancements.
Applsci 14 08254 g006
Figure 7. Display 33 MSE performance for fuzzy enhancement and HE (Unit: a.u.).
Figure 7. Display 33 MSE performance for fuzzy enhancement and HE (Unit: a.u.).
Applsci 14 08254 g007
Figure 8. Display 33 PSNR performance for fuzzy enhancement and HE (Unit: a.u.).
Figure 8. Display 33 PSNR performance for fuzzy enhancement and HE (Unit: a.u.).
Applsci 14 08254 g008
Figure 9. Comparison results of precision (Unit: a.u.).
Figure 9. Comparison results of precision (Unit: a.u.).
Applsci 14 08254 g009
Figure 10. Comparison results of recall (Unit: a.u.).
Figure 10. Comparison results of recall (Unit: a.u.).
Applsci 14 08254 g010
Figure 11. Comparison results of [email protected] (Unit: a.u.).
Figure 11. Comparison results of [email protected] (Unit: a.u.).
Applsci 14 08254 g011
Figure 12. Comparison of loss curves.
Figure 12. Comparison of loss curves.
Applsci 14 08254 g012
Figure 13. Confusion matrix of YOLOv9 results.
Figure 13. Confusion matrix of YOLOv9 results.
Applsci 14 08254 g013
Table 1. Comparison of CCTV and mobility equipment.
Table 1. Comparison of CCTV and mobility equipment.
Equipment
Influencing FactorCCTVMobility
SourceFixed region cameraMobile camera
Lighting effectInfluenced by the timing (i.e., from 12:00 to 14:00)Can be affected at any time
Light sourceFixed sourceFixed and other facilities
Table 2. Data information.
Table 2. Data information.
Data
Truck VideoTrainingValidationTesting
Quantity254171480 (65.34%)357 (15.76%)428 (18.90%)
Total 2265
Table 3. Determine the resolution category based on width and height.
Table 3. Determine the resolution category based on width and height.
Processing Image Files Using Python Imaging Library (PIL) Version 10.4.0
if width ≥ 3840 and height ≥ 2160:
  return “Ultra HD”
elif width ≥ 1920 and height ≥ 1080:
  return “Full HD”
elif width ≥ 1280 and height ≥ 720:
  return “HD”
elif width ≥ 640 and height ≥ 480:
  return “SD”
else:
  return “Low Resolution”
Table 4. Fuzzy inference.
Table 4. Fuzzy inference.
Fuzzy Rules
If input is VB, then output is MB
If input is SB, then output is B
If input is B, then output is VB
If input is D, then output is VD
If input is SD, then output is D
If input is VD, then output is ED
Table 5. Compute the performance of MSE and PSNR between Figure 4 and Figure 6.
Table 5. Compute the performance of MSE and PSNR between Figure 4 and Figure 6.
ResolutionProcessMethodMSEPSNR
LowConvert 640 × 360 to 360 × 360HE116.442227.4697
Joshi and Kumar’s fuzzy [40]116.278527.4758
Fuzzy enhancement62.556630.1681
Fuzzy enhancement with brightness adjustment (adjusted to 7)54.206230.7903
Table 6. Focus on the traffic light area.
Table 6. Focus on the traffic light area.
OriginalHistogram Equalization
Enhancement
Joshi and Kumar’s Fuzzy [40]Fuzzy Enhancement Fuzzy Enhancement with Brightness Adjustment
(Adjusted to 7)
ImageApplsci 14 08254 i001Applsci 14 08254 i002Applsci 14 08254 i003Applsci 14 08254 i004Applsci 14 08254 i005
Table 7. Validating performance of YOLOv9 and YOLOv9 with fuzzy enhancement.
Table 7. Validating performance of YOLOv9 and YOLOv9 with fuzzy enhancement.
ClassImagesInstancesPrecisionRecall[email protected][email protected]:0.95
YOLOv9YOLOv9 with Fuzzy EnhancementYOLOv9YOLOv9 with Fuzzy EnhancementYOLOv9YOLOv9 with Fuzzy EnhancementYOLOv9YOLOv9 with Fuzzy Enhancement
All3573810.8610.9280.8840.8910.8980.9190.6940.708
Green2320.9150.9110.940.940.9670.9610.750.765
GreenLeft40.7290.9230.6880.750.6850.7660.5110.514
Yellow300.9440.9650.9330.9260.9890.9870.7790.791
Red1150.8560.9120.9740.9480.9490.960.7350.762
Table 8. Testing evaluation for detection.
Table 8. Testing evaluation for detection.
MethodsAccuracyPrecisionRecallF1-Score
YOLOv9 with histogram equalization enhancement0.74300.87360.83250.8525
YOLOv90.75000.87700.83810.8571
YOLOv9 with fuzzy enhancement0.82480.91690.89140.9040
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Mu, C.-Y.; Kung, P. Enhancing the Image Pre-Processing for Large Fleets Based on a Fuzzy Approach to Handle Multiple Resolutions. Appl. Sci. 2024, 14, 8254. https://doi.org/10.3390/app14188254

AMA Style

Mu C-Y, Kung P. Enhancing the Image Pre-Processing for Large Fleets Based on a Fuzzy Approach to Handle Multiple Resolutions. Applied Sciences. 2024; 14(18):8254. https://doi.org/10.3390/app14188254

Chicago/Turabian Style

Mu, Ching-Yun, and Pin Kung. 2024. "Enhancing the Image Pre-Processing for Large Fleets Based on a Fuzzy Approach to Handle Multiple Resolutions" Applied Sciences 14, no. 18: 8254. https://doi.org/10.3390/app14188254

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop