rustpotter icon indicating copy to clipboard operation
rustpotter copied to clipboard

Add wakeword detection with Genetic Programming

Open farooqkz opened this issue 2 years ago • 5 comments

Hello. I was about to write a software in Rust to do the job of hotword/wakeword detection. And I found this crate. However, I wanted to do the detection with Genetic Programming. I would be happy to make a PR to add experimental wakeword detection with Genetic Programming to this crate. And it could become stable when the experiments are done and we have good enough accuracy. What do you think?

farooqkz avatar Oct 02 '23 10:10 farooqkz

Of course, that will be great. Any improvement or alternative detection method is welcome.

Are you going to add any additional dependency?

GiviMAD avatar Oct 02 '23 18:10 GiviMAD

Of course, that will be great. Any improvement or alternative detection method is welcome.

Are you going to add any additional dependency?

Yeah I think it makes sense to write a library for GP and add it utilize it using rustpotter. And it makes sense that rustpotter have different detection methods available as "features" and GP is disabled by default as long as it's experimental.

farooqkz avatar Oct 02 '23 20:10 farooqkz

Yeah I think it makes sense to write a library for GP and add it utilize it using rustpotter.

Makes sense, I was asking because I would like to keep the library fully compatible with WebAssembly, but I don't think that would be a problem.

And it makes sense that rustpotter have different detection methods available as "features" and GP is disabled by default as long as it's experimental.

Yes, we can add features for the different detection methods, great idea, but I would prefer to have all of them enabled by default.

Maybe you have already look into these, but as a summary, rustpotter expose their different detection methods as different types of "wakewords", for adding a new one you need to:

  • Create a struct that implements the trait WakewordDetector which holds the implementation for this detection method.
  • Create a serializable struct implementing the traits WakewordLoad, WakewordSave and WakewordFile, used to save/load the wakeword data and initialize your detection implementation.
  • Also you need to modify the Rustpotteradd_wakeword_from_buffer method to try to deserialize the new type, and add a public method like pub fn add_wakeword_gp(&mut self, key: &str, wakeword: WakewordGP) -> Result<(), String> ....
  • Create a PR in the rustpotter-cli adding a command for creating this kind of wakeword.

I think those are all the steps required in order to add a new wakeword type, if no new config is required adding support to the other packages (the java and javascript ones) is just a matter of updating the library.

GiviMAD avatar Oct 02 '23 20:10 GiviMAD

I'm working on it. However, I would like to polish my method more by testing on greater datasets. Currently with 11 positive and 11 negative samples, it reaches zero loss easily.

farooqkz avatar Nov 02 '23 18:11 farooqkz

I am still working on it. It has been a year? dunno. There is a Telegram group for Speech processing. If you are interested, consider joining. https://t.me/speech_recognition

farooqkz avatar Jun 16 '24 12:06 farooqkz