C0 Nittany AI

I led the development of a machine learning model to reduce Penn State's carbon emissions, winning $500 in the Nittany AI Challenge.
Project image

My Journey with C0: Achieving Carbon Neutrality at Penn State

Introduction

The journey to developing the C0 project was both challenging and rewarding. As the main developer, I had the opportunity to dive deep into the intersection of machine learning, data analysis, and environmental sustainability. Our goal was clear: to create a practical solution that would help Penn State achieve carbon neutrality, and our efforts ultimately led to winning $500 from the Nittany AI Challenge.

The Problem

Penn State spends an enormous amount annually on energy, with the majority of it contributing to greenhouse gas emissions. With the global climate crisis becoming more urgent, it was essential to find a way to reduce these emissions efficiently. Our project aimed to address this by developing a predictive model that could help identify and mitigate emissions from various sectors on campus.

The Development Process

Getting Started

I began by gathering and cleaning a vast amount of weather and energy usage data from Penn State's databases. This data formed the backbone of our project, allowing us to train a neural network to predict future emissions. The data preparation process involved a lot of manual effort, but it was crucial to ensure the accuracy and reliability of our predictions.

Building the Model

With the data ready, I used PyTorch to develop a neural network that could predict energy usage based on various factors such as temperature, humidity, wind speed, and more. Here's a snippet of the code that powered our model:

import torch
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt

device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Using {device} device")

data_path ="C:\\Users\\Ben House\\Documents\\C0\\NittanyAI_Weather&EnergyDataLimitedCleaned.csv"
train_data_np = np.genfromtxt(data_path,dtype=np.float32,delimiter=",")
heading = np.genfromtxt(data_path, np.unicode_,delimiter=",")[0]
print(heading)
train_data_np = np.delete(train_data_np, (0), axis=0)
df = pd.DataFrame(data = train_data_np, columns = heading)
print(df)

This code snippet demonstrates how I loaded and prepared the data for training. The model itself was a simple yet powerful neural network designed to learn the complex relationships between weather conditions and energy usage.

Training the Neural Network

Training the model was an iterative process. I used a Stochastic Gradient Descent optimizer and Mean Squared Error loss function to minimize the prediction error. The process wasn't always smooth—there were moments of frustration when the loss value stagnated—but persistence paid off. Here's a glimpse of the training loop:

for epoch in range(500):
    y_pred = model(x)
    loss = criterion(y_pred, y)
    print('epoch:', epoch, 'loss:', loss.item())

    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

Despite the challenges, I was able to achieve a level of accuracy that was satisfactory for our goals. The model's predictions allowed us to identify key areas where emissions could be reduced, making it a valuable tool for Penn State's sustainability efforts.

Visualization and Community Engagement

One of the project's key components was making the data accessible and understandable to a broader audience. I implemented visualizations that highlighted the correlation between different variables and energy usage. Additionally, we developed a mobile app that included a reward system to incentivize student participation in reducing carbon emissions.

The Outcome

The hard work paid off when our proposal won $500 in the Nittany AI Challenge. It was a moment of pride for the entire team, and it validated the countless hours we had spent developing the project. But more importantly, it felt good to contribute something meaningful to the fight against climate change.

Conclusion

The C0 project was a significant milestone in my journey as a developer. It taught me the value of persistence, teamwork, and the impact that technology can have on solving real-world problems. I'm proud of what we accomplished, and I look forward to continuing to develop solutions that make a difference.