This is an AI based project which bagged me “Best innovative project” where I built an expert system using JESS (Java expert system shell) , python and embedded it on to Raspberry pi. I used rain, soil moisture sensor to detect precipitation and servo motors to close or open windows. This project was inspired by 2015 IEEE paper “Design and implementation of rule-based uncertainty reasoning in Smart House” which gave me the idea to predict precipitation using Bayesian Network even when one of the sensors fail.
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Rule based expert system
1. Rule Based Expert System with uncertainty
management in Smart Homes
Team Members
o Abhay R Dixit - 1DS13CS003
o Abhishek Kori - 1DS13CS007
o Diksha Kushwaha - 1DS13CS034
o Varshini B. K. – 1DS13CS112
Under the guidance of
● Prof. Rashmi S R
2. Smart home
● A home equipped with lighting, heating, and electronic devices that can be controlled
remotely by smartphone or computer.
● Falls in the domain of IOT
● Sensor placed around the house for to sense the outer and inner environment
● All the sensors and electronic components are controlled by central processing and
control unit
3. Need for smart homes
● All the electronic devices are getting smarter and connected to the internet
● Advancement and digitalization of real estate sector
● Security and comfortable living
● Saves energy and cost of running house activities
● Personalised home living
4. Expert system
● A piece of software which uses databases of expert knowledge to offer advice or make
decisions
● It mimics a human expert
● Examples: Medical , Agriculture field
5. Rule based expert system
● A rule-based system is a set of "if-then" statements that uses a set of assertions, to
which rules on how to act upon those assertions are created.
Components
● Domain specific knowledge base
● Inference engine
● User Interface
6. Uncertainty
● The sensors and electronic appliances are exposed to nature and human interaction. They
are more likely to get damaged due and give wrong input
● The situations like sensor getting damaged , devices not able to connect to the internet
etc
● These situations collectively contribute to uncertainty situations
Need to solve uncertain situations
● The likelihood the uncertain situations is high
● Customers lose trust over the system
● Wrong decisions or no decisions may cause discomfort and in some cases it might be life
threatening
7. Problem statement
To build an smart system in a regular home which will react and take appropriate decisions to
changing environment and also counter uncertainty situations.
It should be
● Safe
● Dynamic
● Smart
● Adaptable
● Real time
8. Literature Review
“ Explicit Knowledge-based Reasoning for Visual Question Answering “ [1]
Pros:Recognising the question and answering it with reason.
Cons:The problem is that the amount of prior information that can be encoded within a LSTM system is very
limited
“Integration of Rule based and Case based Reasoning System to Support Decision Making “ [2]
Pros: Case Based Reasoning system. An approach has been made to develop a decision support system which will
take decision under complex environment.
Cons: The integration of raw facts and knowledge into a linking case base knowledge to enhance the potential of
the candidate system and to improve the probability of finding the correct measure.
“Detecting Inconsistencies in Rule-Based Reasoning for Ambient Intelligence” [3]
Pros: The purpose of this approach is to facilitate the creation of an information system for AmI using ontological
model and rule-based reasoning, in order to reduce the errors and encourage a more flexible prototyping process
Cons: little refactoring exists in models and rules, and expert-users often find themselves with redundancy between
the various rules’ content
9. “A Case-Based Reasoning System to Control Traffic at Signalized Intersections” [4]
Pros: Monitors , record and measure the traffic flow and regulates the signal
Cons: Initial knowledge is not available and and do not specify the correct source of knowledge
“A Rule-Based Tracking System for Video Surveillance Applications” [5]
Pros: Rule based object identification to help in monitoring video captured by security cameras
Cons: It’s very domain specific and can only focus on certain kind of situations
“Rule-Based Solution for Context-Aware Reasoning on Mobile Devices” [6]
Pros: Mobile computing devices which has even the knowledge of the context which it's currently present in
Cons: Modeling , representing and classifying context is a big challenge
“Considerations on uncertain spatio-temporal reasoning in smart home systems” [7]
Pros: Helps in assisting the elderly inside and promote over all healthy lifestyle
Cons: Inference and measurement of the environment by the hardware is still in its early stage
10. Implementation
Rule base and factbase
● Rule base and fact base are implemented in Java expert system shell (SHELL)
● What is JESS?
JESS execution Cycle
1. Match
2. Conflict
3. Act
JESS syntax
● (deftemplate <template-name> (slot <var-name>) (slot <var-name>) (slot <var-name>))
● (defrule <rule-name>
"<Brief description>"
(<Conditon or LHS>)
=>
(<Action or RHS>)
12. Bayesian Network
● is a probabilistic graphical model that represents a set of random variables and their
conditional dependencies via a directed acyclic graph
● Example: Rain , sprinkler, grass wet
13. Conditional probability
● Conditional probability is a measure of the probability of an event given that (by
assumption, presumption, assertion or evidence) another event has occurred.
Example taking from conditional probability table
● With conditional probability and table we can answer questions like
“What is the probability that it is raining, given the grass is wet?”
14. Overall process flow
1. Send sensor input to event detection module
2. Sense for any event (rain or no rain)
3. If detected assert the fact in fact base
4. Inference engine checks the rules for matching rule with fact in the fact base
5. If a rule is matched then RHS part of that rule gets executed
6. If there is uncertain condition go to Bayesian network , conditional probability module
to calculate the probability of rain
7. If the probability is more than the pre set threshold then assert its rain true else set false
in the fact base
8. Inference engine again scans through the rules for matching rules and executes the
respective RHS
9. Depending on the RHS part the action is sent to electromechanical unit
15. Rain Detection Sensor
● If there is no rain, the resistance between the wires will be very high and there will
be no conduction between the wires in the sensor.
● If there is rain, the water drops will fall on the rain sensor which will decrease the
resistance between the wires and wires on the sensor board will conduct
16. Soil Moisture Sensor
● The Soil Moisture Sensor uses capacitance to measure dielectric permittivity of the
surrounding medium.
● In soil, dielectric permittivity is a function of the water content.
● The sensor creates a voltage proportional to the dielectric permittivity, and therefore
the water content of the soil.
17. Raspberry Pi
● The Raspberry Pi is a low cost, single-board computer that is capable of doing
everything a desktop computer can to do
● It is very easy to interface hardware with raspberrry pi.
18. Servo Motors
● Servos are controlled by sending an electrical pulse of variable width, or pulse
width modulation (PWM), through the control wire.
● The PWM sent to the motor determines position of the shaft, and based on the
duration of the pulse sent via the control wire; the rotor will turn to the desired
position.
● For example, a 1.5ms pulse will make the motor turn to the 90° position. Shorter
than 1.5ms moves it in the counter clockwise direction toward the 0° position, and
any longer than 1.5ms will turn the servo in a clockwise direction toward the 180°
position.
20. Video stream : Video stream is a combination of various frames moving at a certain
speed.
Frame Processing , Key frames : All the frame are separated and and processed
separately, the important frames (key frames) are generated for the video.
Video Processing System: Object identification and annotation in the key frames are
done and their actions are noted down.
Facts Generation : Facts are generated depending on the object annotation.
Video Inference System : Inference is derived by checking the facts against the rules and
an action is decided upon.
Hybrid Knowledge Base : A theoretical framework capturing all the knowledge of the
system.
21. LabelMe - Annotation Tool
● The LabelMe annotation tool
provides a means for users to
contribute to the project.
● The tool can be accessed
anonymously or by logging in to
a free account.
● To access the tool, users must
have a compatible web browser
with javascript support.
● An XML code can be generate
that contain the data about the
annotated image.