The potential of genetic algorithm (GA) as a new way for the variety discrimination of fragrant mushrooms was evaluated. First, the visual/near infrared spectral data ranging from 375 nm to 1025 nm were collected by a spectrometer and then analyzed by principle component analysis (PCA) for space clustering. The resulting accumulative credibility of 94.37% based on the first three principle components (PCs) signifies that it is possible to establish a 3-D model for the variety discrimination of fragrant mushrooms. A new method which combines PCA with 3-D division planes established by genetic algorithm (GA) was proposed. In the test, a number of 195 samples from three varieties of fragrant mushrooms were examined, in which 150 samples were selected randomly for model-building and other 45 for model-prediction with the recognition rate over 91%. It proves feasible to adopt GA for the machine recognition of various fragrant mushrooms.