Search arXivSearch

arXiv · 2609.24384

A Lightweight Convolutional Neural Network for Real-Time Recognition of Hand-Drawn Geometric Shapes

Abstract

Recognizing hand-drawn geometric shapes is a foundational sub-problem of sketch recognition, with applications in education, human-computer interaction, and diagram digitization. This paper presents the design, implementation, and evaluation of a desktop application that recognizes four basic hand-drawn geometric shapes, circle, square, rectangle, and triangle using a compact Convolutional Neural Network (CNN). A dataset of 2,000 labeled 28x28-pixel shape images was collected independently and released publicly. The classifier consists of three convolutional blocks (16, 32, and 64 filters) with max-pooling, an in-model data-augmentation stage (random horizontal flip, rotation, and zoom), a dropout-regularized dense layer of 128 units, and a 4-way linear output layer, totaling 97{,}956 trainable parameters. The network is trained with the Adam optimizer on a sparse categorical cross-entropy objective computed directly on logits. On an 80/20 train-validation split, the model achieves 94.80% training accuracy and 96.01% validation accuracy with a validation loss of 0.1437. A Tkinter-based graphical interface allows a user to draw a shape with the mouse and receive an immediate class prediction with a confidence score. We situate this system within the broader sketch and shape-recognition literature, compare its accuracy against related hand-drawn shape classification studies, and discuss the limitations inherent to a small, single-contributor dataset. The complete source code, trained model, and per-class datasets are released publicly to support reproducibility.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Shahir Abdullah. 2026-09-21. A Lightweight Convolutional Neural Network for Real-Time Recognition of Hand-Drawn Geometric Shapes. https://arxiv.org/abs/2609.24384

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

SSP-GNN: Learning to Track via Bilevel Optimization

We propose a graph-based tracking formulation for multi-object tracking (MOT) where target detections contain kinematic information and re-identification features (attributes). Our method applies a successive shortest paths (SSP) algorithm to a tracking graph defined over a batch of frames. The edge costs in this tracking graph are computed via a message-passing network, a graph neural network (GNN) variant. The parameters of the GNN, and hence, the tracker, are learned end-to-end on a training set of example ground-truth tracks and detections. Specifically, learning takes the form of bilevel optimization guided by our novel loss function. We evaluate our algorithm on simulated scenarios to understand its sensitivity to scenario aspects and model hyperparameters. Across varied scenario complexities, our method compares favorably to a strong baseline.

cs.CV

AdaptiveCDM: Source-Free Few-Shot Domain Adaptation for Cell Detection in Microscopic Images

Cross-domain cell detection for microscopic images suffers from performance degradation due to distribution shifts across imaging domains. Unsupervised Domain Adaptation (UDA) strategies, attempt to overcome domain sift without requiring annotated data from target. However, requirement of availability of annotated data from the source domain and large-size data from target domain are both challenging limitations for realistic scenarios. This is especially true in medical imaging, where privacy requirements might prevent access to annotated source data, and costly data acquisition restricts extensive sampling of the target domain. To address these challenges, we propose AdaptiveCDM, a modular framework for Source-Free Few-Shot Domain Adaptive Object Detection (SF-FSDAOD) setting, that adapts a pretrained source model using only few labeled target images without accessing source data. AdaptiveCDM combines Resolution-Aware Augmentation (RAug) and Category-Aware Representation Learning (CARL). RAug alleviates the scarcity and class imbalance by augmenting instance balanced training examples, while preserving the scale fidelity and morphological properties of cellular structures. CARL enhances discriminative representation learning by encouraging class-consistent proposals, improving both localization and classification. We also introduce two competitive baselines for proposed setting: Faster-FreeShot and MT-FreeShot. Our approach achieves 40.4/43.4 mAP0.5 on M5 and 67.1/75.5 mAP0.5 on Raabin-WBC under 2-/5-shot adaptation. Despite using only a few labeled target images and no source data, AdaptiveCDM achieves competitive or superior performance compared with SOTA methods under their respective supervision settings. Ablations and qualitative analyses further substantiate the contribution of each component and the effectiveness of AdaptiveCDM in low-data regimes. Code/models will be available.

cs.CV

Uncertainty-Weighted Fusion of Image and Synthetic Event for Video Anomaly Detection

Most existing video anomaly detectors rely on RGB frames alone, which limit their ability to capture abrupt or transient motion cues that are critical for identifying anomalous events. We propose Uncertainty Weighted Image Event Fusion (IEF-VAD), a framework that integrates complementary RGB and synthetic motion information through a principled weighting mechanism. The method models the high variance and heavy tailed characteristics of synthetic motion cues with a Student's t likelihood, computes value level inverse variance weights using a Laplace approximation to prevent the image modality from overshadowing motion information, and performs iterative refinement to suppress residual cross modal noise. This formulation provides a more balanced and reliable fusion process compared to cross attention or gating based approaches that often suffer from modality dominance. Without requiring an event camera or frame level annotations, IEF-VAD achieves new state of the art performance on multiple real world anomaly detection benchmarks and remains stable under degradation applied to individual modalities. The results indicate that extracting and integrating complementary motion cues is an effective direction for robust video understanding across diverse environments.

cs.CV