TWAIN is a standard for communication between imaging devices (usually scanners) and computers. Because it’s always written in upper case, it’s often assumed that TWAIN is an acronym – with the “AIN” coming from 'acquired image network'.
It doesn’t. According to the twain.org website, the word “twain” was chosen from Kipling’s the Ballad of East and West, which coined the phrase “…and never the twain shall meet…” to symbolize how hard it was to connect a scanner to a computer. It was changed to upper case to make it more distinctive.
The above TWAIN has no relation to Samuel Clemens (Mark Twain), whose pseudonym was taken from the steamboat practice of calling out the depth of the water to make sure it was deep enough for the boat to safely pass. Mark twain meant the depth of the water to be two fathoms. A fathom is about 6 feet. Twain is an archaic word for two.