Auto Brightness Recognition with Deep Learning

GitHub

For more details, please refer to README.md on GitHub.

Inspiration

The percentage of Windows computers with light sensors is low, leading users to manually adjust the screen brightness to suit different environments. However, this becomes inconvenient, especially for frequent computer users in varying environments. To enhance user experience and comfort, we aim to develop a program that utilizes the camera to automatically adjust screen brightness according to the environment's lighting conditions.

What it does

With this application, Windows computers equipped with built-in web cam can automatically adjust their brightness to match the ambient light even without a light sensor.

Model Implementation

The application used a Convolution Neural Network (CNN) to predict the ambient brightness and make a decision to adjust the screen brightness with 4 levels (i.e. 12%, 37%, 62%, 87%).

Hyperparameters:
  • Adam optimizer is used for faster convergence.
  • Learning Rate: 0.001
  • Momentum: 0.9
    • Empirically, this combination of LR and Momentum is well performed.
  • Output Channels: 2
    • There is no need to implement a complex model for recognizing ambient brightness. Otherwise, a overfit will happen as tested so far.
Early Stopping:
  • The fourth weight (i.e. Wight3.ckpt) is selected to be the final model to prevent overfit since validation and test accuracy has already reached 99%.

For more a detailed solution, please refer to CNN.ipynb.

UI & Interface Implementation

At every second, the application will capture a 480p picture through the webcam and store it on your local computer only (i.e. no internet access needed). The application will also create a CNN object and load the weights into the model as the application started.

The interface contains a CNN class and will read the stored weight. There is a function which takes a picture as the parameter and produces the asperate screen brightness.

Challenges we ran into

The application's ability to auto-adjust the screen brightness is limited to four discrete levels due to the absence of a continuously and smoothly adjustable light source at the University of Toronto. Consequently, the dataset utilized by the application is restricted to categorical data. Even if such a light source existed, insufficient personnel would impede the collection of an adequate number of samples. Alternatively, a softmax activation function could enable continuous mapping by the model.

Accomplishments that we're proud of

We are delighted to have leveraged machine learning to solve the issue faced by Windows users who need to manually adjust the brightness due to the absence of an ambient light sensor. This has significantly enhanced the user experience, making technology more accessible to people, and allowing them to enjoy its benefits to the fullest.

What we learned

All of us are completely new to PyQt, and this project provides us with a valuable opportunity to learn about it. Additionally, we are able to refresh our knowledge about CNN models and their tuning techniques, as well as gain experience in data collection.

What's Next for Auto Ambient Brightness Recognition

Create a more standard dataset to further improve the accuracy of the model. Because the dataset is not rich enough, the model can only be adjusted in 4 steps at the moment, and we hope to make it dynamically adjustable from 0 to 100 in the future.

Built With

Share this project:

Updates