We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

AI Projects with Raspberry Pi — out now!

Artificial intelligence (AI) isn’t just a data centre humming away inside a gigantic warehouse. It is also the single-board computer sitting on your desk, wired up to your smart home equipment, running models locally, securely, and privately.

This is the spirit behind our latest book: AI Projects with Raspberry Pi. This is a hands-on guide to discovering real-world AI applications with Raspberry Pi hardware. These aren’t toy demos, but rather projects you can build, run, and point to and say, “I made that”. Program it right and you might even get a spoken reply.

What’s inside

The book covers a broad range of AI applications, all of them running on a Raspberry Pi:

  • Computer vision — recognise and classify what’s in front of a camera or inside files. We cover both image recognition and video recognition.
  • Python and predictive modelling — work with the regression-style workhorses behind most practical data science.
  • Speech to text (and vice versa) — convert speech to text, generate speech from text, and use spoken commands to control local devices.
  • Linguistics — perform audio transcription, language translation, and processing.
  • Sensor data — gather sensor data on a Raspberry Pi Pico. Use Python to train a machine learning model on your Raspberry Pi, then deploy the model on the Raspberry Pi Pico, where you’ll perform real-time inference.
  • Large language models — run genuine LLMs locally on Raspberry Pi hardware and the Raspberry Pi AI HAT+ 2 accelerator. Run chatbot-style services securely, privately, and locally at the edge.
  • Image generation — use Stable Diffusion techniques to generate images with Raspberry Pi hardware.
  • Model training — discover how models are trained with test and training data. Slice and dice MobileNet and retrain it to detect hand gestures. 

Raspberry Pi hardware… accelerated

If you are into AI and Raspberry Pi, this is the book for you. We make the most of Raspberry Pi hardware, both the bare board and systems accelerated with AI-specific hardware. Here, you’ll find projects that run on a range of Raspberry Pi devices, including Raspberry Pi 4, 5, and Zero 2 W as well as Raspberry Pi Pico microcontrollers. 

As you’d expect, we make full and detailed use of the Raspberry Pi AI Camera and the Raspberry Pi AI HAT+ and AI HAT+ 2 — all using the standard Raspberry Pi OS, so you know exactly what you’re dealing with.

Behind the scenes of LLMs and generative technology

Generative technologies are a thorny subject. This book isn’t here to tell you right from wrong, or insist you get aboard the generative AI train. It’s here to help you understand the deployment and real-world usage of these technologies. 

Once you move beyond the chatbots, you’ll discover a wide range of generative pre-trained transformer models that can be deployed to your computer. You’ll understand the training parameters, sizes, and weights that make up these models, learn how lightweight models are deployed on edge devices to perform inferencing, and discover how LLMs interact with code.

Because Raspberry Pi is a physical computer with input/output, you can use LLMs to perform real-world tasks. 

The physical computing advantage

When it comes to AI, Raspberry Pi is different from a laptop computer or an online chatbot. Raspberry Pi is a real-world device operating at the edge, meaning you can wire it up to the physical world: sensors in, actuators out.

Take voice recognition, for example. In the consumer space, you speak into a device that sends your voice off to another computer in another part of the world, where it is analysed and a response is generated and sent back. For the end user, this is a black-box process — but in this book, you’ll come to understand speech to text and linguistics, and learn how to deploy the models that analyse speech and provide voice feedback for your project. Of course, because this is Raspberry Pi, you can use this knowledge to control any and all devices in your home, on the factory floor, or elsewhere in the real world.

Build real-world projects

Strap an accelerometer to your hand, wave it around, and you’re generating a stream of sensor data. Label the moments where a particular gesture actually happened, feed both the readings and the labels into a training process, and you end up with a model that can recognise that gesture in real time.

In this book, you’ll write code that watches for the gesture and, the moment it fires, tells an attached device to do something. We walk you through this by showing you how to make a magic wand that sparkles when you flick it. It’s one of several projects that take AI out of the abstract and into something you can hold in your hand.

Your journey through the book

The book starts with the basic vocabulary of AI and machine learning, including tensors, the foundational data structure behind almost everything that follows. 

From there, it steps back to map out the Raspberry Pi AI stack, covering both hardware and software, before moving into regression models.

Things get visual with a chapter on generating images from text prompts, followed by a deep dive into running an LLM directly on your Raspberry Pi, using both the CPU and the AI HAT+ 2 accelerator.

Next comes the magic wand chapter: training a model to recognise gestures and building a wand that sparkles on cue.

Voice gets its own extensive chapter — transcribing speech, responding to spoken commands, generating speech from text, translating between languages, and even building a voice-powered chatbot.

The book then zooms in on image recognition, teaching you how to recognise and classify objects in real time using the Raspberry Pi AI Camera or Raspberry Pi AI HAT+ (version 1 or 2).

Finally, we look at accessing and deploying models from model zoos. And we take apart the MobileNet vision model, splicing off the end and retraining it in Python to perform hand gesture recognition.

Why it’s worth your time

If you’re the sort of person who wants to understand AI rather than simply use it, this book is for you. You’ll learn how models are trained, what they can and can’t do, where they’re genuinely useful, and where they’re overhyped. Most importantly, you’ll discover all of this by building practical projects on hardware you already know and love.

AI Projects with Raspberry Pi is available now from Raspberry Pi Press. You can pick up your copy from our store for just £17.99 £8.99 (introductory price). It’s also available from online retailers such as Amazon US and UK, and from other booksellers who have exceptional taste in books. If you’re interested in an electronic version, we’ve got several ways you can get your hands on a PDF or ePUB.

After you add this new book to your shopping cart, be sure to check out the many other books we offer in our online shop.

No comments
Jump to the comment form

Leave a Comment