Deep Learning for Defect Detection on Raspberry Pi

Versión 3.0.0 (9,41 MB) por Kei Otsuka
How to create, train simple network, integrate it into pre/post image processing and generate C code to run it on Raspberry Pi
1,3K descargas
Actualizado 2 sep 2023

Ver licencia

This example shows how to create and train a simple convolutional neural network for defect detection, and how to integrate it into pre/post image processing and generate C code for pre-processing, neural network and post processing to run it on Raspberry Pi.
The algorithm is to detect defective hexagon nuts that has scratch on a surface.
This example demonstrates how to:
#1. Load and explore image data.
#2. Define the network architecture
#3. Train the network
#4. Confirm if trained network works well for new data
#5. Walk through whole algorithm that consist of pre-processing, CNN and
post-processing.
#6. Generate C++ code for whole algorithm to test it on host machine
#7. Generate C++ code for ARM target(Raspberry Pi)
#8. Build and run the exe on the Raspberry Pi
To build and run generated code for deep learning networks that you deploy to Raspberry Pi, you must install third-party software. Please see "Prerequisites for Deep Learning with MATLAB Coder" by running following command.
>>web(fullfile(docroot, 'coder/ug/prerequisites-for-deep-learning-with-matlab-coder.html'))
Note : Code generation for ARM target is only supported on Linux and Windows.
[Japanese]本プログラムでは、簡単な畳み込みニューラルネットワークの作成と、前処理・後処理との統合、コード生成してRaspberry Pi上で動作させるまでの一連の流れをご紹介します。
今回は六角ナットを使用していますが、表面にキズがあるナットは不良品としており、良品と不良品を分類できるネットワークを作成します。また、ナットが写っている場所をROIとして抽出する部分は前処理として、検出された位置に注釈を挿入する部分は後処理として定義しており、それぞれコード生成して統合し、Raspberry Pi上で動作させます。
MATLAB Coderで生成されたコードをRaspberryPi上でビルド&実行させるためには、必要なソフトウェアのインストールおよび環境変数の設定が必要です。以下のコマンドをMATLAB上で実行し、事前に詳細を確認ください。
>>web(fullfile(docroot, 'coder/ug/prerequisites-for-deep-learning-with-matlab-coder.html'))
本プログラムはLinuxプラットフォーム(Ubuntu16.04)上で動作確認をしています。
[Keyward]
画像処理・画像分類・ディープラーニング・DeepLearning・デモ・IPCVデモ・ニューラルネットワーク・Raspberry Pi・ラズパイ

Citar como

Kei Otsuka (2024). Deep Learning for Defect Detection on Raspberry Pi (https://www.mathworks.com/matlabcentral/fileexchange/68474-deep-learning-for-defect-detection-on-raspberry-pi), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2023a
Compatible con R2023a
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Code Generation en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

RaspPi_23aCam

Versión Publicado Notas de la versión
3.0.0

Support for OpenCV ver4.x and ARM Compute Lib ver20.x

2.0.0

Integrated Code Generation Support

1.0.1

Removed GPU Coder from required products

1.0.0