基 于 MATLAB 的 计 算 机 视 觉 插 上 人 工 智 能 的 翅 膀 MathWorks China Application Engineer Tom Shan 2014 The MathWorks, Inc. 1
题 纲 基 于 MATLAB 的 人 工 智 能 设 计 流 程 介 绍 演 示 人 工 智 能 流 程 和 常 见 挑 战 针 对 实 时 视 频 进 行 目 标 检 测 训 练 目 标 检 测 器 并 行 计 算 加 速 集 群 GPU/ 多 GPU 加 速 总 结 3
题 纲 基 于 MATLAB 的 人 工 智 能 设 计 流 程 介 绍 演 示 人 工 智 能 流 程 和 常 见 挑 战 针 对 实 时 视 频 进 行 目 标 检 测 训 练 目 标 检 测 器 并 行 计 算 加 速 集 群 GPU/ 多 GPU 加 速 总 结 4
使 用 机 器 学 习 都 能 帮 我 们 解 决 哪 些 问 题? Clustering Object Recognition or Classification Object Detection 5
机 器 学 习 Machine Learning 机 器 学 习 使 用 数 据, 并 以 此 产 生 出 一 套 用 于 特 定 任 务 的 程 序 任 务 : Image Category Recognition Hand Written Program boats mugs hats Computer Vision Machine Learning boats mugs hats If brightness > 0.5 then hat If edge_density < 4 and major_axis > 5 then boat model = < Machine Learning >(data, label) Algorithm 6
题 纲 基 于 MATLAB 的 人 工 智 能 设 计 流 程 介 绍 演 示 人 工 智 能 流 程 和 常 见 挑 战 针 对 实 时 视 频 进 行 目 标 检 测 训 练 目 标 检 测 器 并 行 计 算 加 速 集 群 GPU/ 多 GPU 加 速 总 结 7
使 用 图 像 进 行 机 器 学 习 的 流 程 Training Data Feature Extraction Learning or Modelling Training Classifier / Model hat Input Image Feature Extraction Classification Classification 8
挑 战 : 使 用 图 像 进 行 机 器 学 习 的 流 程 Training Data Feature Extraction Learning or Modelling Challenge 1 Challenge 2 Challenge 3 Challenge 2 Classifier / Model hat Input Image Feature Extraction Classification 9
基 于 图 像 机 器 学 习 的 共 同 挑 战 Challenge 1: Handling large sets of images Challenge 2: How to extract discriminative information from images Challenge 3: How to model tasks or data using machine learning 10
题 纲 基 于 MATLAB 的 人 工 智 能 设 计 流 程 介 绍 演 示 人 工 智 能 流 程 和 常 见 挑 战 针 对 实 时 视 频 进 行 目 标 检 测 训 练 目 标 检 测 器 并 行 计 算 加 速 集 群 GPU/ 多 GPU 加 速 总 结 11
目 标 : 对 实 时 视 频 中 的 目 标 进 行 识 别 / 分 类 vs vs hat mug boat Known as object classification or recognition 12
什 么 是 特 征 提 取? Bag of Words SURF HOG Image Pixels 特 征 提 取 图 像 特 征 通 常 是 对 于 缩 放 旋 转 亮 度 的 改 变, 具 有 一 致 性 比 直 接 存 储 像 素 数 据, 更 加 紧 凑 需 根 据 实 际 问 题, 进 行 特 征 的 选 取 Sparse Dense 13
Bag of Words Image Processing Toolbox Class / Label Perform image processing, analysis, and algorithm development Image Processing Toolbox provides a comprehensive set of reference-standard algorithms, functions, and apps for image processing, analysis, visualization, and algorithm development. You can perform image analysis, image segmentation, image enhancement, noise reduction, geometric transformations, and image registration. Many toolbox functions support multicore processors, GPUs, and C-code generation. Image Processing Toolbox supports a diverse set of image types, including high dynamic range, gigapixel resolution, embedded ICC profile, and tomographic. Visualization functions and apps let you explore images and videos, examine a region of pixels, adjust color and contrast, create contours or histograms, and manipulate regions of interest (ROIs). The toolbox supports workflows for processing, displaying, and navigating large images. Training Data Vocabulary / Bag of Words 14
Bag of Visual Words ( features) mugs Class / Label Training Data Vocabulary / Bag of Words 15
使 用 Bag of Words 进 行 图 像 识 别 / 分 类 Training Data Bag = Visual Vocabulary Bag Classifier hat Input Image 16
Many Options for Features and Machine Learning Feature Extraction BRISK,FREAK, SURF Histogram of Oriented Gradients (HoG) Using box filters(integral images ) Bag of visual words Color-based features Frequency-domain features Machine Learning SVM Decision trees AdaBoost Bagged trees k-nn Discriminant analysis Bayes classifiers Bottom Line: Many permutations and combinations to fit the needs of your problem 19
挑 战 : 使 用 图 像 进 行 机 器 学 习 的 流 程 Training Data Feature Extraction Learning or Modelling Challenge 1 Challenge 2 Challenge 3 Challenge 2 Classifier / Model hat Input Image Feature Extraction Classification 20
Common Challenges for Machine Learning with Images 挑 战 1: 处 理 大 量 图 像 数 据 集 挑 战 2: 如 何 从 图 像 中 提 取 差 别 信 息 挑 战 3: 如 何 使 用 机 器 学 习 技 术 对 问 题 建 模 方 便 操 作 的 大 量 图 像 数 据 集 imageset 将 Bag of words 用 于 特 征 提 取 更 多 特 征 提 取 函 数 见 Computer Vision System Toolbox Classification APP 21
Examples of Object Recognition/Classification Automatic scene categorization Biometrics Face recognition IRIS recognition Fingerprint recognition Part recognition for factory automation Autonomous robotics 22
题 纲 基 于 MATLAB 的 人 工 智 能 设 计 流 程 介 绍 演 示 人 工 智 能 流 程 和 常 见 挑 战 针 对 实 时 视 频 进 行 目 标 检 测 训 练 目 标 检 测 器 并 行 计 算 加 速 集 群 GPU/ 多 GPU 加 速 总 结 26
基 于 MATLAB 的 目 标 检 测 多 种 方 法 : 1. 特 征 检 测 提 取 和 匹 配 2. 预 先 训 练 好 的 模 型 3. Out-of-the box frameworks 从 头 开 始 设 计 分 类 器 两 类 分 类 器 ( classes are object and everything else ) 27
Object Detection is Classification Sliding Window Extract Feature Classify Patch Label, Score 28
级 联 分 类 器 (Cascade classifier ) 灵 感 Boosting Cancer detection CEA X AFP X CA153 XCA199 X CA125 =+99% accuracy 级 联 分 类 器 的 结 构 (Cascade classifier Structure) 29
典 型 应 用 : Viola Jones Algorithm Face detection 效 率 : will quit at 1 st stage for the majority of the area. Features: HoG overall shape of the object people,car detection LBP Haar Fine scale texture face,nose,eye etc Tip : To save time, use small image set and use HoG & LBP to decide whether it is good with fine scale texture or overall shape. 30
总 结 : 创 建 目 标 检 测 器 使 用 MATLAB Apps 简 化 训 练 过 程 耗 时 采 用 目 标 检 测 器 架 构 快 速 搭 建 自 定 制 目 标 检 测 器 大 量 预 先 训 练 的 检 测 器 可 供 使 用 31
题 纲 基 于 MATLAB 的 人 工 智 能 设 计 流 程 介 绍 演 示 人 工 智 能 流 程 和 常 见 挑 战 针 对 实 时 视 频 进 行 目 标 检 测 训 练 目 标 检 测 器 并 行 计 算 加 速 集 群 GPU/ 多 GPU 加 速 总 结 34
并 行 计 算 助 理 人 工 智 能 MATLAB 并 行 计 算 实 现 : 串 行 到 并 行 Worker Worker Worker TOOLBOXES BLOCKSETS Worker Worker Worker Worker Worker 35
MATLAB 并 行 计 算 实 现 : 串 行 到 并 行 Worker Worker Worker TOOLBOXES BLOCKSETS Worker Worker Worker Worker Worker 36
MATLAB 并 行 计 算 工 具 箱 使 用 并 行 计 算 工 具 箱 Desktop Computer Parallel Computing Toolbox 使 本 地 计 算 加 速 充 分 发 挥 CPU 和 GPU 的 各 自 计 算 能 力 无 需 另 外 的 计 算 资 源 37
易 于 扩 展 到 集 群, 网 格, 和 云 桌 面 计 算 Parallel Computing Toolbox 计 算 集 群 MATLAB Distributed Computing Server Scheduler 38
易 于 使 用 CPU 并 行 编 程 实 现 : 少 量 代 码 修 改 工 具 箱 内 部 函 数 支 持 上 层 编 程 结 构 parfor, batch, distributed 便 于 控 制 底 层 编 程 结 构 createjob, labsend 39
题 纲 基 于 MATLAB 的 人 工 智 能 设 计 流 程 介 绍 演 示 人 工 智 能 流 程 和 常 见 挑 战 针 对 实 时 视 频 进 行 目 标 检 测 训 练 目 标 检 测 器 并 行 计 算 加 速 集 群 GPU/ 多 GPU 加 速 总 结 40
GPU 加 速 卷 积 神 经 网 络 案 例 41
多 GPU 加 速 useparallel yes no 'usegpu yes no only What if GPU + CPU? 自 动 在 大 型 神 经 网 络 训 练 时 保 留 Checkpoints By default, checkpoint saves occur at most once every 60 seconds. Save to.mat file, and load easily 42
题 纲 基 于 MATLAB 的 人 工 智 能 设 计 流 程 介 绍 演 示 人 工 智 能 流 程 和 常 见 挑 战 针 对 实 时 视 频 进 行 目 标 检 测 训 练 目 标 检 测 器 并 行 计 算 加 速 集 群 GPU/ 多 GPU 加 速 总 结 43
Thank You! 45