Various relevance feedback techniques have been applied in content-based image retrieval. However, many are either heuristics-based, or computationally too expensive to be implemented in real-time, or limited to deal with only positive examples. We propose a fast and optimal linear relevance feedback scheme that takes both positive and negative examples from the user. This scheme can be regarded as a generalization of discriminant analysis on one hang, and on the other hand, it is also a generalization of an existing optimal scheme that takes only positive examples. We first define biased classification problem for the case where the data samples are labeled as positive or negative as to whether belonging to the target class (the biased class) or not; then biased discriminant analysis (BDA) is proposed as an optimal linear solution for dimensionality reduction. We also propose biased whitening transformation on the data when Euclidean distance is applied afterwards. Toy problems are designed to show the theoretical advantages of the proposed scheme over traditional discriminant analysis. It is implemented in real-time image retrieval for large databases and experimental results are presented to show the improvement achieved by the new scheme.