姜芳芳 何明一 王欣欣
摘 要: 針對自編碼算法提取輸入特征能更好地發(fā)現(xiàn)樣本間的相關(guān)性的優(yōu)點,以自編碼算法提取待識別樣本特征作為多層前向網(wǎng)絡(luò)的輸入,以彈性BP算法訓練網(wǎng)絡(luò),并用MNIST手寫數(shù)字數(shù)據(jù)庫樣本測試。從正確率、拒識率、錯誤率和可靠率4項性能指標方面與逐像素方法進行了綜合對比測試。研究表明,采用自編碼特征提取、多層前向神經(jīng)網(wǎng)絡(luò)作為分類器以及彈性BP 算法進行訓練的手寫數(shù)字識別,具有更快的收斂速度和更高的識別可靠率。
關(guān)鍵詞: 多層前向神經(jīng)網(wǎng)絡(luò); 自編碼算法; 彈性BP算法; MNIST數(shù)據(jù)庫
中圖分類號: TN911?34; TP183 文獻標識碼: A 文章編號: 1004?373X(2014)10?0031?04
Abstract: As the autoencoder algorithm for input feature extraction is better in discovering the correlation between samples, an new approach is proposed for handwriting number recognition (HNR), in which the autoencoder algorithm is taken to extract the feature under recognition as the input of multilayer feedforward network, resilient back propagation (BP) algorithm is emplored to train the classifer, and some saples chosen from MNIST handwriting digits database are used to test the performance of this new approach. A comprehensive comparisons between this new approach and the pixel?by?pixel method is coducted in correct rate, rejection rate, error rate and reliability rate. This study results show that the proposed new approach (the autoencoder feature extraction, multilayer feedforward neural network classifier and resilient back propagation training algorithm are used together) has faster training speed and higher recognition reliability.
Keywords: multilayer feedforward neural network; autoencoder algorithm; resilient back propagation algorithm; MNIST database
手寫數(shù)字識別(Handwriting Number Recognition,HNR) [1?2]主要指利用計算機智能的識別書寫在紙張上的阿拉伯數(shù)字,是光學字符識別(Optical Character Recognition,OCR)技術(shù)的一個重要方面,有廣泛的應(yīng)用需求。多層前向神經(jīng)網(wǎng)絡(luò)[3](MultiLayer Feedforward Neural Network,MLFNN)由于具有很好的非線性映射能力,在非線性函數(shù)逼近、模式識別與分類等領(lǐng)域得到廣泛的應(yīng)用。在用神經(jīng)網(wǎng)絡(luò)進行模式識別的過程中,特征提取[4?5]是一個重要的環(huán)節(jié),它會直接影響神經(jīng)網(wǎng)絡(luò)分類器識別的效果。基于神經(jīng)網(wǎng)絡(luò)的字符識別的輸入特征提取一般采用逐像素方法[6],這是一種最簡單的特征提取方法,其特點是算法簡單,運算速度快,但對特征較少的圖像,這種方法提取的信息量過大,適應(yīng)性不強,不能很好的表示各類樣本特征。本文在前人工作基礎(chǔ)上,采用自編碼算法[7]提取待分類樣本的特征作為多層前向網(wǎng)絡(luò)的輸入,通過彈性BP算法[8]對網(wǎng)絡(luò)進行訓練,以期訓練速度及識別效果的提升。最后,用公開的MNIST數(shù)據(jù)庫[9]中部分手寫數(shù)字進行驗證。
1 系統(tǒng)原理
基于多層前向網(wǎng)絡(luò)的識別系統(tǒng)如圖1所示。
特征提取是識別系統(tǒng)中關(guān)鍵的組成部分,會直接影響系統(tǒng)的識別效果,本文采用自編碼特征提取方法。神經(jīng)網(wǎng)絡(luò)是識別系統(tǒng)實現(xiàn)功能的載體或方法,利用神經(jīng)網(wǎng)絡(luò)的學習和記憶功能,先讓神經(jīng)網(wǎng)絡(luò)學習訓練樣本中大量樣本信息,以記住各模式類別中的樣本特征,然后在測試樣本時,神經(jīng)網(wǎng)絡(luò)可以回憶起之前記住的各模式類別的特征,從而確定測試樣本所屬的模式類別。本文多層神經(jīng)網(wǎng)絡(luò)的訓練算法為彈性BP算法。
以下主要介紹特征提取模塊中的自編碼特征提取方法,及神經(jīng)網(wǎng)絡(luò)分類器。
2 基于自編碼的特征提取
當神經(jīng)元的激勵函數(shù)是sigmoid函數(shù)時,神經(jīng)元的輸出接近于1的時候認為它被激活,而輸出接近于0的時候認為它被抑制,稀疏性限制表示為:使得神經(jīng)元大部分的時間都是被抑制。斯坦福大學Andrew NG在UFLDL教程[7]中介紹的自編碼技術(shù)將傳統(tǒng)的三層前向網(wǎng)絡(luò)目標值設(shè)為輸入值,在此網(wǎng)絡(luò)隱層加入稀疏性限制后,將經(jīng)誤差反向傳播學到的隱層輸出作為待識別樣本特征,此方法可更好地發(fā)現(xiàn)數(shù)據(jù)間的相關(guān)性。
如果網(wǎng)絡(luò)的輸入數(shù)據(jù)是完全隨機的,比如每一個輸入[xi]都是一個與其他特征完全無關(guān)的獨立同分布高斯隨機變量,那么這一壓縮表示將會非常難學習。但是如果輸入數(shù)據(jù)中隱含著一些特定的結(jié)構(gòu),例如某些輸入特征是彼此相關(guān)的,那么這一算法就可以發(fā)現(xiàn)輸入數(shù)據(jù)中的這些相關(guān)性。具體來說,如果隱層神經(jīng)元的數(shù)量少于輸入層,訓練好的網(wǎng)絡(luò)隱層輸出其實是學習到了輸入數(shù)據(jù)的壓縮表示,當隱層神經(jīng)元的數(shù)量大于輸入層神經(jīng)元的數(shù)量時,給隱層神經(jīng)元加入稀疏性限制,那么此網(wǎng)絡(luò)仍然可以學習到數(shù)據(jù)之間的關(guān)系。
3 基于多層前向神經(jīng)網(wǎng)絡(luò)的分類模塊設(shè)計
多層神經(jīng)網(wǎng)絡(luò)由若干層神經(jīng)元組成,不同層的神經(jīng)元作用各不相同,輸入層接受來自外界的信號,輸出層給出對輸入信號的判別或決策,隱層用來表示或存貯知識。此網(wǎng)絡(luò)可實現(xiàn)樣本數(shù)據(jù)(由輸入模式與期望輸出模式對組成)的映射,同時它還具有推廣與概括等能力,即當輸入模式不是學習過的樣本數(shù)據(jù)時,網(wǎng)絡(luò)的輸出也能與該輸入最接近的樣本輸入對應(yīng)的期望輸出比較接近。圖3為多層前向網(wǎng)絡(luò)的基本結(jié)構(gòu)。其中輸入層神經(jīng)元個數(shù)為[ni],隱層神經(jīng)元個數(shù)為[nh],輸出層神經(jīng)元個數(shù)為[no]。
4 基于彈性BP算法的網(wǎng)絡(luò)訓練
網(wǎng)絡(luò)的訓練算法一般采用最速下降法[10],但是最速下降法存在諸如收斂速度慢,網(wǎng)絡(luò)易陷于局部極小,學習過程易發(fā)生振蕩或平臺效應(yīng)等缺點。為了完善多層前向神經(jīng)網(wǎng)絡(luò)的訓練算法并提高學習速度,將彈性BP算法引入到多層前向網(wǎng)絡(luò)的學習中對其簡要論述。
6 結(jié) 語
本文以自編碼算法提取特征作為網(wǎng)絡(luò)輸入,以彈性BP算法訓練網(wǎng)絡(luò),并用標準手寫數(shù)字識別庫數(shù)據(jù)樣本進行測試。得出的主要結(jié)論是,自編碼算法提取特征用于多層前向網(wǎng)絡(luò)能提高網(wǎng)絡(luò)的收斂速度和識別精度。
參考文獻
[1] LORiGO L M, GOVINDARAJU V. Offline Arabic handwriting recognition: a survey [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2006, 28(5): 712?724.
[2] 柳回春,馬樹元,吳平東,等.手寫體數(shù)字識別技術(shù)的研究[J]. 計算機工程,2003,29(4):24?25.
[3] HAGAN M T, DEMUTH H B, BEALE M H.神經(jīng)網(wǎng)絡(luò)設(shè)計 [M].戴葵,譯.北京:機械工業(yè)出版社,2007.
[4] 翟俊海,趙文秀,王熙照.圖像特征提取研究[J].河北大學學報:自然科學版,2009(1):106?112.
[5] 董慧.手寫體數(shù)字識別中的特征提取和特征選擇研究[D].北京:北京郵電大學,2007.
[6] 胡小鋒,趙輝.Visual C++/Matlab圖像處理與識別實用案例精選[M].北京:人民郵電出版社,2004.
[7] VINCENT P, LAROCHELLE H, BENGIO Y, et al. Extracting and composing robust features with denoising autoencoders [C]// Proceedings of the 25th International Conference on Machine Learning. New York, USA: ACM, 2008: 1096?1103.
[8] RIEDMILLER M, BRAUN H. A direct adaptive method for faster backpropagation learning: the RPROP algorithm [C]// Proceedings of the IEEE International Conference on Neural Networks. San Francisco, CA: IEEE, 1993: 586?591.
[9] MADSEN K, NIELSEN H B, TINGLEFF O. Methods for non?linear least squares problems [M]. Denmark: Informatics and Mathematical Modeling, Technical University of Denmark, 2004.
[10] CUN L, BOSER B, DENKER J S, et al. Handwritten digit recognition with a back?propagation network [M]// Advances in Neural Information Processing Systems. [S.l.]: Morgan Kaufmann, 1990: 396?404.
3 基于多層前向神經(jīng)網(wǎng)絡(luò)的分類模塊設(shè)計
多層神經(jīng)網(wǎng)絡(luò)由若干層神經(jīng)元組成,不同層的神經(jīng)元作用各不相同,輸入層接受來自外界的信號,輸出層給出對輸入信號的判別或決策,隱層用來表示或存貯知識。此網(wǎng)絡(luò)可實現(xiàn)樣本數(shù)據(jù)(由輸入模式與期望輸出模式對組成)的映射,同時它還具有推廣與概括等能力,即當輸入模式不是學習過的樣本數(shù)據(jù)時,網(wǎng)絡(luò)的輸出也能與該輸入最接近的樣本輸入對應(yīng)的期望輸出比較接近。圖3為多層前向網(wǎng)絡(luò)的基本結(jié)構(gòu)。其中輸入層神經(jīng)元個數(shù)為[ni],隱層神經(jīng)元個數(shù)為[nh],輸出層神經(jīng)元個數(shù)為[no]。
4 基于彈性BP算法的網(wǎng)絡(luò)訓練
網(wǎng)絡(luò)的訓練算法一般采用最速下降法[10],但是最速下降法存在諸如收斂速度慢,網(wǎng)絡(luò)易陷于局部極小,學習過程易發(fā)生振蕩或平臺效應(yīng)等缺點。為了完善多層前向神經(jīng)網(wǎng)絡(luò)的訓練算法并提高學習速度,將彈性BP算法引入到多層前向網(wǎng)絡(luò)的學習中對其簡要論述。
6 結(jié) 語
本文以自編碼算法提取特征作為網(wǎng)絡(luò)輸入,以彈性BP算法訓練網(wǎng)絡(luò),并用標準手寫數(shù)字識別庫數(shù)據(jù)樣本進行測試。得出的主要結(jié)論是,自編碼算法提取特征用于多層前向網(wǎng)絡(luò)能提高網(wǎng)絡(luò)的收斂速度和識別精度。
參考文獻
[1] LORiGO L M, GOVINDARAJU V. Offline Arabic handwriting recognition: a survey [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2006, 28(5): 712?724.
[2] 柳回春,馬樹元,吳平東,等.手寫體數(shù)字識別技術(shù)的研究[J]. 計算機工程,2003,29(4):24?25.
[3] HAGAN M T, DEMUTH H B, BEALE M H.神經(jīng)網(wǎng)絡(luò)設(shè)計 [M].戴葵,譯.北京:機械工業(yè)出版社,2007.
[4] 翟俊海,趙文秀,王熙照.圖像特征提取研究[J].河北大學學報:自然科學版,2009(1):106?112.
[5] 董慧.手寫體數(shù)字識別中的特征提取和特征選擇研究[D].北京:北京郵電大學,2007.
[6] 胡小鋒,趙輝.Visual C++/Matlab圖像處理與識別實用案例精選[M].北京:人民郵電出版社,2004.
[7] VINCENT P, LAROCHELLE H, BENGIO Y, et al. Extracting and composing robust features with denoising autoencoders [C]// Proceedings of the 25th International Conference on Machine Learning. New York, USA: ACM, 2008: 1096?1103.
[8] RIEDMILLER M, BRAUN H. A direct adaptive method for faster backpropagation learning: the RPROP algorithm [C]// Proceedings of the IEEE International Conference on Neural Networks. San Francisco, CA: IEEE, 1993: 586?591.
[9] MADSEN K, NIELSEN H B, TINGLEFF O. Methods for non?linear least squares problems [M]. Denmark: Informatics and Mathematical Modeling, Technical University of Denmark, 2004.
[10] CUN L, BOSER B, DENKER J S, et al. Handwritten digit recognition with a back?propagation network [M]// Advances in Neural Information Processing Systems. [S.l.]: Morgan Kaufmann, 1990: 396?404.
3 基于多層前向神經(jīng)網(wǎng)絡(luò)的分類模塊設(shè)計
多層神經(jīng)網(wǎng)絡(luò)由若干層神經(jīng)元組成,不同層的神經(jīng)元作用各不相同,輸入層接受來自外界的信號,輸出層給出對輸入信號的判別或決策,隱層用來表示或存貯知識。此網(wǎng)絡(luò)可實現(xiàn)樣本數(shù)據(jù)(由輸入模式與期望輸出模式對組成)的映射,同時它還具有推廣與概括等能力,即當輸入模式不是學習過的樣本數(shù)據(jù)時,網(wǎng)絡(luò)的輸出也能與該輸入最接近的樣本輸入對應(yīng)的期望輸出比較接近。圖3為多層前向網(wǎng)絡(luò)的基本結(jié)構(gòu)。其中輸入層神經(jīng)元個數(shù)為[ni],隱層神經(jīng)元個數(shù)為[nh],輸出層神經(jīng)元個數(shù)為[no]。
4 基于彈性BP算法的網(wǎng)絡(luò)訓練
網(wǎng)絡(luò)的訓練算法一般采用最速下降法[10],但是最速下降法存在諸如收斂速度慢,網(wǎng)絡(luò)易陷于局部極小,學習過程易發(fā)生振蕩或平臺效應(yīng)等缺點。為了完善多層前向神經(jīng)網(wǎng)絡(luò)的訓練算法并提高學習速度,將彈性BP算法引入到多層前向網(wǎng)絡(luò)的學習中對其簡要論述。
6 結(jié) 語
本文以自編碼算法提取特征作為網(wǎng)絡(luò)輸入,以彈性BP算法訓練網(wǎng)絡(luò),并用標準手寫數(shù)字識別庫數(shù)據(jù)樣本進行測試。得出的主要結(jié)論是,自編碼算法提取特征用于多層前向網(wǎng)絡(luò)能提高網(wǎng)絡(luò)的收斂速度和識別精度。
參考文獻
[1] LORiGO L M, GOVINDARAJU V. Offline Arabic handwriting recognition: a survey [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2006, 28(5): 712?724.
[2] 柳回春,馬樹元,吳平東,等.手寫體數(shù)字識別技術(shù)的研究[J]. 計算機工程,2003,29(4):24?25.
[3] HAGAN M T, DEMUTH H B, BEALE M H.神經(jīng)網(wǎng)絡(luò)設(shè)計 [M].戴葵,譯.北京:機械工業(yè)出版社,2007.
[4] 翟俊海,趙文秀,王熙照.圖像特征提取研究[J].河北大學學報:自然科學版,2009(1):106?112.
[5] 董慧.手寫體數(shù)字識別中的特征提取和特征選擇研究[D].北京:北京郵電大學,2007.
[6] 胡小鋒,趙輝.Visual C++/Matlab圖像處理與識別實用案例精選[M].北京:人民郵電出版社,2004.
[7] VINCENT P, LAROCHELLE H, BENGIO Y, et al. Extracting and composing robust features with denoising autoencoders [C]// Proceedings of the 25th International Conference on Machine Learning. New York, USA: ACM, 2008: 1096?1103.
[8] RIEDMILLER M, BRAUN H. A direct adaptive method for faster backpropagation learning: the RPROP algorithm [C]// Proceedings of the IEEE International Conference on Neural Networks. San Francisco, CA: IEEE, 1993: 586?591.
[9] MADSEN K, NIELSEN H B, TINGLEFF O. Methods for non?linear least squares problems [M]. Denmark: Informatics and Mathematical Modeling, Technical University of Denmark, 2004.
[10] CUN L, BOSER B, DENKER J S, et al. Handwritten digit recognition with a back?propagation network [M]// Advances in Neural Information Processing Systems. [S.l.]: Morgan Kaufmann, 1990: 396?404.