I don't know because breathing is involuntary, perhaps see a physician. But lack of oxygen leads to feelings of panic, no matter what you're thinking mentally; possibly a cooler room, sitting up more, when awake deep breathing techniques (in your nose, then out your mouth- a 'belly breath', = x5 times the oxygen- great for chest pains too). Could also have to do with blood pressure, slow spinal reflex, back pain or pain in general (thoracic vertebrae), or your heart, etc. Even anemia. Plus stress.