The purpose of this project is to recognize and convert a handwritten mathematical expression from an image into its equivalent ASCII representation using a Convolutional Neural Network (CNN).
The project is structured across three Jupyter Notebooks. The following sections outline its core components.
A function is defined to take as input a directory containing images and return a normalized array, adjusted according to the requirements of the model that will be defined later.
Test and training datasets are constructed and populated. Each image in the dataset is assigned a corresponding label, which is initially included in the matrix and later extracted.
A sequential model based on a convolutional neural network (CNN) is defined and then trained on the training dataset. Key metrics such as loss and accuracy are provided to assess the model's performance.
The system processes expressions stored in the "expressions" folder:
- Each expression is loaded sequentially.
- The system segments the expression into individual components (e.g., numbers, operators).
- A prediction is made for each component.
- The final expression is reconstructed and displayed in ASCII format.
- If the recognized expression is valid, it is parsed and evaluated to compute the result.
- If the expression is invalid, an error message is displayed.