Fossil Fuel Demand Prediction AI Model

In today’s age, one of the best things society can do in the fight against climate change is phase out fossil fuels and other carbon-emitting resources. We can’t eliminate them fully yet, however, as they still account for about 60% of the world’s electricity. While clean energy seems like an obvious solution, it’s not entirely reliable due to its production being weather-dependent. Each resource has a peak time and condition, and fossil fuels are needed to meet electricity demands when production is low. Based on this, one thing we can do is figure out exactly how much clean energy is going to be produced, and source fossil fuels to only meet the rest of the demand.

Using artificial intelligence, I built a linear regression model that does just this - predicting how many watts of fossil fuels are needed per hour to meet electricity demands in the state of Pennsylvania. This ensures that we use as much clean electricity as possible and only fossil fuels when necessary, lowering carbon emissions.

As displayed in the image above, my code actually consisted of three separate models that are used together to achieve the final output. Using a particular month and hour as the input, the first predicts watts of solar electricity produced per hour, the second predicts watts of wind electricity produced per hour, and the third predicts the hourly electricity demand in watts for PA (the second, third, and fourth blocks of code). From there, the outputs of model 1 and model 2 are subtracted from the output of model 3. The resulting number is an estimate of the watts of fossil fuels needed to meet the electricity demand per hour.

I worked in Google Colab and used scikit-learn, a popular software for machine learning, to code the above models. The average mean squared error (MSE) was 2369.57, which is relatively high for a group of models like this. The majority of this came from the solar electricity model, which had an MSE of 7063.97. By testing out other types of ML models, I believe that I can decrease this rate in the future.

One of the main challenges I faced was creating the dataset to train my model, as I have only used premade ones in the past. It was a brand new experience for me to build my own, so it took a while to figure out how I should structure my data. With time, I was able to design one that produced accurate predictions. As shown above, I ultimately used the categories Month and Hour to predict Solar, Wind, and Electricity.

Even though technology such as this is very useful, my models are far from perfect. Some of the problems present include that it only taking into consideration two forms of clean energy, which was done in and effort to keep my dataset simpler. By expanding it to more forms, such as geothermal or hydroelectric, the fossil fuels prediction would be more accurate. It also assumes that the weather conditions are perfect, meaning that solar panels and wind turbines are operating at their peak performance. To fix this, I would have to add a new category to my dataset to describe different weather conditions.

Here’s a link to the actual code on Google Colab

If you want to learn more about this project, check out this article and video I made :)

Previous
Previous

TikTok Challenge 2024

Next
Next

Wind Turbine Damage Recognition Model