Professional Documents
Culture Documents
Artificialreport
Artificialreport
INTERNSHIP REPORT
On
“AIML with Python”
Submitted in partial fulfilment for the award of degree
Submitted by:
ANISHA F KURUBAGOND
USN: - 2GO21CS004
Conducted at
FARMER COIN
Department of CSE
Government Engineering College
HAVERI-581110
Internship Report on AIML with Python
Table of Contents
2 About Department 5
3 Introduction 11
4 Task Performed 17
5 Reflection 24
6 Conclusion 32
7 Bibliography 33
CHAPTER-1
Farmercoin Smart Robotic Solution is a company developed from industry research and
academic experienced persons. The company got established in the year 2020 taking
motivation from a 5-year proprietorship from BCSP. The BCSP is a proprietorship MSME
that designs and fabricates PCBs that is located in an industrial area, Hubballi. We are well-
versed in a IOT, Machine\ Deep learning models, Data analysis, networks, databases,
embedded systems, monitoring devices and electric vehicles. We use this expertise to help
customers with small to mid-sized projects.
The company has evolved with multi-disciplined personalities that come from
Biotechnology, Electronics, Computers, Robotics, and Chemistry with a dream of providing
remarkable benefits to society and serving it.
The company focuses on quality, backed by robust tools and methodologies that ensures
the ability to:
Vision: To provide Better monitoring devices for wellbeing for all, now and for future
generations
Mission: To lead research and development of modern days robotics, healthcare and
information technology to provide world-class experience on fingertips to our customers
CHAPTER -2
About Department
Home and office security systems are an essential investment for anyone who wants to keep
their property and assets safe. These systems typically include a combination of sensors,
cameras, alarms, and control panels that work together to detect and deter intruders. Here are
some key considerations when choosing a home or office security system:
Type of system: There are several types of security systems, including wired, wireless, and
hybrid systems. Wired systems are typically more reliable but can be more difficult to install.
Wireless systems are easier to install but can be less reliable if there are signal issues. Hybrid
systems combine the best of both worlds.
Monitoring: You'll also need to decide whether you want your security system to be
monitored or not. Monitored systems are connected to a monitoring center that will alert the
authorities if an alarm is triggered. Unmonitored systems will only sound an alarm, and it's up
to you or someone else to respond.
Features: Consider what features you need in a security system. For example, some systems
have motion sensors that can detect movement and alert you when someone is in your home
or office. Others have cameras that can capture footage and send it to your phone or
computer.
Cost: Security systems can vary greatly in cost, depending on the type of system, the
features, and whether it's monitored or not. Be sure to consider the upfront costs as well as
any ongoing monitoring fees.
Installation: Some security systems can be installed by the homeowner or office manager,
while others require professional installation. Consider your skills and experience before
deciding which system is right for you.
Night vision assistance refers to tools or technologies that can help people see in low-light or
dark environments. Here are some common examples:
Infrared cameras: Infrared cameras use heat signatures to create an image, allowing the user
to see in complete darkness.
Flashlights: Flashlights with a high lumen output can provide bright illumination in low-light
environments.
Thermal imaging cameras: These cameras detect heat signatures, allowing the user to see
objects even in complete darkness.
Low-light binoculars: Binoculars with low-light capabilities can provide better visibility in
dark environments.
Intelligent transportation systems (ITS): These systems use connected sensors, cameras,
and data analytics to monitor traffic flow, detect accidents or hazards, and provide real-time
information to drivers. highways
Electric vehicle (EV) charging infrastructure: Smart roads can include charging stations
for electric vehicles, which can help promote the use of EVs and reduce greenhouse gas
emissions.
Smart lighting: LED lighting systems that are connected to a network can be controlled
remotely, adjusting brightness or turning on and off according to traffic flow or weather
conditions.
Solar roads: Solar road technology integrates photovoltaic cells into the road surface,
generating renewable energy to power streetlights or nearby buildings.
Smart pavement: Advanced pavement materials can be used to improve durability and
reduce maintenance costs, while also providing real-time information on traffic flow and
weather conditions.
Smart contracts: Smart contracts are self-executing contracts with the terms of the
agreement written into code. They can be used to automate certain processes in the supply
chain, such as payments or quality control checks.
Quality control: Blockchain can be used to ensure that quality control standards are met
throughout the supply chain. For example, sensors or IoT devices can be used to monitor
temperature and humidity levels during transport and storage, with the data being recorded on
the blockchain.
Payments and financing: Blockchain can be used to streamline payments and financing
throughout the supply chain. Smart contracts can be used to automatically release payments
when certain conditions are met, such as the delivery of goods to a certain location.
Mobile robots are increasingly being used in agriculture to improve efficiency and reduce
labor costs. Here are some ways in which mobile robots can be used in the agriculture field:
Crop monitoring: Mobile robots equipped with sensors and cameras can be used to monitor
crops, collecting data on growth, soil moisture, and other factors. This information can help
farmers make more informed decisions about irrigation, fertilization, and pest control.
Crop spraying: Robots can be used to spray crops with pesticides or fertilizers, reducing the
need for human labor and improving precision.
Harvesting: Mobile robots can be used to harvest crops such as fruits, vegetables, and nuts,
which can be time-consuming and labor-intensive for human workers.
Weeding: Robots can be used to identify and remove weeds from crop fields, reducing the
need for herbicides and manual labor.
Soil analysis: Mobile robots can be used to collect soil samples and analyze them for nutrient
levels, pH, and other factors. This information can be used to optimize fertilization and crop
yields.
Vision-based cotton plant health monitoring is a technique that uses computer vision and
machine learning to analyze images of cotton plants and identify any signs of stress, disease,
or damage. Here's how it works:
Data collection: High-resolution images of cotton plants are collected using cameras
mounted on drones or ground-based vehicles. These images capture the visible and near-
infrared spectra, which can provide valuable information about the health and vitality of the
plants.
Image processing: The images are processed using computer vision algorithms to extract
features such as leaf area, chlorophyll content, and leaf angle. These features are then used to
calculate indices such as the normalized difference vegetation index (NDVI) or the green
normalized difference vegetation index (GNDVI).
Machine learning: Machine learning algorithms are used to analyze the indices and detect
any signs of stress or disease in the plants. The algorithms can be trained on a dataset of
healthy and stressed plants, allowing them to accurately identify the presence and severity of
any issues.
Actionable insights: The output of the analysis can provide farmers with actionable insights,
such as the need for targeted irrigation, fertilization, or pest control measures. This can help
farmers optimize their crop yields while reducing costs and environmental impact
CHAPTER-3
INTRODUCTION
Introduction Artificial Intelligence (AI) and Machine Learning (ML) stand at the forefront of
technological innovation, driving advancements across a vast array of sectors. AI refers to the
simulation of human intelligence in machines that are programmed to think and learn like
humans. The scope of AI encompasses various technologies, including machine learning,
natural language processing, robotics, and computer vision. Machine Learning, a subset of
AI, focuses on the development of algorithms that can learn from and make predictions or
decisions based on data. ML enables computers to access hidden insights without being
explicitly programmed where to look.
In recent years, AI and ML have evolved from theoretical concepts to practical tools that
solve complex problems and enhance efficiency in industries such as healthcare, finance,
agriculture, and automotive, among others. The ability of AI and ML technologies to analyze
large volumes of data and automate tasks has revolutionized the way organizations operate,
leading to improved outcomes and innovative solutions.
The ability of AI and ML to process and analyze data at an unprecedented scale also plays a
pivotal role in addressing global challenges, such as climate change, by providing insights
that can lead to sustainable solutions. Moreover, these technologies are fostering innovation
in the field of natural language processing, making human-computer interactions more
intuitive and enhancing accessibility to digital technologies.
The primary objective of the one-month internship at FarmerCoin for students in their 4th
semester is to equip them with practical knowledge and hands-on experience in AI and ML.
By integrating academic learning with real-world applications, the internship aims to:
2. Problem-Solving Experience: Engage students in projects that require them to apply their
AI and ML knowledge to address real-world challenges, particularly in the context of
FarmerCoin's focus areas. This will help students develop critical thinking and problem-
solving skills.
5. Preparation for Future Careers: Prepare students for future roles in the rapidly evolving
field of AI and ML, equipping them with the skills and experience necessary to contribute to
the advancement of technology and society.
The field of Artificial Intelligence (AI) and Machine Learning (ML) encompasses a broad
range of technologies, concepts, and methodologies that have seen significant advancements
in recent years. This section provides an overview of the key concepts, technologies, and
frameworks relevant to the projects undertaken during the internship at FarmerCoin, along
with a summary of recent advancements and a review of pertinent literature.
• Supervised Learning: A machine learning technique where models are trained on labeled
data, learning to predict outcomes for new, unseen data based on that training. Key
algorithms include linear regression for continuous outcomes and logistic regression, decision
trees, and neural networks for categorical outcomes.
• Unsupervised Learning: This technique involves training models on data without labeled
responses, enabling the discovery of patterns or structures within the data. Common methods
include clustering (e.g., k-means, hierarchical clustering) and dimensionality reduction
techniques (e.g., Principal Component Analysis - PCA).
• Neural Networks and Deep Learning: At the core of many recent AI advancements,
neural networks, particularly deep learning models, are capable of learning complex patterns
in large datasets. Frameworks like TensorFlow and PyTorch have become standard tools for
developing these models.
Python is a programming language that lets you work quickly and integrate systems
more efficiently. Python was designed for readability, and has some similarities to the
English language with influence from mathematics. Python uses new lines to
complete a command as opposed to other programming language which often use
semicolons or parentheses.
The most recent major version of Python is Python 3, which we shall be using in this tutorial.
Python can be used on a server to create web applications. It can be used along side software
to create workflows. It can connect to database system and also read and modify files.
Python can be used to handle big data and perform complex mathematics. It can be used for
rapid prototyping, or for production ready software development. It works on different
platforms (Windows, Mac, Linux, Raspberry Pi, etc). It runs on an interpreter system,
meaning that code can be executed as soon as it is written. This means that prototyping can
be very quick.
1. Web development : Web framework like Django and Flask are based on Python. They
help you write server side code which helps you manage database, write backend
programming logic, mapping urls etc.
2. Machine learning : There are many machine learning applications written in Python.
Machine learning is a way to write a logic so that a machine can learn and solve a particular
problem on its own. For example, products recommendation in websites like Amazon,
Flipkart, eBay etc. is a machine learning algorithm that recognises user’s interest. Face
recognition and Voice recognition in your phone is another example of machine learning.
3. Data Analysis : Data analysis and data visualisation in form of charts can also be
developed using Python.
4. Scripting : Scripting is writing small programs to automate simple tasks such as sending
automated response emails etc. Such type of applications can also be written in Python
programming language.
7. Desktop applications :You can develop desktop application in Python using library like
TKinter or QT.
Literature and Studies Review : The literature relevant to the projects undertaken during the
internship encompasses a wide array of studies and papers. Key references might include:
• "Deep Learning" by Ian Goodfellow, Yoshua Bengio, and Aaron Courville: This co
• "Case studies on the use of unsupervised learning in data analysis" Such studies
demonstrate the power of unsupervised learning techniques in uncovering hidden patterns in
data without the need for labeled datasets. This literature and the ongoing research in the field
have informed the projects undertaken during the internship, providing both theoretical
underpinnings and practical examples of AI and ML applications. The internship projects
aimed to apply these concepts and technologies to address specific challenges, leveraging the
latest advancements in the field to develop innovative solutions
3. Decision Trees: A model that uses a tree-like graph of decisions and their possible
consequences, including chance event outcomes, resource costs, and utility. It's used for both
regression and classification tasks.
4. Support Vector Machines (SVM): A powerful classification technique that finds the
hyperplane that best separates data into two classes in a high-dimensional space.
5. Random Forests: An ensemble learning method for classification and regression that
operates by constructing a multitude of decision trees at training time and outputting the class
that is the mode of the classes (classification) or mean prediction (regression) of the
individual trees.
1. Q-Learning: It's considered one of the simplest forms of reinforcement learning and is
used to inform decisions by estimating the utility of action-state pairs.
2.Deep Q-Network (DQN): It combines Q-learning with deep neural networks at scale,
enabling the learning of successful policies directly from high-dimensional sensory inputs
through end-to-end reinforcement learning.
CHAPTER-4
Task Performed
4.1 Assignments
T1
CHAPTER-5
Reflection
import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Load customers data
customersdata = pd.read_csv("D:\\ML_project\\customers-data - customers-
data.csv")
# Select relevant columns for clustering
data = customersdata[['products_purchased', 'complains', 'money_spent']]
# Determine the optimal number of clusters using the elbow method
inertias = []
for k in range(1, 11):
kmeans = KMeans(n_clusters=k, init='k-means++', max_iter=400,
random_state=42, n_init=10) # Explicitly set n_init
kmeans.fit(data)
inertias.append(kmeans.inertia_)
# Plot the elbow method graph to find the optimal number of clusters
plt.figure(figsize=(8, 6))
plt.plot(range(1, 11), inertias, marker='o', linestyle='--')
plt.title('Elbow Method for Optimal Number of Clusters')
plt.xlabel('Number of Clusters')
plt.ylabel('Inertia')
plt.grid()
plt.show()
# Based on the elbow method, let's choose K=3 as the optimal number of
clusters
optimal_k = 3
x = customersdata['products_purchased']
y = customersdata['complains']
z = customersdata['money_spent']
c = clusters
plt.show()
import joblib
import pandas as pd
import sys
import os
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton,
QVBoxLayout, QWidget, QLabel, QLineEdit, QMessageBox, QTextEdit,
QHBoxLayout
import subprocess
class VirtualEnvActivatorApp(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setWindowTitle("ML App")
self.setGeometry(100, 100, 400, 200)
self.activate_button.clicked.connect(self.activate_and_open_new_window)
def activate_virtualenv(self):
# Replace 'your_virtualenv_path' with the actual path to your
virtual environment
virtualenv_path = "D:\\myenv"
activate_script = os.path.join(virtualenv_path, 'Scripts',
'activate')
if os.path.exists(activate_script):
try:
# Use a subprocess to activate the virtual environment
#subprocess.Popen(f'cmd.exe /K {activate_script}',
shell=True)
pass
except Exception as e:
QMessageBox.warning(self, "Activation", f"Error activating
virtual environment: {e}")
else:
QMessageBox.warning(self, "Activation", f"Virtual environment
'{virtualenv_path}' not found.")
def activate_and_open_new_window(self):
self.activate_virtualenv()
self.open_new_window()
def open_new_window(self):
self.new_window = NewWindow()
self.new_window.show()
class OutputWindow(QWidget):
def __init__(self, output_text):
super().__init__()
self.setWindowTitle("Output Window")
self.setGeometry(500, 400, 1000, 600)
layout = QVBoxLayout()
self.output_textedit = QTextEdit(self)
self.output_textedit.setPlainText(output_text)
self.output_textedit.setReadOnly(True)
layout.addWidget(self.output_textedit)
self.setLayout(layout)
class NewWindow1(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("Weight Estimator")
self.setGeometry(600, 400, 800, 400)
layout = QVBoxLayout()
# Gender Input
gender_layout = QHBoxLayout()
gender_label = QLabel("Gender:")
self.gender_input = QLineEdit()
gender_layout.addWidget(gender_label)
gender_layout.addWidget(self.gender_input)
layout.addLayout(gender_layout)
# Height Input
height_layout = QHBoxLayout()
height_label = QLabel("Height:")
self.height_input = QLineEdit()
height_layout.addWidget(height_label)
height_layout.addWidget(self.height_input)
layout.addLayout(height_layout)
# Run Button
self.run_button = QPushButton("Run", self)
self.run_button.clicked.connect(self.run_script)
layout.addWidget(self.run_button)
self.setLayout(layout)
def run_script(self):
file_path = "D:\\ML_project\\HeiWei_Linear_Reg.py"
try:
with open(file_path, 'r') as file:
code = file.read()
self.python_code = code
if hasattr(self, 'python_code'):
gender = self.gender_input.text()
height = self.height_input.text()
except Exception as e:
self.show_error_dialog(str(e))
else:
self.show_error_dialog("Please enter values for both
gender and height.")
else:
self.show_error_dialog("Please select a Python file ")
except FileNotFoundError:
self.show_error_dialog(f"File not found: {file_path}")
original_stdout = sys.stdout
sys.stdout = StringIO()
try:
exec(code, globals_dict)
except Exception as e:
return str(e)
finally:
captured_output = sys.stdout.getvalue()
sys.stdout = original_stdout
return captured_output
class NewWindow2(QWidget):
self.script_path = script_path
layout = QVBoxLayout()
self.setLayout(layout)
def run_python_script(self):
if self.script_path:
try:
with open(self.script_path, 'r') as file:
code = file.read()
exec_globals = {}
captured_output = self.capture_output(code, exec_globals)
#self.open_output_window(captured_output)
except Exception as e:
self.show_error_dialog(str(e))
else:
self.show_error_dialog("Please specify the path to the Python
script to run.")
original_stdout = sys.stdout
sys.stdout = StringIO()
try:
exec(code, globals_dict)
except Exception as e:
return str(e)
finally:
captured_output = sys.stdout.getvalue()
sys.stdout = original_stdout
return captured_output
class NewWindow(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
layout = QVBoxLayout()
self.setLayout(layout)
def open_window1(self):
self.window1 = NewWindow1()
self.window1.show()
def open_window2(self):
# Specify the path to the Python script you want to run
script_path = "D:\\ML_project\\k-Means_Customer_Analysis.py" #
Replace with the actual path
self.window2 = NewWindow2(script_path)
self.window2.show()
def main():
app = QApplication(sys.argv)
window = VirtualEnvActivatorApp()
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
CONCLUSION:
The project involved analysis of height-weight of the particular customers and customer data
analysis with proper data processing. By using this we get the following outputs:
Predicted weight
Product purchased
Complains
Money spent
Optimal number of clusters
This internship has been an excellent and rewarding experience. I can conclude that there
have been a lot I`ve learnt from my work at internship. Needless to say, the technical aspects
of the work I`ve done are not flawless and could be improved provided enough time. As
someone with no prior experience with AI and ML. Whatsoever I believe my time spent in
research and discovering it was well worth it and contributed to finding an acceptable
solution to build a fully functional real time application. The things that I`ve learned the
importance of our time-0management skills, self-motivation and ability to learn new things.
BIBILOGRAPHY:
Website:
1.https://www,datacamp.com/corses/intro-topython-for-data-science
2.https://developers.google.com/edu/python
3.www.books.google.co.in
4.www.aimlworld.com
5.www.w3school.com
Reference Book: