About the models
ValleySense uses one pretrained model and two models built by our team, combined by a transparent risk engine. They don't diagnose; they help decide when to test.
Cough detector (pretrained)
- Built by
- COUGHVID project, EPFL (Orlandic, Teijeiro & Atienza, 2021); not trained by ValleySense
- Source
- COUGHVID cough classifier (XGBoost over 68 audio features), published with the COUGHVID dataset. Orlandic, L., Teijeiro, T. & Atienza, D. The COUGHVID crowdsourcing dataset, a corpus for the study of large-scale cough analysis algorithms. Sci Data 8, 156 (2021). https://doi.org/10.1038/s41597-021-00937-4
- Trained on
- 215 hand-labeled recordings: 121 coughs and 94 non-coughs (speech, laughter, silence, background noise).
- Output
- Probability that the recording contains a cough. 0.5 or higher counts as a cough.
- Test metrics
- The authors report its ROC curve in the COUGHVID paper. Not validated by ValleySense.
- Limitations
- Only detects whether a cough is present; it says nothing about the cause. Trained on few recordings, so loud background noise can raise or lower the score.
Dry/wet cough model
- Built by
- ValleySense team
- Trained on
- COUGHVID crowdsourced recordings with an expert dry/wet label, keeping only recordings where all experts agreed: 2,205 recordings (1,764 train, 441 test). Dataset: Orlandic, L., Teijeiro, T. & Atienza, D. The COUGHVID crowdsourcing dataset, a corpus for the study of large-scale cough analysis algorithms. Sci Data 8, 156 (2021). https://doi.org/10.1038/s41597-021-00937-4
- Output
- Probability that the cough is dry (vs wet/productive), from a gradient-boosted classifier over 114 audio features. P(dry) ≥ 0.5 counts as a dry cough in the risk engine.
- Test metrics
- Held-out test set (n = 441): accuracy 0.77. Dry: precision 0.78, recall 0.99. Wet: precision 0.69, recall 0.09.
- Limitations
- Rarely recognizes wet coughs (recall 0.09), so most coughs are called dry; treat a dry result as weak. Trained on phone recordings from the public, not valley fever patients.
- If not loaded
- The app uses the patient's own description of their cough (dry, wet, or not sure).
Chest X-ray model
- Built by
- ValleySense team
- Architecture
- ResNet-18 with ImageNet-pretrained starting weights; the final layer is replaced by one sigmoid output.
- Trained on
- About 30,000–50,000 de-identified chest X-rays from a Stanford chest X-ray dataset, labeled pneumonia or not.
- Output
- pneumonia: probability that the image shows pneumonia. A Grad-CAM heatmap shows where the model looked.
- Test metrics
- Held-out test set of about 1,500 images: AUROC about 0.83.
- Limitations
- Detects a pneumonia pattern, not valley fever, and was not validated on valley fever patients. Like other deep neural networks it can't explain its reasoning; the Grad-CAM heatmap only shows which regions most affected the score and does not mark disease.
- Heatmap
- Grad-CAM: where the model looked. It is not a diagnosis and does not outline disease.
- If not loaded
- The clinician sees a plain message and the assessment is made without the X-ray.
Risk engine
- Method
- Bayesian update in odds space: start from a prior (15% for pneumonia-like illness, else 5%) and multiply by a likelihood ratio for each factor present.
- Where the numbers live
- lib/risk/weights.json: conservative starting estimates with an evidence note for each factor; not published or validated values.
- Limitations
- Not validated on patient data. Likelihood ratios are estimates and factors are treated as independent, which they are not.
- Thresholds
- Low < 20% ≤ Moderate < 35% ≤ High. Serology is recommended at ≥ 20%, when pneumonia is the working diagnosis, or after a prior negative test with ongoing symptoms.
Likelihood ratios version 2026-10-10
| Factor | LR | Evidence note |
|---|---|---|
| Rash on shins / erythema nodosum | 3.0 | In Arizona, erythema nodosum was due to valley fever in nearly two-thirds of patients (UA Valley Fever Center for Excellence). |
| Eosinophilia on CBC | 2.5 | Significant predictor in inpatient and outpatient models (CDC Emerging Infectious Diseases, 2022). |
| Antibiotics without improvement | 2.0 | Classic clue for valley fever misdiagnosed as bacterial pneumonia. |
| Hilar/mediastinal adenopathy on radiology read | 2.0 | More suggestive of valley fever than bacterial pneumonia. |
| Symptoms ≥ 21 days | 1.8 | Cough persisted in 83% of patients at week 8 (Blair et al., Emerging Infectious Diseases, 2014). |
| Fatigue | 1.5 | Reported by all patients at week 4 (Blair et al., 2014). |
| Dust storm, digging, construction, or yard work exposure | 1.5 | Spores are inhaled from disturbed soil. |
| Dry cough | 1.3 | Most patients have a dry cough (Cleveland Clinic Journal of Medicine, 2022); weak on its own. |
| Night sweats | 1.3 | About 60% at weeks 4–8 (Blair et al., 2014). |
| Joint aches | 1.3 | About 45–50% (Blair et al., 2014). |
| New to Arizona (past 3 months) | 1.3 | No prior immunity. |
| Chest pain | 1.2 | Common in primary coccidioidal pneumonia. |
| Wet cough | 0.8 | More typical of bacterial pneumonia. |
| Symptoms < 7 days | 0.8 | Short, sudden illness is less typical. |
| X-ray model: pneumonia pattern (output: pneumonia) | 1.5 | Score ≥ 0.5. 15–29% of community-acquired pneumonia in endemic areas is valley fever. Counted only when the clinician has not recorded a working diagnosis of pneumonia (yes or no), so it is never counted twice. |
Likelihood ratios (LRs) are deliberately conservative starting estimates, NOT published values. Each factor stores the evidence behind it. Change values here; no code changes needed.