## 💡 Inspiration

From farmers' protest around the world, subsidies to keep agriculture afloat, to the regular use of pesticides that kills organisms and pollutes the environment, the agriculture industry has an issue in optimizing resources. So, we want to make technology that would efficiently manage a farm through AI fully automated to reduce human energy costs. Not only that, but we would also open crowdfunding for farm plants as a form of an environmental investment that rewards you with money and carbon credits offset.

## 💻 What it does

Drone:
The drone communicates with the ground sensors which include, UV, pest vision detection, humidity sensor, CO2 sensor, and more. Based on this data then the drone would execute a cloud command to solve it. For example, if it detects a pest, it will call the second drone with the pest spray. Or if its lacking water, it would command the pump using wifi to pump the water, creating an efficient fully automated cycle that reduces resources as it's based on need.

Farmer’s Dashboard:
View the latest data on your plant from its growth, pest status, watering status, fertilizing status, etc. Open your farm for crowdfunding, in terms of land share for extra money. Harvest money would be split based on that share.

Plant Adopter:
Adopt a plan and see how much carbon offset it did in real time until harvest. Other than collecting carbon points you could also potentially get a capital gain from the selling of the harvest. Have a less worry investment by being able to check on it anytime you want with extra data such as height when it’s last sprayed, etc.

On Field Sensor Array and horticulture system:

Collects various information about the plants using a custom built sensor array, and then automatically adjusts lighting, heat, irrigation and fertilization accordingly. The sensor data is stored on cockroachdb using an onramping function deployed on Google Cloud which also hosts the pest detection and weed detection machine learning models.

## 🔨 How we built it:

* Hardware Setup:

SoC Hub: Raspberry PI

Sensor MCU: Arduino Mega 2560

Actuation MCU Arduino UNO R3

Temperature (outdoor/indoor): SHT40, CCS811, MR115A2

Humidity: SHT40

Barometric Pressure: MR115A2

Soil Temperature: Adafruit Stemma Soil Sensing Module

Soil Moisture: Adafruit Stemma Soil Sensing Module

Carbon Dioxide Emitted/Absorbed: CCS811

UV Index/incident: VEML6070

Ventilation Control: SG90 Mini Servo

Lighting: AdaFruit NeoPixel Strip x8

Irrigation Pump: EK1893 3-5V Submersible Pump

\*Drones: DJI TELLO RoboMaster TT

\*Database: CockroachDB

\*Cloud: Google Cloud Services

\*Machine Learning (for pest and weed detection): Cloud Vision, AutoML

Design: Figma

Arduino, Google Vision Cloud, Raspberry pi, Drones, Cockroach DB, etc

We trained ML models for pest (saddleback caterpillar,true armyworm) and weed detection using images dataset from "ipmimages". We used google cloud Auto ML to train our model.

## 📖 What we learned

This is the first time some of us have coded a drone, so it’s an amazing experience to be able to automate the code like that. It is also a struggle to find a solution that can be realistically implemented in a business sense.
## Inspiration

Our inspiration for this project was from the recent spread of pests throughout the U.S., such as Japanese beetles, which have wreaked havoc for crops and home gardens. We personally have gardens at home where we grow plants like cucumbers and tomatoes, and were tired of seeing half-eaten leaves and destroyed plants.

## What it does

PestNet is a computer vision model that takes in videos and classifies up to 19 different pests throughout the video. Our webapp creates an easy interface for users to upload their videos, on which we perform inference using our vision model. We provide a list of all pests that appeared on their crops or plants, as well as descriptions for how to combat those pests.

## How we built it

To build the computer vision model, we used Roboflow to develop a classification model from a checkpoint of a custom pre-trained on the ImageNet dataset. We aggregated images from two datasets and performed data augmentations to create a combined dataset of about 15,000 images. After fine-tuning the model on our data, we achieved a validation accuracy of 93.5% over 19 classes.

To build the web app, we first sketched a wireframe with intended behavior on Figma. We created it with a React frontend (Typescript, Vite, Tailwind CSS, Toastify) with a Python backend (FastAPI). The backend contains both code for the CV model as well as Python processing that we use to clean the results of the CV model. The frontend contains an interactive carousel and a video player for the user to view the results themselves.

## Challenges we ran into

One challenge we ran into was integrating Roboflow into our computer vision workflow, since we had never used the platform and ran into some version control issues. Another challenge we ran into was integrating video uploads into our web app. It was difficult at first to get the types right for sending files across our REST API. A third challenge was processing the data from Roboflow, and getting it to the right format for our web app. All in all, we learned that communication was key: with so many moving parts, it was important that each person working on a separate part of the project made clear what they had made, so we could connect them all together in the end.

## Accomplishments that we're proud of

We're proud of the web app we made! We're also proud of working together and not giving up. We spent at least the first quarter of the hackathon brainstorming ideas and constantly reviewing. We were worried that we had wasted too much time on thinking of a good plan, but it turned out that our current project used a little bit of all of our previous ideas, and we were able to hack together something by the end!

## What we learned

We learned how to easily and quickly prototype computer vision models with Roboflow, as well as how to perform inference using Roboflow's APIs. We also learned how to make a full-stack webapp that incorporates AI models and designs from Figma. Most importantly, we learned how to brainstorm ideas, collaborate, and work under a time crunch :)

## What's next for PennApps

If we had more time, we would develop a more sophisticated computer vision model with more aggregated and labeled data. With the time constraints of the hackathon, we did not have time to manually find and label images that would be more difficult to classify (ex. where bugs are smaller). We would also deploy the Roboflow model locally instead of using the Hosted Video Inference API, so that we could perform inference in real-time. Finally, we also want to add more features to the webapp, such as a method to jump to different parts of the video based on the labels.
# Inspiration

We came to Stanford expecting a vibrant college atmosphere. Yet walk past a volleyball or basketball court at Stanford mid-Winter quarter, and you’ll probably find it empty. As college students, our lives revolve around two pillars: productivity and play. In an ideal world, we spend intentional parts of our day fully productive–activities dedicated to our fulfillment–and some parts of our day fully immersed in play–activities dedicated solely to our joy. In reality, though, students might party, but how often do they play? Large chunks of their day are spent in their dorm room, caught between these two choices, doing essentially nothing. This doesn’t improve their mental health.
Imagine, or rather, remember, when you were last in that spot. Even if you were struck by inspiration to get out and do something fun, who with? You could text your friends, but you don’t know enough people to play 4-on-4 soccer, or if anyone’s interested in joining you for some baking between classes.

# A Solution

When encountering this problem, frolic can help. Users can:
See existing events, sorted by events “containing” most of their friends at the top
Join an event, getting access to the names of all members of event (not just their friends)
Or, save/bookmark an event for later (no notification sent to others)
Access full info of events they’ve joined or saved in the “My Events” tab

Additional, nice-to-have features include:
Notification if their friend(s) have joined an event in case they’d like to join as well

# Challenges & An Important Lesson

Not only had none of us had iOS app development experience, but with less than 12 hours to go, we realized with the original environment and language we were working in (Swift and XCode), the learning curve to create the full app was far too steep. Thus, we essentially started anew. We realized the importance of reaching out for guidance from more experienced people early on, whether at a hackathon, academic, or career-setting.
/\* Deep down, we know how important times of play are–though, we often never seem to “have time” for it. In reality, this often is correlated with us being caught in a rift between the two poles we mentioned: not being totally productive, nor totally grasping the joy that we should ideally get from some everyday activities. \*/