Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This App Inventor project trains a custom image classifier to distinguish apples, bananas, and potatoes from a background class, then runs it in an Android camera app. The workflow is: gather and label images, train and test the model in Personal Image Classifier (PIC), export the model, and connect it to an App Inventor project with the PIC extension. It is a practical learning example, not a published accuracy benchmark.

What the Fruits vs. Veggies project builds

Marcelo José Rovai’s 10 February 2022 tutorial presents image classification on an Android device as an EdgeML project: the app uses a custom-trained model to identify an image rather than sending it to a large server or web service, as described by the tutorial author. The build uses MIT App Inventor, a visual app-building environment, and MIT’s Personal Image Classifier extension.

The example’s scope is deliberately small: its produce classes are apple, banana, and potato, with a fourth class called “Background” for desk or no-produce images. Although the tutorial’s linked dataset includes many other kinds of produce, the demo does not classify all of them. A model can only choose among the labels it was trained to recognize.

What you need to train and run it

  • Example images grouped and labeled for each class you want the model to recognize. For this exercise, Rovai recommends trying to collect at least 50 images per class; that is practical advice for the tutorial, not a universal machine-learning requirement.
  • A computer with a webcam to try images in PIC and inspect its training and test output.
  • MIT App Inventor, the Personal Image Classifier extension, and the exported model file.
  • An Android smartphone with a camera for installing and testing the APK. The tutorial documents an Android workflow, not guaranteed iOS support.

How the tutorial’s dataset and labels fit together

Rovai describes a linked Kaggle fruit-and-vegetable image-recognition dataset with the following categories. The counts are the tutorial’s description of that dataset, not an independently audited inventory. Its dataset counts and the recommendation of at least 50 images per class refer to different things: the former describes the linked collection, while the latter advises on custom PIC training.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
ELEGOO UNO R3 Project Most Complete Starter Kit, Compatible with Arduino
  • 30+ Guided Electronics Projects: Start with LEDs and build toward LCD1602 displays, RFID access, motion detection, distance sensing, motor control and environmental monitoring for STEM learning, coding clubs, classrooms and hobby projects
  • 200+ Components Across 63 Types: Includes an ELEGOO UNO R3 controller, LCD1602, RC522 RFID, RTC, HC-SR501 PIR sensor, ultrasonic sensor, DHT11, GY-521, MAX7219, keypad, joystick, relay, SG90 servo, stepper motor, breadboard and more
  • Begin Without Soldering: Pre-soldered modules, a solderless breadboard, organized storage case and small-parts box reduce setup time and help beginners move from lesson to lesson while keeping LEDs, ICs, wires and sensors easy to find
  • Learn, Modify and Create: Program the ELEGOO UNO R3 board with Arduino IDE using the included PDF tutorial and example code, then adjust sensor thresholds, timing, display text and motor behavior to turn guided lessons into original projects
  • Flexible Power and Project Setup: Includes a 9 V, 1 A power supply, breadboard power module, 9 V battery and USB cable to support controller, breadboard and module experiments without sourcing basic setup accessories separately
Group Categories listed in the tutorial Dataset split described by the tutorial
Fruits Banana, apple, pear, grapes, orange, kiwi, watermelon, pomegranate, pineapple, and mango 100 training images, 10 test images, and 10 validation images per category
Vegetables Cucumber, carrot, capsicum, onion, potato, lemon, tomato, radish, beetroot, cabbage, lettuce, spinach, soybean, cauliflower, bell pepper, chili pepper, turnip, corn, sweetcorn, sweet potato, paprika, jalapeño, ginger, garlic, peas, and eggplant 100 training images, 10 test images, and 10 validation images per category

The tutorial’s three produce labels are only a selection from this larger category list. If you use different classes or images, the model you train will differ from the demo.

Train, export, and add the classifier to App Inventor

  1. Collect and label images. Prepare images for every intended label, including a background class if the app should handle scenes without the target produce. Rovai’s tutorial recommends at least 50 images per class for the custom exercise.
  2. Train the model in PIC. The tutorial says PIC uses transfer learning with a MobileNet model pretrained on ImageNet. Training hyperparameters can optionally be adjusted.
  3. Test with webcam images. Try examples in PIC and inspect the displayed confidence and test-error metrics. The tutorial does not report a stable numerical accuracy result that can serve as a benchmark.
  4. Export the trained model. The tutorial’s export file is named model.mdl.
  5. Import the extension and model. Add personalImageClassifier.aix to the App Inventor project, then upload the trained model to the extension component.
  6. Build and test the Android app. Create the APK, install it on an Android device, and try varied real camera images rather than relying only on the PIC test view.

What the Android app displays

The example interface includes a camera view, a predicted label, the top probability, a status or error label, a camera toggle, and a classify button. The tutorial also demonstrates optional text-to-speech output. The probability is the model’s confidence for its top prediction; it should not be treated as proof that the label is correct.

Rank #2
ELEGOO UNO R3 Project Super Starter Kit with PDF Tutorial for Beginners
  • TURN CODE INTO REAL-WORLD RESULTS — Follow 22+ guided lessons to make LEDs blink, read temperature and distance, move servo and stepper motors, control an LCD and respond to joystick or IR input; ideal for a family weekend build, homeschool unit, coding club or STEM classroom
  • MORE PROJECT VARIETY IN ONE ORGANIZED KIT — Includes the UNO R3 controller, LCD1602 with pre-soldered header, breadboard power module, ultrasonic and DHT11 sensors, joystick, IR receiver and remote, SG90 servo, stepper motor, relay, DC motor, fan blade, displays, LEDs, buttons, resistors and jumper wires
  • START WITHOUT SOLDERING — Plug-in modules, a solderless breadboard and the pre-soldered LCD help beginners focus on wiring, code and testing; the illustrated component list makes it easier to find each part and move from one lesson to the next
  • LEARN THE LOGIC, THEN CREATE YOUR OWN — Use Arduino IDE and the included example code to understand digital input and output, analog sensing, timing, motor control and display functions, then change thresholds, speeds and sequences for alarms, environmental monitors, reaction games and motion projects
  • CLEAR SETUP SUPPORT FOR FIRST-TIME BUILDERS — Download the latest tutorial and code, select the UNO board and correct computer port, check component polarity and breadboard rows, and keep power-module input at 9V or below; younger learners should work with an experienced adult

How to judge the result

The project demonstrates a workflow, not a validated performance claim. Its screenshots do not establish general accuracy, and no single confidence reading proves that the app will work reliably on new images. Test the finished app with different lighting, backgrounds, angles, distances, and examples of each class. Include images with no target produce to see whether the background class is useful.

  • Wrong label: Check whether the intended object is represented by enough varied, correctly labeled training images.
  • Background mistaken for produce: Add representative no-produce or desk examples to the background class and test them again.
  • Good PIC results but poor phone results: Test the actual extension and device combination; compatibility and behavior should not be assumed from the desktop training view.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Extension and device compatibility

MIT App Inventor’s FOSDEM 2024 resource page identifies the Personal Image Classifier extension and states that MIT maintains it under the Apache License 2.0. That establishes the stated stewardship on that page, but not that every historical project file linked by the 2022 tutorial remains available or behaves identically today.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
ELEGOO Mega 2560 R3 Project The Most Complete Starter Kit with Tutorial
  • 35+ Guided Electronics Projects: Progress from LEDs and buttons to RFID access, real-time clocks, motion and distance sensing, environmental monitoring, motor control and interactive displays for STEM learning, coding clubs and maker projects
  • More I/O and Memory for Larger Builds: The MEGA 2560 R3 provides 54 digital I/O pins, including 15 PWM outputs, 16 analog inputs, 4 hardware serial ports and 256 KB flash for projects that combine more sensors, controls and displays
  • 200+ Components for Prototyping: Includes LCD1602, RC522 RFID, RTC, DHT11, HC-SR501 PIR, ultrasonic and water-level sensors, GY-521, MAX7219, keypad, joystick, rotary encoder, relay, SG90 servo, stepper motor, DC motor, breadboard and more
  • Learn, Modify and Create: Follow 35+ guided lessons with example code, then adjust sensor thresholds, timing, display text, motor behavior and control logic to turn structured exercises into access systems, monitors, alarms and interactive projects
  • Organized for Repeatable Learning: Pre-soldered modules, a solderless breadboard, storage case and small-parts box reduce setup time and keep sensors, LEDs, ICs, wires and other components easy to find between projects

MIT’s current image-classification curriculum uses a separate extension called LookExtension and warns that compatibility varies across devices and operating systems. That warning applies to the curriculum’s LookExtension; it is not a confirmed support list for the PIC extension used in the Fruits vs. Veggies tutorial. Check the requirements for the specific extension and test on the Android device and operating-system version you intend to use.

Best Value
Sale
Official Arduino Starter Kit [K000007] - 12 DIY Projects with Electronic Components & English Projects Book - Original Kit from Italy
  • Complete DIY Electronics Kit – The Official Arduino Starter Kit includes everything you need to begin exploring the world of electronics and programming, featuring 12 hands-on DIY projects that teach key concepts in coding and circuit design.
  • Comprehensive English Projects Book – Comes with an easy-to-follow, detailed project book in English, guiding you through each project step by step, ideal for beginners learning electronics and microcontroller programming.
  • Ideal for All Skill Levels – Whether you're a complete beginner or looking to refresh your skills, this kit is perfect for anyone interested in learning electronics, coding, and building creative projects.
  • High-Quality, Original Components – Includes a selection of genuine Arduino components sourced from Italy, ensuring durability, reliability, and compatibility with a wide range of Arduino-based projects.
  • Perfect for Learning & Teaching – This kit is designed for educational purposes, making it an excellent tool for classrooms, hobbyists, and anyone interested in STEM learning and innovation through hands-on experimentation.
Rank #4
Arduino Starter Kit R4 [K000007_R4] – Learn Electronics and Coding with the UNO R4 WiFi Board, 13 Guided Projects in a Printed Book + Growing Resources Online, Official Certification Voucher
  • LEARN ELECTRONICS AND CODING FROM SCRATCH: Start your maker journey or enhance classroom learning with the Arduino Starter Kit R4 – no prior experience required. Includes a printed project book and all components for 13 hands-on tutorials, as well as access to a growing repository of projects that will be added over time.
  • POWERED BY THE ARDUINO UNO R4 WIFI BOARD: Discover modern connectivity and performance with the Arduino UNO R4 WiFi, featuring built-in Wi-Fi and Bluetooth and full compatibility with the Arduino ecosystem.
  • CERTIFICATION VOUCHER INCLUDED: Once you’ve mastered sensors, motors, displays, and logic through the projects, take the official Arduino Fundamentals certification exam with the voucher that comes with your kit.
  • BONUS DIGITAL RESOURCES: Register your kit online to unlock extra projects, multilingual lessons (Italian, German, French), and exclusive online content designed by the Arduino team.
  • DESIGNED FOR LEARNING AND TEACHING: Ideal for classrooms, labs, or self-learners. Combine hands-on experiments with clear explanations and an AI coding assistant to support you as you grow.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.