A method for detecting deviation from a preferred cervical spine posture whenusing amobile device is disclosed The mobile device uses a front-facing camera tocaptureimages of the user and apply a nostril tracking algorithm to the images Thenostril trackingalgorithm is used in real-time to measure displacement of the user's nostrilsand correlatethe nostril displacement to a cervical spine flexion angle. The user'scervical spine flexionangle is communicated using an alarm device, such as a row of lights, whichallows theuser to monitor and correct their posture and avoid potential injury.