Your dog calmly passes someone on the sidewalk, then barks at the next person in a wide-brimmed hat. Dogs notice details that may seem unimportant to us. A hat can change a person's outline or hide their face, and a dog who is uncertain may ask for space by barking. The same dog may react differently to a familiar person in new clothes.

Move away rather than asking the person to remove their hat or approach for a greeting. Cross the street where safe and give your dog a chance to sniff and recover. Do not scold fear or hold the lead tight while someone comes closer. If barking or lunging is escalating, there has been a bite, or the change came on suddenly, ask your veterinarian and a qualified, reward-based behavior professional for individual help.

Practice without surprises

Ask a familiar adult to wear a hat at a distance where your dog notices but remains comfortable. The person should not stare, reach, or approach. Reward your dog for glancing at them and turning back toward you, then leave. Across separate sessions, reduce the distance only if your dog remains loose and willing to eat. Later, change one thing at a time: another hat, the person standing, then a slow movement.

If your dog freezes, refuses food, retreats, or barks, make the next attempt easier. Never turn a stranger into an unwilling training helper. A walk on which your dog notices a hat and then moves on comfortably is enough progress. For more on helping a dog notice unfamiliar people calmly, see the reactive-walks guide, strangers are not training prop

Sources: VCA Animal Hospitals: Fears and Phobias in Dogs - Animals and People. Dogs Trust: Reactive dogs - why it happens and how to help.