DeployU
Interviews / AI & MLOps / What are model cards and why are they important for responsible AI?

What are model cards and why are they important for responsible AI?

conceptual Responsible AI Interactive Quiz Code Examples

The Scenario

You are a senior ML engineer at a healthcare company. Your team has developed a new deep learning model that can detect signs of diabetic retinopathy in retinal images. The model has the potential to save millions of people from blindness, but it also has the potential to cause harm if it is not used correctly.

The company is planning to release the model to the public, and you have been tasked with creating a model card for it. The model card must be comprehensive and transparent, and it must address all the potential risks and limitations of the model.

The Challenge

What is your strategy for creating a model card for this model? What are the key sections that you would include in the model card, and what information would you provide in each section? How would you use the model card to promote the responsible use of the model?

Wrong Approach

A junior engineer might create a very brief model card with only the model's accuracy and a link to the paper. They might not consider the ethical implications of the model or the potential for bias. They might also not provide enough information for others to reproduce their results.

Right Approach

A senior engineer would understand that a model card is a critical component of responsible AI, especially for a high-stakes application like medical diagnosis. They would create a comprehensive model card that includes all the relevant information about the model, including its architecture, training data, evaluation results, limitations, and potential biases. They would also use the model card as an opportunity to educate users about the responsible use of the model.

Step 1: Gather the Information

The first step is to gather all the information that you will need to create the model card.

SectionInformation to include
Model DetailsModel architecture, version, framework, and any other relevant technical details.
Intended UseThe specific use cases that the model was designed for.
FactorsThe factors that can affect the model’s performance, such as image quality, patient demographics, and camera type.
MetricsThe metrics that were used to evaluate the model’s performance, such as accuracy, precision, recall, and F1-score.
Training DataInformation about the data that was used to train the model, including the size of the dataset, the demographics of the patients, and any potential biases in the data.
Evaluation DataInformation about the data that was used to evaluate the model.
Ethical ConsiderationsA discussion of any ethical considerations related to the model, such as the potential for bias, the risk of misdiagnosis, and the importance of human oversight.
Caveats and RecommendationsAny caveats or recommendations for using the model, such as the importance of using it in consultation with a qualified medical professional.

Step 2: Write the Model Card

The next step is to write the model card. Here is an example of what the model card for our diabetic retinopathy model might look like:

---
license: apache-2.0
tags:
- healthcare
- computer-vision
- diabetic-retinopathy
---

# Model Card for a Diabetic Retinopathy Detection Model

## Model Details

This model is a ResNet-50 convolutional neural network that has been trained to detect signs of diabetic retinopathy in retinal images.

## Intended Use

This model is intended to be used by qualified medical professionals to assist in the diagnosis of diabetic retinopathy. It should not be used as a standalone diagnostic tool.

## Factors

The model's performance can be affected by a variety of factors, including image quality, patient demographics, and camera type.

## Metrics

The model was evaluated on a held-out test set and achieved an accuracy of 95%, a precision of 96%, and a recall of 94%.

## Training Data

The model was trained on a dataset of 100,000 retinal images from a diverse group of patients. The dataset was balanced for age, gender, and ethnicity.

## Evaluation Data

The model was evaluated on a dataset of 10,000 retinal images that were not used in the training process.

## Ethical Considerations

-   **Bias:** The model may be biased towards certain demographic groups. It is important to be aware of this and to use the model in a way that is fair and equitable.
-   **Misdiagnosis:** The model is not perfect and may make mistakes. It is important to use the model in consultation with a qualified medical professional.
-   **Human Oversight:** The model should not be used as a standalone diagnostic tool. All diagnoses should be confirmed by a qualified medical professional.

## Caveats and Recommendations

-   This model is not a substitute for a professional medical opinion.
-   The model should only be used by qualified medical professionals.
-   The model should be used in conjunction with other diagnostic tools.

Step 3: Promote Responsible Use

The final step is to use the model card to promote the responsible use of the model. This includes:

  • Making the model card easily accessible to all users of the model.
  • Educating users about the potential risks and limitations of the model.
  • Encouraging users to report any issues or concerns they have with the model.

Practice Question

You are creating a model card for a hiring model that is used to screen job applicants. Which of the following would be the most important to include in the 'Ethical Considerations' section?