The Salad Days of AI

Students Create Digital Green Thumbs To Nurture Vegetables in Automated Greenhouses

Wednesday, December 16, 2020 - by Byron Spice

Stephanie Rosenthal inspects radish and lettuce plants after removing them from an automated greenhouse in Newell-Simon Hall. Student teams developed AI programs to control water, light and humidity to nurture the plants.

Nidhi Jain has never had much luck growing plants.

"I've tried to work with plants, but they didn't want to work with me," said the senior computer science major from California. "So I've stuck to succulents."

Green thumb or no, this fall Jain and her classmates in the School of Computer Science's Autonomous Agents course applied their knowledge of artificial intelligence, including machine learning and computer vision, to grow lettuces and radishes in small, automated greenhouses. Without ever seeing or touching their plants in person, they worked in groups of three to nurture their sprouts, writing programs that made all of the decisions on adjusting light, humidity and soil moisture based on sensor data.

Reid Simmons, who teaches the course with Stephanie Rosenthal, said using AI to grow vegetables is a good way for students to put into practice the knowledge of AI-based autonomous agents that they learned in class. Agents have applications in many areas, such as self-driving cars, intelligent factories and smart homes. Automated greenhouses proved a good match to the need for a course exercise.

"We wanted something that was physical, that would have to interact with the environment," explained Simmons, a research professor in the Robotics Institute and Computer Science Department (CSD) who directs SCS's undergraduate AI degree program. And they wanted these agents to run for two weeks at a time. "Most of the alternatives were robots and the likelihood that a robot would work for two weeks was very low."

Plants grow — and die — slowly, so they don't provide the immediate, dramatic feedback of, say, a robot running into a wall. But students said they nevertheless learned a lot about the pitfalls of autonomous agents during the semester's two growing periods.

"Deployment isn't as easy as you think," said Vicky Zeng, a senior artificial intelligence major from Singapore. The autonomous agents receive input from temperature, humidity, soil moisture and light sensors, which they interpret to make adjustments on light, watering and fan operation. Faulty soil moisture sensors, however, plagued all of the teams, resulting in plants going without needed water. "Even if your agent is running fine, it can end up making poor decisions if it's getting bad sensor data," she said.

"Some of what they're learning is that relying only on your sensor values can be problematic," said Rosenthal, an assistant teaching professor in CSD. During the second growing period, she noted, moisture sensors showed there was plenty of water in the soil despite most teams never having watered, "but after a week we know the plants probably need water." In that case, the students were allowed to make a one-time adjustment to prevent all their plants from dying.

Autonomous agents thus must be designed to cope with errors, Zeng said. More than that, "We can't be waiting to see errors. We have to have methods for predicting them. Sometimes things are out of your control but you try to prevent them from getting into that state." One solution: setting a maximum number of days that the plants can go without watering.

Arthur Dzieniszewski, a senior computer science major from New Jersey, comes from a family of gardeners and was immediately intrigued by the autonomous agents course when he heard about it. Many courses in computer science are heavy on theory, so having a course grounded by growing plants made it more interesting and relatable, he said.

Overall, the teams had great success in the two growing periods. Though they were graded based on the first two weeks of growth, Simmons and Rosenthal allowed the plants to grow an extra two weeks so they had a chance to develop enough for harvesting.

The vegetable-growing exercise proved popular with the students, Rosenthal said, and several chose to take the course, in part, because of it. Dzieniszewski has even created his own automated greenhouse that is functionally equivalent to what the class used. Though he doesn't have any plants growing yet, he can control the greenhouse remotely and use an autonomous agent to run it.

After each growing period, the teams would make presentations to the class, summarizing their experiences and lessons learned. Jain said this was one of her favorite parts of the class. Another highlight, she said, was when Simmons harvested some of the vegetables from the first growing period and ate the radishes during class.

"This was really exciting because I was finally able to have some success at growing some plants," Jain added.

For more information, Contact:
Byron Spice | 412-268-9068 | bspice@cs.cmu.edu