This is the Sipeed M1n AI development kit, that consists of the main processing module,
a camera module, a USB type C breakout board, some header pins and a fastening screw. All
this, for just 10 dollars. The main question is, what can it be used for?
Before we proceed, I would like to mention that this is not a sponsored video. I have
purchased this module independently and all views are my own based on the testing that
I have carried out. With that being said, let’s continue.
In this video, we will take a closer look at the module, learn how to use it and then
test it out by running some of the demo examples which include colour detection, image processing,
scanning a QR code, as well as face detection.
Let’s start by talking about the module, which itself is extremely tiny. All the components
are on one side of the PCB with the other being flat. The board itself consists of the
main processor which is clocked at 400MHz, and is based on the RISC-V open architecture.
Internally it has 8Mib of RAM, where MiB stands for Mebibyte and 1 Mebibyte is equal to 1
Megabyte.
It also has a general-purpose neural network processor which is also called a KPU, and
this is optimized to carry out certain operations that are frequently used when carrying out
machine learning, image processing and so on. Having dedicated hardware like this makes
the entire process very efficient and increases the overall response as we will see later
in the video.
All of this allows the chip to be useful for several applications including: machine vision
– which can include object detection, image classification, face detection and recognition
as well as extracting coordinates and other information from the video feed. The chip
also has a high-performance microphone array audio processor which makes it suitable for
machine hearing applications. Think of it as applications where you might to capture
surround sound audio or 3D audio and then reproduce this later. And of course, you can
combine the two for hybrid applications.
The other interesting bit about the processor is that it has these hardware modules that
can be used to interface and communicate with other peripherals like you would do with an
Arduino.
Coming back to the board, it also has a 26MHz oscillator, some passives, 128Mbit FLASH memory,
along with this chip which is a 3-channel buck converter. This means that it can provide
3 output voltages from a single input power source. This is needed because the main processor
requires 3.3V, 1.8V and 0.9V for correct operation.
The board plugs into this adaptor board which provides the USB interface and also gives
you access to some of the GPIO pins. It also has a reset button and a boot button. Assembling
it is very simple, you just need to slide the board in and then use a screw to hold
it in place to give you something like this.
In order to plug in the camera module, you first need to slide this tab up, then insert
the flex connector like so and then push the tab back down to hold it in place. The module
does have double sided tape that can be used to place it in position which is a nice touch.
Before we learn how to use this module, I would like to point you to this board which
is the Sipeed Maixduino kit. It uses the same processor but adds a lot of other things which
include an ESP32 module for wifi connectivity, a microphone, audio amplifier with a connector
for a speaker as well as a display port. For $24, you get all of this along with the camera
and display module, which is some very good value for money. The reason I bring this up
is because it would be much easier for you to use this as a development platform and
create your applications with it. You can use several development platforms including
the Arduino IDE. Once you are happy with how things work, you can then use this smaller
module and wire it all together.
Now that we know more about the module, let’s try to understand what is it useful for. Even
though you can interface sensors, modules to it this is not meant to be used like an
Arduino board. It is also very different when compared to the Raspberry PI. The PI has a
lot more performance and in a way it is a general purpose computer. However, you do
need to load an operating system on to the microSD card to get started. If you want to
carry out image processing, then you would need to buy a camera module which itself would
cost a lot more than this little board. You then need to configure OpenCV or whatever
it is that you want to get started which can get complicated.
This board and more so the Maixduino, sits somewhere in between. They have been designed
for applications which require some level of image processing or computation and they
do a very good job at keeping it simple. One main drawback is that the highest image
or video resolution it can process is VGA at 30fps. This will most likely change in
future releases.
It is kind of similar to the ESP32-CAM board that we have been using. OpenMV is a board
that is perhaps extremely similar to the Sipeed board and it has much greater processing capabilities
but also costs a lot more.
Now let’s start testing the module out. Use a USB type C cable to plug it into your
computer.
Click the start menu, type in Device manager and then open it up. You should see two new
devices like this and we need to install the drivers for both. So right click it the first
one, select the update driver option and then follow the process as shown on screen. It
will install a driver and the device name will change but we are not done yet. Repeat
this again like so, and it will then show up correctly. You may need to repeat this
process for the other device as well and they should both show up as serial ports. The COM
port number may be different for your system.
Once this is done, use the link in the description to visit this page. Open this file and scroll
down to part 2 where you have the download links for different operating systems. Copy
the one for windows and paste it in a new window to get this page. Enter the captcha
code to start the download process. Wait for it to complete and then navigate to the downloads
section to run it. Follow the onboard instructions to install it and you will then be able to
open up the IDE to get something like this, by default we have an example script as seen
here.
This is similar to the OpenMV IDE and we mainly use micropython here for coding. Micropython
is similar to the regular python that we use with the raspberry pi but this version is
optimized for microcontrollers. If you have not used micropython, then there are two main ways
by which you can interact with the board. First, you can use the Tools menu to open
a new serial port. Then select the serial port, baud rate and click Ok to view this
section. Hit the reset button on the board and you should get a command prompt that you
can use to execute commands with. If you do not get this, then try connecting to the other
COM port. The board has two serial ports – one is dedicated to the terminal seen here while
the second one can be used for your application – say to interface to a GPS module and so
on.
You could technically type out all these lines one at a time to execute the script, but this
is not always efficient which is why we use the second method. To do this, first, make
sure you select the correct board from the tools menu. There is no option for the Sipeed
m1n board yet, so select the Maixduino option seen here. Then click this icon and select
the COM port, usually the first one.
You will then be able to connect to the board. And the icon will change as seen here. Once
done, simply click the play button to execute the script. Just like that, you can view the
live feed from the camera. You also get a histogram which shows you the individual colour
components of the video.
This is extremely response specially when compared with the ESP32-CAM board. It is actually
running at half the framerate when used like this, with the IDE. If you had the Maixduino
dev kit then you would also be able to view the feed on the LCD, which would be even better.
There is documentation to help you learn how to use all the different components and modules.
This would include the hardware interfaces, audio capture, machine vision and so on. Use
the link in the description to view these example scripts that can be used to get a
feel for the capabilities. Once done, extract the file and then use a program line Sublime
to open the folder so that you can view the individual scripts. Again, you have the same
categories as the documentation website and you can use them together to get a better
understanding of the board. Keep in mind that some of them use the LCD module which is present
in the maixduino dev kit, which is also another reason why you might want to buy that kit
first.
Lets start with something simple. Navigate to the machine vision folder, and then open
up the FPS display script. Copy the entire script, paste it in the IDE and then click
the RUN icon again to execute the code. You will now be able to view the framerate of
the video feed as a text overlay. You can easily change the text string to display whatever
you like.
Next, open up the image deal script, copy it and then paste it in the IDE. This script
processes the live video feed and carries out 3 operations on it to gives us some visual
effects, which last for 10 seconds each. Like before, click the RUN icon to execute it.
It first creates an outline, then sharpens the image and finally creates the relieve
effect as seen here. Again, the video feed is extremely responsive even with all these
effects so it is pretty impressive overall.
Now, let’s do some colour detection. Open up the green blob script, copy, paste and
run it like before. When you run it, you will notice that the board starts detecting all
green objects and it draws a bounding box around it. This is similar to what we did
in a previous video which uses OpenCV that’s running on a raspberry pi zero board. If you
haven’t watched that video then let me tell you that the raspberry pi version setup is
much more complicated than this and the end result is not as good as this one.
We are currently using openMV functions to carry out all this processing so you could
learn more about them and modify the script to detect other colours and even change the
properties of the bounding box and so on.
The next example is going to be very useful as we will be using the board to scan QR codes.
Open up the demo, copy and paste it in the IDE. The script tries to find QR codes and
it then print the message or link to the terminal. Click the RUN button to give you something
like this.
I would also recommend opening up the serial terminal so that we can view the response
from the board. By default, the script doesn’t seem to work at all and you will notice that
the video feed is actually flipped which is the reason for it not working. So, stop the
execution, edit the sketch by changing this to 0 and then run it again. It will now be
able to detect and read QR codes. The relevant information from the QR codes will be printed
to the serial terminal. Just like that, you can scan QR codes and obtain the data from
them. This could then be sent over the serial port to another device or it can be used to
carry out certain operations.
We are going to finish things off by using the board for face detection. In order to
do this, we need to use some machine learning which involves using a lot of sample images
to train a neural network. Watch this video is you want to get a high-level overview of
machine learning. We will not be training the network here as that will take a lot of
time, but instead, we will use a pretrained weight file for the demo and we will load
this into the FLASH memory.
Open up the find face example script, copy and paste in within the IDE. You will notice
that there is a link at the top so use that to open up this page which gives you more
information about the example. This too uses tiny Yolo for detection. You can download
the weight file using this link shown here. Once completed, extract the file to access
the binary file that we need.
In order to load this file to memory, we need the kflash software which can be downloaded
using the link in the description. I’ve switched to Windows here as it’s much easier
to run it there. Double click this file to open it up, click this icon to change the
the IDE. It will instantly detect faces and also print out the XY co-ordinates, dimensions
and such in almost real time. Keep in mind that it is still running slower through the
IDE and that it will be much faster if you use the dev kit with the LCD which is simply
amazing.
The face detection you see here using this tiny board is so much better than what we
obtained using the raspberry pi as everything is optimized for this application. And that
is the benefit of using a board that is optimized for AI applications.
In summary, this is much more powerful when compared to a standard Arduino board. However,
it is not as powerful as a Raspberry pi. It sits somewhere in between for specific image
processing applications with a focus on artificial intelligence. I do hope this video has been
useful for you and that you learnt something. Don’t forget to like, share and subscribe
as we will be testing out boards like this one in the future. Thank you for watching
and I will see you in the next one.