Coder Social home page Coder Social logo

cifar10_image_classifier_on_stm32's Introduction

STM32图像分类

项目简介

本项目实现了在STM32上进行图像分类的任务。使用CIFAR-10数据集,通过Caffe机器学习框架搭建和训练神经网络模型,然后将所得模型进行转换,使其能够运行在STM32上。本项目运行在Keil的模拟器中,所以无需开发板也能体验机器学习在STM32上的应用效果。

目录说明

目录 描述
arm_nnexamples_cifar10 STM32图像分类MDK项目源码
script 图片预处理脚本
test_images_from_cifar10 来自CIFAR-10数据集的测试图片
test_images_from_internet 来自互联网的测试图片

项目的输入

一幅宽32像素高32像素的彩色图像,为方便STM32实验操作, 事先将图像转换为像素值数组,存放在arm_nnexamples_cifar10_inputs.h中。

项目的输出

输出是测试图像所属的类别的概率,概率值最大的就是目标图像的所属类别,输出结果如下图所示:

细心的同学可能要问了,为什么这里的输出是127,而不是一个0~1之间的数?

这个跟我们使用的Softmax函数有关,一般Softmax函数的公式是这样的:

y_i = e^(x_i) / sum(e^x_j)

而在STM32上我们采用的是以2为底Softmax函数,所以其输出会有所不同。

y_i = 2^(x_i) / sum(2^x_j)

众所周知,微控制器的计算性能有限,这样做可以大大减小计算量,并且从数学上来讲梯度是一样的,我们依然能够很好地分辨出目标图像的所属类别。

使用说明:

编译 -> Debug调试运行 -> 打开Debug (printf) Viewer (View->Serial Windows->Debug (printf) Viewer)

相关链接

cifar10_image_classifier_on_stm32's People

Contributors

edgeai-lab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.