Lección 9: (Inteligencia Artificial para océanos)

Grades 3-5 | Grados 6-8 | Grades 9-12

Descripción

Tutorial Summary: First students classify objects as either "fish" or "not fish" to attempt to remove trash from the ocean. Then, students will need to expand their training data set to include other sea creatures that belong in the water. In the second part of the activity, students will choose their own labels to apply to images of randomly generated fish. This training data is used for a machine learning model that should then be able to label new images on its own.

Checking Correctness: This tutorial will not tell students whether they completed the level correctly. It is possible to skip through the different parts of the activity quickly. Encourage students to watch the videos, read the instructions, and try different things along the way. At any time, they can share their findings with you or a classmate.

Have fun completing your Hour of Code!

Objetivo

This tutorial is designed to quickly introduce students to machine learning, a type of artificial intelligence. Students will explore how training data is used to enable a machine learning model to classify new data. Students should have a positive experience during the tutorial and more importantly should be motivated to keep learning computer science.

Agenda

Actividad previa

Actividad

Ampliación del aprendizaje

Actividad de Cierre

Explorando la Vista de Información

Objetivos

El alumnado podrá:

  • Discute el papel que juega la inteligencia artificial en sus vidas.
  • Entrena y prueba un modelo de aprendizaje automático.
  • Piensa acerca de cómo el prejuicio humano juega un papel en el aprendizaje automático.

Preparación

Una semana antes de su Hora del código

  • Revise la Guía del educador de la hora del código y [Mejores prácticas de educadores exitosos][1] para comenzar a planificar su evento de Hora del código.
  • Registre su evento de hora del código si desea obtener apoyo de aula, descuentos en carteles o participar en el regalo de robótica (solo Ee. Uu.).
  • Revise y complete el tutorial en línea usted directamente: [Fiesta de baile][3]
  • Asegúrese de probarlo primero antes de pedir a sus estudiantes que lo completen. Verifique su tecnología y decida si necesita solucionar algún problema antes de su Hora del código.
  • Revise la lección complementaria, ["La gran fiesta"][4] para determinar si desea o no llevar a cabo esta lección antes de su Hora del código.

Un día antes de su Hora del código

  • Cada estudiante que complete la actividad debe recibir un certificado. [Imprima uno][5] para cada estudiante de antemano para que sea más fácil entregarlo al final de su Hora de código.
  • (opcional) Inste a los estudiantes a traer auriculares para utilizar durante la actividad.

Enlaces

Aviso! Por favor realice una copia de los documentos que piense compartir con los estudiantes

Para Students

Vocabulario

  • Aprendizaje automático - Cómo las computadoras reconocen patrones y toman decisiones sin ser programadas explícitamente

Guía docente

Actividad previa

Desarrolla el entretenimiento

Motiva: Explica a los estudiantes las metas de la actividad de hoy. Van a comenzar a usar una nueva herramienta que les permita rápidamente hacer aplicaciones que instantáneamente pueden enviarse a ellos mismos o a amigos para que las use.

Video: El primer nivel de esta actividad es un video que debería motivar a los estudiantes para competir la actividad y explicar cómo funcionará. Considera mirarlo en clase y rápidamente hacer preguntas para resolver cualquier consulta.

Actividad

General Support

General Support: As a teacher your role is primarily to support students as they make their way through the tutorial. Here are a few tips that should help students regardless of the level they're working on

  • Collaborate with Neighbors: Encourage students to check in with a neighbor to discuss what they are experiencing. Since this tutorial includes videos and students may be wearing headphones it can get easy to "go into a bubble". Help break those barriers by actively pairing students.
  • Read the Instructions: The instructions usually provide helpful information about what is happening behind the scenes.
  • Go back and try different things: If students finish quickly, encourage them to go back to "Train More". In the last part of the activity, students can also go back and choose a "New Word". More training data tends to make the machine learning model more accurate and consistent. Students can also learn by purposefully training their model incorrectly, or not training it at all.

Level 1 - Machine Learning

Video: AI: aprendizaje automático - Video

Quick Share-out: Where have you seen or experienced artificial intelligence in your lives? Examples from the video include:

  • email filters
  • auto-complete text
  • video recommendation systems
  • voice recognition
  • translation apps
  • digital assistants
  • image recognition

Prompt: Based on what you saw in the video, what is machine learning?

Discussion Goal

Goal: Get students acquainted with the world of artificial intelligence. Reflect on the prevalence of artificial intelligence in our lives and think broadly about potential future innovations.

Discuss: Beginning in small groups then moving to whole class, students share their responses.

Say: Machine learning refers to a computer that can recognize patterns and make decisions without being explicitly programmed. In this activity you’re going to supply the data to train your own machine learning model. Imagine an ocean that contains creatures like fish, but also contains trash dumped by humans. What if we could train a computer to tell the difference and then use that technology to help clean the ocean?

Content Corner

Every image in this part of the tutorial is fed into a neural network that has been pre-trained on a huge set of data called ImageNet. The database contains over 14 million hand-annotated images. ImageNet contains more than 20,000 categories with a typical category, such as "balloon" or "strawberry", consisting of several hundred images. When A.I. is scanning new images and making its own predictions in the tutorial, it is actually comparing the possible categories for the new image with the patterns it found in the training dataset.

Levels 2-4 - Train AI to Clean the Ocean

Students can work through the first three levels on their own or with a partner. To program A.I., use the buttons to label an image as either "fish" or "not fish". Each image and label becomes part of the data used to train A.I. to do it on its own. Once trained, A.I. will attempt to label 100 new images on its own, then present a selection that it determined have the highest probability of being "fish" based on its training. Students who consistently label things correctly should see an ocean full of different types of sea creatures, without much (or any) other objects.

Level 5 - Training Data & Bias

Quick Share-out: How well did A.I. do? How do you think it decided what to include in the ocean?

Video: AI: datos de entrenamiento - Video

Discussion Goal

Goal: Get students to reflect on their experience so far. It is important at this point that they realize the labeling they are doing is actually programming the computer. The examples they show A.I. are the "training data".

Prompt: How do you think your training data influence the results that A.I. produced?

Discuss: In small groups, students share their responses. Circulate the room and listen to student ideas. This can be followed with full class discussion, or students can jump right back into the tutorial.

Content Corner

The fish in this tutorial are randomly generated based on some pre-defined components, including mouths, tails, eyes, scales, and fins, with a randomly chosen body color, shape, and size. Rather than looking at the actual image data, A.I. is now looking for patterns in these components based on how the student classifies each fish. It will be more likely to label a fish the same way the student would have if it has matching traits.

Levels 6 - Using Training Data

In the second half of the activity, students will teach A.I. about a word of their choosing by showing it examples of that type of fish. As before, A.I. doesn't start with any training data about these labels. Even though the words in this level are fairly objective, it's possible that students will end up with different results based on their training data. Some students may even intentionally train A.I. incorrectly to see what happens. If students are reflecting on how machine learning works, it should be encouraged!

Level 7 - Impacts on Society

Video: AI: implicaciones para la sociedad - Video

Say: Artificial intelligence systems learn from the data we give it, but that data could be opinion-based or biased.

Discussion Goal

Goal: The goal of this discussion is to bring students back to the context of artificial intelligence in the real world.

Say: Think back to the examples of artificial intelligence we discussed at the beginning. Think of a time where machine learning might have got something wrong in the real world? (For example, voice recognition fails to understand you.)

Prompt: How could biased data result in problems for artificial intelligence? What are ways to address this?

Discuss: Beginning in small groups then moving to whole class, students share their responses.

Say: Some ways to address bias are to use a larger or more inclusive set of training data. In the final part of the activity you’re going to teach A.I. a word that could be interpreted in different ways.

Level 8 - Teach A.I. a new word

Here, as before, students will use training data to teach A.I. to recognize different types of fish. The words in this list are intentionally more subjective than what students will have seen so far. Encourage students to decide for themselves what makes a fish look "angry" or "fun". Two students may choose the same label and get a very different set of results based on which fish traits were their focus. Encourage students to discuss their findings with each other or go back and choose new words. Each student will rely on their own opinions to train A.I. which means that A.I. will learn with the same biases held by the students. As students begin to see the role their opinion is playing, ask them to reflect on whether this is good or bad, and how it might be addressed.

Open question: What is a problem you care about that artificial intelligence could help to solve?

Ampliación del aprendizaje

Ayuda a clasificar animales en el Parque Nacional Mountain Zebra

Snapshot Safari ha colocado cientos de cámaras trampa en el sur de África, para capturar millones de imágenes de animales hermosos y raros. Los estudiantes pueden clasificar los diferentes animales en estas imágenes para ayudar a proteger a la cebra de Cape Mountain en peligro de extinción. ¡Lee sobre el proyecto a continuación, y luego haz clic en "Clasificar" para probarlo!

Snapshot Mountain Zebra - Zooniverse

Actividad de Cierre

Celebra y avanza

Imprime certificados: Imprime certificados para que los estudiantes celebren sus logros.

code.org/applab: Al final de la lección, alienta a que los estudiantes visiten la página de inicio del Laboratorio de aplicaciones en donde puedan obtener ideas sobre más formas de continuar la aventura con el Laboratorio de aplicaciones.

Explorando la Vista de Información

En la pantalla de resultados finales, se puede ver una visualización del modelo de aprendizaje automático de IA haciendo clic en .

Ejemplo 1: entrenamiento basado en un rasgo (forma del cuerpo)

Como ejemplo, veamos a un estudiante que está entrenando en IA para reconocer peces "circulares" mediante la selección de peces con alguna rasgo en particular:

Cuerpos "circulares":

Después de unos 30 conjuntos de datos de entrenamiento, podemos ver que IA es capaz de clasificar el pez perfectamente. Ha reconocido con éxito un patrón: todos los peces que el estudiante seleccionó tenían una de las mismas dos formas corporales.

Pez "circular" - entrenamiento: 30
Al hacer clic en el botón de información, podemos ver que IA está muy segura de que, en general, el "cuerpo" es el componente más importante de los peces y ha determinado que son "circulares". Se puede hacer clic en un pez para inspeccionarlo. La información aquí muestra que, para este pez, IA determinó que la forma de su cuerpo era un indicador positivo de que se trataba de un pez "circular".
Pez "no circular" - entrenamiento: 30
Al alternar la vista, también podemos analizar el pez que IA determinó que "no es circular". Las barras verdes que apuntan a la derecha representan una señal de que el rasgo es "circular". Las barras rojas que apuntan a la izquierda indican que "no es circular". IA decide cómo clasificar cada pez según *todos los componentes, incluso aquellos que no se muestran en la lista.*
¿Qué pasa con los otros rasgos?

Es posible que hayas notado que otros rasgos como el color parecen importarle a IA, a pesar de que el estudiante solo estaba mirando la forma del cuerpo. Además del hecho obvio de que IA no puede leer nuestras mentes, hay otra razón por la que IA podría sacar algunas de las conclusiones equivocadas.

Los peces en este tutorial se generan al azar. Los peces que el estudiante etiquetó como "circulares" tuvieron aleatoriamente algunos de los mismos colores. Si el conjunto de datos de entrenamiento no incluye peces verdes con cuerpos redondos, IA tendrá menos confianza en clasificar uno como "circular" incluso si eso es lo que pretendía el estudiante.

Ejemplo 2: uso de la vista de información para mejorar el modelo

Agregar más datos de entrenamiento no solo cambia los resultados, sino los datos que se muestran en la vista de Información. A veces, el gráfico de resultados que se muestra puede aclarar por qué los resultados no coinciden con las expectativas.

Ahora consideremos a un estudiante que quiere entrenar en IA para reconocer un pez "enojado". Para lograr esto, deben seleccionar cualquier pez con cejas que apunten hacia adentro y bocas fruncidas. Etiquetarán a un pez como "enojado" si tiene una combinación de estos rasgos:

Ojos "enojados": bocas "enojadas":

Can A.I. figure out what the student is doing without being explicitly programmed? It depends on how much training data the student provides and the quality of data in the set.

¿IA puede averiguar qué está haciendo el estudiante sin ser programado explícitamente? Depende de la cantidad de datos de entrenamiento que proporcione el estudiante y la calidad de los datos en el conjunto.

Pez "enojado" - entrenamiento: 30 Pez "enojado" - entrenamiento: 200
Aquí podemos ver que IA entendió de inmediato que los "ojos" eran el rasgo más importante, pero seguido de cerca por el "color", y no la "boca". Hay algunos peces morados en la imagen de la izquierda que tienen bocas que son diferentes de lo que el estudiante estaba apuntando. ¿Quizás muchos de los peces "enojados" que el estudiante seleccionó inicialmente eran morados? Una forma de mejorar el modelo sería continuar entrenando, asegurándose de continuar hasta que varios peces morados "no enojados" hayan sido etiquetados correctamente. Mejoró los resultados después de un mayor entrenamiento.