csukuangfj commited on
Commit
4aff68a
1 Parent(s): a2902a5

first commit

Browse files
README.md ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ library_name: keras
6
+ pipeline_tag: automatic-speech-recognition
7
+ arxiv: https://arxiv.org/abs/2410.15608
8
+ ---
9
+ # Model Card: Moonshine
10
+
11
+ [[Blog]](https://petewarden.com/2024/10/21/introducing-moonshine-the-new-state-of-the-art-for-speech-to-text/) [[Paper]](https://arxiv.org/abs/2410.15608) [[Installation]](https://github.com/usefulsensors/moonshine/blob/main/README.md) [[Podcast]](https://notebooklm.google.com/notebook/d787d6c2-7d7b-478c-b7d5-a0be4c74ae19/audio)
12
+
13
+ This is the model card for running the automatic speech recognition (ASR) models (Moonshine models) trained and released by Useful Sensors.
14
+
15
+ Following [Model Cards for Model Reporting (Mitchell et al.)](https://arxiv.org/abs/1810.03993), we're providing some information about the automatic speech recognition model. More information on how these models were trained and evaluated can be found [in the paper](https://arxiv.org/abs/2410.15608). Note, a lot of the text has been copied verbatim from the [model card](https://github.com/openai/whisper/blob/main/model-card.md) for the Whisper model developed by OpenAI, because both models serve identical purposes, and carry identical risks.
16
+
17
+ ## Model Details
18
+
19
+ The Moonshine models are trained for the speech recognition task, capable of transcribing English speech audio into English text. Useful Sensors developed the models to support their business direction of developing real time speech transcription products based on low cost hardware. There are 2 models of different sizes and capabilities, summarized in the following table.
20
+
21
+ | Size | Parameters | English-only model | Multilingual model |
22
+ |:----:|:----------:|:------------------:|:------------------:|
23
+ | tiny | 27 M | ✓ | |
24
+ | base | 61 M | ✓ | |
25
+
26
+ ### Release date
27
+
28
+ October 2024
29
+
30
+ ### Model type
31
+
32
+ Sequence-to-sequence ASR (automatic speech recognition) and speech translation model
33
+
34
+ ### Paper & samples
35
+
36
+ [Paper](https://arxiv.org/abs/2410.15608) / [Blog](https://petewarden.com/2024/10/21/introducing-moonshine-the-new-state-of-the-art-for-speech-to-text/)
37
+
38
+ ## Model Use
39
+
40
+ ### Evaluated Use
41
+
42
+ The primary intended users of these models are AI developers that want to deploy English speech recognition systems in platforms that are severely constrained in memory capacity and computational resources. We recognize that once models are released, it is impossible to restrict access to only “intended” uses or to draw reasonable guidelines around what is or is not safe use.
43
+
44
+ The models are primarily trained and evaluated on English ASR task. They may exhibit additional capabilities, particularly if fine-tuned on certain tasks like voice activity detection, speaker classification, or speaker diarization but have not been robustly evaluated in these areas. We strongly recommend that users perform robust evaluations of the models in a particular context and domain before deploying them.
45
+
46
+ In particular, we caution against using Moonshine models to transcribe recordings of individuals taken without their consent or purporting to use these models for any kind of subjective classification. We recommend against use in high-risk domains like decision-making contexts, where flaws in accuracy can lead to pronounced flaws in outcomes. The models are intended to transcribe English speech, use of the model for classification is not only not evaluated but also not appropriate, particularly to infer human attributes.
47
+
48
+ ## Training Data
49
+
50
+ The models are trained on 200,000 hours of audio and the corresponding transcripts collected from the internet, as well as datasets openly available and accessible on HuggingFace. The open datasets used are listed in the [the accompanying paper](https://arxiv.org/abs/2410.15608).
51
+
52
+ ## Performance and Limitations
53
+
54
+ Our evaluations show that, the models exhibit greater accuracy on standard datasets over existing ASR systems of similar sizes.
55
+
56
+ However, like any machine learning model, the predictions may include texts that are not actually spoken in the audio input (i.e. hallucination). We hypothesize that this happens because, given their general knowledge of language, the models combine trying to predict the next word in audio with trying to transcribe the audio itself.
57
+
58
+ In addition, the sequence-to-sequence architecture of the model makes it prone to generating repetitive texts, which can be mitigated to some degree by beam search and temperature scheduling but not perfectly. It is likely that this behavior and hallucinations may be worse for short audio segments, or segments where parts of words are cut off at the beginning or the end of the segment.
59
+
60
+ ## Broader Implications
61
+
62
+ We anticipate that Moonshine models’ transcription capabilities may be used for improving accessibility tools, especially for real-time transcription. The real value of beneficial applications built on top of Moonshine models suggests that the disparate performance of these models may have real economic implications.
63
+
64
+ There are also potential dual-use concerns that come with releasing Moonshine. While we hope the technology will be used primarily for beneficial purposes, making ASR technology more accessible could enable more actors to build capable surveillance technologies or scale up existing surveillance efforts, as the speed and accuracy allow for affordable automatic transcription and translation of large volumes of audio communication. Moreover, these models may have some capabilities to recognize specific individuals out of the box, which in turn presents safety concerns related both to dual use and disparate performance. In practice, we expect that the cost of transcription is not the limiting factor of scaling up surveillance projects.
65
+
66
+ ## Setup
67
+
68
+ * Install `uv` for Python environment management
69
+
70
+ - Follow instructions [here](https://github.com/astral-sh/uv)
71
+
72
+ * Create and activate virtual environment
73
+
74
+ ```shell
75
+ uv venv env_moonshine
76
+ source env_moonshine/bin/activate
77
+ ```
78
+
79
+ * Install the `useful-moonshine` package from this github repo
80
+
81
+ ```shell
82
+ uv pip install useful-moonshine@git+https://github.com/usefulsensors/moonshine.git
83
+ ```
84
+
85
+ `moonshine` inference code is written in Keras and can run with the backends
86
+ that Keras supports. The above command will install with the PyTorch
87
+ backend. To run the provided inference code, you have to instruct Keras to use
88
+ the PyTorch backend by setting and environment variable .
89
+
90
+ ```shell
91
+ export KERAS_BACKEND=torch
92
+ ```
93
+
94
+ To run with TensorFlow backend, run the following to install Moonshine.
95
+
96
+ ```shell
97
+ uv pip install useful-moonshine[tensorflow]@git+https://github.com/usefulsensors/moonshine.git
98
+ export KERAS_BACKEND=tensorflow
99
+ ```
100
+
101
+ To run with jax backend, run the following:
102
+
103
+ ```shell
104
+ uv pip install useful-moonshine[jax]@git+https://github.com/usefulsensors/moonshine.git
105
+ export KERAS_BACKEND=jax
106
+ # Use useful-moonshine[jax-cuda] for jax on GPU
107
+ ```
108
+
109
+ * Test transcribing an audio file
110
+
111
+ ```shell
112
+ python
113
+ >>> import moonshine
114
+ >>> moonshine.transcribe(moonshine.ASSETS_DIR / 'beckett.wav', 'moonshine/tiny')
115
+ ['Ever tried ever failed, no matter try again, fail again, fail better.']
116
+ ```
117
+
118
+ * The first argument is the filename for an audio file, the second is the name of a moonshine model. `moonshine/tiny` and `moonshine/base` are the currently available models.
119
+
120
+ ## Citation
121
+ If you benefit from our work, please cite us:
122
+ ```
123
+ @misc{jeffries2024moonshinespeechrecognitionlive,
124
+ title={Moonshine: Speech Recognition for Live Transcription and Voice Commands},
125
+ author={Nat Jeffries and Evan King and Manjunath Kudlur and Guy Nicholson and James Wang and Pete Warden},
126
+ year={2024},
127
+ eprint={2410.15608},
128
+ archivePrefix={arXiv},
129
+ primaryClass={cs.SD},
130
+ url={https://arxiv.org/abs/2410.15608},
131
+ }
132
+ ```
base/decoder.weights.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f54389d63cc36864d14fb5c6a1b542a3c046ee5c58e44588cde27904c2a8a02
3
+ size 165954080
base/encoder.weights.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a793fa34ed2174f5229601c9dc31b92bdf4802c6c5b9e6f299cf958873932eda
3
+ size 66913672
base/preprocessor.weights.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d3ccf645d9a209a9c73eb3378a9b23e98d4954e880caa8187b85b083dd2eb41
3
+ size 14093256
onnx/base/cached_decode.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4ce1a77e172eea8f4161e55d242aaeb670c245faf89175432d6d6d0ff6e59b6
3
+ size 231431906
onnx/base/encode.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7080bed747cf5b5cd632441e834437bb587466f676b39e6a3531a11595d8a57
3
+ size 83407854
onnx/base/preprocess.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ffa630d395c5ccf76f5d4954be5b882df76aaf6491519ec01fd82ea7a3819fb2
3
+ size 14077290
onnx/base/uncached_decode.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:311cdcb7ba1d754ccb02ebf1ae6d75c0179ac831bd0242b7f58a1bf97cfc013a
3
+ size 253570809
onnx/tiny/cached_decode.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d27f1a476d7615a2eaf33aed3c30d181557258f8c83a9308ba0c7ca13b07189
3
+ size 119667327
onnx/tiny/encode.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36ba25e28e9dc3899b2e8f63e4031ef445a5a91d31b4cc18f0771b8a26993fd6
3
+ size 30095274
onnx/tiny/preprocess.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f33addce61a143460fe753b5ee5b7db255e5140b5b779c065b94f6c83ff0bf4e
3
+ size 6800738
onnx/tiny/uncached_decode.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe688629b801f7e91983d87fbe6bf8f07cfc5340f4c2c3b340f67cf4827af3cb
3
+ size 127620212
tiny/decoder.weights.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f36805f4a7ebf29a2598fa26b6a964882e2f0403658126403d04e52e61eece5
3
+ size 78048024
tiny/encoder.weights.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a35b4b5907c0757bf080a95878bd4af7024b7f4041cf85e694d057b4187d7011
3
+ size 24222328
tiny/preprocessor.weights.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fc2ea6d695c32b8672271db0ede8eb6285e18cef37c13accbb1f92c83dc6bb6
3
+ size 6818248