编程知识 cdmana.com

Technical practice: recognition application experience of resnet-50 mushroom "Jun" based on mindspore

This article is shared from Huawei cloud community 《 be based on MindSpore Of ResNet-50 The mushroom “ jun ” The recognition application experience of 》, Original author :Dasming.

Abstract : Based on Huawei MindSpore Framework of the ResNet-50 A network model , Realization 6714 Zhang Gong 10 Mushroom like image recognition and classification training .

Backed by a new design concept , Huawei cloud launched MindSpore Deep learning camp , Help Xiaobai to start the high-performance deep learning framework faster , Fast training ResNet-50, Realize your first mobile phone App Development , Learn intelligent news classification 、 Basketball testing and 「 Guess you like 」 Model !

MindSpore Deep learning camp , adopt 21 A reasonable course schedule of days , Not only provides an introduction to the current hot mobile deployment , And interesting practices that keep up with current events , More in-depth explanation of the underlying development , Let you go from framework to algorithm to development , All can be caught in one net .

stay MindSpore21 The third class of the day , Mr. Wang Hui shared the information based on MindSpore Of ResNet-50 The recognition and reasoning model of , How to apply it to “ The mushroom ’ jun ’ Is it poisonous ?” The detection scene of .

ResNet The situation before was :

CNN Be able to extract low/mid/high-level Characteristics of , The more layers the network has , It means being able to extract different level The richer the characteristics of . also , The deeper the network, the more abstract the features extracted , The more semantic information . In fact, with the increase of the number of neural network layers , Gradients disappear or explode, making deep networks hard to train .

The solution to this problem is the regularization initialization and the middle regularization layer (Batch Normalization), In this way, dozens of layers of network can be trained . Although through the above method can train , But there's another problem , It's degradation , Network layers increase , But the accuracy on the training set is saturated or even decreased .

ResNet The residual structure is proposed , It's to solve the problem of gradient disappearance 、 Explosion or degradation of training . Its classical structure is shown in the figure below :

As shown in the figure below , On the left is the normal floor , And on the right is ResNet;

As shown in the figure below , On the left is the normal floor , And on the right is ResNet;

With the increasing number of network layers , The output of the normal layer H(X) It's getting harder and harder to learn . and ResNet Crossing the convolution layer will input X As the final output .F(X) It's called residuals .

Deep residual network has relatively low complexity and deeper network layers . Won the first place in many competitions .

ResNet-50 Medium 50, The number of layers of the network is 50 layer .

The experience assignment of this class is based on Huawei MindSpore Framework of the ResNet-50 A network model , Realization 6714 Zhang Gong 10 Mushroom like image recognition and classification training . Computing power is based on Huawei cloud ModelArts, Huawei is used for network storage OBS Object storage service . Lots of pictures uploaded OBS In the barrel process , Used OBS-browser-plus Kit tools , Set it up OBS After login permission and storage directory , You can drag and drop the directory locally , A large number of data files can be automatically uploaded into the queue .

be based on 1*Ascend910 CPU Calculation power , The whole training process takes 10.04minutes, The average loss of training accuracy of data sets 0.569, The output log is shown in the following figure .

The training generated model , adopt Eval test “ Mushroom Superman ” picture .

The classification result is “ Horst's pinfold umbrella , Agaricales , Phaeodaceae ……”, The test log is shown in the figure below . I also checked the picture of the umbrella , Let alone the rest , Color similarity is still very high .

The whole experience is simple and smooth , Combining with the examples, we can deepen our understanding of ResNet-50 Understanding of deep neural networks .

Click to follow , The first time to learn about Huawei's new cloud technology ~

版权声明
本文为[Huawei cloud developer community]所创,转载请带上原文链接,感谢

Scroll to Top