Introducing Deep Learning and IoT to First-Year Engineering Students with MATLAB
By Chao Wang, Arizona State University
A recent survey by the American Society of Engineering Education Corporate Member Council highlighted two areas in which engineering graduates are inadequately prepared to meet industry demands: artificial intelligence (AI) and Internet of Things (IoT).
At Arizona State University (ASU) Ira A. Fulton Schools of Engineering, we’re taking steps to address this skills gap by introducing engineering students to AI and IoT concepts early in their college careers. Specifically, I have added a new learning module to the first-year Introduction to Engineering course in which students complete hands-on AI and IoT exercises using MATLAB®. In these exercises, students perform image classification with a deep learning network and then send the results of their classifications to the ThingSpeak™ IoT analytics platform for aggregation and analysis. The module requires no previous programming experience in MATLAB and no additional hardware, with students using their own laptops, tablets, and webcams. Just as importantly, the module requires minimal instructor preparation because the exercises were designed, implemented, and validated by MathWorks engineers. At ASU, I had the module ready to use in the course within a couple of hours.
Motivating Students with Meaningful Exercises
Introduction to Engineering is a required course for all first-year engineering students at ASU. As a result, students with interests in a variety of engineering disciplines enroll. Students also have varying levels of prior experience with programming. Any exercises we introduce in the course must take this diversity into account. Specifically, the exercises must strike a balance: They must be challenging enough to keep the students interested and motivated, but not so difficult that they become discouraged—particularly when the exercise is not directly related to the discipline they plan to pursue.
Given these requirements, the AI and IoT module has proven to be a good fit for the course. Not only can the module be completed in a single lecture, but its exercises also provide a meaningful, hands-on introduction to AI and IoT, two concepts that students might otherwise not see until years later in their curriculum. When I teach the course, I make it a point to tell students that all engineering disciplines in the future—including mechanical, aerospace, chemical, electrical, and others—will increasingly incorporate machine learning and AI techniques, including the techniques they learn in this course.
Preparing with MATLAB Onramp
Before I added the AI and IoT content to the course, Intro to Engineering included a three-lesson module that introduced students to MATLAB for data analysis and visualization. This existing module is important because many upper-level courses that students will take later (including a signal processing course that I also teach) require a basic understanding of MATLAB to complete assignments, labs, and projects.
To make room in the schedule for the new deep learning and IoT module, I compressed the existing three-lesson MATLAB sequence into two lessons. I did this by having the students complete MATLAB Onramp—a free introductory tutorial that can be completed in 2 hours—as a pre-lecture homework assignment. As they complete the tutorial in their browsers, students learn the basics of MATLAB by working through exercises that include automated assessments and provide immediate feedback.
Having finished MATLAB Onramp, students enter the three-lecture sequence after already familiarizing themselves with MATLAB. In the first lecture, I quickly review the basics that the students learned and have them practice using MATLAB to write and run scripts; define and access scalar, vector, and matrix variables; and create 2D plots from data imported from a text file. In the second lecture of the series, students use MATLAB to solve problems from various engineering disciplines. For example, I have them import experimental data from a file and create plots to visualize the relationship between input and output variables (Figure 1). I also have students practice data analysis skills needed in all engineering disciplines, such as curve fitting, interpolation, and extrapolation.
Introducing the Deep Learning and IoT Module
Once the students have a basic understanding of MATLAB commands and scripts, they are ready for the deep learning and IoT module in the third lecture. I have them bring in a laptop or tablet with a camera as well as some objects, such as fruit, to be classified during the module’s first exercise.
Before getting started, I provide a brief introduction to AI, machine learning, and deep learning. Then I have the students review and execute a MATLAB script using MATLAB Online (Figure 2), which requires no downloads or installation. The script—one of three that are provided by MathWorks for the module—takes a photograph using the camera on the student’s device, before classifying the image using AlexNet, a pretrained deep learning model.
After running the script, the students review their results, which includes the AlexNet classification of the object that they photographed as well as a confidence score (Figure 3).
Leading into the next exercise, I give the students an overview of IoT, including common applications and benefits. Students then use MATLAB to send the classification labels obtained from the deep learning model to a public ThingSpeak channel. In the third and final exercise of the module, they use MATLAB to read aggregated classification data for the entire class in real time from ThingSpeak and then visualize the data by plotting a histogram (Figure 4).
Student Evaluations and Next Steps
As the deep learning and IoT module concluded, I asked the students to complete a Situational Motivation Scale (SIMS) survey to assess their self-determination and motivation. Two results from this survey stood out to me. First, with a mean of 5.85, the self-determination index for the new module was higher than course activities students had completed in past years that had a mean score of 5.47. Second, female students reported higher self-determination than their male counterparts. When I started teaching Introduction to Engineering, there were just a handful of female students. Today, about a quarter of the class is female. Activities like the deep learning and IoT module, which seems appealing to female students, are likely to encourage them to continue in the engineering program. This, in turn, will help increase student diversity in the program, which is an issue that has long been important to me and many of my colleagues.
Aside from the survey, I received informal feedback from the students on the module. While they enjoyed and learned from the module, several had questions about the classifications provided by AlexNet, which in several cases were inaccurate. I used this opportunity to talk about classification errors, what can cause them, and what consequences they have in real-world applications. Going forward, I am planning to experiment with other pretrained networks in the module to see if another network will provide more accurate classifications. I am also planning to add more data science and data analytics exercises into the MATLAB lectures to give students an important introduction to these concepts in their first year.