Artificial intelligence (AI) is more than just a data center buzzing inside a giant warehouse. It’s also a single-board computer that sits on your desk, connects to your smart home equipment, and runs your models locally, securely and privately.
This is the spirit behind our latest book. AI projects using Raspberry Pi. This is a practical guide to discovering real-world AI applications using Raspberry Pi hardware. These aren’t toy demos; these are projects you can build, run, point to, and say, “I built this.” If programmed correctly, you may even get an audio response.

what’s inside
This book covers a wide range of AI applications, all of which run on a Raspberry Pi.
- computer vision — Recognize and classify what’s in front of your camera or in your files. Covers both image recognition and video recognition.
- Python and predictive modeling — Work with the regression-style workhorses behind most practical data science.
- Convert audio to text (and vice versa) — Convert speech to text, generate speech from text, and control local devices using voice commands.
- linguistics — Performs audio transcription, language translation, and processing.
- sensor data — Collect sensor data with Raspberry Pi Pico. Train a machine learning model on Raspberry Pi using Python and deploy the model to Raspberry Pi Pico to perform real-time inference there.
- large language model — Run regular LLM locally on Raspberry Pi hardware and Raspberry Pi AI HAT+ 2 accelerators. Run chatbot-style services securely, privately, and locally at the edge.
- image generation — Generate images on Raspberry Pi hardware using stable diffusion techniques.
- Training the model — See how the model is trained using test and training data. Slice and retrain MobileNet to detect hand gestures.

Raspberry Pi hardware…speed up
If you’re interested in AI and Raspberry Pi, this book is for you. We take full advantage of Raspberry Pi hardware, both bare boards and systems accelerated with AI-specific hardware. Here you’ll find projects that run on a variety of Raspberry Pi devices, including the Raspberry Pi 4, 5, Zero 2 W, and Raspberry Pi Pico microcontrollers.
As you might have guessed, we are making full and detailed use of the Raspberry Pi AI camera, Raspberry Pi AI HAT+ and AI HAT+ 2. They all use the standard Raspberry Pi OS, so you know exactly what you’re working with.
Behind the scenes of LLM and generation technology
Generative technology is a difficult topic. This book is not here to tell you what’s right or wrong, or to advocate for you to jump on the generative AI train. It is here to help you understand the deployment and practical usage of these technologies.
Moving beyond chatbots, you’ll find a wide range of pre-trained generative transformer models that can be deployed on your computer. Understand the training parameters, sizes, and weights that make up these models, learn how lightweight models are deployed to edge devices to perform inference, and discover how LLM interacts with your code.
Because the Raspberry Pi is a physical computer with input and output, you can use LLM to perform real-world tasks.

Advantages of physical computing
When it comes to AI, the Raspberry Pi isn’t like a laptop computer or an online chatbot. Raspberry Pi is a real-world device that runs at the edge. This means that you can connect to the physical world, inputting sensors and outputting actuators.
Let’s take voice recognition as an example. In the consumer space, when you speak into a device, your voice is transmitted to another computer in another part of the world, where it is analyzed and a response is generated and sent back. For end users, this is a black-box process, but in this book you’ll learn how to understand speech-to-text and linguistics and deploy models that analyze audio and provide audio feedback for your projects. Of course, since this is a Raspberry Pi, you can use this knowledge to control any device in your home, on the factory floor, or in the real world.
Build real-world projects
When you strap an accelerometer to your hand and shake it, it generates a stream of sensor data. By labeling a specific gesture at the exact moment it occurs and feeding both the readings and the label into a training process, you have a model that can recognize that gesture in real time.
In this book, you will write code that monitors gestures and tells the connected device to do something the moment the gesture occurs. I’ll walk you through this step as I explain how to make a magic wand that lights up when you flick it. This is one of several projects taking AI from abstract to tangible.
your journey through books
The book starts with the basic vocabulary of AI and machine learning, and also includes tensors, the fundamental data structure behind almost everything that follows.
From there, we return to planning the Raspberry Pi AI stack, covering both hardware and software, before moving on to regression models.
The chapter on generating images from text prompts visualizes the situation, and then details how to run LLM directly on the Raspberry Pi using both the CPU and the AI HAT+ 2 accelerator.
Next comes the chapter on magic wands. Train a model to recognize gestures and build a glowing wand on cue.
Voice has its own extensive chapters, including transcribing voice, responding to voice commands, generating speech from text, translating between languages, and even building chatbots with voice.

The book then focuses on image recognition, showing you how to recognize and classify objects in real time using the Raspberry Pi AI Camera or Raspberry Pi AI HAT+ (version 1 or 2).
Finally, we’ll look at accessing and deploying models from the model zoo. We then decompose the MobileNet vision model, stitch the ends together, and retrain it in Python to perform hand gesture recognition.
Why it’s worth your time
If you want to understand AI rather than just use it, this book is for you. Learn how models are trained, what they can and cannot do, where they are really useful, and where they are overstated. Most importantly, you can discover all this by building working projects on hardware you are already familiar with.
AI projects using Raspberry Pi is available from Raspberry Pi Press. You can receive a copy from our store. £17.99 £8.99 (introductory price). It is also available from online retailers such as Amazon in the US and UK, as well as other booksellers with good taste in books. If you’re interested in an electronic version, there are several ways to obtain a PDF or ePUB.
Once you’ve added this new book to your shopping cart, be sure to check out the many other books we have available in our online shop.
