A longer video with audio can be accessed here.
This MATLAB project implements a Fuzzy Logic System (FIS) to predict the taste of rice based on a given dataset. The FIS is designed to model the taste as the output, utilizing various input variables, such as stickiness.
Follow these steps to utilize the Rice Taste Prediction Fuzzy Logic System:
-
Opening the GUI:
- Run the
app.mlapp
file to access the graphical user interface (GUI).
- Run the
-
Evaluating Results:
- provide inputs in the 4 text fields and click enter (all inputs must be in the correct range or else you will get a warning in the console).
Utilize the provided GUI and scripts to streamline the process of taste prediction and explore the functionalities for your specific use case.
- app.mlapp: Graphical User Interface (GUI) for the FIS.
- objectiveFunc.m: Helper function to calculate Root Mean Square Error (RMSE) for FIS evaluation.
- riceTaste.m: Scripts for FIS generation and tuning.
- riceTasteFIS.fis: Latest saved FIS file for quick loading and usage.
- readme.md: Documentation file (you are here).
The rice taste dataset includes the following input variables:
- Feature 1
- Feature 2
- Feature 3
- Feature 4
And the output variable: Taste score
The code reads the rice taste dataset and separates input and output variables.
A baseline fuzzy inference system (FIS) is generated using the genfis
function with Fuzzy C-Means clustering and Mamdani type rules.
The FIS is evaluated, and its output is plotted using centroid defuzzification.
The FIS is further tuned in two steps:
- Learning rules from scratch using a Genetic Algorithm (GA).
- Tuning membership functions using a Particle Swarm Optimization (PSO) algorithm.
The costs of different FIS configurations are calculated based on the root mean square error (RMSE) using the objectiveFunc
function.
The costs of the baseline FIS, FIS with learned rules, and FIS with tuned membership functions are displayed.
The rulebases of the baseline FIS and the FIS with learned rules are shown.
The objective function calculates the RMSE between actual and predicted values.
Feel free to reach out for any questions or improvements!
Contact: zhengjiawen44@gmail.com