Está en la página 1de 14

Clasificación de calidad de manzanas usando redes neuronales artificiales, utilizando un brazo robótico de 4 GDL.

-------------------------------------------------------------------------------------------------------------------------------------------
1 2 3 4
J. de la Cruz Alejo is with the School Tecnologico Nacional de Mexico of the Tecnologico de Estudios Superiores de Ecatepec, Mexico, (e-mail: jdelacruz@tese.edu.mx). J. Antonio Lobato-Cadena, M. Belem Arce-Vazquez and A. Mora-Ortega are
with the same School (e-mails: {202121831, mariaarce, amora}@tese.edu.mx).
* Corresponding author.

Abstract: En pequeñas industrias, uno de los grandes problemas es la clasificación de manzanas porque estas se realizan de forma manual, y esto no permite obtener un producto que cuente con una buena
calidad, por lo tanto, no se obtiene un producto con las características adecuadas para poderlas llevar al mercado y que sean de su consumo. En el siguiente trabajo de investigación se realizó el diseño de
una red neuronal artificial (NN) del tipo backpropagation, en la cual fue implementada y aplicada a un brazo robótico de 4 GDL, para determinar la calidad de la manzana, se utilizaran sensores de peso,
altura y color para realizar experimentación y determinar las características apropiadas que debe de tener una manzana determinando la calidad del producto, el control realizado a través de una red neuronal
artificial nos determinara la calidad nos determina en 3 rangos bueno, malo o regular aplicando a un brazo robótico el cual acomoda la manzana, clasificándolas según su calidad, sé utilizo una banda
transportadora de tipo cinta la cual nos permite transportar las manzanas imitando una línea de producción, permitiendo que nuestro sistema sea continuo y sistemático.
Keywords: control inteligente, clasificación de manzanas, brazo robótico, redes neuronales artificiales.

1. Introduction también utilizaremos una banda transportadora de tipo de cinta que nos permitirá trasladar

Actualmente los avances tecnológicos han emergido por la necesidad de optimizar ciertos la manzana de un lugar a otro imitando una línea de producción.

procesos automáticos, que permitan mejorar la eficiencia de sistemas automáticos, utilizando


tecnología avanzada para impulsar la mejora de ciertas líneas de producción. Un ejemplo son las 2. Aplicación del método backpropagation de una red neuronal
maquinas inteligentes que son capaces de aprender y resolver problemas, imitando funciones Las redes neuronales artificiales están compuestas por una capa de entrada, capas ocultas y una
cognitivas del ser humano, es por eso que se han desarrollado sistemas inteligentes, en líneas de capa de salida las cuales son utilizadas y empleadas para aproximación de funciones que estén
producción para incrementar la precisión y rapidez del sistema, que favorezcan los resultados al relacionados con clasificación de patrones [12,13]. Para realizar el proceso de entrenamiento de la
obtener un producto de calidad, tal es el caso que en pequeñas industrias existe la clasificación de rede neuronal mediante el algoritmo backpropagation suele aplicarse mediante dos etapas, la
manzanas con un proceso de selección manual, esto ocasiona la obtención de un producto que no propagación directa y la etapa de regresión [14]. La propagación directa se realiza mediante las
cumple con ciertas características indicadas para determinar una buena calidad del fruto, el sistema señales de entrada la cuales se propagan capa por capa hasta la señal de salida, los valores de los
manual es ineficiente debido a que ocasiona retrasos en la línea de producción, además de que no pesos y umbrales sinápticos no modifican su valor durante la ejecución de esta etapa [15]. La
se ofrece al mercado un producto con buena calidad[1,2,3,4]. las cuales son de mayor exportación primera ecuación para esta etapa (2.1) representa la suma del producto de entrada con los pesos.
( L) ( L) ( 0) ( 0)
con diferentes países, lo que genera un gran aumento de nivel de ventas internacionales. Esta parte
I j =W 1 ,0 ∙ a0 +W 1 , 1 ∙ a1 + ⋯ +W 1 ,n ∙ an (2.1)
redactala mejor, explica si te refieres a las manzanas que exporta México
En las últimas décadas se han diseñado e implementado sistemas de control que sean capaces
Donde:
de identificar y mejorar la calidad de un producto. en sistemas automatizados que mejoren la ( L)
eficiencia y optimicen los procesos automáticos para eliminar productos que no cumplan con
I j es la suma de la multiplicación de los pesos por su entrada.
características estándares de calidad [5]. Actualmente el control inteligente se divide en 4 términos X a es el número de entradas hacia la red neuronal.
( L)
que son control difuso, sistemas expertos, redes neuronales artificiales y algoritmos genéticos y es
W ji representa los elementos de los pesos sinápticos que se encuentran dentro de la red.
uno de los recursos, el cual se utiliza para resolver problemas más complejos, debido a su optimo
funcionamiento en sistemas no lineales, obteniendo sistemas más robustos y óptimos para el mejor
La siguiente ecuación (2.2) se utiliza para representar los valores de cada neurona de salida.
desarrollo de ciertas líneas de producción resolviendo tareas complejas [6,7].
El uso redes neuronales artificiales se ha implementado en control de procesos que ha Y (1j )=g ' ( I (j1 )) (2.2)
(L)
mejorado, la eficiencia y la calidad obteniendo una producción sin defectos utilizando herramientas
g '( I ) representa la función de salida con respecto a la
j
como lo son sensores, actuadores y controladores que se apliquen en tecnologías avanzadas que se
entrada.
encarguen de organizar y controlar las actividades que existen en una línea de producción [8,9].
Las redes neuronales artificiales tienen como función el aprendizaje y son sistemas no lineales que
El método bacpropagation o etapa de regresión donde se emplean cálculos para algoritmos
tienen la flexibilidad de aprender sin la mínima intervención de un agente, además que pueden
diseñados para el entrenamiento de la red neuronal artificial [16,17], por lo cual el funcionamiento
utilizarse para un control multivariable convirtiéndolos en sistemas autónomos que tienen la
de este método es empleado para recorrer el error de salida hasta la entrada y así poder ajustar el
capacidad de aprender de forma independiente es por eso que el uso de las redes neuronales
umbral y los pesos sinápticos de cada neurona con el fin de reducir el error una vez obtenido el
artificiales ayuda a tener un sistema más optimo y eficiente ,ya que ayudan a tomar decisiones
resultado, la función del error cuadrático medio se utiliza para mejorar y medir el rendimiento de
inteligentes, gracias a que aprenden a modelar datos de entrada y salida [10,11].
los resultados que se obtuvieron por las neuronas de salida representada por la ecuación (2.3).
Para resolver el problema de obtener una buena calidad de manzanas, se realizó el diseño e
n3
1
implementación de una red neuronal artificial a un sistema que es capaz de identificar y clasificar
las manzanas, que cuentan con una buena calidad para mejorar la clasificación del producto, el uso
Er (k )= ∑
2 j=1
(d j ( k )−Y (jL ) (k ))
2
(2.3)
de redes neuronales ayuda a mejorar los sistemas de producción, ya que tienen la capacidad de
tener un aprendizaje supervisado y hacen que el sistema sea más rápido y preciso, para mejorar la Donde:
( L)
clasificación de calidad de la manzana se utilizó un sensor de peso, altura y color, utilizando estas
Y j es el valor producido por la neurona j de la salida de
herramientas y con la ayuda de la red neuronal artificial podremos determinar cuál es la calidad de
la manzana, una vez que se clasifico la manzana un brazo robótico que cuenta con 4 GDL
la red.
acomodara la manzana después de que la red neuronal determino si es buena, regular o mala,
k r representa las muestras del entrenamiento.
d j ( k ) es el valor deseado correspondiente. calidad de la manzana en la cual se representara con 1 y 0 indicando cual es buena(B), regular(R) o

Er ( k ) error cuadrático Medio. mala(Ma), en la tabla 1 se muestran los valores obtenidos que serán implementados en las entradas
y salidas de nuestra red neuronal artificial.
n L numero de neuronas de la capa de salida de la red Corrige el diseño de tus tablas debe de ser como el que modifique de la tabla 1. Títulos en
neuronal. Negrita y K sin bordes adentro
Table 1 Data set
Para ajustar los pesos sinápticos a través del proceso de entrenamiento consiste en minimizar el
error entre las salidas con respecto a las salidas deseadas [18], con respecto al función (2.4). Inputs Outputs
P(gr) A(cm) M (%) B R Ma
(L) (L)
∂ Er(L) ∂ Er ∂ Y j ∂ I j 220 8 100 1 0 0
∇ Er = = (L) ∙ (L) ∙ 219 8 100 1 0 0
∂ W (L)
ji ∂ Y j ∂ I j ∂ W (L)
ji
218 8 100 1 0 0
(2.4)
217 8 100 1 0 0
Para el ajuste de los pesos debe hacerse en dirección contraria opuesta al gradiente para
215 8 100 1 0 0
minimizar el error (2.5,2.6). 214 8 100 1 0 0
∂ Er 213 8 100 1 0 0
W (jiL ) ( n+1 )=W (jiL )(n)−η ∙ ( L) (2.5) 212 8 100 1 0 0
∂ W ji
220 8 75 0 1 0
∂ Er 219 8 75 0 1 0
(L)
∇ W ji =−η ∙ ( L) (2.6) 218 8 75 0 1 0
∂ W ji 217 8 75 0 1 0
Donde: 216 8 75 0 1 0
215 8 75 0 0 1
n representa la tasade aprendizaje .
( L) 214 8 75 0 0 1
W ji ( n+1 ) representa los pesos a actualizar. 220 8 50 0 0 1
( L)
W ji (n) representa los pesos anteriores. 219 8 50 0 0 1
Para actualizar los pesos de la capa siguiente utilizando la regla de la cadena se utiliza la 218 8 50 0 0 1
siguiente ecuación (2.7). 217 8 50 0 0 1
n2 ( 2)
∂ Er ∂ Er ∂ I k

Se realizaron pruebas con diferentes arquitecturas de red neuronal artificial con la mejor
= ∙ =B (2.7)
∂ W ji k=1 ∂ I (k2 ) ∂ Y (j1)
(1 ) opción que cumple con los requerimientos indicados para obtener buenos resultados fue la que
cuenta con una capa de entrada, una capa intermedia con 10 neuronas y una capa de salida como se
n2
∂ Er
B¿ ∑
muestra en figura 1, se menciona que entre más capas ocultas tenga la red neuronal artificial, mas
( 2)
∙ ∂¿ ¿ ¿ (2.8) es la información capaz de aprender, que depende del tipo de información a procesar, el costo es
k=1 ∂ I k
significativo ya que el algoritmo de entrenamiento suele converger demasiado lento, este
Para obtener los pesos de la última capa se representa de la siguiente manera: entrenamiento se realizó con la herramienta nntool del software Matlab® el cual se entrena la red
nL
A(jL )=⌊ ∑ A(jL ) ∙W (jiL ) ⌋ ∙ g' (I (JL ))
neuronal artificial ingresando lo datos obtenidos de manera experimental algunos de ellos se
(2.9) muestran en la tabla 1. Se utilizó el método feed-forward bacporopagation, utilizando la función
j=1
sigmoide que nos ayuda a mantener el valor de salida y suavizar el valor de la magnitud hasta un
cierto limite [19,20]. En la figura 2 podemos observar el tiempo en el que nuestro sistema
Al final de la ecuación obtenemos:
converge y las épocas que tardo para que el error alcance su valor mínimo. Cuano hables de Matlab

( 1) ( 1) ( L) o solidworks agrega la ® que es de marca registrada


W ( n+1 )=W ( n ) +η ∙ A ∙ an
ji ji j (2.10)

2.1 desarrollo de la red neuronal artificial.


Se realizo pruebas experimentales para poder implementar una red neuronal artificial en
software en la cual se utilizaron un conjunto de datos los cuales son ocupados para poder entrenar
la red neuronal, en esta se implementaron 1815 datos, por lo cual se complementaron 3 entradas en
nuestra red neuronal artificial que están representadas por 3 variables principales que son peso(P),
altura(A) y maduración(M), para la variable peso se muestra en el conjunto de datos, el valor
mayor que podría tener de peso una manzana y el valor menor, esto está representado en gramos, la
altura máxima con pruebas experimentales se identificó que el tamaño máximo de una manzana es
de aproximadamente de 8 cm y valor mínimo de 5cm, para variable de maduración se realizaron
pruebas experimentales donde la maduración de la manzana será representada por el color
representado en porcentajes , 100% representa una madures total de la manzana, 75% indica que la
manzana le falta un porcentaje por madurar y el 50% representa que la manzana empieza su etapa
de maduración, se colocaron 3 salidas para la red neuronal artificial en estas estará representado la
hallar el error cuadratico medio donde la variable oj1,oj2 y oj3 represnta el valor desado.
Output of the artificial neuronal network Esta es
0.12
Output 1 mi % PROPAGACION DIRECTA % figura
0.1 Output 2 % neuronas de la primera capa%
Mean Square Error

Output 3 pon tu figura


I1j11=(w1ji11*valorX)+(w1ji12*valorY)+
0.08 3 en esta parte
(w1ji13*valorZ)+(umbralj11*x0); //Entrada
0.06 Neurona 1I1j12=(w1ji21*valorX)+
(w1ji22*valorY)+(w1ji23*valorZ)+ después
0.04 (umbralj12*x0); //Entrada Neurona
viene la
Y1j1=1/(1+exp(-I1j11)); // Salida de la neurona 1
0.02 Y1j2=1/(1+exp(-I1j12)); // Salida de la neurona
% Entradas neuronas de la capa de salida %
0
0 100 200 300 400 500 600 700 I2j1=(w2ji11*Y1j1)+(w2ji21*Y1j2)+
Epochs (w2ji31*Y1j3)+(w2ji41*Y1j4)+(w2ji51*Y1j5)+
(w2ji61*Y1j6)+(w2ji71*Y1j7)+(w2ji81*Y1j8)+
(w2ji91*Y1j9)+(w2ji101*Y1j10)+(umbralj21*x0);
I2j2=(w2ji12*Y1j1)+(w2ji22*Y1j2)+
(w2ji32*Y1j3)+(w2ji42*Y1j4)+(w2ji52*Y1j5)+
(w2ji62*Y1j6)+(w2ji72*Y1j7)+(w2ji82*Y1j8)+
(w2ji92*Y1j9)+(w2ji102*Y1j10)+(umbralj22*x0);
% Salidas: neuronas de la capa de salida %
Y2j1=1/(1+exp(-I2j1));
Figure // Salida
3 ouputt de la neurona
errors.

Y2j2=1/(1+exp(-I2j2)); //Salida de la neurona


Y2j3=1/(1+exp(-I2j3)); // Salida de la neurona
E1=E1+((1/2)*((oj1-Y2j1)^2));
E2=E2+((1/2)*((oj2-Y2j2)^2));
E3=E3+((1/2)*((oj3-Y2j3)^2));

retropagacion en donde utilizamos las ecuaciones 2.4 obteniendo el resultado utilizando la regla de
la cadena y utilizando la ecuación 2.7, 2.10 y 2.11 para la actualización de nuestros pesos, que son
para nuestra capa oculta que está representado en la siguiente figura 5 donde podemos observar,
que la variable delta representa nuestro
Figureerror localpropagation.
4 direct que se va recorriendo hacia atrás realizando la
actualización de nuestros pesos.
después de
haber % Actualizacion: pesos sinagticos de la realizado
este primera capa de intermedia %
delta11=((delta21*w2ji11)+
(delta22*w2ji12)+(delta23*w2ji13))*(Y1j1*(1-
Figure 1 artificial neural network for apple classification. Y1j1));
delta12=((delta21*w2ji21)+
(delta22*w2ji22)+(delta23*w2ji23))*(Y1j2*(1-
Y1j2));
delta13=((delta21*w2ji31)+
(delta22*w2ji32)+(delta23*w2ji33))*(Y1j3*(1-
Y1j3));
w1ji11=w1ji11+(tpaso*delta11*valorX);
w1ji12=w1ji12+(tpaso*delta11*valorY);
w1ji13=w1ji13+(tpaso*delta11*valorZ);
umbralj11=umbralj11+(tpaso*delta11*x0);
w1ji21=w1ji21+(tpaso*delta12*valorX);
w1ji22=w1ji22+(tpaso*delta12*valorY);
Figure 5 regression propagation.

entrenamiento obtenemos valores deseados de los pesos, son con los que mejor se adaptan a
Figure 2 error determined with the nntool tool.
nuestro sistema, en la tabla 2 podemos observar los resultados que se obtuvieron de nuestra red
neuronal artificial con los valores obtenidos y la salida deseada.
Hay que corregir el formato de la fig 2 en negritas solo es el titulo, lo demás no lleva negritas y los
Table 2 data obtained..
números de la tabla igual hacerlos del mismo tamaño que la letra de los ejes

2.2 desarrollo y implementación de la red neuronal artificial Desired output Values obtained
Para poder implementar el control inteligente en nuestro Arduino mega 2560, se realizó el 1.00 0 0 0.997 0.003 0.000
entrenamiento con la herramienta de Matlab, en la cual se pueden observar los 3 errores de nuestra 1.00 0 0 0.997 0.003 0.000
salida de nuestra red neuronal artificial para el eje x representa las épocas en que tardo en aprender
1.00 0 0 0.997 0.002 0.000
nuestra red neuronal artificia,l que está conformada como se muestra en la figura 1, para el eje y
1.00 0 0 0.997 0.002 0.000
tenemos el error cuadrático medio. el cual está convergiendo gracias al algoritmo de entrenamiento
1.00 0 0 0.997 0.002 0.000
implementado como se observa en la figura 3, con el siguiente código de la figura 4 se realizó la
1.00 0 0 0.997 0.002 0.000
parte de la propagación directa donde se realiza el producto de la suma de los pesos hacia la
1.00 0 0 0.987 0.002 0.000
primera entrada utilizando la ecuación 2.1, despues se obtuvo el valor de la salida que es el valor de
0 1.00 0 0.001 1.000 0.001
la ecuación de 2..2 utilizando la función sigmoide y por ultimo utilizamos la ecuación 2.3 para
0 1.00 0 0.001 1.000 0.001  LoadCell.tareNoDelay(): permite realizar la calibración del sensor.

0 1.00 0 0.001 1.000 0.001  LoadCell.getNewCalibration(Know_mass): se obtine el valor de referencia de

0 1.00 0 0.001 1.000 0.001 peso, para ajustar el sensor y así obtener el peso deseado.

0 1.00 0 0.001 1.000 0.001  LoadCell.getData(): se obtiene el valor de peso en unidades decimales.

0 1.00 0 0.001 1.000 0.001 Para poder determinar la altura de nuestra manzana para
0 1.00 0 0.001 1.000 0.001 nuestra segunda entrada de nuestra red neuronal artificial,
0 0 1.00 0.000 0.248 0.870 se utilizó el sensor ultrasónico que se encarga de medir la
0 0 1.00 0.000 0.011 0.990 distancia en cm, gracias alas ondas que emiten y que es
0 0 1.00 0.000 0.011 0.990
reflejado una vez que se retorna del objeto, para medir la
0 0 1.00 0.000 0.011 0.990
altura, de la manzana se colocara el sensor en una base
0 0 1.00 0.000 0.011 0.990
en la cual el sensor está posicionado en una altura de 10
0 0 1.00 0.000 0.011 0.990
cm, cuando la manzana este en posición para determinar
la altura , el sensor medirá la distancia que se encuentra
posicionado hasta la manzana, una vez que se realizó la
Se trabajo con nuestra tarjeta Arduino en el cual es compilado en el IDE , el lenguaje de
medición solo se restara la altura en donde esta
programación en el que se trabajo es el de C++, la frecuenci que nos proporción nuestro
posicionado el sensor y la distancia que se obtuvo hacia
controlador arduino mega es de 16 mhz la cual es de gran ventaja ya que los sensores que se
donde se encuentra la manzana, de esta forma
ocuparon tienen una resolución de 8 bits y trabajan a una menor frecuencia que la del el Arduino,
obtendremos el valor de la altura de la manzana, estos
en la figura 6 está representado nuestro diagrama de bloques donde podemos observar el
cálculos se realiza mediate el siguiente Código mostrado
funcionamiento de nuestro sistema como entradas tenemos nuestro sensor de peso, sensor
en la figura 8.
ultrasónico y el sensor de color, señales que el controlador Arduino se encargara de medir, también
se encargara de determinar la calidad de nuestra manzana clasificándola en buena, regular o mala
 Pin Trigger: manda un pulso de ultrasonido.
con la ayuda de nuestra red neuronal artificial implementada en el controlador, por ultimo activara
 Pin echo: se encarga de recibir el pulso una vez que fue rebotado.
nuestros actuadores (servomotores), para la realización de movimiento de nuestro brazo robótico y
 PulseIn():devuelve la longitud en microsegundos o un valor cero dentro del tiempo
poder acomodar la manzana.
de espera

Te recomiendo que la fig 6 la pongas en formato una columna  d: distancia obtenida.


Para nuestra tercera entrada de nuestra red neuronal artificial como se muestra en la figura 6, se
pinMode(Echo, INPUT);
Figure 8 code toelectrónico
get the height.
digitalWrite(Trigger,
utilizo un sensor de color, el cual es un dispositivoLOW); capaz de detectar luminosidad a
void
través de fotodiodos que loop(){simultáneamente una vez obtenida la lectura la corriente se
son activados
long t;
convierte en frecuencia de onda cuadrada, la cual nos permitirá obtener la maduración de la
long d;
manzana a través del color colocando en rangos el color y poniéndolo en una escala de 50% a
digitalWrite(Trigger, HIGH);
100%, considerando que delayMicroseconds(10);
para la experimentación de la maduración se consideraron manzanas
rojas, las cuales tienendigitalWrite(Trigger,
un gran cambio en cuantoLOW);
a su maduración, el sensor se configura
t = pulseIn(Echo, HIGH);
activando los fotodiodos Rojo,Verde y azul simultáneamente mediante el siguiente código como se
d = t/59;
muestra en la figura 9.
Serial.print("Distancia: ");
 pulseIn:valorY=10-d;
tiempo de espera para ajustar los parámetros de los fotodiodos.

 digitalWrite: mantiene en alto o bajo la activacion de los fotodiodos.


Figure 6 blocks diagram.  Delay : tiempo de espera en el programa principal.
:
Se utilizó un sensor de peso que es una galga extensiométrica que forma parte de la primera entrada
Rojo_Frec=pulseIn(sensorSalida, LOW);
hacia la red neuronal artificial, acompañada con el chip HX711 que nos permite obtener el peso de
Serial.print(" R= ");
un objeto de carga de máximo de un 1 kg, gracias a sus transductores de fuerza que son causadas Serial.print(Rojo_Frec);
por las cargas de peso que proporcionan señales eléctricas, suficiente para determinar el peso de delay(30);
digitalWrite(S2,HIGH);
nuestras manzanas, que al hacer pruebas experimentales se obtuvieron resultados que el mayor
digitalWrite(S3,HIGH);
peso de una manzana es de aproximadamente 220 gr, para trabajar con este dispositivo se tienen delay(30);
que realizar la calibración de la báscula, mediante el siguientes Código mostrado en la figura 7, Verde_Frec = pulseIn(sensorSalida, LOW);
utilizando el controlador Arduino Mega, obtenemos los valores de peso sobre un objeto. Serial.print(" V= ");
Serial.print(Verde_Frec);

Serial.println("***"); delay(30);
Serial.println("comensando la calibracion:");  digitalWrite(S2,LOW);
Serial.println(".");  digitalWrite(S3,HIGH);
boolean _resume = false; delay(30);

while (_resume == false) { Azul_Frec = pulseIn(sensorSalida, LOW);
LoadCell.update();  digitalWrite(S2,LOW);
if (Serial.available() > 0) {  digitalWrite(S3,HIGH);
if (Serial.available() > 0) { delay(30);

char inByte = Serial.read();
if (inByte == 't') LoadCell.tareNoDelay();  Figure 9 code for apple ripening.
} 
} Para poder ingresar los valores a las estradas de nuestra red neuronal artificial con los sensores

if (LoadCell.getTareStatus() == true) { ya mencionados, se deben normalizar, colocándolos en un rango de 1 a 0, se utilizó la siguiente
Serial.println("Tare complete");
_resume = true;

Figure 7 code to obtain the weight.


ecuación 2.11 y el código mostrado en la siguiente figura

X− Xmin
x= (2.11)
Xmax− Xmin

 X = representa el valor real de nuestros datos de entrada.

 Xmin = representa el valor mínimo que toma de nuestros valores de

entrada.

 Xmax= representa el valor máximo que toma de nuestros valores de

entrada.

 valorX: representa el valor del sensor de peso.

 valorY: representa el valor del sensor de altura.

 valorX=(valorX-6)/(220-0);
valorZ: representa el valor del sensor de color.
valorY=(valorY-6)/(220-0);
valorZ=(valorZ-6)/(220-0);
Figure 10 normalized data.

Con el siguiente código como se muestra en la figura 11, una vez ya

entrenada nuestra red neuronal artificial y de haber obtenido los

pesos que mejor se adaptaron a nuestro sistema obtenemos la

clasificación de nuestra manzana.

I2j1=(w2ji11*Y1j1)+(w2ji21*Y1j2)+
(w2ji31*Y1j3)+(w2ji41*Y1j4)+(w2ji51*Y1j5)+
(w2ji61*Y1j6)+(w2ji71*Y1j7)+(w2ji81*Y1j8)+
(w2ji91*Y1j9)+(w2ji101*Y1j10)+(umbralj21*x0);
I2j2=(w2ji12*Y1j1)+(w2ji22*Y1j2)+
(w2ji32*Y1j3)+(w2ji42*Y1j4)+(w2ji52*Y1j5)+
(w2ji62*Y1j6)+(w2ji72*Y1j7)+(w2ji82*Y1j8)+
(w2ji92*Y1j9)+(w2ji102*Y1j10)+(umbralj22*x0);
I2j3=(w2ji13*Y1j1)+(w2ji23*Y1j2)+
(w2ji33*Y1j3)+(w2ji43*Y1j4)+(w2ji53*Y1j5)+
(w2ji63*Y1j6)+(w2ji73*Y1j7)+(w2ji83*Y1j8)+
(w2ji93*Y1j9)+(w2ji103*Y1j10)+(umbralj23*x0);
Y2j1=1/(1+exp(-I2j1)); //% Salida de la neurona 1
Y2j2=1/(1+exp(-I2j2)); //% Salida de la neurona 2
Y2j3=1/(1+exp(-I2j3)); // Salida de la neurona 3
Serial.println(Y2j1,4);
Serial.println(Y2j2,4);
Serial.println(Y2j3,4);

Figure 11 artificial neural network programmed in arduino.

Table 3 shows a comparison of the controller in an experimental and implemented way, as well as
some data with its respective movement action. The implemented artificial neural network has a
very small error compared to the desired data, so we can say that the controller has already reached
system convergence.
Input data Desired data Artificial neuronal network from nntool Artificial neuronal network in Transtibial prosthesis
Arduino

E P1 P2 A S1 S2 A S1 S2 A S1 S2 Motion

0 480 890 0 0 0 0 0 0 0.001 0 0 Static

0 500 900 0 0 0 0 0 0 0.001 0 0 Static

0 590 930 0 0 0 0 0 0 0.034 0.03 0 Static

0 620 950 0 0 0 0 0 0 0.003 0.054 0 Static

40 0 0 -1 0 0 -1 0 0 -0.95 0 0 Dorsiflexión

60 0 0 -1 0 0 -1 0 0 -0.98 0 0 Dorsiflexión

190 460 870 1 20 20 1 20 20 0.99 19.7 20 Plantar flexion

440 490 900 1 20 20 1 20 20 0.99 19.9 20 Plantar flexion

500 620 950 1 20 20 1 20 20 0.99 19.9 19.9 Plantar flexion

200 670 840 1 20 0 1 20 0 0.99 19.9 0 Walk to the left

500 780 950 1 20 0 1 20 0 0.99 19.9 0 Walk to the left

190 14 700 1 0 20 1 0 20 0.99 0.04 20 Walk to the right

180 17 790 1 0 20 1 0 20 0.99 0.04 20 Walk to the right

Table 3. Comparison of nntool's artificial neural network and the artificial neural network implemented in Arduino.

1.

3. Transtibial prostheses
The design of the transtibial prosthesis was carried out under the SolidWorks software for
simulation, which is shown in figure 8. It is divided into three main components, socket, ankle and
prosthetic foot. Then, each component was manufactured with a 3d printer, carrying out a study of
different materials to guarantee that they support human weight without suffering the risk of
rupture, as well as to reduce the weight of the robotic-type prosthesis by working with different
types of plastic instead of stainless steel and aluminum.

Figure 9. Socket of transtibial prosthesis.

3.2 Prosthetic ankle


Figure 10 shows the prosthetic ankle, which performs the main stages of human locomotion such
as dorsiflexion and enhanced flexion, as well as performing 20° triplanar movements to perform
lateral displacements, imitating the human gait cycle. The linear actuator (10) adds impulse energy
by means of an electric motor, a gear train and a stem (7), capable of raising and cushioning the
human weight, managing to reduce metabolic wear and tear, helping a more comfortable human
gait for the amputees. To carry out triplanar movements, steering knuckles (5) are used, connected
by means of a connection bar (6) to servomotors (2) that control the desired angular position. By
Figure 8. Transtibial prosthesis design. means of the connector (1), the ankle is joined with the prosthetic socket of figure 8 and, the base

3.1 Socket of the servomotors (4) connects the ankle with the foot of the transtibial prosthesis.

The prosthetic socket is in charge of joining the prosthesis with the amputee, as well as transmitting
the weight to the rest of the prosthesis. Inside, the adhesive electrodes of the myoelectric sensor
were placed to capture muscle stimulation. Figure 9 shows the three components of the socket, the
first is the prosthetic adapter that can be of different sizes, depending on the height of the amputee.
In addition, it joins the ankle with the prosthetic socket, the second joins the connector prosthetic
with the part number three, component three is the socket where the stump of the amputee is
placed.
Figure 11. Foot of transtibial prosthesis.

Figure 10. Ankle of prosthesis. Figure 12.

3.3 Prosthetic foot Side view of


prosthetic
The prosthetic foot shown in figure 11, is made up of three pieces, the first replaces the human
design.
instep, it also connects the prosthetic foot with the first piece of figure 10. Piece two has the ability
to bend and return to its original form, which makes it easier to carry out the main stages of human
3.4
locomotion. In piece 3, the pressure sensors that measure the position of the transtibial prosthesis
are located. In order for the pressure sensors to capture the load of the prosthesis in a better way,
springs located in the center of the thin film of the sensor were used as shown in a figure 12 and, in Simulation in SolidWorks
addition, help cushion the load of the piece 1 from figure 11. A load simulation was carried out using SolidWorks software to determine which components
receive a greater load. According to the results obtained, the prosthetic socket and the instep were
the ones that bear the most load. In the ankle section, the prosthetic socket and 13b shows the
instep both without any risk of rupture, this is because in SolidWorks the red color indicates
rupture of the part, yellow, high-risk rupture, green little risk of the rupture, and blue without any
risk of rupture. Table 4 shows the data used for the simulation, as well as the stress and
displacement results obtained.
Table 4. Simulation data in SolidWorks.

Maximum Displacement
Part name. Material Applied load
tension

Socket PLA 90 Kgf 9.341 e-05N/m^2 8.950 e-02mm

Connector PLA 90 Kgf 7.044 e-05N/m^2 0 mm

Adapter ABS 90 Kgf 9.341 e-05N/m^2 0 mm

Instep PLA 2 Kgf 1.371 e-05N/m^2 1.371e-05mm


b)

a)
Figure 13. Simulation of the Prosthetics pieces.

3.5 Transtibial prosthesis prototype


The prototype parts were made on a Creality Ender 3 3D
printer. Figure 14 shows the prototype both front and side views. The transtibial prosthesis has a Figure 15. Electric diagram

weight of 2.16 kg and can support the weight of a 90 kg. without risk of rupture. Also, it can
generate enough driving force to lift the weight of a person, allowing to imitate the main stages of To prevent the electronic components from being damaged by water or dust, all the elements were

human locomotion, which is optimal because the part of the amputated leg corresponds to 5.9% of placed in a box made in 3d printing as shown in figure 16, which the amputee can transport in the

the weight of a person. bag of some article of clothing. In this way, damage caused by accidents is avoided and a longer
durability of the transtibial prosthesis is ensured.

Figure 14. Prototype of transtibial prosthesis Figure 16. Connection of transtibial prosthesis

3.6 Electronics of the transtibial prosthesis 4. Characterization of the transtibial prosthesis


Figure 15 shows the electronic connection of the transtibial prosthesis which is composed of an Another aspect of our study is focused on the evaluation of the myoelectric signal, which is
Arduino Mega 2560, a myoelectric sensor (E), two pressure sensors (P1,P2), two L298N, two responsible for capturing the electrical signal that the nerves send to the muscle through ECG
servomotors (S1,S2) , a 7805 regulator (U1) and a linear actuator (A). The development board's electrodes that are located in the muscle inside the socket to connect to the stump of the amputee.
digital outputs were used to control the L289N, as well as PWM outputs to control the angular The sensor captures, amplifies, and denoises the myoelectric signal. The evaluation were in
position of the servo motors. The advantage of using two L298N is that we can power all the different situations: standing, bending the knee, exerting force on the muscle, walking, and
sensors and actuators with a single 12 V power supply, which reduces space and provides more jumping. In this case the output voltage of the sensor is in the range from 0 to 1, but the sensor can
comfort when using the transtibial prosthesis. In addition to controlling the bipolar voltage to drive amplify the gain increasing the output voltage. Experimental results are shown in Figure 19. Then,
the stem of the linear actuator (A). The electromyography sensor receives the signal through the to characterize the movements that the prosthesis must perform, Table 5 presents a list of input data
ECG electrodes that are located inside the socket of the transtibial prosthesis. correlated with their respective desired data, which are proposed for NN training. The first four
rows indicate that a person is flexing the knee, or the foot is in the air after walking so the actuators
return to their original position. Rows 5, 6 and 7, indicate a person standing up and because the
EMG signal is very low, no movement is required. For this case, the data indicates that the
prosthesis should not make any movement as shown in figure 17. Table 6 presents once again the
input data with their respective proposed desired data, that will train the NN, so that through the
actuators, the transtibial prosthesis performs the improved flexion movement and lateral
displacement. The first 4 rows indicate a forward plantar flexion movement, while rows 5 and 6
indicate a lateral displacement to the left with almost the same weight because the actuator stem is
located on the right side, rows 7, 8 and 9 indicate a right lateral displacement. Figure 18 shows the
prosthesis performing enhanced flexion and 18b shows the prototype performing a left lateral
displacement.

Table 6. Data for prototype movement.

b)
a)
Figure 18. Transtibial prosthesis in motion Input data Desired data

E P1 P2 A S1 S2

180 460 880 1 20 20

190 480 890 1 20 20

200 490 900 1 20 20

210 500 910 1 20 20

220 920 950 1 20 0

230 736 897 1 20 0

190 10 862 1 0 20

200 19 875 1 0 20

210 19 880 1 0 20

Myoelectric signal flexing the knee Myoelectric signal with hard on the leg
0.15 0.25

0.2
0.1

Output of sensor
Ouput of sensor

0.15
0.05
0.1

0
0.05

-0.05 0
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3
Time (s) Time (s)
Myoelectric signal walking Myoelectric signal hopping
0.6 1

0.5
0.8
Output of sensor

Output of sensor

0.4
0.6
0.3
0.4
0.2

0.1 0.2

0 0
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3
Time (s) Time (s)
Figure 19. Leg myoelectric signal
Table 7 shows a comparison between the proposal of this work with others found in the literature. number of inputs in the NN, the position of the prosthesis and stump can be analyzed with more
In it, the main characteristics of both operation and construction materials are shown. It also shows precision. This is because by increasing the number of actuators we can better imitate the gait
the contribution of intelligent control for prosthetic systems, since by working with a greater cycle.

Table 7. Comparison beetwen othersPrototypes

Name Motion Material

Powered prosthesis with torque It works by means of an actuator which performs the bidirectional movements of the ankle, help reduce metabolic wear. All this through the use of Steel and aluminum
dense, low ratio actuation [23] gears, motors, stainless steel bearings, aluminum parts, which means that the prosthesis has a weight of 6.05 Kg and needs to input additional energy to
that of the person to carry out human locomotion.

Systems and methods for an ankle Transtibial prosthesis with an ankle load direction mechanism that, supported by an actuator, allows bidirectional movements of human locomotion, Steel
prosthesis [24] having a lighter weight that reduces fatigue problems.

Biomechanical design and The prototype generates dorsiflexion and plantar flexion movements, generating an angular ankle position of 27° and a lifting force of 1000 N by Carbon fiber and aluminum
prototyping of a powered ankle- means of an electric actuator, it is capable of lifting the weight of an individual of 80 Kg and through springs it cushions the human weight. The
foot prosthesis [25] prototype has a weight of 2.23 kg without the prosthetic socket.

Biomedical design of powered The prototype is an elastic spring prosthesis that works by means of a unidirectional spring and a controllable force actuator, this to imitate the gait Carbon fiber and steel
ankle-foot prosthesis [26] cycle. The controllable force actuator is made up of a DC motor, a mechanical transmission and a distribution gear, this to control the retribution force,
while the unidirectional spring prevents the movement of the prosthesis while it is in the balancing stage.

This work Using sensors, actuators and intelligent control to learn and adapt the position and trajectory of the prosthesis when walking, the prototype is capable ABS, PLA, TPU and Steel.
of raising the human weight by means of a linear actuator and performing lateral movements through direction labels controlled by servomotors. In
addition, it allows to imitate the main stages of human locomotion, dorsiflexion and plantar flexion. Its innovation is the ability to perform triplanar
movements, reducing the risk of falls and having a more comfortable and natural gait cycle. Also, by working with lightweight materials and providing
energy to the gait cycle through electronic actuators, metabolic wear is reduced. The prototype has a weight of 2.16 kg and supports a weight of 90 kg
without risk of breakage

5. Conclusions
The successful simulation and implementation of a transtibial prosthesis has been done by [2] Zhang, F., Li, X. C., Lim, C. P., Hua, Q., Dong, C. R., &
using a NN as controller. The designed prototype can be used for amputees that allows them to
Zhai, J. H. (2022). Deep emotional arousal network for
move without depending on another person, this helps them to perform basic tasks by themselves.
multimodal sentiment analysis and emotion
recognition. Information Fusion, 88, 296-304.
The transtibial prosthesis has an anthropometric design for the human foot, ankle and tibia fibula,
[3 Shi, H., Cao, G., Ma, G., Duan, J., Bai, J., & Meng, X.
this allows imitating the movements of enhanced flexion and dorsiflexion, which are the main
(2022). New progress in artificial intelligence algorithm
stages of human locomotion. By using the results of computational calculations of the design research based on big data processing of IOT systems on
parameters for the NN and the outcomes of the simulation, we have designed and implemented an intelligent production lines. Computational Intelligence and
intelligent control based on backpropagation algorithm applied to a transtibial prosthesis, which Neuroscience, 2022.
presents positive results By correctly imitating the movements of human locomotion. Also, the [4] Unay, D., & Gosselin, B. (2005, September). Artificial
control which have multiple inputs and outputs allows to analyze the movement of the human ankle neural network-based segmentation and apple grading by
and foot with a greater number of variables, determining its position and imitating its trajectory in a
machine vision. In IEEE International Conference on Image
Processing 2005 (Vol. 2, pp. II-630). IEEE.
better way by means of linear and rotary actuators that perform the gait and angular inclination
[5] Monsone, C., & Csapó, Á. B. (2019, October). Charting the
cycle.
state-of-the-art in the application of convolutional neural
Acknowledgements This work was supported by the Tecnologico Nacional de Mexico of the
networks to quality control in industry 4.0 and smart
Tecnologico de Estudios Superiores de Ecatepec. manufacturing. In 2019 10th IEEE International Conference on
Author contributions Experimental were from Lobato-Cadena and Arce-Vazquez. Data collection Cognitive Infocommunications (CogInfoCom) (pp. 463-468).
was performed by Mora-Ortega, de la Cruz-Alejo. Data analysis was performed by de la Cruz- IEEE.
Alejo and Lobato-Cadena. The frst draft was written by de la Cruz-Alejo and Lobato-Cadena, and [6] Nguyen, D. H., Sun, X., Tretiak, I., Valverde, M. A., &
Mora-Orrega reviewed and edited the draft. All authors commented on previous versions of the Kratz, J. (2023). Automatic process control of an automated
manuscript. All authors read and approved the fnal manuscript and agree with the order of
fibre placement machine. Composites Part A: Applied Science
and Manufacturing, 168, 107465.
presentation of the authors.
[7] Sun, G., Li, M., Wang, Y., Zhou, K., Hu, X., Guo, Z., &
Declarations Zhu, L. (2022). Temperature-compensated fiber-optic online
Competing interests The authors declare no competing interests. monitoring methodology for 3D shape and strain of near-space
airship envelope. Applied Optics, 61(31), 9279-9295.
References
[8] Zhang, J., Lei, P., Hu, S., Zhu, M., Yu, Z., Xu, B., & Qiu,
K. (2019). Functional-link neural network for nonlinear
equalizer in coherent optical fiber communications. IEEE
[1] Du, J., Xu, Y., & Wang, Y. (2023). How to improve
Access, 7, 149900-149907.
sustainability for industrial sectors: Optimizing production
[9] Rajesh, M., & Sitharthan, R. (2022). Introduction to the
scales based on performance-oriented resource
special section on cyber-physical system for autonomous
reallocation. Energy Economics, 119, 106525.
process control in industry 5.0. Computers and Electrical
Engineering, 104, 108481.
[10] Yin, X., & Jiang, Z. (2023). Wave condition preview [24] Ipsey, J., 355 East Erie Street, Chicago, Illinois 60611
assisted real-time nonlinear predictive control of point- (US). PICKERILL, Tom, & 355 East Erie Street, Chicago,
absorbing wave energy converter based on long short-term Illinois 60611 (US). (2022). Systems and methods for an ankle
memory recurrent neural identification. Mechanical Systems prosthesis (Patent Núm. 2022047364 Al). En World Patent
and Signal Processing, 188, 109669. (2022047364 Al).
[11] Dharwadkar, N. V., Pakhare, A. R., Veeramani, V., Yang, [25] Alleva, S., Antonelli, M. G., Beomonte Zobel, P., &
W. R., & Math, R. K. M. (2022). Textile Production Line Durante, F. (2020). Biomechanical design and prototyping of a
Monitoring System Using Wavelet-Regression Neural powered ankle-foot prosthesis. Materials, 13(24), 5806.
Network. Journal of Cases on Information Technology [26] Debta, S., & Kumar, K. (2018). Biomedical design of powered ankle-foot prosthesis–A Review. Materials
(JCIT), 24(3), 1-26. Today: Proceedings, 5(2), 3273-3282.
[12] Gu, Z., Ma, Q., Liu, C., Xiao, Q., Gao, X., Yan, T., ... & Jesus de la Cruz-Alejo PhD in Electrical Engineering, He has a Postdoctoral Stay at the University of
Cui, T. J. (2022). High‐Resolution Programmable Metasurface Guadalajara with the topic: "VLSI Analog Design with CMOS Technology". He has carried out different
Imager Based on Multilayer Perceptron Network. Advanced projects related to the design and manufacture of CMOS and FGMOS in low-power, low-voltage VLSI analog
Optical Materials, 10(18), 2200619. mode. He has carried out research projects on intelligent control systems applied to Mechatronics and
[13] Wei, Z., Wu, N., Zou, Q., Zou, H., Zhu, L., Wei, J., & Alternative Energies systems. Currently, he is a full-time professor at the Tecnológico de Estudios Superiores
Huang, H. (2023). Data Modeling of Sewage Treatment Plant de Ecatepec developing projects. He can be contacted at email: jdelacruz@tese.edu.mx
Based on Long Short-Term Memory with Multilayer J. Antonio Lobato Cadena. He obtained the title of Mechatronic engineer at Tecnologico de Estudios
Perceptron Network. Water, 15(8), 1472. Superiores de Ecatepec (TESE) in 2021. Currently, he is studying for a master’s mechatronic engineering
[14] Senoo, T., Jinguji, A., Kuramochi, R., & Nakahara, H. sciences at Tecnologico de Estudios Superiores de Ecatepec. He can be contacted in
(2022). Multilayer Perceptron Training Accelerator Using 202121831@tese.edu.mx
Systolic Array. IEICE TRANSACTIONS on Information and M. B. Arce-Vazquez, received the PhD degree in Biotechnology from Universidad Autónoma
Systems, 105(12), 2048-2056. Metropolitana, México in 2016. She is a full time professor in the
[15] Wang, Y., Wang, L., Chang, Q., & Yang, C. (2020). Tecnológico de Estudios Superiores de Ecatepec, México since 2016,
Effects of direct input–output connections on multilayer His research interests are on biotechnology as well as energy systems
perceptron neural networks for time series prediction: L. and renewable energy in the line of biofuels. ORCID: 0000-0002-7763-
Wang. Soft Computing, 24, 4729-4738. 9529.: mariaarce@tese.edu.mx.
[16] Li, X., Zhang, K., Li, W., Feng, Y., & Liu, R. (2022). A
two-stage transfer regression convolutional neural network for A. Mora-Ortega, received the PhD degree in Mechanical Eng.
bearing remaining useful life prediction. Machines, 10(5), 369. from Universidad Autónoma Nacional de Mexico, México in 2015. He
[17] Morales, G., Sheppard, J. W., Hegedus, P. B., & Maxwell, is a full time professor in the Tecnológico de Estudios Superiores de
B. D. (2023). Improved Yield Prediction of Winter Wheat Ecatepec, México since 2015, where he is a member of the researching group of energy efficiency and
Using a Novel Two-Dimensional Deep Regression Neural renewable energy and the American Physics Society. His research interests are about energy system and energy
Network Trained via Remote Sensing. Sensors, 23(1), 489. renewable. ORCID: 0000-0001-5200-3527.: amora@tese.edu.mx
[18] Woo, S. Y., Choi, K. B., Lim, S., Lee, S. T., Kim, C. H.,
Kang, W. M., ... & Lee, J. H. (2019). Synaptic device using a
floating fin-body MOSFET with memory functionality for
neural network. Solid-State Electronics, 156, 23-27.
[19] Ou, S., Guo, Z., & Wang, J. (2022). Multistability of Fuzzy
Neural Networks With a General Class of Activation Functions
and State-Dependent Switching Rules. IEEE Transactions on
Fuzzy Systems, 31(2), 645-659.
[20] Jagtap, A. D., Shin, Y., Kawaguchi, K., & Karniadakis, G.
E. (2022). Deep Kronecker neural networks: A general
framework for neural networks with adaptive activation
functions. Neurocomputing, 468, 165-180.

[19] Whittington, J. C., & Bogacz, R. (2019). Theories of error


back-propagation in the brain. Trends in cognitive sciences,
23(3), 235-250.
[20] Tan, H. H., & Lim, K. H. (2019, April). Review of second-
order optimization techniques in artificial neural networks
backpropagation. In IOP conference series: materials science
and engineering (Vol. 495, No. 1, p. 012003). IOP Publishing.
[21] Lillicrap, T. P., Santoro, A., Marris, L., Akerman, C. J., &
Hinton, G. (2020). Backpropagation and the brain. Nature
Reviews Neuroscience, 21(6), 335-346.
[22] Narkhede, M. V., Bartakke, P. P., & Sutaone, M. S.
(2022). A review on weight initialization strategies for neural
networks. Artificial intelligence review, 55(1), 291-322.
[23] Gregg Richardson TX (US), R., Toby B. Elery, Farmers
Branch, TX (US), Nesler Austin TX (US), C., & (us), S. R. A.
(2019). Powered prosthesis with torque dense, low ratio
actuation (Patent Núm. 20190328551 Al). En US Patent
(20190328551 Al).

También podría gustarte