This article is shared by Dasming from huawei Cloud community “Recognition Application Experience of ResNET-50 Mushroom” Based on MindSpore.

Abstract: The resNET-50 network model based on Huawei MindSpore framework was used to realize the recognition and classification training of 6714 mushroom pictures of 10 categories.

Backed by a new design concept, Huawei Cloud launched the MindSpore Deep Learning training camp, to help Xiaobai quickly pick up the high-performance deep learning framework, quickly train ResNET-50, achieve your first mobile App development, learn intelligent news classification, basketball detection and “guess you like” model!

MindSpore Deep Learning Training camp, through 21 days of reasonable course arrangement, not only provides the current hot mobile deployment introduction, but also interesting practice to keep up with current events, and more in-depth explanation of low-level development, so that you can learn everything from framework to algorithm to development.

In the third lesson of MindSpore 21-day actual practice, Teacher Wang Hui shared how to apply the recognition reasoning model based on MindSpore resNET-50 in the question “Is mushroom ‘jun’ poisonous? Detection scenario.

ResNet’s previous status was:

CNN can extract low/mid/high-level features. The more layers of the network, the richer features of different levels can be extracted. Moreover, the deeper the network is, the more abstract the features are and the more semantic information is extracted. In fact, with the increase of neural network layers, gradient disappearance or explosion makes it difficult to train the deep network.

The solution to this problem is regularization initialization and Batch Normalization layers in the middle, where dozens of layers of the network are trained. Although training can be achieved through the above methods, another problem will occur, namely, degradation. The number of network layers increases, but the accuracy rate in the training set is saturated or even decreased.

ResNet proposed the residual structure to solve the problem of gradient disappearance, explosion or training degradation. Its classical structure is shown in the figure below:

As shown below, the normal layer is on the left and ResNet is on the right;

As shown below, the normal layer is on the left and ResNet is on the right;

As the number of network layers increases, the output H(X) of common layer becomes more and more difficult to learn. ResNet takes the input X as the final output across the convolutional layer. F of X is called the residual.

Deep residual networks have relatively low complexity and deeper network layers. Won the first prize in many competitions.

The 50 in RESNET-50 indicates that the network has 50 layers.

The experience assignment of this class is based on the ResNET-50 network model of Huawei MindSpore framework to realize the recognition and classification training of 6714 pictures of 10 types of mushrooms. The computing power is based on Huawei Cloud ModelArts, and the network storage uses Huawei OBS service. In the process of uploading a large number of images to the OBS bucket, the OBS-Browser-Plus suite tool is used. After setting the OBS login permission and the storage directory, you can drag and drop the OBS directory locally. A large number of data files can be uploaded automatically into the queue.

Based on the computing power of 1*Ascend910 CPU, the whole training process takes 10.04minutes, and the average loss of training accuracy of data set is 0.569. The output log is shown in the figure below.

The “Mushroom Superman” image was Eval tested on the model generated by the training.

The results of classification are “Hochellanae, Toadomycete, Rhochellanae…” , the test log is shown in the figure below. I also checked the pictures of The pink pleated umbrella of Huo’s. Apart from other things, the color similarity is quite high.

The whole experience process is simple and smooth, combined with examples to deepen the understanding of RESNET-50 deep neural network.

Click to follow, the first time to learn about Huawei cloud fresh technology ~