speech-to-text 基准测试框架

网友投稿 1117 2022-10-20

speech-to-text 基准测试框架

speech-to-text 基准测试框架

Speech-to-Text Benchmark

Made in Vancouver, Canada by Picovoice

This is a minimalist and extensible framework for benchmarking different speech-to-text engines. It has been developed and tested on Ubuntu 18.04 (x86_64) using Python3.6.

Table of Contents

BackgroundDataMetricsWord Error RateReal Time FactorModel Size Speech-to-Text EnginesAmazon TranscribeCMU PocketSphinxGoogle Speech-to-TextMozilla DeepSpeechPicovoice CheetahPicovoice Leopard UsageWord Error Rate MeasurementReal Time Factor Measurement ResultsLicense

Background

This framework has been developed by Picovoice as part of the Cheetah project. Cheetah is Picovoice's streaming speech-to-text engine, specifically designed to run efficiently on the edge (offline). Deep learning has been the main driver in recent improvements in speech recognition but due to stringent compute/storage limitations of IoT platforms, it is mostly beneficial to cloud-based engines. Picovoice's proprietary deep learning technology enables transferring these improvements to IoT platforms with significantly lower CPU/memory footprint.

Data

LibriSpeech dataset is used for benchmarking. We use the test-clean portion.

Metrics

This benchmark considers three metrics: word error rate, real-time factor, and model size.

Word Error Rate

Word error rate (WER) is defined as the ratio of Levenstein distance between words in a reference transcript and words in the output of the speech-to-text engine, to the number of words in the reference transcript.

Real Time Factor

Real time factor (RTF) is measured as the ratio of CPU (processing) time to the length of the input speech file. A speech-to-text engine with lower RTF is more computationally efficient. We omit this metric for cloud-based engines.

Model Size

The aggregate size of models (acoustic and language), in MB. We omit this metric for cloud-based engines.

Speech-to-Text Engines

Amazon Transcribe

Amazon Transcribe is a cloud-based speceh recognition engine, offered by AWS. Find more information here.

CMU PocketSphinx

PocketSphinx works offline and can run on embedded platforms such as Raspberry Pi.

Google Speech-to-Text

A cloud-based speech recognition engine offered by Google Cloud Platform. Find more information here.

Mozilla DeepSpeech

Mozilla DeepSpeech is an open-source implementation of Baidu's DeepSpeech by Mozilla.

Picovoice Cheetah

Cheetah is a streaming speech-to-text engine developed using Picovoice's proprietary deep learning technology. It works offline and is supported on a growing number of platforms including Android, iOS, and Raspberry Pi.

Picovoice Leopard

Leopard is a speech-to-text engine developed using Picovoice's proprietary deep learning technology. It works offline and is supported on a growing number of platforms including Android, iOS, and Raspberry Pi.

Usage

Below is information on how to use this framework to benchmark the speech-to-text engines.

Make sure that you have installed DeepSpeech and PocketSphinx on your machine by following the instructions on their official pages.Unpack DeepSpeech's models under resources/deepspeech.Download the test-clean portion of LibriSpeech and unpack it under resources/data.For running Google Speech-to-Text and Amazon Transcribe, you need to sign up for the respective cloud provider and setup permissions / credentials according to their documentation. Running these services may incur fees.

Word Error Rate Measurement

Word Error Rate can be measured by running the following command from the root of the repository:

python benchmark.py --engine_type AN_ENGINE_TYPE

The valid options for the engine_type parameter are: AMAZON_TRANSCRIBE, CMU_POCKET_SPHINX, GOOGLE_SPEECH_TO_TEXT, MOZILLA_DEEP_SPEECH, PICOVOICE_CHEETAH, PICOVOICE_CHEETAH_LIBRISPEECH_LM, PICOVOICE_LEOPARD, and PICOVOICE_LEOPARD_LIBRISPEECH_LM.

PICOVOICE_CHEETAH_LIBRISPEECH_LM is the same as PICOVOICE_CHEETAH except that the language model is trained on LibriSpeech training text similar to Mozilla DeepSpeech. The same applies to Leopard.

Real Time Factor Measurement

The time command is used to measure the execution time of different engines for a given audio file, and then divide the CPU time by audio length. To measure the execution time for Cheetah, run:

time resources/cheetah/cheetah_demo \resources/cheetah/libpv_cheetah.so \resources/cheetah/acoustic_model.pv \resources/cheetah/language_model.pv \resources/cheetah/cheetah_eval_linux.lic \PATH_TO_WAV_FILE

The output should have the following format (values may be different):

real 0m4.961suser 0m4.936ssys 0m0.024s

Then, divide the user value by the length of the audio file, in seconds. The user value is the actual CPU time spent in the program.

To measure the execution time for Leopard, run:

time resources/leopard/leopard_demo \resources/leopard/libpv_leopard.so \resources/leopard/acoustic_model.pv \resources/leopard/language_model.pv \resources/leopard/leopard_eval_linux.lic \PATH_TO_WAV_FILE

For DeepSpeech:

time deepspeech \--model resources/deepspeech/output_graph.pbmm \--lm resources/deepspeech/lm.binary \--trie resources/deepspeech/trie \--audio PATH_TO_WAV_FILE

Finally, for PocketSphinx:

time pocketsphinx_continuous -infile PATH_TO_WAV_FILE

Results

The below results are obtained by following the previous steps. The benchmarking was performed on a Linux machine running Ubuntu 18.04 with 64GB of RAM and an Intel i5-6500 CPU running at 3.2 GHz. WER refers to word error rate and RTF refers to real time factor.

EngineWERRTF (Desktop)RTF (Raspberry Pi 3)RTF (Raspberry Pi Zero)Model Size (Acoustic and Language)
Amazon Transcribe8.21%N/AN/AN/AN/A
CMU PocketSphinx (0.1.15)31.82%0.321.872.0497.8 MB
Google Speech-to-Text12.23%N/AN/AN/AN/A
Mozilla DeepSpeech (0.6.1)7.55%0.46N/AN/A1146.8 MB
Picovoice Cheetah (v1.2.0)10.49%0.040.623.1147.9 MB
Picovoice Cheetah LibriSpeech LM (v1.2.0)8.25%0.040.623.1145.0 MB
Picovoice Leopard (v1.0.0)8.34%0.020.552.5547.9 MB
Picovoice Leopard LibriSpeech LM (v1.0.0)6.58%0.020.552.5545.0 MB

The figure below compares the word error rate of speech-to-text engines. For Picovoice, we included the engine that was trained on LibriSpeech training data similar to Mozilla DeepSpeech.

The figure below compares accuracy and runtime metrics of offline speech-to-text engines. For Picovoice we included the engines that were trained on LibriSpeech training data similar to Mozilla DeepSpeech. Leopard achieves the highest accuracy while being 23X faster and 27X smaller in size compared to second most accurate engine (Mozilla DeepSpeech).

License

The benchmarking framework is freely available and can be used under the Apache 2.0 license. The provided Cheetah and Leopard resources (binary, model, and license file) are the property of Picovoice. They are only to be used for evaluation purposes and their use in any commercial product is strictly prohibited.

For commercial enquiries contact us via this form.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Codeforces Round #360 (Div. 1) A. NP-Hard Problem (二分图)
下一篇:#yyds干货盘点# 面试必刷TOP101:寻找峰值
相关文章

 发表评论

暂时没有评论,来抢沙发吧~