CoolFace
Modelpublic

pat229988/dam-tflite-dynamic-range

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes9downloads
Model Card

DAM TFLite Dynamic-Range Quantized Weights

This repository publishes a dynamic-range quantized TensorFlow Lite version of the Kintsugi Health Depression-Anxiety Model (DAM): `KintsugiHealth/dam`.

Only the converted TFLite weights and conversion/evaluation metadata are published here. The original PyTorch checkpoint, original training data, and DAIC-WOZ audio are not included.

Relationship to the Original Model

This is a derivative conversion of KintsugiHealth/dam for smaller on-device runtime deployment. For the original model card, intended use, limitations, clinical context, and references, see:

  • Original model: https://huggingface.co/KintsugiHealth/dam
  • Original license metadata: Apache-2.0
  • Base model: openai/whisper-small.en

This model card intentionally separates the converted-weight details from the original DAM model card. The original clinical and safety limitations still apply.

Files

FileDescription
dam_features_scores_dynamic_range.tfliteDynamic-range quantized TFLite model
dam_features_scores_dynamic_range.metadata.jsonInput/output metadata and thresholds
evaluation_results.jsonMachine-readable size/accuracy summary
EVALUATION.mdHuman-readable evaluation summary
NOTICEDerivative-work and original-model attribution
LICENSEApache License 2.0

Input / Output

The model expects precomputed DAM/Whisper log-mel features, not raw audio.

Input:

text
dtype: float32
shape: [1, 80, 3000]

Output:

text
dtype: float32
shape: [2]
order: [depression_score, anxiety_score]

The app/runtime should perform the same preprocessing as DAM's featex.py:

  1. 1.Load mono audio and resample to 16 kHz.
  2. 2.Remove DC offset and normalize amplitude to [-1, 1].
  3. 3.Pad/split audio into 30-second chunks.
  4. 4.Run Whisper log-mel feature extraction.
  5. 5.Apply DAM log-mel energy rescaling.
  6. 6.Run this TFLite model per chunk and aggregate scores as needed.

Quantization Type

This is dynamic-range quantization:

  • input remains float32
  • output remains float32
  • weights are quantized/compressed internally by TensorFlow Lite

No preprocessing or postprocessing dtype changes are required relative to the fp32 TFLite model.

Size and Accuracy

ModelSizeRelative
Legacy fp32 TFLite rebuild695.64 MiB1.00x
Dynamic-range TFLite184.98 MiB0.266x

The dynamic-range model is approximately 73.4% smaller / 3.76x smaller.

Evaluation on 20 DAIC-WOZ participant-only audio files showed:

TaskMAE vs official PyTorch chunk meanMax AESeverity agreement
Depression0.015800.0413620/20
Anxiety0.015800.0388720/20

See EVALUATION.md and evaluation_results.json for details.

Runtime Download Example

python
from huggingface_hub import hf_hub_download

model_path = hf_hub_download(
    repo_id="pat229988/dam-tflite-dynamic-range",
    filename="dam_features_scores_dynamic_range.tflite",
)
print(model_path)

Loading with TensorFlow Lite / LiteRT

python
import numpy as np

try:
    from ai_edge_litert.interpreter import Interpreter
except Exception:
    import tensorflow as tf
    Interpreter = tf.lite.Interpreter

interpreter = Interpreter(model_path="dam_features_scores_dynamic_range.tflite")
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()[0]
output_details = interpreter.get_output_details()[0]

# features shape: [1, 80, 3000], dtype float32
features = np.zeros((1, 80, 3000), dtype=np.float32)

interpreter.set_tensor(input_details["index"], features)
interpreter.invoke()
scores = interpreter.get_tensor(output_details["index"]).reshape(-1)

depression_score, anxiety_score = scores.tolist()

Thresholds

The metadata file includes the original DAM thresholds:

json
{
  "depression": [-0.6699, -0.2908],
  "anxiety": [-0.7939, -0.2173, 0.1521]
}

Safety / Clinical Limitations

  • This model is not intended for diagnosis or self-diagnosis without clinical oversight.
  • Performance may degrade with noisy audio, multiple speakers, non-English speech, or recordings outside intended conditions.
  • This repository provides a conversion-fidelity evaluation, not an independent clinical validation of the quantized model.

Attribution

Original DAM model by Kintsugi Health:

  • https://huggingface.co/KintsugiHealth/dam
  • Source model ID: KintsugiHealth/dam
  • Original license metadata: Apache-2.0