S/he could be barking at the wind or sounds that you cannot hear (I would investigate that). Or s/he could just be bored. In either case, I would teach the dog to stop barking on command. You can use "that'll do" as a command. If you go over to see what they are barking at, the dog will more readily accept the command. To avoid training him or her to bark to get attention, you want to interrupt the barking by going over to where the dog is, and saying "that'll do", then distract him by asking him to sit (if it is difficult to get his attention, make sure he sees you have a treat). Give him a treat for sitting (as he will also have stopped barking), and then ask for a few more things (come, lay down, etc), treating for each behavior because even though he knows these easy behaviors, he is ignoring the "thing" out the window for you, which might be hard for him. The dog will learn that barking will attract your attention (which he wants) but he will also have to work as a result (which he may not like as much). So, this might cut down on unnecessary barking. Once he is quiet on command, you can reward him for that and not ask him to work for it.
#PetBehaviorandTraining