Handwritten Polynomial Equation Recognition Using CNN and Symbolic Solution with SYMPY

Authors

  • Anup Gaire Department of Computer Engineering, Khwopa Engineering College, Bhaktapur, Nepal Author
  • Rohisha Shrestha Department of Computer Engineering, Khwopa Engineering College, Bhaktapur, Nepal Author
  • Rosha Prajapati Department of Computer Engineering, Khwopa Engineering College, Bhaktapur, Nepal Author
  • Shristi Yakami Department of Computer Engineering, Khwopa Engineering College, Bhaktapur, Nepal Author
  • Avijit Karna Department of Computer Engineering, Khwopa Engineering College, Bhaktapur, Nepal Author

DOI:

https://doi.org/10.3126/jsce.v13i2.96568

Keywords:

CNN, Handwritten equation solver, Image processing, PyQt5-interface, Polynomial recognition, Symbol segmentation

Abstract

This study presents an easy-to-use system that can recognize and solve handwritten polynomial equations using a Convolutional Neural Network (CNN). To achieve this, we began by collecting digits and math symbols from various publicly available sources. We began with a dataset of around 30,000 samples, then converted the images to grayscale, inverted them, applied binary thresholding, and removed noise to clean them up. Individual symbols are then separated using OpenCV, and a custom-trained CNN model classifies each symbol. We used 16 classes to classify our data. To ensure the model’s ability to detect symbols increases and produces efficient results, we expanded our data set through data augmentation to over 100, 000 images. CNN, built using Keras, achieved an impressive 98.99% classification accuracy, reliably identifying each character during training. Once the symbols are recognized, they are combined to form a complete equation. For normal equations, the system uses the eval () function to evaluate expression, providing quick, dynamic solutions . For polynomial equations of up to the third degree, SymPy is utilized for symbolic computation, providing accurate and detailed solutions. The solution is presented through a PyQt5-based user interface, that allows users to upload their handwritten equations and view the solved results. The proposed method supports polynomial equations with variables and basic mathematical operators, providing an accurate and user-friendly educational tool. The system supports basic mathematical symbols (+, –, ×, =, x, y). It can handle polynomial equations up to the third degree, which will be beneficial for students learning algebra or for quick problem solving.

Downloads

Download data is not yet available.

Downloads

Published

2026-07-27

Issue

Section

Research Papers

How to Cite

Gaire, A., Shrestha, R., Prajapati, R., Yakami, S., & Karna, A. (2026). Handwritten Polynomial Equation Recognition Using CNN and Symbolic Solution with SYMPY. Journal of Science and Engineering (JScE), 13(2), 23-32. https://doi.org/10.3126/jsce.v13i2.96568