swim against the current
Also, swim against the stream or tide. Go against prevailing opinion or thought, as in I'm voting for him even if that is swimming against the current. Shakespeare used a similar metaphor in 2 Henry IV (5:2): "You must now speak Sir John Falstaff fair, which swims against your stream." For the antonym, see swim with the tide.