Ecuador exports two major types of cocoa beans, the highly regarded and lucrative National, known for its fine aroma, and the CCN-51 clone type, used in bulk for mass chocolate products. In order to discourage exportation of National cocoa adulterated with CCN-51, a fast and objective methodology for distinguishing between the two types of cocoa beans is needed. This study reports a methodology based on computer vision, which makes it possible to recognize these beans and determine the percentage of their mixture. The methodology was challenged with 336 samples of National cocoa and 127 of CCN-51. By excluding the samples with a low fermentation level and white beans, the model discriminated with a precision higher than 98%. The model was also able to identify and quantify adulterations in 75 export batches of National cocoa and separate out poorly fermented beans. A scientifically reliable methodology able to discriminate between Ecuadorian National and CCN-51 cocoa beans and their mixtures was successfully developed. © 2017 Society of Chemical Industry.