Pre existing Databases: There are several curated antonym databases such as wordpress and so on from which you can directly check if you can get antonyms of a given word.
Hearst Patterns: Given some seed antonym pairs of words, one can find patterns in text, how known antonyms tend to occur. X, not Y : “It is hot, not cold”, from X to Y where X and Y are adjectives: “From beautiful to grisly” are examples of such patterns. These are called Hearst patterns.
From Word Embeddings: Note that Using Word vectors(built from any technique), one can find related or associated words like (black, white), (black, green), (rich, wealthy), (rich, affluent), (rich, poor). Because black and green are colours, they will occur in similar sentences/contexts. However, related words could be synonyms, antonyms, derived, plural etc., it would be difficult to distinguish between each such class.
There are specialized embedding algorithms to distinguish embeddings.
One could train a classifier on top of word embeddings with available antonym pairs for the antonym detection task.