Inspiration
Convolutional Neural Networks (CNNs) are in great demand for image recognition in different branches of science and technology, including agriculture, where CNNs are used to distinguish crops for mapping, estimate yield, detect pests and weeds, etc. As far as most modern CNNs are built in Python using libraries like Tensorflow and PyTorch, these CNNs are often unsuitable for embedded systems and weak PCs with older CPUs and GPUs to run smoothly. Therefore, some people still have no access to CNN power in image recognition. My task was to resolve this issue providing the approach of low-level coded CNN from scratch in pure C with no external libraries used. C-based code usually runs times faster than Python code, is more universal, portable and provides great suitability for embedded devices.
What it does
Crop Classifier is a tiny CLI app, featuring the standard simple CNN for agricultural crops recognition. Kaggle Crop Diseases Dataset (https://www.kaggle.com/datasets/shubham2703/five-crop-diseases-dataset) was used as a basis for training. The app provides CNN training, saving the model in .bin file, and further usage for image classification based on the extracted features and regulations during the training process.
How we built it
I built it using modular approach in pure C - no ML libraries, only standard C libraries!
Challenges we ran into
It was extremely tricky to implement correct memory management and signal propagation throughout the network. Also, it was difficult to write the CNN core from scratch.
Accomplishments that we're proud of
Functional CNN for agricultural crops image recognition written in pure C - it would be difficult to find analogues in the Internet!
What we learned
I learned how to implement CNN with no common ML/DL libraries like pandas, numpy, sklearn, tensorflow, pytorch in relatively low-level programming language like C.
What's next for Crop Classifier
- Improved algorithms and accuracy
- Better statistical evaluation of the models
- Results export functionality
- Training visualization
- Improved UI/UX
- better performance even with small datasets
Log in or sign up for Devpost to join the conversation.