Supervised Contrastive Learning Framework and Hardware Implementation of Learned ResNet for Real-Time Respiratory