当前位置:网站首页>Realize batch data enhancement | use of keras imagedatagenerator
Realize batch data enhancement | use of keras imagedatagenerator
2022-07-28 09:05:00 【51CTO】
WeChat official account :AI Algorithm and image processing
Content catalog
What is data imbalance? Here is a brief explanation , Focus on operation and Application :1、 Data imbalance 2、 Common solutions function description preparation function description parameter description parameter description complete code effect display summary
What is data imbalance
Here is a brief explanation , Focus on operation and Application :
1、 Data imbalance
In most cases , We believe that different categories of data are evenly distributed , Many algorithms are also based on this assumption , But in the real world , It is often not so . for example , The situation of machine sending failure is what we want to predict , But in fact, the probability of failure is very low , Therefore, the sample size leading to failure is very small , Even if you set all the prediction results to normal , The accuracy is still high , But this model is useless , Such similar examples are very common .
2、 Common solutions
There are many solutions , Mainly from two aspects ( During the interview, you may ask )
In the project , We may not have so much time to think about solving it from the aspect of Algorithm , Most of the time, I think that I can use it , But many online examples are based on built-in data , This is very uncomfortable , Or data enhancement based on a picture , A lot of pain . More generally , Data enhancement for all pictures in a folder under the training set , That's why I wrote this .
Function description
preparation
The environment used
Functional specifications
1)ImageDataGenerator Image generator
Parameter description
remarks : Data enhancement for a single image , You can see ImageDataGenerator and flow Instructions for use
Parameters
rotation_range: Integers , The random rotation angle of the picture when the data is raised
2)flow_from_directory
Complete code
Effect display


summary
1、 It can basically meet the requirements of data enhancement we need
There is a point to emphasize here ,ImageDataGenerator It should be that every picture will be randomly operated ( For example, cutting , Spin, etc ) The role of
I hope every carefully written tweet can help you , Maybe you are already a great God , These are of no use to you , But this is a problem that novices will encounter at the beginning , I don't want you to give up because of a little setback , So tweeting on the one hand is to record the pit you really encounter , On the other hand, I also hope to improve my expression ability .
The code has been updated to :https://github.com/SCUTPZW/AI_study/tree/master
I hope I can get your sincere star( It hasn't been clicked yet )

END


边栏推荐
- Image batch processing | necessary skills
- 说透缓存一致性与内存屏障
- Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]
- Flink Window&Time 原理
- KEGG通路的从属/注释信息如何获取
- 1w5字详细介绍分布式系统的那些技术方案
- Kubernetes data persistence scheme
- 谷歌 Material Design 的文本框为什么没人用?
- The chess robot pinched the finger of a 7-year-old boy, and the pot of a software testing engineer? I smiled.
- Kubernetes cluster configuration dashboard service
猜你喜欢

1w5字详细介绍分布式系统的那些技术方案

中国地图省>市>级>区>镇>村5级联动下载【2019和2021】

1w5 words to introduce those technical solutions of distributed system in detail

Distributed system architecture theory and components

Completion report of communication software development and Application

JSON file storage

Kubernetes technology and Architecture (VII)

Eight ways to solve EMC and EMI conducted interference

Digital signatures and Ca certificates
![Detailed explanation of DHCP distribution address of routing / layer 3 switch [Huawei ENSP]](/img/9c/b4ebe608cf639b8348adc1f1cc71c8.png)
Detailed explanation of DHCP distribution address of routing / layer 3 switch [Huawei ENSP]
随机推荐
Go interface advanced
Three ways to create threads
Dapp安全总结与典型安全事件分析
Network interface network crystal head RJ45, Poe interface definition line sequence
图片批处理|必备小技能
Kubernetes data persistence scheme
Why is the text box of Google material design not used?
C #, introductory tutorial -- debugging skills and logical error probe technology and source code when the program is running
Why setting application.targetframerate doesn't work
Digital signatures and Ca certificates
Let me teach you how to assemble a registration center?
Kubernetes cluster configuration dashboard service
[activity registration] User Group Xi'an - empowering enterprise growth with modern data architecture
ES6 let与const
Go waitgroup and defer
Detailed explanation of DHCP distribution address of routing / layer 3 switch [Huawei ENSP]
JSON 文件存储
Hyperlink label
49 opencv deep analysis profile
TXT text file storage