ai字母组合发音规律

目录: (Table of contents:)

  1. Introduction介绍
  2. About the Dataset关于数据集
  3. Setting up Monk and Prerequisites设置和尚和先决条件
  4. Downloading Dataset下载数据集
  5. Creating Projects and Experiments创建项目和实验
  6. Approach方法
  7. Selecting the best model选择最佳型号
  8. Conclusion结论

介绍: (Introduction:)

It is an easy task for us to classify handwritten information but to computers, it is a disconcerting and daunting job. Handwritten character classification in general is a challenging task because there are innumerable ways in which any character can be written.

对我们来说,对手写信息进行分类是一项容易的任务,但是对于计算机而言,这是一项令人不安和艰巨的工作。 通常,手写字符分类是一项艰巨的任务,因为可以使用无数种方法来写入任何字符。

Neural networks have although redefined this task and also play a huge role in developing such classifiers, provided they are fed with a huge amount of data for it to be trained.

神经网络虽然重新定义了这项任务,并且在开发此类分类器的过程中也发挥了巨大作用,但前提是它们会被提供大量数据进行训练。

In this particular blog, we will explore the Russian alphabets and classify them in their handwritten form.

在这个特别的博客中,我们将探索俄语字母并将它们以手写形式分类。

关于数据集: (About The Dataset:)

In the data set, we have got 14190 colored images distributed among 3 image folders, consisting of all 33 categories of Russian alphabets.

在数据集中,我们获得了14190张彩色图像,分布在3个图像文件夹中,其中包括所有33个俄语字母类别。

The first folder has striped backgrounds (with few horizontal and/or vertical lines), the second folder has white backgrounds and the third one has graph type backgrounds (with many ordered horizontal and vertical lines).

第一个文件夹具有条纹背景(水平和/或垂直线很少),第二个文件夹具有白色背景,第三个文件夹具有图形类型背景(水平和垂直线有序许多)。

Here are some images from the dataset:

以下是数据集中的一些图像:

Sample Images from the dataset
来自数据集的样本图像

Here are the Russian letters and their corresponding numerics used for prediction purpose:

以下是用于预测目的的俄语字母及其对应的数字:

а=>1, б=>2, в=>3, г=>4, д=>5, е=>6, ё=>7, ж=>8, з=>9, и=>10, й=>11, к=>12, л=>13, м=>14, н=>15, о=>16, п=>17, р=>18, с=>19, т=>20, у=>21, ф=>22, х=>23, ц=>24, ч=>25, ш=>26, щ=>27, ъ=>28, ы=>29, ь=>30, э=>31, ю=>32, я=>33

а=> 1,б=> 2,в=> 3,г=> 4,д=> 5,е=> 6,ё=> 7,ж=> 8,з=> 9,и=> 10, й=> 11,к=> 12,л=> 13,м=> 14,н=> 15,о=> 16,п=> 17,р=> 18,с=> 19,т=> 20, у=> 21,ф=> 22,х=> 23,ц=> 24,ч=> 25,ш=> 26,щ=> 27,ъ=> 28,ы=> 29,ь=> 30, э=> 31,ю=> 32,я=> 33

So don’t worry, even if we don’t get the article, we are going to leave with some Russian alphabets impression atleast!The complete dataset is prepared and uploaded by Olga Belitskaya and can be found right here:

所以不用担心,即使我们没有得到这篇文章,我们也将至少留下一些俄语字母的印象!完整的数据集是由Olga Belitskaya准备并上传的,可以在这里找到:

Now let’s get going by setting up the monk and some prerequisites.

现在,让我们开始设置和尚和一些先决条件。

设置和尚和先决条件 (Setting up Monk and Prerequisites)

We start by installing the monk library.

我们首先安装和尚库。

1.)We have used colab here, so here is the installation process for the same.

1.)我们在这里使用了colab,因此这里是相同的安装过程。

#Installation process for colabpip install -U monk-colab

Although we can explore other ways of the installation at the monk library.

尽管我们可以在和尚库中探索其他安装方式。

2.)Add this to system path (Required for every terminal or kernel run)

2.)将其添加到系统路径(每个终端或内核运行必需)

import syssys.path.append("monk_v1/");

下载数据集 (Downloading Dataset)

Next, we will get the dataset from Kaggle directly to colab. For that, we have to first create an API token from Kaggle.

接下来,我们将直接从Kaggle获取数据集到colab。 为此,我们必须首先从Kaggle创建API令牌。

Go to your Kaggle profile>> My Account >> Scroll down to API section >> Click on Create new API Token( remember to expire all other tokens if used previously)

转到您的Kaggle个人资料>>我的帐户>>向下滚动到API部分>>单击创建新的API令牌(请记住,如果以前使用过,所有其他令牌都将过期)

After clicking on this, the kaggle.json file will be installed in your system.Next, go the dataset page again and on the right of the new notebook option, we can find an icon to copy the API command. This command will be used to download the dataset.For now, upload the kaggle.json file in google colab as shown here.

单击此按钮后,kaggle.json文件将安装在您的系统中。接下来,再次进入数据集页面,在新笔记本选项的右侧,我们可以找到一个图标来复制API命令。 此命令将用于下载数据集。现在,如下所示,将kaggle.json文件上传到google colab中。

! pip install -q kagglefrom google.colab import filesfiles.upload()#Upload the kaggle.json file here

Further, use the API command to download the dataset.

此外,使用API​​命令下载数据集。

! mkdir ~/.kaggle! cp kaggle.json ~/.kaggle/! chmod 600 ~/.kaggle/kaggle.json#Download the full dataset zip file to Colab! kaggle datasets download -d 'olgabelitskaya/classification-of-handwritten-letters'

Now, unzip this file and create a new file to store all the datasets in one place.

现在,解压缩该文件并创建一个新文件以将所有数据集存储在一个位置。

#Unzip the downloaded zip file and put it under a new files section! unzip -qq sample.zipimport zipfilezip_ref = zipfile.ZipFile('classification-of-handwritten-letters.zip', 'r')zip_ref.extractall('files')zip_ref.close()

After this is done, we import these libraries and the appropriate backend.

完成此操作后,我们将导入这些库和相应的后端。

import osimport syssys.path.append("monk_v1/");sys.path.append("monk_v1/monk/");#Importing MXNet Gluon API backendfrom monk.gluon_prototype import prototype

I have used MXNet Gluon API as Backend here, with just one line of code we can choose our desired backend and not worry about encountering different syntax later. This is possible with the monk library, by using just one syntax we can work across different frameworks like PyTorch, MXNet, Keras, TensorFlow.

我在这里使用MXNet Gluon API作为后端,只需一行代码,我们就可以选择所需的后端,而不必担心以后遇到不同的语法。 和尚库可以做到这一点,只需使用一种语法,我们就可以跨不同的框架(如PyTorch,MXNet,Keras,TensorFlow)工作。

创建项目和实验 (Creating Project and Experiments)

To create the project name and the experiment name we use the prototype function. We can now create multiple experiments under a project and make comparisons among them on various aspects.

为了创建项目名称和实验名称,我们使用了原型函数。 现在,我们可以在一个项目下创建多个实验,并在各个方面进行比较。

#Setup Project Name and Experiment Namegtf = prototype(verbose=1);gtf.Prototype("Pilot", "Densenet_121");
New Project is formed!
新项目成立了!

方法 (Approach)

Approach for model training :

模型训练方法:

We have not concatenated the three image folders, which would have allowed us to train the entire dataset together.Our approach to building a robust model is training the model first by using images that are least affected by the background i.e. second image folder.Also, this folder is reasonably big (with a large number of images), so it can train the model effectively at first and we can understand how the model is performing with simpler data.

我们没有串联三个图像文件夹,这可以让我们一起训练整个数据集。我们构建健壮模型的方法是首先使用受背景影响最小的图像(即第二个图像文件夹)来训练模型。此文件夹相当大(包含大量图像),因此它可以在一开始就有效地训练模型,并且我们可以了解模型如何使用更简单的数据来执行。

This would somewhat ensure if the model learns to extract desired features and we can verify this by analyzing plots for the same.If it is observed that the model has learned to extract features properly, then we can continue training the model with the next folder containing graphic type background images, even this folder is big enough so hopefully, it makes the model learn to ignore the background.

这一定程度上可以确保模型是否学会提取所需的特征,我们可以通过分析相同特征的图来验证这一点。如果观察到模型已学会正确提取特征,则可以继续使用包含以下内容的下一个文件夹训练模型图形类型的背景图像,即使这个文件夹足够大,也希望它使模型学会忽略背景。

Finally, we update and train the model with images containing stripped background.

最后,我们使用包含剥离背景的图像更新和训练模型。

This approach allows us to figure out which part of the dataset is not being classified properly and in case of unsatisfactory results, we can analyze all plots and identify where the model is performing poorly and focus on that part.

通过这种方法,我们可以找出数据集的哪个部分没有正确分类,如果结果不令人满意,我们可以分析所有图并确定模型在哪里表现不佳,然后集中精力关注该部分。

Approach for developing models :1.)First, the backend is chosen (MXNet Gluon), some basic models are selected which can be appropriate for this particular task.2.)Less dense variants are chosen and their performances are compared.

开发模型的方法:1.)首先,选择后端(MXNet Gluon),然后选择一些适合于此特定任务的基本模型。2.)选择较少的密集变体,并比较它们的性能。

#Analysing basic modelsanalysis_name = "analyse_models";models = [["resnet34_v2", False, True],["densenet121", False, True],["vgg16", False, True],["alexnet",False,True],["mobilenetv2_1.0",False , True]];epochs=5percent_data=15analysis = gtf.Analyse_Models(analysis_name, models, percent_data, num_epochs=epochs, state="keep_all");

3.)Parameters are tuned for the models. This is the most crucial part of developing a good model.

3.)针对模型调整参数。 这是开发良好模型的最关键部分。

#Shuffle the datagtf.update_shuffle_data(True);#For densenets batch size of 2 and 4 did not work well, batch size of 8 worked just fine , after which validation loss starts to increasegtf.update_batch_size(8);#learning rate 0.1 and 0.05 were not working well ,lr lesser than that didn't vary much w.r.t val and training loss .0.01 best choice#Though optimizers like Adam and its variants are very fast at converging but the problem with them are they sometimes get stuck at local optima's.#Whereas famous optimizers linke SGD and SGD plus momentum are slower to converge , but they dont get stuck at local optima easily.#Here after analysing all these optimizers , sgd worked better.#sgd was the best optimizer even for densenetsgtf.optimizer_sgd(0.01);gtf.Reload();

This analysis is very important while tuning parameters.

调整参数时,此分析非常重要。

4.)With the same tuned parameters, more dense variants for the same models are tried.

4)使用相同的调整参数,尝试使用相同模型的更密集的变体。

#Comparing DenseNets for different depth of densenet variants.analysis_name = "analyse_models";models = [["densenet121", False, True], ["densenet161", False, True], ["densenet169", False, True],["densenet201", False, True]];epochs=10percent_data=15analysis = get.Analyse_Models(analysis_name, models, percent_data, num_epochs=epochs, state="keep_none");

If we would have directly gone for dense networks, maybe due to exploding/diminishing gradients it wouldn’t perform well and we may end up not considering that option at all.

如果我们直接去密集的网络,也许是由于梯度的爆炸/减小,它可能无法很好地工作,最终我们可能根本不考虑该选项。

选择最佳型号 (Selecting the best model)

After all these efforts it is quite easy to figure out which model can give you the best results when exposed to unseen data. For this case it turns out to be Densenets, the appropriate depth of the Densenet chosen is 121, it is enough to give desirable results.Resnets architecture ranks second, in terms of overall performance after being tuned. Mobilenets can potentially perform very well, although it took a lot of training time and space for this particular task.

经过所有这些努力,很容易找出暴露于看不见的数据时哪种模型可以为您带来最佳结果。 对于这种情况,结果证明是Densenet,所选择的Densenet的适当深度为121,足以给出理想的结果。Resnets体系结构在调整后的总体性能方面排名第二。 Mobilenet的性能可能很好,尽管为此特定任务花费了大量的培训时间和空间。

Three plots here are of the same model but with updated data. Densenet_121_3 is trained on the complete dataThe plot indicates that the model is learning fairly well on all three kinds of datasets.We got a hard to beat validation performance from our model.

这里的三个图具有相同的模型,但具有更新的数据。 Densenet_121_3在完整数据上进行了训练该图表明该模型在所有三种数据集上的学习都非常好,我们的模型在验证性能方面无与伦比。

Final Model
最终模型

The model doesn’t look like it is over-fitting and performs well on classifying new images, ensuring that the model is good to go.If there are any improvements that we could do in the present model, it would be focusing on improving/increasing the images with graphic type backgrounds. If we carefully observe, after those images are updated and the model is trained, the model’s performance has dipped a bit.This is another area of work that can be explored.

该模型看起来不太合适,并且在对新图像进行分类时表现出色,从而确保该模型能够很好地运行。如果在当前模型中我们可以做任何改进,它将专注于改进/使用图形类型的背景增加图像。 如果我们仔细观察,在更新了这些图像并训练了模型之后,模型的性能就会有所下降,这是可以探索的另一个工作领域。

结论 (Conclusion)

we have performed Transfer learning using various architectures, used a well-defined approach to build a solid classifier. Although there is one thing to be noted here, creating projects and experiments made it very easy for us to manage and compare experiments/models.

我们已经使用各种架构进行了转移学习,并使用了定义明确的方法来构建可靠的分类器。 尽管这里需要注意一件事,但是创建项目和实验使我们很容易管理和比较实验/模型。

Also, we could perform so many complex operations using very few lines of code. If we would have gone for the conventional approach, making such comparisons across models would cost us undesirable stretched out code, which can be very hard to debug. Also updating the data set and re-training models was made an elementary task when we used the monk library.

同样,我们可以使用很少的代码行执行许多复杂的操作。 如果我们会采用传统方法,那么在模型之间进行这样的比较将使我们付出不必要的扩展代码,这可能很难调试。 当我们使用和尚库时,更新数据集和重新训练模型也成为一项基本任务。

There are also certain areas mentioned where more work can be done which could further increase the performance and reliability of the model.

还提到了某些可以做更多工作的领域,这些工作可以进一步提高模型的性能和可靠性。

We have also made inferences using some test images, visit the code link below to view them.

我们还使用一些测试图像进​​行了推断,请访问下面的代码链接以查看它们。

For the entire code :

对于整个代码:

or you can view code at image classification zoo.

或者,您可以在图像分类Zoo上查看代码。

For more such applications:

对于更多此类应用程序:

Monk Tutorials:

和尚教程:

Please share this article if it helped you learn something new!

如果可以帮助您学习新知识,请分享此文章!

Thanks for Reading!

谢谢阅读!

翻译自: https://towardsdatascience.com/russian-alphabets-classification-using-monk-ai-4df7d1ad8542

ai字母组合发音规律


http://www.taodudu.cc/news/show-2888748.html

相关文章:

  • 英语发音规则---ir字母组合发音规律
  • 常见字母组合发音规律
  • 百家姓JSON
  • 4.电子计算机的分类,公基计算机基础知识汇总40
  • 字符串作业及默写
  • 2020年英文取名大数据分析及图形化
  • 姑苏慕容与软件开发
  • scrum立会报告+燃尽图(第二周第六次)
  • 最大公约数几种算法分析
  • Scrum立会报告+燃尽图(Final阶段第七次)
  • Scrum立会报告+燃尽图(Beta阶段第二周第六次)
  • beta阶段贡献分配实施
  • Scrum立会报告+燃尽图(Beta阶段第二次)
  • day2
  • 作业20180925-2 功能测试
  • 《论语》全译——公冶长篇第五
  • 换了5G手机不会用5G网络?赶快来补课!
  • 联通5G卡插到手机显示3G
  • 华为5g cpe 虚拟服务器,中国移动科普5G CPE:不换手机也能体验5G
  • 手机5g什么时候普及_5g网络什么时候普及?
  • 5g基站服务器需要芯片吗,依靠芯片就能实现5G吗?没有基站和基带会很尴尬!...
  • 运营商再次大规模建设新5G网络,用户或被迫更换5G手机
  • 看完之后终于明白了,要用5G网络必须要换成5G手机吗?
  • HCIA-5G网络架构及关键技术
  • 浅谈5G网络及其应用
  • 5G系统新型网络架构
  • 华为cpe虚拟服务器,华为5G CPE Pro:让你不用换手机就能体验5G网络
  • 4G网络要升级成5G,换卡还是换手机?
  • 5G网络简介
  • 5G网络架构(接入网,传输网,核心网)

ai字母组合发音规律_使用和尚ai的俄语字母分类相关推荐

  1. 英语发音规则---ir字母组合发音规律

    英语发音规则---ir字母组合发音规律 一.总结 一句话总结: 这个字母组合通常在单词中读[ɜː]:girl /gɜːl/ n. :shirt /ʃɜːt/ n. girl /gɜːl/ n. 女孩 ...

  2. 神码ai人工智能写作机器人_神经符号AI为我们提供具有真正常识的机器

    神码ai人工智能写作机器人 By Katia Moskvitch 卡蒂亚·莫斯科维奇(Katia Moskvitch) "那只狗躲在床底下. 再次." ("The dog ...

  3. ai人工智能换脸原理_他们如何看待AI监视内部工作原理

    ai人工智能换脸原理 Large scale intelligent surveillance systems used by governments and corporates have attr ...

  4. ai css 线条粗细_如何训练AI将您的设计模型转换为HTML和CSS

    ai css 线条粗细 by Emil Wallner 埃米尔·沃尔纳(Emil Wallner) 如何训练AI将您的设计模型转换为HTML和CSS (How you can train an AI ...

  5. 常见字母组合发音规律

    [ i: ] i e ea ee ei ie [ i ] i o y ei e ui a ey [ e ] e ai a ie ea ue [ æ ] a ai [ ʌ ] u ou o oo [ a ...

  6. ai建立使用图案_怎么用AI创建无缝拼贴图案样式 Illustrator创建无缝拼贴图案教程...

    无缝拼贴图案是很多设计师喜欢在界面中用到的图案,并且在很多领域都有应用,那么这个很有前景的图案纹理该怎么制作呢,下面西西就给大家详细讲解下怎么用Illustrator制作出大气典雅的无缝拼贴图案. 具 ...

  7. 怎么用ai做出适量插画_怎么用AI和AE制作矢量插画风猫咪动效

    1、打开AI,[Ctrl+N]新建画布,[宽度]为500px,[高度]为500px,点击[确定]. 2、使用[圆角矩形工具]画出圆角矩形充满画布,使用[吸管工具]吸取提前做好的色板上的深蓝色使其填充矩 ...

  8. 怎么用ai做出适量插画_如何用AI把照片制作成矢量线条插画

    课课家将在本教程里使用Illustrator把照片制作成矢量线条插画,教程难度只算一般,但是挺有创意的,也算是一个技巧的分享吧.喜欢的朋友让我们一起来学习吧. 我们先来看一下效果图: 2.依据图片的复 ...

  9. ai预测占比_百度推出AI翻译工具 中国人工智能行业数据分析及预测(图)

    日前,推出一款人工智能工具,可实时将英语翻译成中文和德语,以挑战谷歌的竞争产品.谷歌先前推出一款PixelBuds产品,称这款无线耳机可以进行实时翻译.目前,百度的翻译工具只能互译英语和中文,或者互译 ...

最新文章

  1. #Ruby# Introspect (2)
  2. 【 MATLAB 】Fourier Transforms ( fft )
  3. 【无标题】RestHighLevelClient工具类
  4. 【树的直径】 POJ 1985 Cow Marathon
  5. try catch用法_synchronized用法总结
  6. Zabbix Maintenance 维护周期
  7. Gson实现自定义解析json格式
  8. 计算机专业评副高论文要求,护士晋升副高职称论文要求
  9. k1075停运吗_列车停运计划
  10. Flink时间属性和窗口
  11. jenkins shell 权限_Jenkins+gitee+nuxt自动化部署
  12. php传值和引用哪个效率高,php方法传值和传引用性能比较
  13. Cinnamon 任务栏网速
  14. 有没有永久免费的云服务器?看完这篇文章你就明白了!
  15. 职场晋升加薪:除了自己努力,这20条规则和方法你也要知道!
  16. 计算机键盘怎么打字,用电脑键盘打字的小技巧 怎么用电脑键盘打字
  17. 计算机网络物联网论文,物联网对计算机网络技术发展分析
  18. 前端开发JS--匀速运动
  19. centos下espeak文本转语音的代码实现
  20. 房屋租赁管理系统API

热门文章

  1. 操作系统中消费者与生产者的同步互斥问题
  2. 电影票房多视图可视化(echarts)
  3. 在受控主机上创建文件或目录
  4. 优思学院|准时化生产(JIT)是什么?
  5. BPF-JIT中bug归类
  6. 汽车SoC安全故障的自动识别(下):案例展示和指标分析
  7. 【网单服务端】神鬼世界一键安装服务端双镜像优化版网游单机
  8. Git 无法切换分支,报错git did not exit cleanly
  9. MQ消息队列(三)RabbitMQ及Erlang安装过程中常见问题
  10. linux mint 安装ubuntu软件中心,Ubuntu和Linux Mint:安装Pinta 1.6工具