Pneumonia is a leading cause of death among children under five years of age (U5s), causing roughly 1.6 million deaths per year. Pneumonia deaths could be averted if caretakers recognized early the symptoms and danger signs. Machine learning is a promising technology for the early detection of pneumonia in children. However, existing models require a lot of datasets for training, which is scarce, especially in health settings. Few-shot learning models have been used to address that challenge but they have issues with computational complexity and are difficult to train. This study proposes a model that leverages the strengths of transfer learning and Siamese networks in few-shot pneumonia detection and classification. Experimental results revealed that the proposed model had an accuracy of 92.04%, recall of 90.32%, and F1 score of 90.09%. Also, different values of the learning rate were recorded and the model performed at its best with the learning rate of 0.000004. The proposed model also performed well with triplet loss. The results revealed that the proposed model was robust to overfitting which is a major limitation with few shot learning models, and was also easy to train. For future studies, we recommend an ensemble of the Siamese networks and traditional neural networks such as convolutional neural networks in the automated detection of pneumonia.