Speaker independent voice command recognition
Software

There are many many speech recognition toolkits and software packages, which should be able to do what you want.  See, e.g., https://en.wikipedia.org/wiki/List_of_speech_recognition_software for a partial list.

For instance, if you're looking for open source software, you could try Sphinx, Simon, or any number of other software packages.  They can be trained in various ways, and probably can be used for what you want.  There are also many proprietary speech recognition tools, which might meet your needs as well.

Algorithms

The algorithms used by speech recognition systems are pretty standard.  You split the audio into frames, use the MFCC transform to compute Mel features, then use Dynamic Time Warping or a HMM with Gaussian mixture model to recognize the spoken phrases.  I would anticipate this standard pipeline would likely work for your requirement, if you train it appropriately.

(I'm not sure why you want to start from a spectrogram rather than from the audio clip itself.)