语音识别入门第五节:基于GMM-HMM的语音识别系统

目录

基于孤立词的GMM-HMM语音识别系统

语音识别中GMM是一个对角的GMM,它的协方差为对角阵,这是因为在GMM-HMM语音识别中,一般使用MFCC特征,而MFCC特征各维特征是独立的,只需要对角阵就可以描述它,此外,对角GMM模型的参数量相对较少,所需的计算量也更少。
语音识别中的HMM是一个三状态的左右模型(每个状态只能跳转到自身或者下一个状态)的HMM,如图所示(s1、s2、s3为状态):

语音识别入门第五节:基于GMM-HMM的语音识别系统

; 训练

从系统的角度考虑,输入数据为词w和w所对应的训练数据,输出为词w的GMM-HMM模型。​
其中的任务的关键是从训练数据X w 1 , X w 2 , X w 3 , ⋯ X_{w1,X_{w2},X_{w3},\cdots}X w 1 ,X w 2 ​,X w 3 ​,⋯​中训练P w ( X ) P_w(X)P w ​(X ),估计GMM-HMM模型参数,使用的准则为最大似然。
本节使用的方法为Viterbi学习(Viterbi训练)和Baum-Welch学习(前向后向训练)。
V i t e r b i 训练 \color{#FF0000}{Viterbi训练}Vi t er bi 训练
类比问题:如果性别已知,询问男孩(或女孩)的平均身高。

[En]

Analogy problem: if the gender is known, ask for the average height of boys (or girls).

E步:使用Viterbi算法得到最优的状态序列(对齐 alignment),在时刻t t t处于状态i i i的概率(0或1),估计GMM模型中时刻t t t处于状态i i i第k k k个GMM分量的概率。
M步:更新转移参数、GMM参数(详见语音识别入门第三节:GMM以及EM算法)。
重复E/M步。
具体流程如下:

  • 初始化GMM-HMM参数λ = ( a i j , G M M 参数 ) \lambda=(a_{ij},GMM参数)λ=(a ij ​,GMM 参数),其中,每个状态j j j对应的GMM参数为( α j m , μ j m , Σ j m ) (\alpha_{jm},\mu_{jm},\Sigma_{jm})(αjm ​,μjm ​,Σjm ​)
  • 基于GMM-HMM参数λ \lambda λ和Viterbi算法得到状态-观测对齐,得到每个观测对应的隐藏状态
  • 更新参数λ \lambda λ
    –a ^ i j = C ( i → j ) ∑ k C ( i → k ) \hat{a}{ij}=\frac{C(i \to j)}{\sum{k}C(i \to k)}a ^ij ​=∑k ​C (i →k )C (i →j )​,C ( i → j ) C(i \to j)C (i →j )表示从状态i i i到状态j j j的转移次数
    – 更新GMM参数
  • 重复2、3步,直到收敛

在语音识别问题中,一开始就没有相应的模型。通常,语音中包含的帧的数量根据状态的数量被平均划分,并为每个状态分配相应的特征,然后估计初始参数。

[En]

In the problem of speech recognition, there is no corresponding model at the beginning. Generally, the number of frames contained in a speech is divided equally according to the number of states, and the corresponding characteristics are assigned to each state, and then an initial parameter is estimated.

前向后向训练( B a u m − W e l c h 训练) \color{#FF0000}{前向后向训练(Baum-Welch训练)}前向后向训练(B a u m −W e l c h 训练)
类比问题:知道每个人都属于男孩(或女孩)的概率,并询问男孩(或女孩)的平均身高。

[En]

Analogy question: know the probability that everyone belongs to a boy (or girl), and ask for the average height of a boy (or girl).

E步:使用前向算法+后向算法,估计在时刻t t t处于状态i i i的概率0 ≤ p ≤ 1 0\le p \le 1 0 ≤p ≤1,并估计GMM模型中时刻t t t处于状态i i i第k k k个GMM分量的概率。
M步:更新转移参数、GMM参数。
重复E/M步。
具体流程如下:

  • 初始化GMM-HMM参数λ = ( a i j , ( c j m , μ j m , Σ j m ) ) \lambda = \left( a_{ij},\left( c_{jm},\mu_{jm},\Sigma_{jm} \right) \right)λ=(a ij ​,(c jm ​,μjm ​,Σjm ​))
  • E步:对所有时间t t t、状态i i i
    – 递推计算前向概率α t ( i ) \alpha_t(i)αt ​(i )和后向概率β t ( i ) \beta_t(i)βt ​(i )
    – 计算ζ t ( j , k ) = ∑ i α t − 1 ( i ) a i j c j k b j k ( o t ) β t ( j ) ∑ i = 1 N α T ( i ) \zeta_t(j,k)=\frac{\sum_{i} \alpha_{t-1}(i)a_{ij}c_{jk}b_{jk}(o_t)\beta_t(j)}{\sum_{i=1}^{N}\alpha_T(i)}ζt ​(j ,k )=∑i =1 N ​αT ​(i )∑i ​αt −1 ​(i )a ij ​c jk ​b jk ​(o t ​)βt ​(j )​,ξ t ( i , j ) = α t ( i ) a i j b j ( o t + 1 ) β t + 1 ( j ) ∑ i = 1 N α T ( i ) \xi_t(i,j)=\frac{\alpha_t(i)a_{ij}b_j(o_{t+1})\beta_{t+1}(j)}{\sum_{i=1}^{N}\alpha_T(i)}ξt ​(i ,j )=∑i =1 N ​αT ​(i )αt ​(i )a ij ​b j ​(o t +1 ​)βt +1 ​(j )​,γ t ( i ) = ∑ k = 1 N ξ t ( i , j ) \gamma_t(i)=\sum_{k=1}^{N}\xi_t(i,j)γt ​(i )=∑k =1 N ​ξt ​(i ,j )。
  • M步:更新参数
    –μ ^ j k = ∑ t = 1 T ζ t ( j , k ) o t ∑ t = 1 T ζ t ( j , k ) \hat{\mu }{jk} = \frac{\sum {t=1}^{T}\zeta t(j,k)o_t}{\sum {t=1}^{T}\zeta_t (j,k)}μ^​jk ​=∑t =1 T ​ζt ​(j ,k )∑t =1 T ​ζt ​(j ,k )o t ​​
    –Σ ^ j k = ∑ t = 1 T ζ t ( j , k ) ( o t − μ ^ j k ) ( o t − μ ^ j k ) T ∑ t = 1 T ζ t ( j , k ) \hat{\Sigma}{jk}= \frac{\sum {t=1}^{T}\zeta t(j,k)(o_t-\hat{\mu }{jk})(o_t-\hat{\mu }{jk})^T}{\sum {t=1}^{T}\zeta_t (j,k)}Σ^jk ​=∑t =1 T ​ζt ​(j ,k )∑t =1 T ​ζt ​(j ,k )(o t ​−μ^​jk ​)(o t ​−μ^​jk ​)T ​
    –c ^ j k = ∑ t = 1 T ζ t ( j , k ) ∑ t = 1 T ∑ k ζ t ( j , k ) \hat{c }{jk} = \frac{\sum {t=1}^{T}\zeta_t (j,k)}{\sum {t=1}^{T}\sum {k}\zeta_t (j,k)}c ^jk ​=∑t =1 T ​∑k ​ζt ​(j ,k )∑t =1 T ​ζt ​(j ,k )​
    –a ^ i j = ∑ t = 1 T − 1 ξ t ( i , j ) ∑ t = 1 T − 1 ∑ k = 1 N ξ t ( i , k ) = ∑ t = 1 T − 1 ξ t ( i , j ) ∑ t = 1 T − 1 γ t ( i ) \hat{a }{ij}=\frac{\sum {t=1}^{T-1}\xi_t (i,j)}{\sum {t=1}^{T-1}\sum{k=1}^{N}\xi_t (i,k)}=\frac{\sum {t=1}^{T-1}\xi_t (i,j)}{\sum {t=1}^{T-1}\gamma_t (i)}a ^ij ​=∑t =1 T −1 ​∑k =1 N ​ξt ​(i ,k )∑t =1 T −1 ​ξt ​(i ,j )​=∑t =1 T −1 ​γt ​(i )∑t =1 T −1 ​ξt ​(i ,j )​
  • 重复2、3步,直到收敛

解码

从系统角度考虑,输入为各个词汇的GMM-HMM模型和未知的测试语音X t e s t X_{test}X t es t ​,输出为X t e s t X_{test}X t es t ​对应的词。
其中的关键点为在概率的框架中对所有的w w w就散P w ( X t e s t ) P_w(X_{test})P w ​(X t es t ​)。
本节使用的方法为前向算法和Viterbi算法(可以回溯到最优的状态序列)。
对于one、two两个数字的识别问题,分别使用one和two的HMM模型计算它们的概率,此时可以使用前向算法和Viterbi算法。首先,可以对one和two分散的建立拓扑结构,如下图所示。

语音识别入门第五节:基于GMM-HMM的语音识别系统
语音识别入门第五节:基于GMM-HMM的语音识别系统
也可将one和two表示为一个紧凑的图,如下图所示(此时只能使用Viterbi算法)。
语音识别入门第五节:基于GMM-HMM的语音识别系统
语音识别入门第五节:基于GMM-HMM的语音识别系统
此系统目前仅可识别独立的one或two,无法识别连续的多个词,如连续的one one one或one two one等,此时可将上图中节点E增加一个连接到节点S的跳转,这样就拥有可以表达连续数字串的能力。
基于孤立词的语音识别系统有很多缺点:
[En]

The speech recognition system based on isolated words has many shortcomings:

  • 建模单元的数量和计算量与词典的大小成正比
    [En]

    the number of modeling units and the amount of computation are proportional to the size of the dictionary.*

  • 词的状态数(a/accomplishment)对每个词应该不同,长词应该使用更多的状态。
  • 存在OOV(Out of Vocabulary)的问题。
  • 事实上,词不是一种语言的基本发音单位,作为造型单位的词不能共享这些发音的基本单位。
    [En]

    in fact, words are not the basic pronunciation units of a language, and words as modeling units cannot share the basic units of these pronunciations.*

; 基于单音素的GMM-HMM语音识别系统

音素/词典

音素是发音的基本单元。
英文一般会使用CMU Phone音素列表,共39个音素(其中,红色的为元音音素):A A \color{#FF0000}AA AA A E \color{#FF0000}AE A E A H \color{#FF0000}AH A H A W \color{#FF0000}AW A W A X \color{#FF0000}AX A X A X R \color{#FF0000}AXR A XR A Y \color{#FF0000}AY A Y B BD CH D DD DH DX E H \color{#FF0000}EH E H E R \color{#FF0000}ER ER E Y \color{#FF0000}EY E Y F G GD HH I H \color{#FF0000}IH I H I X \color{#FF0000}IX I X I Y \color{#FF0000}IY I Y JH K KD L M N NG O W \color{#FF0000}OW O W O Y \color{#FF0000}OY O Y P PD R S SH T TD TH TS U H \color{#FF0000}UH U H U W \color{#FF0000}UW U W V W X Y Z ZH
中文音素(可以认为声韵母就是音素):a \color{#FF0000}a a o \color{#FF0000}o o e \color{#FF0000}e e i \color{#FF0000}i i u \color{#FF0000}u u v \color{#FF0000}v v b p m f d t n l g k h j q x zh ch sh z c s y w a i \color{blue}ai ai e i \color{blue}ei e i u i \color{blue}ui u i a o \color{blue}ao a o o u \color{blue}ou o u i u \color{blue}iu i u i e \color{blue}ie i e u e \color{blue}ue u e e r \color{blue}er er a n \color{blue}an an e n \color{blue}en e n i n \color{blue}in in u n \color{blue}un u n v n \color{blue}vn v n a n g \color{blue}ang an g e n g \color{blue}eng e n g i n g \color{blue}ing in g o n g \color{blue}ong o n g
除此之外,一般还会引入一个静音音素Slience(SIL)

词典是词到音素序列的映射(文件),其中,0~910个数字的词典如下所示,其中,R音素是共享的,S音素也是共享的:

词音素oneW AA NtwoT UWthreeTH
R \color{red}R R

IYfourF AO
R \color{red}R R

fiveF AY Vsix
S \color{green}S S

IH K
S \color{green}S S

seven
S \color{green}S S

EH V AX NeightEY TnineN AY NzeroZ IY
R \color{red}R R

OW

训练

每个音素均使用经典的三状态结构。在训练时需将音素序列的三状态结构相连。如图是单词one的单音素结构图:

语音识别入门第五节:基于GMM-HMM的语音识别系统

; 解码

与孤立词解码类似,基于单音素的解码框图如下:

[En]

Similar to isolated word decoding, a single-phoneme-based decoding diagram is shown below:

语音识别入门第五节:基于GMM-HMM的语音识别系统
单音节语音识别系统也有许多缺点:
[En]

Monosyllabic speech recognition system also has many disadvantages:

  • 建模单位不多。一般来说,英语系统中的音素数量为30-60个,而汉语系统中的音素数量约为100个。
    [En]

    there are few modeling units. Generally speaking, the number of phonemes in English systems is 30-60, while that in Chinese systems is about 100.*

  • 音素的发音受其所处语境的影响,如链接、吞咽等。
    [En]

    the pronunciation of phonemes is affected by the context in which they are located, such as linking, swallowing, etc.*

基于三音素的GMM-HMM语音识别系统

三音素

考虑音素的上下文,一般会考虑前一个和后一个音素,称之为三音素,表示为A-B+C。
例如,单词KEEP是由音素K IY P组成,其三音素为# \color{#FF0000}{#}#-K+YI,K-IY+P,YI-P+# \color{#FF0000}{#}#。符号#代表空或边界点。
思考问题: \color{red}思考问题:思考问题:

  • 假设训练系统中有 N 个音素,一共有多少个三音素? \color{red}假设训练系统中有N个音素,一共有多少个三音素?假设训练系统中有N 个音素,一共有多少个三音素?
  • 如果训练系统中有的三音素训练数据特别少或不存在,应该怎么办? \color{red}如果训练系统中有的三音素训练数据特别少或不存在,应该怎么办?如果训练系统中有的三音素训练数据特别少或不存在,应该怎么办?
  • 有的三音素在训练数据中不存在,但在测试数据中存在怎么办? \color{red}有的三音素在训练数据中不存在,但在测试数据中存在怎么办?有的三音素在训练数据中不存在,但在测试数据中存在怎么办?

三音素虽然解决了单音节音素存在的问题,但也带来了新的问题。

[En]

Although the triphoneme solves the problems existing in monosyllabic phonemes, it brings new problems.

决策树

为了解决上述问题,可以共享上下文中发音相似的三个音素的参数,这将大大减少模型的参数数量,而对于训练数据不足的问题,共享也可以增加其数据。为了实现发音相近的三音素共享参数,可以通过聚类(自下而上)或决策树(自上而下)来实现。

[En]

In order to solve the above problems, the parameters of the three phonemes with similar pronunciation in the context can be shared, which will greatly reduce the number of parameters of the model, and for the problem of lack of training data, sharing can also increase its data. In order to realize the three-phoneme sharing parameters with similar pronunciation, it can be realized by clustering (bottom-up) or decision tree (top-down).

决策树是解决三音素参数共享的一种实用方法。

[En]

The decision tree is a practical solution for sharing parameters of three phonemes.

决策树是一个二叉树,每个非叶子节点上都会有一个问题,每个叶子节点都是一个绑定的三音素的集合,而绑定的粒度为状态,如A-B+C和A-B+D的第一个状态绑定在一起,并不代表其第2/3个状态也需要绑定在一起,也就是B的每个状态都有一个小的决策树。如下图所示:

语音识别入门第五节:基于GMM-HMM的语音识别系统
决策树非叶节点的常见问题有:是否为元音、是否为突发音、是否为鼻音、是否为摩擦音、是否为流动音、位置信息等。
[En]

The common problems of non-leaf nodes of decision tree are: whether it is a vowel, whether it is a burst sound, whether it is a nasal sound, whether it is a friction sound, whether it is a flow sound, location information and so on.

将一条一条的问题进行整合即为问题集,而问题集一般可通过语言学家定义或自动构建问题集,Kaldi中通过自顶向下的聚类自动构建问题集。

Original: https://blog.csdn.net/u010207220/article/details/126008625
Author: 安静_xju
Title: 语音识别入门第五节:基于GMM-HMM的语音识别系统

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/515147/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球