According to Kwaidan: Stories and Studies of Strange Things, a book by Lafcadio Hearn that features several Japanese ghost stories and a brief non-fiction study on insects, a butterfly was seen in Japan as the personification of a person’s soul; whether they be living, dying, or already dead. One Japanese superstition says that if a butterfly enters your guestroom and perches behind the bamboo screen, the person whom you most love is coming to see you. However, large numbers of butterflies are viewed as bad omens. When samurai Taira no Masakado was secretly preparing for his famous revolt, there appeared in Kyoto so vast a swarm of butterflies that the people were frightened — thinking the apparition to be a portent of coming evil.
The Japanese director Masaki Kobayashi adapted four Hearn tales into his 1965 film, Kwaidan.