The drawing's creator Robert Baden-Powell, in his 1915 book My Adventures as a Spy, wrote:
“This sketch of a butterfly contains the outline of a fortress, and marks both the position and power of the guns. The marks on the wings between the lines mean nothing, but those on the lines show the nature and size of the guns, according to the keys below.”
It was espionage by entomology.
See explanation at source link below.