Model Pipeline - Privacy considerations
This pipeline shows how a computer vision model processes images while respecting privacy. It includes steps to blur faces and remove sensitive info before training and prediction.
Jump into concepts and practice - no test required
This pipeline shows how a computer vision model processes images while respecting privacy. It includes steps to blur faces and remove sensitive info before training and prediction.
Loss
1.0 | *
0.8 | *
0.6 | *
0.4 | *
0.2 | *
0.0 +---------
1 2 3 4 5 Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.85 | 0.60 | Model starts learning, loss high, accuracy low |
| 2 | 0.65 | 0.72 | Loss decreases, accuracy improves |
| 3 | 0.50 | 0.80 | Model learns important features while preserving privacy |
| 4 | 0.40 | 0.83 | Training converges, privacy filters do not harm learning |
| 5 | 0.35 | 0.85 | Final epoch with good accuracy and low loss |
import cv2
image = cv2.imread('group_photo.jpg')
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
faces = face_cascade.detectMultiScale(image, scaleFactor=1.1, minNeighbors=5)
for (x, y, w, h) in faces:
face_region = image[y:y+h, x:x+w]
blurred_face = cv2.GaussianBlur(face_region, (99, 99), 30)
image[y:y+h, x:x+w] = blurred_face
cv2.imwrite('blurred_photo.jpg', image)What will be the result of running this code?