Handwritten Polynomial Equation Recognition Using CNN and Symbolic Solution with SYMPY

Authors

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

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.

Abstract
0
PDF
0

Downloads

Published

2026-07-27

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, 13(2), 23-31. https://doi.org/10.3126/jsce.v13i2.96568

Issue

Section

Research Article

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, 13(2), 23-31. https://doi.org/10.3126/jsce.v13i2.96568