Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How to use scikit-image for data augmentation
Search
tereka114
March 16, 2022
Programming
320
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
How to use scikit-image for data augmentation
第33回コンピュータビジョン勉強会の資料です。内容は、scikit-imageを使ったData Augmentationの方法です。
tereka114
March 16, 2022
More Decks by tereka114
See All by tereka114
トラブルがあったコンペに学ぶデータ分析
tereka114
2
2.1k
Harnessing Large Language Models for Training-free Video Anomaly Detection
tereka114
1
1.8k
KDD2023学会参加報告
tereka114
2
680
Prompting Large Language Models with Answer Heuristics for Knowledge-based Visual Question Answering
tereka114
0
470
Mobile-Former: Bridging MobileNet and Transformer
tereka114
0
1.2k
DER: Dynamically Expandable Representation for Class Incremental Learning
tereka114
0
270
Jupyter Notebookを納品した話
tereka114
0
560
Multi Scale Recognition with DAG-CNNs
tereka114
0
190
面倒くさいこと考えたくないあなたへ〜Tpotと機械学習〜
tereka114
0
320
Other Decks in Programming
See All in Programming
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
990
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.7k
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
680
From 6 People Classroom Meetup to 100 People Regional Conference / FOSS4G Hiroshima 2026
furukawayasuto
0
110
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
140
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
130
ALB ログから Trace を気合で繋げる技術
fohte
7
870
[KotlinConf Extended South Korea 2026] KotlinConf 2026 발표자 후기
wisemuji
0
100
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
450
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.4k
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
560
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Become a Pro
speakerdeck
PRO
31
6.2k
The browser strikes back
jonoalderson
0
1.6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.6k
Utilizing Notion as your number one productivity tool
mfonobong
4
570
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Site-Speed That Sticks
csswizardry
13
1.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
How STYLIGHT went responsive
nonsquared
100
6.3k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
510
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
Transcript
How to use scikit-image for data augmentation @tereka114
自己紹介 1. 山本 大輝(@tereka114) 2. のんびりしているエンジニアの日記(Blog) 1. http://nonbiri-tereka.hatenablog.com/ 3. Acroquest
Technology株式会社 4. データ分析のお仕事しています。 1. 画像処理、自然言語処理
Outline 1. Scikit-imageとは何か 2. Data Augmentationとは何か 3. Data Augmentationで使える関数の紹介 1.
画像の読み込み 2. アフィン変換 3. ヒストグラム正規化 4. Numpyの便利関数紹介
Outline 1. Scikit-imageとは何か 2. Data Augmentationとは何か 3. Data Augmentationで使える関数の紹介 1.
画像の読み込み 2. アフィン変換 3. ヒストグラム正規化 4. Numpyの便利関数紹介
Scikit-imageとは何か? 1. Scikit-imageは画像処理のライブラリ。 2. 因みにscikitとは、scipy toolkitを示していて、 特にこのライブラリは広く使われている。 3. 実は気にしていないだけで、案外バックエン ドでは動いていることがある。
CaffeのData Augmentation
Scikit-imageの良い点 1. Installが簡単 1. Sudo pip install scikit-image 2. 基本的な操作はNumpyの関数で可能
1. 簡単に行列演算を実施することができる。
Scikit-imageでできること 1. 画像の入出力(当たり前) 2. 画像の変換 1. Histogram normalization、Affine Transform 3.
特徴量抽出 1. Local Binary Pattern, Histogram of Orientation
Scikit-imageでできること 1. 画像の入出力(当たり前) 2. 画像の変換 1. Histogram normalization、Affine Transform 3.
特徴量抽出 1. Local Binary Pattern, Histogram of Orientation
Outline 1. Scikit-imageとは何か 2. Data Augmentationとは何か 3. Data Augmentationで使える関数の紹介 1.
画像の読み込み 2. アフィン変換 3. ヒストグラム正規化 4. Numpyの便利関数紹介
Data Augmentation 1. データに対して情報を加えること。 2. 画像に対しては、元画像に対して回転、平 行移動、スケール変更などの情報を加える。 3. Kaggleではよく使われる方法 4.
AlexNetの元論文でも使われている。
Example of Data Augmentation 引用元:https://cesarlaurent.wordpress.com/2015/02/19/29/
Example of Data Augmentation 引用元:https://cesarlaurent.wordpress.com/2015/02/19/29/
Outline 1. Scikit-imageとは何か 2. Data Augmentationとは何か 3. Data Augmentationで使える関数の紹介 1.
画像の読み込み 2. アフィン変換 3. ヒストグラム正規化 4. Numpyの便利関数紹介
画像の読み込み 1. skimage.io.imreadでファイル名を第一引数 に使うと可能です。 2. 読みこんだ画像はnumpy.arrayなので行列 計算はそのまま可能 3. OpenCVと併用する場合は注意、行列の並び 順はRGB。(OpenCVはBGR)
画像の読み込み 1. Scikit-imageでの画像を読み込み
アフィン変換 1. 平行移動を伴う線形変換のこと 1. 「並行移動」・「回転」・「拡大・縮小」が可能 2. パラメータを与えるだけで簡単にできる。 1. Scale:スケールの変換 2.
Rotate:回転 3. Translated:平行移動
アフィン変換 Affine変換の行列を作成 rotateはradian 線形変換
ヒストグラム正規化 1. ヒストグラムを平滑化することによって、コン トラストを調整することができる。 1. このコントラスト調整によって、精度がよくな ることも・・・
ヒストグラム正規化
ヒストグラム正規化
Numpyの便利関数紹介 1. np.random.randomとnp.random.binomialを 組み合わせると、ノイズが作れる。 2. Transpose関数で転置できる。 1. 多くのDeepLearningライブラリでは、 channel,height,widthの順番を求められる。 2.
scikit-imageの画像はheight,width,channel 3. img.transpose(2,0,1)とすると期待する入力にな る。
Numpyの便利関数紹介 1. whereを使うと一定以上の値を抽出して、定 数に変換など可能 1. 値が0.5より高い箇所を1とする。 1. x[np.where(x > 0.5)]
= 1 2. 画像自体はnumpyの行列の為、以下の方法 で、画像を切り取ることが可能 1. img = img[10:10 + 224]
まとめ 1. scikit-imageでData Augmentationをやってみ ようの紹介です。 2. Data Augmentationは画像処理(特に認識) で使われ、成果をあげている。 3.
Scikit-imageで、簡単にできる。