Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Automation of the Bender Visual Motor Gestalt Test

Course: Computational Cognitive Science
Project Type: Mandatory Course Project

📖 Description

This repository contains the code and methodology for automating the Bender Gestalt Test, a classic neuropsychological assessment used to evaluate visual-motor functioning and detect potential neurological impairments or psychological conditions.

The goal of this project is to build an end-to-end AI pipeline that takes scanned handwritten test papers from students, extracts clinical features (such as figure distortion, rotation, and erasures), and predicts a final psychological diagnosis. To achieve this, our 10-member team has split the architecture into two distinct but deeply integrated phases:

  1. Computer Vision (CV) Pipeline: Detects and classifies drawn figures from raw images.
  2. Machine Learning (ML) Pipeline: Processes the structured data from the CV model and predicts the final psychological diagnosis.

📑 Table of Contents

  1. Description
  2. Dataset Overview
  3. Project Roadmap
  4. Repository Structure
  5. Contribution

📊 Dataset Overview

The dataset provided for this project consists of the following components:

  • Raw Scans (89 images): Scanned handwritten A4 pages (both portrait and landscape) containing student drawings of the 9 standard Bender Gestalt figures.
  • Ground Truth PDF: Used strictly as the reference for the correct orientation of the figures. Constraint: Images are never artificially rotated during preprocessing or augmentation.
  • Clinical Labels (CSV/Excel): A structured dataset containing demographic data (Age, Gender), drawing sequence, identified Gestalt errors (e.g., closure difficulties, angle alterations), and the final expert diagnosis (Normal vs. Abnormal/Neurosis, etc.).

Key Data Constraints Handled:

  • Erasures as Features: Erasures are treated as clinical indicators of psychological state, not as noise.
  • Multi-Value Cells: The raw Excel file contains comma-separated features within single cells, requiring strict feature engineering (One-Hot Encoding) before ML training.

🗺️ Project Roadmap

Part 1: Computer Vision (Image to Structured Data)

  • Data Annotation: Annotate the 89 raw images with bounding boxes for figures and erasures using LabelImg/Roboflow.
  • Data Augmentation: Apply safe augmentations (brightness, contrast, noise, cropping) to expand the dataset. Strictly no rotation.
  • Transfer Learning: Fine-tune YOLOv8 (pre-trained on ImageNet) to detect and classify the drawn figures.
  • Inference & Output: Run the trained model on the dataset to generate a structured cv_final_output.xlsx matching the expected schema.

Part 2: Machine Learning (Structured Data to Diagnosis)

  • Feature Engineering: Clean the raw dataset by parsing multi-feature cells (str.split, get_dummies) into binary columns.
  • Exploratory Data Analysis (EDA): Analyze class distributions, apply SMOTE (if necessary), and create stratified train/test splits.
  • Baseline Models: Train Logistic Regression and Random Forest classifiers to establish initial performance benchmarks.
  • Advanced Models: Implement complex models (e.g., XGBoost, SVM) to maximize predictive accuracy.
  • Model Explainability: Utilize SHAP values to interpret the model and visualize which specific drawing errors most heavily influence the final diagnosis.

📁 Repository Structure

bender_gestalt_project/
│
├── data/                               # Data directory
│   ├── raw/                            # Immutable original data (images, PDFs, raw CSV)
│   ├── interim/                        # Data currently being processed (annotations)
│   └── processed/                      # Cleaned features and CV model output
│
├── notebooks/                          # Interactive experimentation notebooks
│   ├── team1_cv/                       # YOLOv8 training, augmentation, and inference
│   └── team2_ml/                       # EDA, feature engineering, and model training
│
├── src/                                # Production-ready Python scripts
│   ├── cv_pipeline/                    # YOLO training and inference scripts
│   └── ml_pipeline/                    # Feature engineering, ML training, and evaluation
│
├── models/                             # Saved model weights (.pt, .pkl)
├── reports/                            # Generated reports, figures, and SHAP visuals
├── README.md                           # Project documentation
└── requirements.txt                    # Project dependencies (YOLO, sklearn, pandas, shap)

🤝 Contribution

This project was developed by a 10-person team, divided into two specialized sub-teams working in parallel.

Name Role / Sub-Team GitHub Profile
[Student Name 1] Lead Annotator & Data Manager (Team 1 - CV) @username
[Student Name 2] Augmentation & Preprocessing Specialist (Team 1 - CV) @username
[Student Name 3] Transfer Learning Engineer (Team 1 - CV) @username
[Student Name 4] Model Tracking & Optimization (Team 1 - CV) @username
[Student Name 5] Inference & Output Engineer (Team 1 - CV) @username
[Student Name 6] Feature Engineering Lead (Team 2 - ML) @username
[Student Name 7] EDA & Data Preprocessor (Team 2 - ML) @username
[Student Name 8] Baseline ML Engineer (Team 2 - ML) @username
[Student Name 9] Advanced Models Engineer (Team 2 - ML) @username
[Student Name 10] Evaluation & Explainability Specialist (Team 2 - ML) @username

About

A program for analysis of the Bender Gestalt Test. It combines computer vision for extracting features, and machine learning for diagnosis

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages