How quocbao2772004/autograde works
Project Type & Purpose
• This is a full-stack (backend mainly) automated grading tool. Its purpose is to process scanned answer sheets by first using image processing (via OpenCV) to detect and extract answer regions, then applying a CNN model (with deep learning techniques) to determine marked answers. Finally, it compares the detected responses against a predefined answer key (in CSV format) to compute scores.
• The key functionalities include image processing, deep learning inference, and result evaluation/report generation.
Analyzing the File Structure
• Top-Level Files & Folders:
• README.md: Provides project overview, installation, and usage guidelines.
• answer_key.csv: The configurable answer key.
• The “code” directory: Contains the main scripts (process_image.py) and Jupyter notebook (create_answer_file.ipynb) used for running the image processing and evaluation procedures.
• The “cropped_images” directory: Stores intermediate processed images, likely organized into sub-folders (e.g., I, II, III, sbd) for different forms or regions.
• The “dataset” directory: Likely contains raw or processed data used for training/validation.
• The “model” directory: Contains the CNN code (modelCNN.py) and the associated pre-trained weights (weight.h5).
Core Components & Relationships
a. Input / Data Acquisition:
• Scanned answer sheets (supplied by the user) serve as input.
b. Image Processing Module:
• Implemented in process_image.py (and possibly assisted by OpenCV routines).
• Functions include detecting answer regions and cropping/mapping the images.
• Processed outputs are stored in the “cropped_images” directory.
c. Answer Key Component:
• Uses answer_key.csv which holds the correct answers.
• Likely read using Pandas within the Python scripts.
d. Deep Learning Module:
• Encompasses the CNN model defined in modelCNN.py.
• Uses the pre-trained weight file (weight.h5) for inference.
• Processes locally cropped images for marking detection.
e. Answer Evaluation & Reporting Module:
• Compares the CNN’s outputs with the answer key.
• Generates a final grading report automatically.
• May be integrated within process_image.py or triggered separately (see create_answer_file.ipynb).
Architectural Patterns & Technologies
• Modular design:
• Separation between the image pre-processing (OpenCV) and the classification/inference components (CNN).
• Clear dependency on CSV-based configuration (answer key) which makes grading customizable.
• Underline the use of external libraries and frameworks:
• Python is the base language.
• OpenCV is key for image processing.
• Pandas is used for data handling.
• The CNN model leverages deep learning frameworks (most likely TensorFlow or Keras, implied by the use of .h5 weights).