Edge AI – Multiple Object Tracking (MOT, 多個物體追蹤)

(Multiple) Object detection (OD, 物體檢測) 是 edge AI 應用的主角,例如安防監控人和車的偵測,無人機或 robot 的地面人的偵測,自動駕駛的車/自行車/機車/行人偵測。 Object detection 從傳統 computer vision 算法例如 HOG 轉變成 AI(i.e. 深度學習) 算法例如 YOLO, SSD. 一個很重要但常常被忽略的配角是 (multiple) object tracking (MOT, 物體追蹤)。目前 object detection 大多是 frame base, i.e. frame-by-frame detection, 而非 time-sequence base (e.g. RNN). 因此如何 track detected objects frame-by-frame 就很重要並且需要額外的算法。 Tracking-by-detection!! Paradigm shift!! Surveillance camera 的 …

Math ML – Modified Softmax w/ Margin

[@rashadAdditiveMargin2020] and [@liuLargeMarginSoftmax2017] Softmax classification 是陳年技術,可還是有人在老幹上長出新枝。其中一類是在 softmax 加上 maximum margin 概念 (sometimes refers to metric learning), 另一類是在 softmax 所有 dataset 中找出 "supporting vectors" 減少 computation 卻不失準確率。實際做法都是從修改 loss function 著手。本文聚焦在第一類增加 margin 的 算法。 Softmax in DL or ML Recap Softmax 最常用於 DL (i.e. deep layers) 神經網絡最後一層(幾層)的 multi-class classification 如下圖。 and Input vector, , dimension . Weight …

NLP #1: 自然語言處理簡介

AI talk 最常被提到的口號:“Data is the King”. 確實 AI 發展最快的幾個領域如 recommendation system (cloud), computer vision (cloud/edge), and NLP (cloud/edge) 都有巨量 dataset: labeled or unlabeled, public or private. 相形之下,voice, industrial/scientific/medical (ISM), etc. 進展比較慢。除了 data 相對比較少,還有其他的原因。 以 NLP 為例,NLP 中有各種各樣的任務,比如分類 (Classification),翻譯 (translation),問答(QA),實體命名識別(NER)等。對於這些不同的任務,最早的做法是根據每類任務定制不同的模型,輸入預訓練好的embedding,然後利用特定任務的數據集對模型進行訓練,如下圖。這裡存在的問題就是,不是每個特定任務都有大量的標籤數據可供訓練,對於那些數據集非常小的任務,恐怕就難以得到一個理想的模型。 我們看一下圖像領域是如何解決這個問題的。圖像分類是計算機視覺中最基本的任務,當我要解決一個小數據集的圖像分類任務時,該怎麼做?CV領域已經有了一套成熟的解決方案。我會用一個通用的網絡模型,比如Vgg,ResNet或者GoogleNet,在ImageNet上做預訓練(pre-training)。ImageNet有1400萬張有標注的圖片,包含1000個類別,這樣的數據規模足以訓練出一個規模龐大的模型。在訓練過程中,模型會不斷的學習如何提取特徵,底層的CNN網絡結構會提取邊緣,角,點等通用特徵,模型越往上走,提取的特徵也越抽象,與特定的任務更加相關。當完成預訓練之後,根據我自己的分類任務,調整最上層的網絡結構,然後在小數據集里對模型進行訓練。在訓練時,可以固定住底層的模型參數只訓練頂層的參數,也可以對整個模型進行訓練,這個過程叫做微調(fine-tuning),最終得到一個可用的模型。 總結一下,整個過程包括兩步,拿一個通用模型在ImageNet上做預訓練(pre-training),然後針對特定任務進行微調(fine-tuning),完美解決了特定任務數據不足的問題。還有一個好處是,對於各種各樣的任務都不再需要從頭開始訓練網絡,可以直接拿預訓練好的結果進行微調,既減少了訓練計算量的負擔,也減少了人工標注數據的負擔。 A good reference of NLP. [@zhangTransformerBERT2019] Pre-trained network 例如 ResNet 或是 MobileNet 可以做為特徵提取的骨幹,用於各類的圖像任務。像是下圖的 object …

Math ML – Kernel Method 數學基礎

在深度學習 (DL) 如此火紅之前,最熱門的 machine learning 必殺技是 kernel method or kernel trick. 大多數的 ML 招式都可以加上 kernel method 再產生更多 papers, 例如 Kernel SVM (classification, supervised learning) Kernel Ridge Regression (regression, supervised learning) Kernel PCA (dimension reduction, unsupervised learning) Kernel K-Means (clustering, unsupervised learning) Why Kernel? 直觀解釋 下圖左是 non-linear decision boundary (for supervised or semi-supervised learning) 的例子。普通的 linear …

Math ML – Multiclass Classification: Softmax, SVM, IVM

Multi-class classification (MCC) 是一個陳年題目,標準作法就是 softmax classification. Softmax MCC 在 CNN 分類網絡擔任 feature classification 最後收官角色。在 attention based 的 transformer, BERT 更是扮演主角。 另外在一些特殊的應用如人臉識別,不同的 softmax loss function 近年也有很多的進展。 值得更進一步探討背後的基本數學原理以及變形。最好有一個 unified theory vs. applications correspondence! Linear separable dataset, 特別是 binary dataset, SVM 的優勢 (i) maximum margin; (ii) efficiency computation for both training (convex optimization) and inference; (iii) intuitively explainable …

Math AI – Manifold Learning 數學基礎

前面幾篇文章提到 manifold learning, 只討論用於降維,沒有討論如何用於 learning. 什麼是 learning? No free lunch theorem told us need to (1) underline structure; (2) constraints to learn something from existing data. underline structure => manifold hypothesis or kernel method, 如下式的 (function search space). constraint => Occam razor principle, simpler is better than complex, smooth (underfit or just make) is better …

Computer Graphics I: Rendering – Rasterization Vs. Ray Tracing

Computer Graphics 是 model 3D 的物體和運動。要能被人眼看到,有兩個要素:(1) 要有光線打光在 3D 的物體和空間呈現亮度和顏色。(2) 3D 物體的亮度和顏色要轉為 2D display 顯示。這個過程稱為 rendering (渲染). (1) and (2) 的順序決定了兩種 rendering 的方式:rasterization or ray casting/tracing. Ray casting/tracing: Ray Based Rendering (1->2) Ray casting/tracing 的主體是 rays 如下圖。為了簡化,我們假設每一個 2D display pixel 對應 1 ray (1 pixel per ray or 1 ppr). 對於 720p (1280×720 ~ 1M pixel) …

Hidden Markov Model:Part4 Learning

HMM 的參數可以用 完整表示:包含 transition matrix, emission matrix, and an initial distribution. 重點是 HMM 如何和實際應用或問題關聯,有三種基本應用和問題:[@jurafskyHIddenMarkov2019] The Likelihood Evaluation Problem: 根據觀察序列O及模型參數λ,得出此序列的機率 P(O|λ), 對應 forward and backward algorithms. The Decoding Problem: 根據觀察序列O及模型參數λ,得出最有可能的隱藏狀態序列(hidden state sequence), 對應 Viterbi algorithm. The Learning Problem: 根據觀察序列O,調整模型參數 使得 P(O|λ) 最大化, 對應 Baum-Welch (B&W) algorithm (a special case of EM algorithm). HMM 的第三類應用更基本和廣泛。注意是調整參數,十分接近 machine learning …

Hidden Markov Model:Part3 Sequence Decode and Kalman Filter (Non-Sequence Detector)

幾次紀錄學習 Kalman filter (KF), Hidden Markov Model (HMM), Convolution Code (CC) and Trellis Code Modulation (TCM) Viterbi decoding 都是孤立的主題,缺乏相互的連結。 這幾個題目 underlying structure 都是 decode hidden state。 橫向連結幾個主題的分類 and united Optimal sequence detection Point state: Filtering, prediction, smoothing learning in hidden state (next topic) EM for HMM estimate the noise of kalman filter Summary Kalman filter …

Hidden Markov Model 三大問題:Part2 Decode Sequence

HMM 的參數可以用 完整表示:包含 transition matrix, emission matrix, and an initial distribution. 重點是 HMM 如何和實際應用或問題關聯,有三種基本應用和問題:[@jurafskyHIddenMarkov2019] The Likelihood Evaluation Problem: 根據觀察序列O及模型參數λ,得出此序列的機率 P(O|λ), 對應 forward and backward algorithms. The Decoding Problem: 根據觀察序列O及模型參數λ,得出最有可能的隱藏狀態序列(hidden state sequence), 對應 Viterbi algorithm. The Learning Problem: 根據觀察序列O,調整模型參數 使得 P(O|λ) 最大化, 對應 EM algorithm. 另外,維基百科有寫出另外經典問題,其實就是 (discrete state) Kalman filter. 還有 xxx 也有 forward/backward computation (in …

Design a site like this with WordPress.com
Get started