0% found this document useful (0 votes)
22 views

Lab Report (1) Bachpan

Rrr
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Lab Report (1) Bachpan

Rrr
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Lab Report

for

NEURAL NETWORK AND FUZZY LOGIC


(CS-453)

Department Of Software Engineering and Computer Science

Name Muhammad Haris


Roll number 019
Semester Vll
Course Neural Network & Fuzzy Logic
Lab Instructor Miss Aqsa
Certificate

This is to certify that Mr. / Ms.


…………………………………. of Seventh
Semester, Final Year, Department of
Software Engineering and Computer
Science bearing Roll No. ………….……. has
completed the necessary lab work for the course
of Neural Network and Fuzzy logic prescribed
by the Ziauddin University, Faculty of
Engineering Science and Technology, under
my supervision for the academic session
………………

_______________________ _______________________

Course Teacher Lab Teacher


Name: _______________________ Name: _______________________

Designation: __________________ Designation: __________________

Department: ___________________ Department: ___________________


Blooms
Taxonomy’s
CLO PLO
S.No LAB OBJECTIVES Psychomotor
domain

PERFORM a program to Implement a simplified fraud detection system using the


1 McCulloch-Pitts Neuron model.
CLO-3 PLO-5 P–03

PERFORM ANDNOT function to create a MATLAB program to simulate an email


2 spam filter using a simplified McCulloch-Pitts neural network.
CLO-3 PLO-5 P–05

PERFORM XOR function to develop a MATLAB program to simulate a smart CLO-3


3 PLO-5 P–05
home security system using a McCulloch-Pitts neural network to approximate the
XOR function.
PERFORM a machine learning model using Python and a suitable library (e.g.,
4 TensorFlow, PyTorch, scikit-learn) to predict the sentiment (positive or negative) of
CLO-3 PLO-5 P–05
movie reviews.
5 PRACTICE a program for solving linearly separable problem using Perceptron CLO-3 PLO-5 P–03
Model

PERFORM a program to a company’s access control system, employees need both CLO-3 PLO-5 P-05
6 their access card and a biometric scan (e.g., fingerprint) to enter secure areas.
Implement a simplified version of this access control system using the AND
function concept.
CLO-3 PLO-5 P-04
7 PRODUCE Perceptron net for an AND function with bipolar inputs and targets.

CLO-3 PLO-5 P-07


To IMPLEMENT a project on any topic object detection using roboflow
8
(open ended).

Outline the steps to IMPLEMENT instance segmentation using YOLOv8 and CLO-3 PLO-5 P–03
9 Python.

10 CONSTRUCT to gain foundational knowledge in Artificial Neural Networks CLO-3 PLO-5 P-05
(ANNs), explore diverse network types, comprehend neuron models, and grasp the
training/validation process using Python.

DESIGN and IMPLEMENT a recurrent neural network (RNN) in MATLAB and CLO-3 PLO-5 P–03
11 also in Python.

To Adapts a high-quality training data that can be used to train and improve
12 machine learning models for tasks such as object detection, tracking, and activity
CLO-3 PLO-5 P–06
recognition in videos.

Use Advance techniques (Time Series) of Neural Network to DESIGN prediction of CLO-3
13 PLO-5 P–07
gold prices by using data set of 1970 to 2022 in MATLAB/Python. (Open Ended)

14 CLO-3 PLO-5 P-07


Project
Lab # 01
Objective: PERFORM a program to Implement a simplified fraud detection system using the
McCulloch-Pitts Neuron model.

Code:
Output:
LAB # 2
Objective: PERFORM ANDNOT function to create a MATLAB program to simulate an
email spam filter using a simplified McCulloch-Pitts neural network.

Code:

Expected Output:

LAB # 3
Objective: PERFORM XOR function to develop a MATLAB program to simulate a smart
home security system using a McCulloch-Pitts neural network to approximate the
XOR function.

Code:
Output:
LAB # 4
Objective: PERFORM a machine learning model using Python and a suitable library (e.g.,
TensorFlow, PyTorch, scikit-learn) to predict the sentiment (positive or negative) of movie
reviews.

Code:
Output:

LAB # 5
Objective: PRACTICE a program for solving linearly separable problem using Perceptron
Model

Output:
LAB # 6

Objective: PERFORM a program to a company’s access control system, employees need


both their access card and a biometric scan (e.g., fingerprint) to enter secure areas. Implement
a simplified version of this access control system using the AND function concept.

Code:

Output:
LAB # 7
Objective: PRODUCE Perceptron net for an AND function with bipolar inputs and targets.
Output:

LAB # 8
Objective: To IMPLEMENT a project on any topic object detection using roboflow
(open ended).

We chose the topic of SMART HOME AUTOMATION SYSTEM in which we were detecting
home objects .
LAB # 9
Objective: Outline the steps to IMPLEMENT instance segmentation using YOLOv8 and
Python.

Steps:
 Ensure that the Ultralytics package installed by running the following command in
notebook:

 Then, import the YOLO models factory object:

 Then, you need to instantiate the model, that will be used for predictions. I will use a
pretrained medium-sized model, shipped with YOLOv8, that can detect 80 object
classes. In contrast with object-detection models, the segmentation model names
have -seg suffix. So, if you need to load a medium-sized model for segmentation, you
need to specify yolov8m-seg.pt file.

 I will use the image with cat and dog, that named cat_dog.jpg and located in the
current folder with the notebook:

 Let's run the model to get segmentation results for this image:

The predict method for segmentation model works the same as for object detection model. It
returns an array of results for each image, specified in the method call. In this case, this
array contains a single item. Let's get it:
LAB # 10

Objective: CONSTRUCT to gain foundational knowledge in Artificial Neural Networks


(ANNs), explore diverse network types, comprehend neuron models, and grasp the
training/validation process using Python.

Understanding the Basics of Neural Networks:

 Learn the basic concepts of neural networks, including neurons, layers, activation functions, weights,
biases, and the feedforward process.
 Understand how neural networks are used for various tasks such as classification, regression, and
clustering.

Explore Neuron Models:


 Study different neuron models, including the perceptron, sigmoid neuron, ReLU (Rectified Linear Unit)
neuron, and others.
 Understand the mathematical formulation and behavior of each neuron model.
 Implement neuron models using Python to gain hands-on experience.

Learn about Diverse Network Types:

 Study different types of neural network architectures, such as feedforward neural networks (FNNs),
convolutional neural networks (CNNs), recurrent neural networks (RNNs), and generative adversarial
networks (GANs).
 Understand the structure and applications of each network type.
 Implement simple versions of each network type using Python frameworks like TensorFlow or
PyTorch.

Grasp the Training/Validation Process:

 Learn about the training/validation process for neural networks, including data preprocessing, model
training, validation, and evaluation.
 Understand concepts such as loss functions, optimization algorithms (e.g., gradient descent, Adam),
and backpropagation.

 Implement training/validation pipelines for neural networks using Python and popular machine
learning libraries.
Experiment with Real-world Datasets and Problems:

 Apply your knowledge to real-world datasets and problems to gain practical experience.
 Experiment with different network architectures, hyperparameters, and optimization strategies to
improve performance.
 Use Python libraries like scikit-learn, TensorFlow, or PyTorch to work with datasets and train models.

Stay Updated with Research and Best Practices:

 Stay updated with the latest research in the field of neural networks and deep learning.
 Follow tutorials, blogs, and research papers to learn about new architectures, techniques, and best
practices.
 Participate in online communities and forums to discuss ideas, ask questions, and collaborate with
others.

Build and Deploy Neural Network Applications:

 Once you have a solid understanding of neural networks and their applications, work on building and
deploying neural network applications.
 Develop projects that solve real-world problems, such as image classification, natural language
processing, or time series prediction.
 Deploy your models in production environments using frameworks like TensorFlow Serving or Flask.

LAB # 11

Objective: DESIGN and IMPLEMENT a recurrent neural network (RNN) in MATLAB and also
in Python.
Design and Implementation in MATLAB:

Design and Implementation in Python:


LAB # 12
Objective: To Adapts a high-quality training data that can be used to train and improve machine
learning models for tasks such as object detection, tracking, and activity recognition in videos.

Adapting high-quality training data for tasks such as object detection, tracking, and activity
recognition in videos involves several key steps. Here is a structured approach to ensure you have
high-quality data suitable for training and improving machine learning models:

1. Data Collection

 Source High-Quality Videos: Gather videos from reliable sources that are relevant to your
task. Ensure the videos are of high resolution and cover diverse scenarios.

 Diverse Environments: Ensure that your data includes various environments, lighting
conditions, and perspectives to make your model robust.

2. Data Annotation

 Labeling Tools: Use professional labeling tools like Labelbox, VGG Image Annotator (VIA), or
CVAT (Computer Vision Annotation Tool) to annotate your videos.

 Object Detection: Annotate bounding boxes around objects of interest in each frame.

 Tracking: Ensure that each object has a unique ID across frames to maintain consistency.

 Activity Recognition: Label sequences of frames with activity labels, indicating what action
or activity is being performed.

3. Data Augmentation

 Spatial Transformations: Apply transformations like rotation, scaling, translation, and


flipping to increase the diversity of your training data.

 Temporal Augmentation: Alter the frame rate, duplicate frames, or skip frames to simulate
different video recording conditions.

 Color Adjustments: Vary brightness, contrast, saturation, and hue to make the model robust
to different lighting conditions.

4. Data Quality Assurance

 Consistency Checks: Ensure that annotations are consistent across frames and videos.

 Validation: Manually review a subset of annotations to check for accuracy.

 Automated Checks: Implement scripts to check for common annotation errors such as
missing labels, overlapping bounding boxes, or incorrect IDs.

5. Data Splitting

 Training, Validation, and Test Sets: Split your data into training, validation, and test sets.
Ensure that each set contains a representative distribution of your data.

 Stratification: Maintain the same distribution of classes and activities in each split to avoid
bias.

6. Preprocessing
 Normalization: Normalize pixel values to a common range, typically [0, 1] or [-1, 1].

 Resize Frames: Resize frames to a consistent size that matches the input requirements of
your neural network.

 Frame Extraction: For activity recognition, extract frames at a consistent rate.

7. Data Storage and Management

 Efficient Storage: Store your data in a structured format like TFRecord (TensorFlow) or HDF5,
which allows efficient reading and writing.

 Metadata: Keep metadata files that describe your dataset, including annotation formats,
class labels, and any preprocessing steps.

8. Training and Evaluation

 Model Training: Use frameworks like TensorFlow, PyTorch, or Keras to build and train your
models.

 Hyperparameter Tuning: Experiment with different architectures, learning rates, batch sizes,
and other hyperparameters.

 Model Evaluation: Evaluate your models on the validation set using metrics like precision,
recall, F1-score, IoU (Intersection over Union), and mAP (mean Average Precision).

Example: Data Annotation and Preprocessing in Python

Here is a Python example that demonstrates basic data annotation loading and preprocessing for
object detection:

LAB # 13
Objective: Use Advance techniques (Time Series) of Neural Network to DESIGN prediction of gold
prices by using data set of 1970 to 2022 in MATLAB/Python. (Open Ended)
LAB # 14

Drone detection

INDEX code
Contact Section

About section
Evaluation metrics
Dataset
To initiate the object detection training for the Drone Detection System, I Utilized the
following dataset comprising images of Drones.

You might also like