UNIVERSITY OF TECHNOLOGY, SYDNEY FACULTY OF ENGINEERING AND INFORMATION TECHNOLOGY 49275 NEURAL NETWORKS AND FUZZY SYSTEMS ASSIGNMENT 2 QUESTION ONE [ Character recognition ] [ 50 marks ] This problem is a variation of a pattern recognition problem presented by Widrow and Hoff in 1960. It is a simple symbol recognition problem with three letters T, G and F, in an original form and in a shifted form as shown in Figure 1b. The 6 input vectors 6 5 4 3 2 1 , , , , , x x x x x x and the corresponding target vectors 6 5 4 3 2 1 , , , , , d d d d d d in the training set are:                                                              1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x                                                          1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 x                                                             1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 x                                                              1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 x                                                          1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 x                                                             1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6 x              1 1 1 1 d ,              1 1 1 2 d ,              1 1 1 3 d ,              1 1 1 4 d ,              1 1 1 5 d ,              1 1 1 6 d Assume that the network has 2 hidden layer neurons and all continuous perceptrons use the bipolar activation function f e e 2 1 1 ()         . Note that due to the necessary augmentation of inputs and of the hidden layer by one fixed input, the trained network should have 17 input nodes, 3 hidden neurons, and 3 output neurons. Assign -1 to all augmented inputs. 1.1 Assume that the learning constant is 2 . 0   , and the initial random output layer weight matrix W() 1 and hidden layer weight matrix W () 1 are                6428 . 0 5242 . 0 2137 . 0 9630 . 0 7826 . 0 5377 . 0 0871 . 0 0280 . 0 9003 . 0 ) 1 ( W  ) 1 ( W               4556 . 0 6026 . 0 7222 . 0 6263 . 0 8842 . 0 1795 . 0 8709 . 0 6475 . 0 8436 . 0 2309 . 0 2076 . 0 5945 . 0 9803 . 0 2943 . 0 7873 . 0 8338 . 0 1886 . 0 4764 . 0 5839 . 0 1106 . 0           3626 . 0 6762 . 0 5947 . 0 6924 . 0 0680 . 0 1098 . 0 9695 . 0 9607 . 0 3443 . 0 0503 . 0 1627 . 0 8636 . 0 4936 . 0 6024 . 0 Using the error back propagation training, calculate the next weight updates W W (),() 22. [ 20 marks ] 1.2 The above training set was trained with the same set of initial random output layer weight matrix W() 1 and hidden layer weight matrix W () 1 as above, and a learning constant of 2 . 0   . The training set was recycled when necessary. Determine the final weight matrices ) 1201 ( W Wf  and ) 1201 ( W Wf  after 200 cycles. Plot the cycle error curve for this training exercise. [ 20 marks ] One of the test character, which is shown below, has the following feature input vector:                                                            1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x Calculate the output vector z which is generated from the above feature input vector. How would the neural network classify this feature input vector? Describe how the above character recognition system can be improved using a validation set. Propose a reasonable validation set. [ 10 marks ] Figure 1a Multilayer Neural Network Figure 1b Training Set QUESTION TWO [Truck-Backer Upper Control] [ 50 marks ] Backing up a truck to a loading dock is a nonlinear control problem. The truck and loading zone are shown in Figure 2.1. The truck position is exactly determined by the three state variables ,, x y where  is the angle of the truck with the horizontal. Control to the truck is the angle  . Only backing up is considered. The truck moves backward by a fixed unit distance every stage. For simplicity, assume that there is enough clearance between the truck and the loading dock such that y does not have to be considered as an input. The task here is to design a control system, whose inputs are     90270020 ,,, x and whose output is   4040 , such that the final stages will be      90 , 10 , f f x  . The dynamics of the truck backer-upper procedure can be approximated by:                           b k k k k k k k k y k y k k k k k x k x )] ( sin[ 2 sin ) ( ) 1 ( ) ( cos ) ( sin ) ( ) ( sin ) ( ) 1 ( ) ( sin ) ( sin ) ( ) ( cos ) ( ) 1 ( 1            where b is the length of the truck. Assume that b  4. Fuzzy logic is required for this truck backer-upper control. In this simple fuzzy logic controller, a set of linguistic variables is chosen to represent 5 degrees of truck angle   error   907090110270 ,,,, , 5 degrees of truck position  x error  07101320 mmmmm ,,,, , and 5 degrees of control angle        401001040 ,,,, as shown in Figure 2.2. The generic rule set in the form of "Fuzzy Associative Memories" is shown in Figure 2.3. The initial states of this truck are assumed to be ) 10 , 5 . 12 , 75 ( )) 1 ( ), 1 ( ), 1 ( ( m m y x    . 2.1 If the Centre of Area (COA) defuzzification strategy is used with the fire strength i of the i-th rule calculated from    iXX ii x x  min((),()) 12 12 determine the defuzzified control angle ) 1 (  and the next state )] 2 ( ), 2 ( ), 2 ( [ y x  . [ 20 marks ] 2.2 If the Mean of Maximum (MOM) defuzzification strategy is used with the fire strength i  of the i-th rule calculated from ) ( ). ( 2 1 2 1 x x i i X X i     determine the defuzzified control angle ) 1 (  and the next state )] 2 ( ), 2 ( ), 2 ( [ y x  . Then continue and calculate ) 2 (  and )] 3 ( ), 3 ( ), 3 ( [ y x  . Write a computer program to calculate the system state vector )] 1 ( ), 1 ( ), 1 ( [    k y k k x  and the defuzzified control angle ) (k  for 100 consecutive sampling points. Plot the corresponding vertical truck position ) (k y against the horizontal truck position ) (k x for these 100 sampling points. Plot the defuzzified control angle ) (k  for these 100 sampling points. [ 20 marks ] Find the dominant rule which contributes the highest fire strength to the control action for the defuzzified control angle ) 1 (  . If softer control action (for slower response) is required, modify this dominant rule and recalculate the new defuzzified control angle ) 1 ( *  and the next state vector )] 2 ( ), 2 ( ), 2 ( [ y x  . Using the modified FAM table, plot the corresponding vertical truck position ) (k y against the horizontal truck position ) (k x for these 100 sampling points. Plot the new defuzzified control angle ) ( * k  for these 100 sampling points. [ 10 marks ] Figure 2.1 Diagram of truck and loading zone Figure 2.2 Membership functions of a truck backer-upper system Figure 2.3 Generic Fuzzy Associative Memories H.T. NGUYEN April 2017 MARKING SCHEME Assignment 2: Neural Networks and Fuzzy Logic Student Name: ____________________ Mark: ___________ Requirement Criteria Comment Standard “Declaration of Originality” cover page as provided by the Faculty At front of report, completed and signed Yes/no Question 1 1.1 Neural Network: Back Propagation  Presentation  ) 2 ( W  ) 2 ( W  Calculation/software code /20 Question 1 1.2 Neural Network: Training and Test  Presentation  ) 1201 ( W  ) 1201 ( W  Cycle error curve  Software code  Classify the test character  Discussion /30 Section 2 2.1 Fuzzy Logic: COA defuzzification  Fuzzification  Combined fuzzy inference  Moment calculation  Area calculation  Defuzzified control angle ) 1 (   Next state vector )] 2 ( ), 2 ( ), 2 ( [ y x  /20 Section 2 2.2 Fuzzy Logic: MOM defuzzification  Fuzzification  Defuzzified control angle ) 1 (  and next state vector )] 2 ( ), 2 ( ), 2 ( [ y x   ) 2 (  and )] 3 ( ), 3 ( ), 3 ( [ y x   Truck position plot and defuzzified control angle plot (100 points)  Software code  Dominant rule  Modified FAM Table  New defuzzified control angle ) 1 ( *   New truck position plot and defuzzified control angle plot (100 points)  Software code /30