1. A method of detecting keywords, comprising: at an electronic device with one or more processors and memory: training an acoustic model with an International Phonetic Alphabet (IPA) phoneme mapping collection and a plurality of audio samples in a plurality of different languages, wherein the acoustic model includes: a foreground model configured to match a phoneme in an input audio signal to a corresponding keyword; and a background model configured to match a phoneme in the input audio signal to a corresponding non-keyword; after training the acoustic model, generating a phone decoder based on the trained acoustic model; obtaining a keyword phoneme sequence, including: collecting a set of keyword audio samples; decoding the set of keyword audio samples with the phone decoder to generate a set of phoneme sequence candidates; and selecting the keyword phoneme sequence from the set of phoneme sequence candidates; after obtaining the keyword phoneme sequence, detecting one or more keywords in the input audio signal with the trained acoustic model, including: matching one or more phonemic keyword portions of the input audio signal with one or more phonemes in the keyword phoneme sequence with the foreground model; and filtering out one or more phonemic non-keyword portions of the input audio signal with the background model.