Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the automatic learning of ModelArts to identify the classification of poisonous mushrooms

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you about how to use ModelArts to automatically learn to identify the classification of poisonous mushrooms. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

In those days, Snow White ate poisonous mushrooms in exchange for a kiss from Prince Charming. If Snow White didn't eat poisonous mushrooms, would she still meet Prince Charming? Zhang Xiaobai doesn't think so-- maybe she will meet Zhang Xiaobai. Zhang Xiaobai gave her AI MindSpore Lite reasoning, she will not be poisoned, will also fall in love with Zhang Xiaobai's AI magic, and will not empathize with Prince Charming.

In order to give Snow White Amway the knowledge of poisonous mushrooms as soon as possible, Zhang Xiaobai wrote this article on the automatic learning of poisonous mushrooms through ModelArts. I hope Snow White can see it and pay attention to it.

The automatic learning function of ModelArts is only a few steps:

(1) prepare the data set of poisonous mushrooms

(2) create automatic learning projects for data tagging

(3) Model training for data sets.

(4) deploy the trained model online.

(5) Test the services that have been deployed online, and carry out the reasoning of mushroom pictures.

First, create a dataset: first, get the dataset of poisonous mushrooms ready, and click the link below to download the zip package:

Https://ascend-tutorials.obs.cn-north-4.myhuaweicloud.com/resnet-50/demo/ResNet-50%E8%BF%9B%E9%98%B6%E4%BD%9C%E4%B8%9A%E4%B8%80%E9%94%AE%E4%B8%8B%E8%BD%BD%E5%8C%85.zip

The file has 951m, download patiently. Unzip it after downloading

Open the mushrooms/train folder and store 9 categories of poisonous mushroom pictures below.

Upload these images (with directories) to your own OBS bucket.

The OBS path uploaded by Zhang Xiaobai is obs://mindspore-21day-tutorials/resnet-50-2/mushrooms/train/.

Then, create a new dataset-dumogu dataset:

Since OBS is classified by directory, you can import the first directory first, as shown in the figure above.

Enter: / mindspore-21day-tutorials/resnet-50-2/mushrooms/train/Agaricus/

Output: / mindspore-21day-tutorials/resnet-50-2/output-mindspore/

After you create it, you can mark all the currently imported pictures as Agaricus.

After tagging this category, you can click "Import" on the dataset.

Fill in the OBS location of the second category:

Click OK.

The system performs the import task of the catalog dataset.

When the import is complete, you can see the number of annotations and the number of the entire dataset:

The image (dataset) imported this time will be unmarked:

At this point, you can jump to the maximum number displayed on each page below the picture (currently 60), and then select "Select current Page".

And enter the label of this kind of unlabeled picture in the signature, such as Suillus, and click OK.

You can see that the number of unlabeled images is decreasing, but the number of pictures labeled Suillus is increasing:

Label the unlabeled pictures repeatedly until all the unlabeled pictures are tagged, and then import and annotate the datasets of other catalogs (other categories). Repeat this until the callout is complete.

This is really a manual job, known as the "data labeling engineer". )

All right, our data set is ready.

After annotating, ModelArts generates the following directory under the output directory you set earlier:

There are five more directories below:

The annotation directory is the annotation file directory, which contains:

V002.manifest .

After opening it, the details are as follows:

{"annotation": [{"name": "Cortinarius", "type": "modelarts/image_classification", "creation-time": "2020-11-11 11:07:34", "annotated-by": "human/zhanghui_china/zhanghui_china"}], "usage": "train", "source": "s3://mindspore-21day-tutorials/resnet-50-2/mushrooms/train/Agaricus/import_1605064037231/219_m7t5mnXvmsw.jpg", "id": "0008324d2a2933fa17ef490e8413edc1", "sample-type": 0}

The relationship between pictures and categories is annotated in JSON.

The second step is to set up an automatic learning task.

Open the automatic learning menu.

Click create Project, enter the name: exeML-dumogu, select "existing dataset" and select the dataset-dumogu dataset you just created.

Then open the built project exeML-dumogu and click the red one on the right to start the training:

The following menu pops up in the system, input the training verification ratio less than 0.8 and 0.2, and then start the model training.

Confirm the configuration and submit

The system begins model training:

After the training, it will be prompted that the accuracy, accuracy, recall rate and so on, the key depends on the accuracy-94%, OK.

Click the deployment buttons above to begin deployment.

Next step:

After clicking submit

Wait patiently, and you can also see the progress of deployment in the "deploy online"-"online Services" menu.

After deployment, the following screen appears:

You can click "upload" to upload some pictures to be predicted.

For example, in the figure above, 55% of the probability is Agaricus....

Let's upload a real Agaricus.

Score 1.0. It's absolutely accurate.

The above are all pictures taken directly from the dataset, with a score of either 1.00 or 0.99.

Zhang Xiaobai then found some pictures of poisonous mushrooms on the Internet:

This is both high and low.

Find some food to eat, such as Flammulina velutipes and Lentinus edodes:

Okay, let's go back and look at the specific meaning of these nine categories:

Label_list = ["Agaricus Agaricus, Agaricales, Agaricaceae, Agaricaceae, Agaricus, widely distributed in temperate regions of the Northern Hemisphere, non-toxic", "Amanita, Agaricus, Amanita, mainly distributed in Heilongjiang, Jilin, Sichuan, Xizang, Yunnan and other places in China, poisonous", "Boletus Boletus, Agaricus, Boletus, Boletus, Boletus Distributed in Yunnan, Shaanxi, Gansu, Xizang and other places, poisonous ","Cortinarius Trichoderma, Umbellifera, Trichodermaceae, Mycelia, distributed in Hunan and other places (growing on broad-leaved forests such as mountain hair in summer and autumn)", "Entoloma Hodgella, Cymboptera, Flavaceae, Genus, mainly distributed in the North Island and the western part of South Island, New Zealand, poisonous" "Hygrocybe yellowish brown wet umbrella, Agaricales, Agaricaceae, Genus, distributed in Hong Kong (found in Pine Tsai Garden), poisonous", "Lactarius Pleurotus ostreatus, genus Lactarius, widely distributed in subtropical pine woodland, non-toxic", "Russula faded red mushroom, Agaricus, Pleurotus ostreatus, distributed in Hebei, Jilin, Sichuan, Jiangsu, Xizang and other places Suillus is nontoxic, distributed in Jilin, Liaoning, Shanxi, Anhui, Jiangxi, Zhejiang, Hunan, Sichuan, Guizhou and other places.

Several pictures of poisonous mushrooms I found by myself were identified as:

The intoxication rate of Russula, non-toxic Amanita, toxic Lactarius, non-toxic Amanita, toxic Hygrocybe, toxic Amanita, toxic Lactarius, non-toxic Snow White is 3pm 7.

The two pictures of edible mushrooms found by Zhang Xiaobai were identified as:

Lactarius, non-toxic Lactarius, non-toxic-Snow White has a 100% chance of eating good food.

It seems that the seven dwarfs are still necessary to help Snow White try the poison at least seven times.

As for a key knowledge gained in the actual combat camp, we also need to emphasize here: ResNet convolution neural network will certainly classify a picture that does not have a classification, even if it does not belong to any category, it will score strongly, but the score will be slightly lower, such as 0.5, 0.6, 0.7 and so on. This is not the incompetence of this network, but the in-depth learning of this area, which can only come to this point.

Therefore, Zhang Xiaobai believes that if the score is very low, we will not classify it in the application for the time being. (or write down the score and let others see that it's not really a question of probability anyway, and you can't blame ResNet. Having said this, Zhang Xiaobai feels that this is like the probability index of the weather forecast. )

The above is the editor for you to share how to use ModelArts automatic learning to identify the classification of poisonous mushrooms, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report