Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Sensor performance using neural network

Status
Not open for further replies.

Raff

Newbie level 4
Joined
Mar 22, 2011
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,337
Hello. I have constructed a neural network by using Matlab software. I got a data from 2 sensors which is ultrasonic sensor and distance sensor. These two sensor will give an ouput voltage for distance measurement. So i want to evaluate the sensor performance by using neural network. The algorithm that i use is LM algorithm. As i know, 80% of input data is for training and the other 20% is for testing.

By using NN i want to evaluate an error between sensor value and real value/measured value. For example, sensor value is 50cm but the estimate value is 48cm. How to evaluate this error to check the performance of the sensor?
1. Should i take all the sensor value to input data and the output/target data is real value/measured value or
2. 80% sensor value to input data and the other 20% for output?

Thanks.
 

Dear friend;
What you mean while saying “evaluate the sensor performance by using neural network” and “to evaluate an error”. Its sound comes to me a little bit strange.
But if you want to make an estimator which converts sensor analog output to distance measurement, then it is an application of NN.
To do so you should follow method 1. Apply analog measurements as input, and real physical measurement values as targets. Keep the train and test ratios as you stated (80% to 20%), it is quite reasonable.
I think you should chose linear output neurons in your NN.

Good luck
 

Thanks for reply emresel,
I have converts sensor analog output to distance in cm by using c program and used the value in 'cm' for NN. I have a little bit confused how to compare sensor value and measurement value by using NN. I did like this for NN.
1. Input data set = sensor value
2. Output data set = measurement value
Is this right?
Thanks for advice
 

Hi Raff;
As i undertsand;
You can convert analog value to cm by a C program. Right?
Then you have a measured value by your sensor and corresponding actual value (ie measured by a ruler).
ie actual measurement (with a ruler) is 49cm, your sensor output is (converted by C program) 51cm (introducing some error).
OK in this case what do you want to apply with NN?
Could you please explain more specifically? May be then can help you more specifically.
 
  • Like
Reactions: Raff

    Raff

    Points: 2
    Helpful Answer Positive Rating
Yes emresel. I did like that.
There sensor output and actual value is taken from 0cm until 110cm and have an error between sensor output and actual measurement when the distance increased.
Can i use neural network to get the sum square error(sse) so it can verify the performance of the sensor? Is this reliable by using neural network?
Thanks a lot.
 
Last edited:

Dear friend;
I can say that;
Apply sensor output values (in cm) as inputs
Actual measerement values as targets and train your NN. So that you can use it to correct your sensor output.
Good luck
 
  • Like
Reactions: Raff

    Raff

    Points: 2
    Helpful Answer Positive Rating
dear emresel,
thanks a lot and i have tried it and its work. Now im trying to train with different angle because different angle give different measurement value. Should i separate it to different dataset or combine it together in one dataset? For example, have 90 degrees and 80 degrees of angle,combine it together or train it separately.
Thanks friend.
 

Hi Raff;
Separate network is also a possible solution.
But if I were you I would apply angle and sensor measurements as inputs (two dimensional input vectors) and actual measurements as targets. And train NN accordingly.
In this case your NN should try to correct any measurement between the reference angle results (ie you have 80deg and 90deg reference measurments in train set, but your system perform a measurement at 85deg)
On the other hand, this might be a little bit tricky. Because in this case your input parameters have different domains and ranges (ie distance in cm and in the range 10-100cm, on the other hand angle in degree and in range 45-135 deg, just as an example).
So in this case, you may need more training data and apply some pre-post processing your data -known as normalization (check prestd and trastd function is in MATLAB)-
Good luck
 
  • Like
Reactions: Raff

    Raff

    Points: 2
    Helpful Answer Positive Rating
dear emresel,
I have follow your instructions about neural network. By combined the data using prestd and trastd it is a little bit complex. The MSE also different compared to the first solution (using separate data). At now, Im still using the separate data and process it one by one. My target is to verify the performance of sensor by using MSE. After training process using neural network (LM algorithm), the MSE value is reduced. At now, Im using all the data(100%) as training data to reduce MSE value and the result is successful. Should i take 20% of data as testing process? At now Im confused whether using 80% as training and 20% or using 100% as training. The target only to reduce the value of MSE.
Thanks a lot.
 

Hi Raff;
At now, Im using all the data(100%) as training data to reduce MSE value
In this case how can you evaluate network performance if you use all samples (100%) for training?
You need some data set to evaluate network performance (to understand if it is trained in a good manner or not)
To reduce error rate, you can use different training-test (validation) strategies.
Have a look at the document, it is more logical to use that kind of methods to improve performance (i.e. k-fold)
**broken link removed**

Here is a matlab code for k-fold that i coded before (change *.txt to *.m).
For your reference, hope helps.
 

Attachments

  • my_k_fold.txt
    2 KB · Views: 61

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top