SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
ライブラリ紹介:
Fertilized Forests
原健翔
名古屋大学 大学院情報科学研究科
間瀬研究室 D3
Fertilized Forests
1
 Random Forestsのオープンソースライブラリ
 ACMMM 2015
Open Source Software Competition
Honorable Mention Award
http://www.multimedia-computing.de/fertilized/
どういう人におすすめ?
2
 Hough Forestsを使いたい人
 Random Forestsのアルゴリズムを
一部改変して使いたい人
 Random Forestsのアルゴリズムに関する
研究をしたい人
何ができる?
3
 Random Forestsによる識別・回帰
 Hough Forestsによる物体検出
特徴は?
4
 拡張性が高い
 識別,回帰,密度推定,多様体学習,
半教師あり学習に対応可能なモデル*に基づく実装
 Matlabのサポート
*A. Criminisi et al. “Decision Forests for Classification, Regression,
Density Estimation, Manifold Learning and Semi-Supervised Learning”, 2011.
導入方法
5
 Windowsのみビルド済みのものが存在
http://www.multimedia-computing.de/fertilized/files/binaries/fertilized-1.02.zip
 VS2013 x64, Boost 1.58, Eigen 3.2.1,
OpenCV 2.4.11, Python 2.7.9,(Matlabはない)
 それ以外は自分でcmakeを使ってビルド
 VS2015 x64, Boost 1.58, Eigen 3.2.1,
OpenCV 3.1.0, Python 3.5.1でビルド成功
 Boost 1.61だとエラーが出た
導入方法 | ビルド済み版・Python
6
 “python setup.py install” でインストール
 ただsetup.pyがビルド済み版に付いてない…
 githubに公開されているソースコードの中から
setup.pyを持ってきて利用する必要あり
https://github.com/classner/fertilized-forests
 “setup.py.in”を”setup.py”にリネームして利用
 binding/python の中にいれて実行
基本的な使い方 | 識別
7
from fertilized import Soil
soil = Soil()
forest = soil.StandardClassificationForest(2, 2)
forest.fit(X, Y)
forest.predict(X2)
基本的な使い方 | 回帰
8
from fertilized import Soil, Result_types
soil = Soil(result_type=Result_types.regression)
forest = soil.StandardRegressionForest(2)
forest.fit(X, Y)
forest.predict(X2)
Soil
9
Soil(self, input_dtype_str='float',
feature_dtype_str='float',
annotation_dtype_str='uint', result_type=0)
Result_types: probabilities, regression, hough_map
各種クラスを生成するためのクラス
ClassificationForest, RegressionForestなど
StandardClassificationForest
10
StandardClassificationForest(
n_classes, n_features, max_depth=0,
test_n_features_per_node=0,
n_thresholds_per_feature=0, n_trees=10,
min_samples_per_leaf=1, min_samples_per_split=2,
min_gain_threshold=1e-07, allow_redraw=1,
random_seed=1, entropy_name='induced',
entropy_p1=2, threshold_optimization_threads=1)
StandardClassificationForest
11
 n_classes: クラス数
 n_features: 特徴次元数
 max_depth: 木の最大深さ
 test_n_features_per_node:
各ノードでランダム選択する特徴の生成数
 n_thresholds_per_feature:
各特徴に対するランダムしきい値の生成数
StandardClassificationForest
12
 n_trees: 決定木数
 min_samples_per_leaf: 葉ノードの最小要素数
 min_samples_per_split: 分岐時の最小要素数
 min_gain_threshold:
情報利得の値での終了条件
 allow_redraw: 新たな子ノードを
生成できなかったときにもう一度試すかどうか
StandardClassificationForest
13
 random_seed: 乱数シード
 entropy_name: 情報利得計算に用いる尺度
(induced, classification_error,
renyi, tsallis, shannon)
 entropy_p1: 上の尺度のパラメータ
 threshold_optimization_threads:
並列化のスレッド数
カスタマイズの方法
14
 StandardForestのパラメータは
scikit-learnなどとあまり変わらない
 カスタマイズしたRandom Forestsを
利用するためにはForestを自分で定義する
Forest カスタマイズ
15
AlignedSurfaceCalculator
(StandardClassificationForest)
LinearSurfaceCalculator
Forest
16
Forest(max_tree_depth, min_samples_at_leaf,
min_samples_at_node, n_trees,
deciders, leaf_managers, training)
設定が必要な要素
リストで渡して決定木ごとに設定
Random Forestsを設定するためのクラス
Decider
17
ThresholdDecider(self,
selection_provider,
feature_calculator,
threshold_optimizer, ...)
入力データの形式や最適化方法を設定するためのクラス
SelectionProvider
18
 StandardFeatureSelectionProvider:
ランダムに入力特徴ベクトルの中から
次元を選択
入力からFeatureCalculatorへの投げ方を
設定するためのクラス
Feature(Surface)Calculator
19
 AlignedSurfaceCalculator: 1次元を選択
 QuadraticSurfaceCalculator: 2次関数
 DifferenceSurfaceCalculator:
2次元を選択して差を計算
分岐のための特徴を設定するためのクラス
input_dtypeとfeature_dtype
20
 input_dtype: 入力する特徴ベクトルの型
 feature_dtype: FeatureCalculatorの出力の型
ThresholdOptimizer
21
 RandomClassificationThresholdOptimizer:
識別用
 RegressionThresholdOptimizer: 回帰用
 AlternatingThresholdOptimizer:
HoughForests用に
二種類のThresholdOptimizerを設定可能
パラメータの最適化方法を設定するためのクラス
LeafManager
22
 ClassificationLeafManager: 識別用
 RegressionLeafManager: 回帰用
 HoughLeafManager: Hough Forests用
葉ノードのデータ形式を設定するためのクラス
Training
23
 ClassicTraining: 普通の学習用
 BoostedTraining: Boosting用
学習方法を設定するためのクラス
Forest カスタマイズ
24
from fertilized import Soil
soil = Soil()
prov = soil.StandardFeatureSelectionProvider(...)
surf = soil.LinearSurfaceCalculator(...)
opt =
soil.RandomizedClassificationThresholdOptimizer(...)
dec = soil.ThresholdDecider(prov, surf, opt)
leafMgr = soil.ClassificationLeafManager(...)
training = soil.ClassicTraining(...)
continue on next page...
Forest カスタマイズ
25
decs = [dec for i in range(n_trees)]
leafMgrs = [leafMgr for I in range(n_trees)]
forest = soil.Forest(..., decs, leafMgrs, training)
forest.fit(X, Y)
forest.predict(X2)
決定木ごとに乱数シードを変えるなら
for文回してそれぞれで設定する必要あり
SurfaceCalculatorの違い
26
AlignedSurfaceCalculator LinearSurfaceCalculator
カスタマイズ要素
27
Figure 1*
* C. Lassner and R. Lienhart, “The fertilized forest Decision Forest Library”, Proc. ACMMM15.
自分の実装例
28
 行動検出用Hough Forestsのための実装
 多クラス版HoughLeafManagerを実装
 多クラス版オフセット用Optimizerを実装
 自分のデータ形式に合わせた
FeatureSelectionProvider/Generatorを実装
まとめ
Fertilized Forests
 Random Forestsのオープンソースライブラリ
 C++, Python, Matlabで使用可能
 拡張性が高いのが売り
 Hough Forestsの実装も使える
29

Mais conteúdo relacionado

Destaque

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Destaque (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

ライブラリ紹介:Fertilized Forests