Category: Machine Learning

  • Real-Time Object Recognition with CNNs

    Summary

    This assignment is an individual work. Every student will independently design and implement a real-time object recognition system using OpenCV and PyTorch. The aim is to build a system that captures live video frames from a laptop camera, automatically recognizes four chosen object categories, and overlays the recognized object as a subtitle on the video stream. The categories can be any e.g., shoes, pens, cards, bottles, etc.

    Students will collect their own image datasets, train and test different CNN models, and compare results across three strategies: (1) baseline CNN trained from scratch on the dataset collected, (2) CNN with data augmentation, and (3) transfer learning with a pre-trained network.

    Deliverables include:

    • All Python code files (separate scripts for: i) data collection (a .py file), ii) model training and evaluation (a notebook (.ipynb file) including the code and outputs (plots and printed evaluation results)), iii) real-time application (.py file))
    • Final trained model file (.pt or .pth file (best model only) that can be loaded with torch.load())
    • A brief written report (PDF, Maximum word limit 2000)
    • A short demonstration video of the real-time application (using the best model only)

    Submission: Submit as a PDF file via Forum. Include links to various artifacts (e.g., video) on the first page of the report. You can put artifacts on Google drive. Make sure that the link is accessible.

    Section 1: Data Collection and Preprocessing

    Objective: Create and prepare a dataset for CNN training.

    Steps/Questions:

    • Write an OpenCV script to capture and store frames from your laptop camera.
      • The script should automatically create a directory and save frames as image files. (Note: You may need to grant camera permissions by running your code in terminal: $python your_script.py)
    • Collect 35 images per object category for four distinct objects. It is advised to collect more (2x) and then manually filter out samples that have problems (such as those not containing the object, containing artifacts like blur or other type of noise)
    • Split data into training, validation, and test sets (20, 5, 10).

    Section 2: Model selection

    Objective: Define three CNN-based approaches for comparison.

    Steps/Tasks:

    -** Model 1: Baseline CNN: **Implement and train a CNN model from scratch using your dataset.

    • Model 2: Data Augmented CNN: Retrain the same CNN using data augmentation techniques (rotation, flips, brightness adjustments, etc.).
    • Model 3: Transfer Learning: Choose a pre-trained model (e.g., MobileNetV2, ResNet18) and fine-tune it on your dataset. Use a relatively small model suitable for limited data and your laptop resources. Note that you may not be able to run on your computer the large models you train on colab.

    IMPORTANT: You should avoid using YOLO object detection models! The models used should be lightweight CNN models.

    Section 3: Model Training and Hyperparameter Tuning

    Objective: Train and optimize models using PyTorch.

    Steps/Tasks:

    • Implement a PyTorch training loop with clear code comments.
    • Train each of the three models using appropriate hyperparameters.
    • Explore hyperparameter variations (learning rate, batch size, optimizer choice).
    • Record training and validation performance (create learning curves).
    • Identify which hyperparameters have the biggest effect on performance.
    • Everything done (e.g., hyper parameter tuning) should be reflected in the report e.g., via graphs.

    Section 4: Model Evaluation

    Objective: Evaluate model performance on unseen test data.

    Steps/Questions:

    • Evaluate all three models on the test set.
    • Report accuracy, precision, recall, and confusion matrix for each model using proper visualizations
    • Compare performance results across the three models and explain differences.

    Section 5: Real-Time Demonstration

    Objective: Deploy the best-performing model in a real-time OpenCV application.

    Steps/Tasks:

    • Implement an application script using OpenCV that:
    • Captures real-time video feed.
    • Runs inference using the selected CNN model.
    • Displays the recognized object name as a subtitle on the video.
    • For an object outside the 4 categories, the model should predict “Other”
    • Record a short video demo (1-2 minutes) of your application running with different objects. (you may use the screen recording function of QuickTime Player). You must include yourself in the video too. Please discuss with your instructor in case you have any challenge in this part.

    Section 6: Conclusions

    Objective: Reflect on results, insights, and limitations.

    Questions:

    • Show key results via graphs and charts
    • Which of the three approaches performed best? Why?
    • What challenges did you face during dataset collection and training?
    • Link the concepts you used in this assignment to respective lessons from the course. Include a table for this part

    Section 7: Technical Interviews

    After the submission of assignment, each student will give a technical interview to the instructor. In the interview, the student will explain how he/she executed this assignment. The instructor will ask questions from the student to assess students’ understanding of the assignment.

    Word limit: Max 2500

    Grading dimensions

    The following components will be considered for assessment:

    1. Dataset collection, quality, and preprocessing
    2. CNN model design and training implementation (including hyper parameter tuning)
    3. Evaluation and comparison of three models
    4. Functionality of real-time object recognition system
    5. Code quality, report clarity, and demonstration video

    IMPORTANT: Students are expected to develop a good understanding of the content of their work and be able to answer the instructors questions during viva. This will be considered part of the assessment and reflected in their grades.

    Assignment Information

    Weight:

    15%

    Learning Outcomes Added

    • : Explain the fundamentals of deep learning, including motivation, problem formulation, and architectures.
    • : Apply and evaluate the design and implementation of deep learning architectures and techniques.
    • : Recognize and critically analyze deep learning methods for different types of learning tasks across various domains.

    Requirements: 2000 | Python

  • Exploratory Data Analysis, Dataset Collection, and Automated…

    if there’s any other informations or sources needed to complete the assignment, feel free to ask. for the naming format of submission files, i’ll rename it myself later on. other than that please let me know if anytrhing else is needed. thanks

    Requirements: according to the question

  • Machine Learning Question

    all of the codes should have comments to make it all clear

    the data set should be about the UAE.

    Requirements:

  • Machine Learning & AI Essentials CIS 142

    Month 1 Assessment Assignment

    Modules Covered:
    Module 1: Introduction to Artificial Intelligence
    Module 2: Foundations of Machine Learning
    Purpose
    This assignment evaluates what youve learned during the first month of the course. You will
    demonstrate your understanding of core AI and machine learning concepts, terminology, ethical
    considerations, and how these ideas apply to real-world scenarios.
    This is not a memorization exercise, clear explanations, examples, and reasoning matter more than
    technical jargon.

    Assignment Overview
    Total Points: 100
    Format: Typed document (Word or PDF)
    Length: ~35 pages (not including diagrams, if used)

    Part 1: AI Foundations & Core Concepts (25 points)
    Answer all questions in complete sentences.
    1. What is Artificial Intelligence?
    o Define AI in your own words.
    o Briefly describe its historical development (early goals vs modern reality).
    o Explain one major way AI impacts everyday life today.
    2. AI vs Machine Learning vs Deep Learning
    o Clearly explain the difference between:
    Artificial Intelligence
    Machine Learning
    Deep Learning

    o Provide one real-world example for each.
    3. Key Terminology
    Choose four of the following terms and explain them clearly:
    o Algorithm
    o Model
    o Dataset
    o Features
    o Training data
    o Prediction
    Your explanations should be understandable to someone with no technical background.

    Part 2: AI Ethics & Societal Impact (20 points)
    Answer the following in short-essay form (12 paragraphs each).
    1. Ethical Concerns in AI
    Identify and explain two ethical issues related to AI (examples: bias, privacy, surveillance, job
    displacement, misinformation).
    2. Real-World Impact
    Choose one industry (healthcare, finance, education, transportation, hiring, social media, etc.)
    and explain:
    o How AI is used
    o One benefit of AI in that industry
    o One ethical or societal risk
    3. Your Perspective
    Do you believe AI should be more heavily regulated? Why or why not?
    Support your answer with at least one concept from the course.

    Part 3: Foundations of Machine Learning (30 points)
    1. Types of Machine Learning
    Explain the difference between:
    o Supervised learning
    o Unsupervised learning

    o Reinforcement learning
    For each type:
    o Describe how it works
    o Give one practical example
    2. Data & Features
    o What is the difference between data and features?
    o Why is feature selection important in machine learning?
    3. Concept Check
    Explain why more data does not always mean better results.

    Part 4: Model Training & Performance (15 points)
    1. Training, Validation, and Testing
    Explain:
    o What training data is used for
    o Why validation data exists
    o Why test data must be kept separate
    2. Overfitting vs Generalization
    o Define overfitting
    o Define generalization
    o Explain why overfitting is a problem in real-world AI systems

    Part 5: Applied Scenario (10 points)
    Scenario:
    A company is building an AI system to predict whether students will pass or fail an online course based
    on attendance, assignment completion, and quiz scores.
    Answer the following:
    1. What type of machine learning would this system most likely use? Why?
    2. Name two features that could be used in the model.
    3. What is one ethical concern related to using this system?
    4. What could happen if the model is overfitted?

    Grading Criteria
    Criteria Weight
    Concept accuracy 35%
    Clarity & explanation 25%
    Real-world examples 20%
    Ethical reasoning 10%
    Organization & professionalism 10%

    Submission Checklist
    Before submitting, make sure:
    You answered all sections
    Explanations are in your own words
    Examples are clear and relevant
    Writing is organized and easy to follow

    Requirements: 5 parts | Python