Dog's are very sensitive and empathetic creatures. A lot of studies do indicate that they can tell that they have upset you. Sometimes they associate this with an action, but depending on your reaction they may not associate their behavior with your emotional state. Keep on a training routine and you will notice a difference. A behaviorist can also help when you are struggling.