This article addresses biases in machine learning models. The author also points out that “it is impossible to build a fully unbiased AI system”. Nickles acknowledges that bias in AI is inevitable because it stems from human decisions made during data collection, structuring, and labeling. Nickles acknowledges that ml5, a platform commonly used by students, artists, and designers, has made machine learning more accessible to non-technical users, particularly in educational settings. While this accessibility is beneficial, it also brings a significant question: how can beginners, who may not have the expertise to recognize or address biases in machine learning models, practically manage or reduce these biases when they use the models?
For this week, I decided to continue working on my previous project, Flappy Millie, and create an easier version of it. Instead of using the mouse to control Millie’s movement, I want to detect the user’s nose and use it to control Millie’s movement. I used the nose detection example that was demonstrated in class as a reference. Therefore, I imported the ml5 library and made Millie’s position follow the user’s nose position.
However, in my previous version, Millie was controlled by gravity, so when I tried to playtest the game, Millie would start at the nose position but immediately fall down. At first, I thought there was an issue with the model, thinking it failed to detect my nose and that’s why Millie wasn’t following my nose movement. After carefully checking all the code, I realized it was the gravity causing Millie to keep falling. So, I set the gravity and velocity to zero to prevent Millie from being affected by them.
Here is my final work:
https://drive.google.com/file/d/1qcvn8aB--NJ4LFMAYqWyo4y5JxlamQUn/view?usp=sharing
code:
let bone = [];
var flappy;
let millie;
var gameOver;
var backGround;
let bodySegmentation;
let video;
let segmentation;
let bodyPose;
let noseObj = {};
let poses = [];
function preload() {
flappy = loadSound("flappy.mp3");
gameOver = loadSound("game over.wav");
backGround = loadSound("background.mp3");
bodyPose = ml5.bodyPose();
}
function setup() {
createCanvas(640, 480);
video = createCapture(VIDEO);
video.size(640, 480);
video.hide();
bodyPose.detectStart(video, gotPoses);
backGround.play();
millie = new Millie();
bone.push(new Bone());
}
function draw() {
background("pink");
image(video, 0, 0, width, height);
if (poses.length > 0) {
let pose = poses[0];
if (pose.nose) {
noseObj = pose.nose;
}
}
millie.x = noseObj.x;
millie.y = noseObj.y;
for (var i = 0; i < bone.length; i++) {
bone[i].show();
bone[i].update();
if (bone[i].hits(millie)) {
textSize(30);
fill(255, 0, 0);
text("GAME OVER", 150, 250);
gameOver.play();
backGround.stop();
noLoop();
}
}
millie.update();
millie.show();
if (frameCount % 100 == 0) {
bone.push(new Bone());
}
}
function gotPoses(results) {
poses = results;
}
p5.js link: