Raspberry Pi Image Recognition: Raspberry Pi 3B+ vs 4 Speed Test

게시자

The Raspberry Pi board is a fabulous device, functioning as an actual computer with a price tag of just $35. Up until the recently announced Raspberry Pi 4's debut, one thing holding it back was its lack of a USB 3.0 port.

Raspberry Pi 3B+ vs. 4

Adding a USB 3.0 port takes the Pi's theoretical data transfer rate from 480 Mbps to 5 Gbps, a data throughput increase of over 10x. The Raspberry Pi 4 features two USB 3.0 ports along with a pair of 2.0 ports for less data-intensive tasks. For some applications, this port update could be reason enough to upgrade, though the new model also features increased process speed and more available RAM.

I considered how these upgrades could affect my projects, especially applications that involve an accelerator, such as Google's Coral Edge TPU. The idea came from one of my previous applications, where bird identification reportedly takes about three seconds, supposedly held back by the USB 2.0 speeds. The project uses a Zero W, which isn't the most powerful Pi available.

I decided to focus my experiment on running image ID on the Pi 3B+ versus the Pi 4. Keep in mind that the Pi 4 has two to four times more powerful processing power.

So let's see how these two stack up against one another. My initial guess was that the speed increase wouldn't reach 10x, but that it would exceed the 4x speed increase you might expect from the ratio between the devices' processing capabilities. As it turns out, I was very wrong, at least for this parrot-ID demo.

Trial 1: Edge TPU on the Raspberry Pi 4

First, I attempted to install the TPU software on the Raspberry Pi 4 per Google's instructions, but I received an error message stating that my system wasn't supported. It turns out that supported devices only include Pi 2 and 3 B/B+. While there's a workaround for Raspbian Buster, which I was running on the Pi 4, I still wasn't immediately able to get the software working correctly. Next, I tried the procedure with a 3B+, which succeeded and let me run a demo, identifying the scarlet macaw in 4.4 seconds.

The next question was: would the TPU software work on the Pi 4? Yes! The system identified the right bird using a 3.0 port in 3.6 seconds, and four seconds using one of the Pi 4's 2.0 ports.

The identification speed, while noticeable, wasn't nearly as dramatic as I'd expected. The question remains whether using the B+ for a roundabout installation threw things off. I did find it interesting that the performance jump was .4 seconds when using a 2.0 port, and another .4 seconds when using the 3.0 port. This would imply that the 2.0 port is only part of the bottleneck here, with the Pi's speed contributing to the speed increase as well.

Trial 2:Using a Pre-Compiled RPi 4 Disk Image

To examine whether installation on the Pi 3+ somehow throttled the Pi 4, I used a pre-compiled Raspberry Pi 4 disk image from the EdgeTPU GitHub page. The page is quick to note that it's not an officially supported product, but I figured it was worth a try. Here's the process:

1. Flash the card using the balenaEtcher tool.

2. Download the model, labels file, and photo as outlined in the getting started page under "Run a model on the Edge TPU."

3. Navigate to the demo directory for Python 3.7 using: "cd /usr/local/lib/python3.7/dist-packages/edgetpu/demo" incantation.

4. Finally, run the "classify_image" routine on the demo macaw.

Here are the results I received:

- USB 2.0: 4.0 seconds

- USB 3.0: 3.5 seconds

While this process might offer results a tenth of a second faster than the previous Pi 4 run, the difference could also be due to user error when using a timer. I'm also not certain that I enabled maximum frequency the first time around—and I don't know how the precompiled disk image handles maximum frequency anyway. Based on those two factors, I can't observe a clear difference between this not-quite-official image and my Pi 4 run hacked together with a Pi 3B+.

Conclusion: Raspberry Pi 4 Image Recognition Speed

As it stands, swapping from a 3B+ to a Pi4 with a USB 3.0 port will save you up to .9 seconds when running the scarlet macaw identification demo. A time savings of 20% may be helpful for your application, but it's not the dramatic result I was expecting. On the other hand, in real-world scenarios with repeated image classifications, or other processing tasks, using the Pi 4 could make a huge difference.

관련 상품 참조

RASPBERRYPI4 4GB | 4 Model B

Raspberry Pi Foundation Embedded System Development Boards and Kits 보기

최신 뉴스

Sorry, your filter selection returned no results.

개인정보 보호정책이 업데이트되었습니다. 잠시 시간을 내어 변경사항을 검토하시기 바랍니다. 동의를 클릭하면 Arrow Electronics 개인정보 보호정책 및 이용 조건에 동의하는 것입니다.

당사의 웹사이트에서는 사용자의 경험 향상과 사이트 개선을 위해 사용자의 기기에 쿠키를 저장합니다. 당사에서 사용하는 쿠키 및 쿠키 비활성화 방법에 대해 자세히 알아보십시오. 쿠키와 추적 기술은 마케팅 목적으로 사용될 수 있습니다. '동의'를 클릭하면 기기에 쿠키를 배치하고 추적 기술을 사용하는 데 동의하는 것입니다. 쿠키 및 추적 기술을 해제하는 방법에 대한 자세한 내용과 지침을 알아보려면 아래의 '자세히 알아보기'를 클릭하십시오. 쿠키 및 추적 기술 수락은 사용자의 자발적 선택이지만, 웹사이트가 제대로 작동하지 않을 수 있으며 사용자와 관련이 적은 광고가 표시될 수 있습니다. Arrow는 사용자의 개인정보를 존중합니다. 여기에서 당사의 개인정보 보호정책을 읽을 수 있습니다.