Live: In-Person at ITU Lahore and Online
This course provides an engaging introduction to programming, data science, and AI through Python and PyTorch. Students will explore fundamental programming concepts, visualize data, work on real-world mini projects, and delve into object detection and chatbot development using industry-standard tools. The hands-on nature of the course encourages creativity, experimentation, and collaboration, preparing students for deeper learning in AI and machine learning.
Writing Python programs using variables, conditionals, loops, and functions.
Creating and manipulating tensors with PyTorch for simulations and experiments.
Building simulations like dice games using randomness and modular code.
Visualizing data with Matplotlib and Seaborn, including pie charts and bar graphs.
Understanding object detection and applying pretrained models on real-world images.
Exploring use cases of AI in everyday life—like detecting books or traffic signs.
Building and customizing your own chatbot with transformer models like GPT-2.
Gaining insights into Retrieval-Augmented Generation (RAG) and how AI can access external knowledge to improve responses.
Developing a solid foundation in programming, data visualization, AI applications, and ethical tech usage.
“Introducing AI with Python”
June’2025-July’2025
Here you can view and download your certificates
Introduction to AI
Discussion about the goals of the course
Recap of Python Basics
Variables
Loops
Lists
Dictionary
Learned how to store information in variables like name, age, and height.
Used print() to show messages and mix text with variable values.
Used if, elif, and else to let Python make smart decisions.
Compared numbers and values to control what the code does.
Built a simple grading system based on student scores.
Stored many values in a list, like a list of grades.
Used a for loop to check each grade and give feedback.
Used a while loop to count down like a rocket launch.
Added up numbers in a list and found the average.
Made the code feel like a smart assistant talking to us.
Created a basic version of a chatbot that responds with helpful messages.
Discussed the Large Language Models (LLMs) and their role in modern AI.
Explored how AI understands, generates, and visualizes data intelligently.
Imported Matplotlib and NumPy to prepare for data visualization.
Plotted a line chart to show Math and Science scores over 8 weeks.
Added labels, titles, markers, and grids to improve chart readability.
Used a bar chart to compare average scores across school subjects.
Applied custom colors to make the charts visually appealing.
Learned that line charts are great for showing trends over time.
Learned that bar charts are best for comparing different categories.
Developed a Python-based AI chatbot for banking that understands customer queries in natural language.
Stored customer info in dictionaries for personalized responses.
Used keyword-based intent recognition to categorize queries.
Implemented random response selection per topic to make replies more human-like.
Designed graceful handling for unknown questions and exit commands like “bye”.
Created a check_balance() function that validates account numbers and provides accurate info.
Main chatbot loop continuously interprets user input and responds until exit.
Included error handling for invalid inputs and tested responses with varied user queries.
Demonstrated iterative debugging and refinement during development.
Learned that images are made of numbers using PyTorch tensors.
Each image is built with pixels, and each pixel has Red, Green, and Blue values.
Used torch.randint() to create ROBO’s first tiny image (3×3).
Printed out the red, green, and blue parts of ROBO’s image using slicing.
Discovered that bigger numbers mean brighter colors in each channel.
Made a larger black-and-white image using torch.zeros() and added white on top.
Learned how to visualize images using matplotlib.pyplot.imshow().
Created a rainbow picture by stacking red, green, and blue color bands in a tensor.
Drew a smiley face with two dark eyes and a smile on a light-colored background.
Used PyTorch operations like slicing ([start:end]) and assignment to draw inside tensors.
Revision of concepts used in Assignment 03.
Started with RGB color concept.
Learned how red and green values mix to make new colors.
Explored how pixels store RGB values.
Faced a coding bug and discussed how to fix it.
Learned how imshow() maps colors using min and max values.
Noted that flat values give no visible color contrast.
Used nested loops and if conditions to make a chessboard.
General discussion on tensors and images.
Create simple visual representations (like a face, plus sign, traffic lights, etc.) using PyTorch tensors and display them using matplotlib.
Each image is built using 2D or 3D tensors (torch.full, torch.ones, torch.zeros) to represent grayscale or RGB color values.
Plus Image: An RGB image of a red plus sign is drawn by setting horizontal and vertical bars to red on a white canvas.
Traffic Lights: Three colored circles (red, yellow, green) are created on a gray vertical panel using RGB tensors.
Square with Edges: A plain black square is shown; the fig background is set to blue for visual contrast, though the square itself has no visible content.
Cube Image: Four quadrants of an image are colored red, green, yellow, and blue to simulate a cube-like 2D pattern.
Interactive Menu: The main() function allows the user to choose which image to view by entering a number from 1 to 5.Face Image: A grayscale image with eyes and a mouth is created using selective black patches on a gray background.
Created grayscale images as 2D tensors using torch.zeros() and filled regions using slicing.
Displayed how a human sees an image vs. how a computer sees it (as numbers).
Applied a 3×3 edge detection filter manually using nested loops and element-wise multiplication.
Used filters to find bright borders and corners of shapes. Normalized results to improve visibility.
Made a custom grayscale scene with bright squares and a circle using math ((x-a)^2 + (y-b)^2 < r^2).
Applied filters to detect horizontal and vertical edges separately.
Created and applied a custom 3×3 filter to test edge detection effects.
Combined horizontal and vertical edge maps using
√(H² + V²) and used a threshold to highlight strong edges.
Learned how to load real-world road images using Python libraries like requests, PIL, and torch.
Resized the image tensor to a manageable (480×640) shape using torch.nn.functional.interpolate().
Visualized the road image using matplotlib.pyplot.imshow() and discussed its shape.
Converted the image to grayscale with torch.mean() to simplify edge detection.
Focused only on the bottom half of the image where road lanes are usually visible.
Created Sobel filters (edge detectors) to identify vertical changes in pixel values.
Used a sliding window technique to apply the Sobel filter and detect vertical edges.
Applied a threshold (> 0.5) to highlight strong edges that likely represent lane lines.
Reconstructed the full image with detected lanes highlighted on top using alpha blending.
Counted how many lane pixels were found and computed lane coverage percentage.
Interpreted detection quality based on coverage: Excellent, Good, or Needs tuning.
Understood how self-driving cars use such techniques to identify road lanes in real time.
Explored how digital images can be manipulated using code for real-world applications.
Loaded and displayed an image using the PIL (Python Imaging Library).
Manipulated images by applying transformations like resize, crop, rotate, and flip.
Converted a color image to grayscale for simpler analysis and storage.
Adjusted image brightness using ImageEnhance to simulate lighting changes.
Applied blur filters for softening or preprocessing tasks.
Saved the processed images for reuse in other projects.
Explored how digital images can be manipulated using code for real-world applications.
Loaded and displayed an image using the PIL (Python Imaging Library).
Manipulated images by applying transformations like resize, crop, rotate, and flip.
Converted a color image to grayscale for simpler analysis and storage.
Adjusted image brightness using ImageEnhance to simulate lighting changes.
Applied blur filters for softening or preprocessing tasks.
Saved the processed images for reuse in other projects.
Loaded Iris dataset and converted it to binary classification (removed class 2).
Split data into 80% training and 20% test sets.
Standardized features using StandardScaler.
Compared feature stats (mean & std) before and after normalization.
Visualized data using histograms and 2D scatter plots.
Built a feedforward neural network with 2 hidden layers and ReLU activation.
Used sigmoid output for binary classification probabilities.
Deployed model and data to GPU if available.
Printed total number of trainable parameters.
Used binary cross-entropy loss and Adam optimizer (lr=0.01).
Trained for 200 epochs, printed loss and accuracy per epoch.
Plotted loss and accuracy across training epochs.
Evaluated model on test set; reported test accuracy and loss.
Printed detailed predictions (sample, true label, predicted, probability, correct/incorrect).
Rated model performance (Excellent/Good/Moderate) based on accuracy.
Cleared GPU memory post-training.
Displayed final summary confirming successful training/testing using PyTorch.
Assignment 07
Nourishing the Programmer in you!
schoolofseedprogramming@gmail.com
query@seedprogramming.org