The ScribbleSolver is a web based machine learning model that combines Convolutional Neural Networks (CNNs) and Optical Character Recognition (OCR) technology to recognize and interpret handwritten mathematical equations. This project has resulted in a model that accurately identifies digits and mathematical symbols from handwritten input, effectively translating these into solvable equations.
Our model is highly accurate with a measured accuracy of 98.27%, and a minimized loss function of 0.656%. This showcases the successful application of machine learning techniques to solve complex, real-world problems.
Flask==2.1.1
gunicorn==20.1.0
pybase64
Pillow
requires.io
numpy
sympy
opencv-python-headless
regex
tensorflow
keras
A. Scribble:
1. Scribble any one variable equation on the drawing board.
2. Note: The model is trained only on "x", so make sure to use "x" only. It can be trained on more variables but to improve efficiency and simplicity we used x.
3. Make sure there is space between each number so that it recognises easily.
4. Equations should be in the format of "ax²+bx+c=0". Make sure to include "=0" or "=anything" at the end.
5. Cannot handle negative power.
6. Press the solve equation button and wait for few seconds for the roots.
B. Enter:
1. Enter the equation in the input field.
2. Equations should be in the format of "ax^2 + bx + c = 0". Make sure to include "=0" or "=anything" at the end.
3. Can handle negative power.
4. Press the solve equation button and wait for few seconds for the roots.
C. The digits are not recognisable when they overlap each other's space.
D. The digits are recognisable when they are in their own space.
- Scribble eqution on the drawing pad.
![Screenshot 2023-07-17 at 5 29 43 AM](https://private-user-images.githubusercontent.com/81812754/253834160-e9f33421-0d25-42b4-a384-152031b64ab0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NDA2MzUsIm5iZiI6MTcyNTk0MDMzNSwicGF0aCI6Ii84MTgxMjc1NC8yNTM4MzQxNjAtZTlmMzM0MjEtMGQyNS00MmI0LWEzODQtMTUyMDMxYjY0YWIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDAzNTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkNzY0YWEyODFhOWE3YWE2NmY4ZWUzNDQ5YzQyNmUwYWZiZDkwMjkyZDk0N2E2NjE2N2UwMGZjMThlZjA1YjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.84roesZK9SC00aHbanO6Q4MbE3axLmtIZaB0NIu71iY)
- Press solve equation button to solve.
![Screenshot 2023-07-17 at 5 30 00 AM](https://private-user-images.githubusercontent.com/81812754/253834186-7d1426b6-76e8-4c5b-b846-7a79da31a713.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NDA2MzUsIm5iZiI6MTcyNTk0MDMzNSwicGF0aCI6Ii84MTgxMjc1NC8yNTM4MzQxODYtN2QxNDI2YjYtNzZlOC00YzViLWI4NDYtN2E3OWRhMzFhNzEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDAzNTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFhMjA0YjhlNzg1NTJiZGIxODM4NTM0ZWI2OWM0MmQ2YmJhNWU1MjEyOGZlYjBiNjcyMTZmYjUxYWJiYzlhYWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.UgLaLd_uGQefAUGwPD5oGzuXpdKTXwbYTFAg3-ANJxY)
- Enter an equation in the input field.
![Screenshot 2023-07-17 at 5 31 00 AM](https://private-user-images.githubusercontent.com/81812754/253834221-ca606a5f-d01e-428a-b009-755cf9c18764.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NDA2MzUsIm5iZiI6MTcyNTk0MDMzNSwicGF0aCI6Ii84MTgxMjc1NC8yNTM4MzQyMjEtY2E2MDZhNWYtZDAxZS00MjhhLWIwMDktNzU1Y2Y5YzE4NzY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDAzNTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFjMTMzMGNlZDM1OWJiNTdmY2VhNzhjZjE1MTVlZTJiMjRhZjIxNmJhMGE2MjIxMjJlODdiMGE5OWY5YTEzNzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Se7oef3NuJOd0-uMiBVo-dLzS2xIJiV1a4h5KhDez-w)
- Press solve equation button to solve.
![Screenshot 2023-07-17 at 5 31 17 AM](https://private-user-images.githubusercontent.com/81812754/253834248-9ae7c042-86b4-4a08-89ac-8b0c5c515c74.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NDA2MzUsIm5iZiI6MTcyNTk0MDMzNSwicGF0aCI6Ii84MTgxMjc1NC8yNTM4MzQyNDgtOWFlN2MwNDItODZiNC00YTA4LTg5YWMtOGIwYzVjNTE1Yzc0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDAzNTIxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU1NGJiMzU2OWJmYjQyZDYyMjkzYjYzN2FlNjNjMDI5NjdmODk4MzQ0ODgxYWQ2MGZlYThkMjg2OGEyMDBkYjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.OdZie2-bnqekgSQRMt5Ks0MULFOAiAyI7B5W3HHW60Y)
Clone the repo
git clone https://github.com/ritessshhh/ScribbleSolver
The model uses a combination of Convolutional Neural Networks (CNNs) for feature extraction from the image inputs, and Optical Character Recognition (OCR) technology for converting the detected features into understandable symbols.
Our CNN architecture consists of a series of convolutional, max pooling, and dense layers, with a final softmax layer for multi-class classification of the different digits and mathematical symbols.
The OCR technology then translates these classified features into a form that can be used to generate a solvable equation.
Our model achieved an accuracy of 98.27%, with a minimized loss function of 0.656%. This level of performance demonstrates that our model is highly effective at recognizing and interpreting handwritten mathematical equations.
We are planning to extend this model to recognize more complex mathematical symbols and to work on larger and more complex equations. Feedback and contributions are always welcome.
Copyright [2023] [Ritesh Chavan]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.