@@ -253,10 +253,10 @@ Naive Bayes classifiers are based on Bayes' theorem with the assumption of indep
In our case, we are using the **Gaussian Naive Bayes** classifier, which assumes that the likelihood of the features is Gaussian. Though our image data does not strictly adhere to this assumption, we are still testing the performance of this classifier because we have numerical features which we do not want to regard as discrete features but as continuous ones which can be modeled by a Gaussian distribution with smoothing.
#### How Naive Bayes Works
**How Naive Bayes Works**
Naive Bayes classifiers work by calculating the probability of each class and the conditional probability of each feature belonging to each class. Despite its simplicity, Naive Bayes can yield surprisingly good results, especially in cases where the independence assumption holds.
#### Expected Results
**Expected Results**
While not as sophisticated as models like CNNs, Naive Bayes classifiers can still be quite effective, especially in scenarios with limited data or computational resources. However, their performance might be limited in our project due to the high interdependence of features in image data.
### Decision Tree
...
...
@@ -264,35 +264,35 @@ While not as sophisticated as models like CNNs, Naive Bayes classifiers can stil
A Decision Tree classifier is a flowchart-like structure that recursively divides the dataset into smaller and smaller subsets based on the most significant features. It can also be viewed as a model that makes decisions based on asking a series of questions.
#### How Decision Trees Work
**How Decision Trees Work**
Based on the features of the input data, a Decision Tree model asks a series of yes/no questions and leads down a path in the tree that eventually results in a decision (in this case, fruit classification). These models are intuitive and easy to visualize but can become complex and prone to overfitting, especially with a large number of features.
A simplified example of a Decision Tree for our fruit classification task with a maximum depth of 2 is shown below. In each node, the tree compares a feature of the input image to a threshold and decides which branch to follow based on the result. The final decision is made at the leaf nodes.
For our image classification task, decision trees might struggle with the high dimensionality and complexity of the data. They can serve as a good baseline but are unlikely to outperform more advanced models like CNNs.
### Random Forest
Random forest is an ensemble learning method, essentially a collection of decision trees, designed to improve the stability and accuracy of the algorithms.
#### How Random Forests Work
**How Random Forests Work**
Random forests create a *'forest'* of decision trees, each trained on a random subset of the data. The final output is determined by averaging the predictions of each tree. This approach helps in reducing overfitting, making the model more robust compared to a single decision tree.
#### Expected Results
**Expected Results**
Random forests are expected to perform better than individual decision trees in our project. They are less likely to overfit and can handle the variability in the image data more effectively. However, they might still fall short in performance compared to more specialized models like CNNs, particularly in high-dimensional tasks like our image classification.
### CNN (Convolutional Neural Network)
Convolutional Neural Networks (CNNs) are a class of deep neural networks, highly effective for analyzing visual imagery. CNNs are particularly suited for image classification because they can automatically and adaptively learn spatial hierarchies of features from input images. This makes them capable of learning directly from raw images, eliminating the need for manual feature extraction.
#### How CNNs Work
**How CNNs Work**
CNNs are composed of multiple layers, including convolutional layers, pooling layers, and fully connected layers. The convolutional layers apply a series of filters to the input image, each filter detecting a specific feature. The pooling layers then downsample the feature maps, reducing their dimensionality. The fully connected layers then process the high-level features and make the final classification.
#### Expected Results
**Expected Results**
The CNN model is expected to outperform the baseline models and the basic classifiers (Naive Bayes, Decision Trees, and Random Forest) due to its higher capacity to learn complex features from images. CNNs are particularly effective for image classification tasks, and we anticipate that our CNN model will achieve the highest accuracy among all the models we've implemented.