Fuzzy Cyber Physical Pet Care Systems Chris Thomas Computing Generations 1st Generation: 1945-1955 Vacuum tube computers Used magnetic drums. Almost impossible to program, very slow 2nd Generation: 1955-1965 Programming languages, assembly language

Transistors, magnetic core memory 3rd Generation: 1965-1970s Quartz clocks, integrated circuits, operating systems 4th Geneation: 1970s-2000s VLSI, Chips, General Consumer Usage, Networks 5th Generation: 2000s-Now Mobile computer revolution, touch screen phones, wireless capabilities

6th Generation: 2010s-? Internet Of Things / Cyber Physical Systems Cyber Physical Systems Tight coupled combination of and coordination between the systems numerous (usually) distributed computational and physical elements Cyber Physical Systems use computation and communication embedded in and interacting with physical processes to extend new capabilities to existing physical systems

Defining Characteristics of CPS Cyber capabilities in almost every physical component of system Networked at multiple scales Multiple temporal and spatial scale interactions Intelligent behaviors, dynamic reconfigurability Highest degrees of automation possible Some CPS explore unconventional computational substrates Attempt to combine physical and computational domains Computational materials clothing?

A cyber physical system integrates computing, communication, and storage capabilities with the monitoring and control of physical entities dependably, safely, securely, efficiently, and in real-time. Wireless Sensor Networks Highly distributed networks of small, lightweight wireless nodes Usually deployed in large numbers over a dispersed region Sensors monitor the environment, by measuring physical parameters such as temperature, pressure, and humidity May be randomly deployed (but not necessarily)

Usually rely on peer-to-peer communication rather than global communication with a central server (making local decisions) Distributed synchronization Real-time communication Power consumption is a huge issue (many are battery Reasoning Under Uncertainty How can we use the sensor information to make decisions?

Sensor data can be noisy Sensors are usually not binary (provide a continuous valued reading) Impossible to cover all cases using exhaustive rules One answer: Machine Learning approaches This has its drawbacks.. ML models take training data and generate opaque models themselves For simpler problems, is this really necessary? Can we combine human like intuitions with traditional if-then

logic? Fuzzy Logic Created in 1965 by Lotfi Zadeh A superset of conventional (Boolean) logic that has been extended to handle the concept of partial truth The central notion in fuzzy systems is that truth values (or membership values in fuzzy sets) are indicated by a probability value in the range [0.0, 1.0]. IF-THEN rules have long been used in A.I. systems, but such systems dont deal

with fuzzy consequents and fuzzy antecedents? Its not always clear that in the statement IF p THEN q, that p is true or false? How do we reason under uncertainty in these situations? Using manually crafted IF-THEN rules allows experts to express their intuitions to the system naturally in a way ML doesnt Thus, the focus on fuzzy logic is on significance rather than precision Fuzzy logic is a convenient way to map an input space into an output space using human notions and intuitions while factoring in uncertainty Fuzzy Sets

Membership Function The Membership Function defines how every input point is mapped to the membership value (between 0 and 1). Membership Functions Classical Set Definition: Fuzzy Set Definition: X is the universe of discourse (ex, set of all integers) is the membership function of x in the fuzzy set A. The membership function maps x to a membership value between 0 and

1. Basic Fuzzy Logic Operations Fuzzy Set Operations (Union) Fuzzy set operations are defined by a binary mapping function which takes as input the items from the two input sets and maps their inputs into a single set. The membership function of A union B on x is defined by the binary mapping S which takes as inputs xs membership values in set A and B

How the binary mapping function is defined is up to the designer It must follow the following properties, however: Boundary: S(1,1) = 1, S(a,0) = S(0, a) = a.

Monotonicity: S(a,b) <= S(c,d) if a is <= c and b <=d Communitavity: S(a,b) = S(b,a) Associativity: S(a, S(b,c)) = S(S(a,b), c) Fuzzy Logic Systems Knowledge-based on rule-based systems The knowledge base consists of numerous fuzzy IF-THEN rules Assume our knowledge base has the following rules: Rule 1: If service is poor or food is rancid, then leave a cheap tip. Rule 2: If the service was good, then leave an average tip. Rule 3: If the service is excellent or the food is delicious, then leave a generous

tip. Given available inputs, service or food, we need to make a decision on the amount of tip to leave. Lets say our tip amount can be from 525%. Lets assume that the user ranks their service and food on a scale from 0 to 10 Note The inputs here are crisp numbers (non-fuzzy) and need to be fuzzified Step 1: Fuzzify The Inputs We need to take each input and compute the fuzzy values for each of the membership functions (delicious and rancid

for food and poor, good, and excellent for service) Lets assume we rate service = 3 and food = 8. Step 2: Apply the Fuzzy Operator(s) We need to determine the antecedent value for each of the rules, that is for each fuzzy rule: IF p then Q p needs to have a single value (the antecedent) If p has more than one fuzzy value (for instance a OR b) we need to fuzzy OR them To do this, we apply the fuzzy operator(s) defined in the rule

Step 3: Apply Implication Method Rules may have different weights from 0 to 1. In this case, they are all 1. The consequent is a fuzzy set itself represented by a membership function defined semantically as a mapping from the antecedent. Step 4: Aggregation Step 5: Defuzzify Step 4 produced an aggregate output set, which was a range of

output values. However, we need a tip percentage from this. The input to the defuzzification process is a fuzzy set, and the output is a single number. There are numerous methods that can be used to defuzzify: centroid, bisector, middle of maximum, largest of maximum, smallest of maximum, etc. Centroid is the most popular and is

thus the one shown below: Fuzzy Pet Care Intelligent Pet Door The authors construct three applications using a shared fuzzy database Intelligent Pet Door WSN modules provide owner with temperature and humidity data Light motion sensors are on the top of the pet door to detect whether the pet is entering or exiting The pet wears a tag on its collar that broadcasts its ID to pet door every 20 seconds.

A radio runtime measure is used by pet door to determine distance of pet collar The control system contains the fuzzy logic rules specified by the user. For instance, no pet is allowed to go outside on a rainy day. Whether the pet is allowed in or out depends on all the factors considered by FIS Fuzzy Pet Care Intelligent Pet Feeder Pet feeders are havens for crawling insects, such as ants Wet pet food cannot be left out because it spoils soon after being put out The authors design a pet feeder which has a bowl cover which

opens and closes automatically. Infrared sensor detects pet request for access is sent to fuzzy logic engine Fuzzy logic system can either grant or deny access based on prior info and rules Allows users to create time schedules for eating, which pets may each from that pet feeder, how long they may eat from it at any one period, etc. If the time schedule is used, music can call the pet to the pet feeder when it is time to eat

Fuzzy Location Aware Algorithm We want to find out if the pet is straying from home (enters a critical region far enough away from the beacon to trigger an alarm) We also want to minimize the number of messages that the pets collar needs to send The server will poll the pets collar dynamically based on distance to critical region and current speed of the pet Minimize the number of messages the collar sends dynamically: Using the last two sample points, determine the speed on the pet

Using the pets current speed, determine the amount of time necessary for the pet to travel from its current position to the critical region. The critical region begins at distance R from the beacon node Dynamically update the sampling rate so that the pet will not make it to the critical region before the next poll for location is broadcast The update sampling rate is determined with Fuzzy inference Fuzzy Location Aware Algorithm The inference engine sets up fuzzy rules for tracking the target

node based on the following information: Distance between the pet and the critical region (the closest point of the critical region) The stationary time of the pet The relative velocity of the pet Here the antecedent is the distance between target node and critical point The consequent is estimated time before the node reaches the critical point

References For the Pet Care Appliance of Location Aware Infrastructure on Cyber Physical Systems Introduction to Cyber Physical Systems - Yuping Dong Cyber-Physical Systems: Issues and Challenges Rabi N. Mahapatra Introduction to Wireless Sensor Networks: Peyman Teymoori Matlab Tutorial: About Fuzzy Logic