This study aims to categorize the following dogs' primary emotional states: anger, fear, and happiness. The research team utilized Transfer Learning (TL) and advanced 2D/3D Convolutional Neural Networks (CNNs) to identify these emotions from two small datasets-static images and video clips. The image dataset covers various canine emotional expressions across various contexts, forming the basis for the training of Dog Emotion Recognition-Transfer Learning Neural Network (DER-TLNN) algorithm. DER-TLNN has an accuracy rate of 70% for emotion classification based on static images (400 images). In addition, DER-TLNN is the basis for the Video Dog Emotion Recognition Network (VDERNet) algorithm, which is designed to categorize video clips depicting dogs' emotional states. Trained on video data sourced online (39 videos), VDERNet achieves an accuracy of 96%, highlighting AI's potential in understanding canine emotions in dynamic contexts with non-invasive techniques. These findings demonstrate the efficacy of TL and 3D CNNs in animal behavior analysis and contribute to a better understanding of canine emotions. The research provides promising applications in improving human-dog interactions and enhancing canine welfare, showcasing the immense potential of AI in animal behavior studies. The achievement of notable results with small datasets, along with data augmentation and regularization techniques, underscores our innovative approach and the potential impact of AI in animal behavior studies.