Skip to content
ValleySense

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.

Pretrained, not ours

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.
Built by our team

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).
Built by our team

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.
Rules, not a trained model

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

FactorLREvidence note
Rash on shins / erythema nodosum3.0In Arizona, erythema nodosum was due to valley fever in nearly two-thirds of patients (UA Valley Fever Center for Excellence).
Eosinophilia on CBC2.5Significant predictor in inpatient and outpatient models (CDC Emerging Infectious Diseases, 2022).
Antibiotics without improvement2.0Classic clue for valley fever misdiagnosed as bacterial pneumonia.
Hilar/mediastinal adenopathy on radiology read2.0More suggestive of valley fever than bacterial pneumonia.
Symptoms ≥ 21 days1.8Cough persisted in 83% of patients at week 8 (Blair et al., Emerging Infectious Diseases, 2014).
Fatigue1.5Reported by all patients at week 4 (Blair et al., 2014).
Dust storm, digging, construction, or yard work exposure1.5Spores are inhaled from disturbed soil.
Dry cough1.3Most patients have a dry cough (Cleveland Clinic Journal of Medicine, 2022); weak on its own.
Night sweats1.3About 60% at weeks 4–8 (Blair et al., 2014).
Joint aches1.3About 45–50% (Blair et al., 2014).
New to Arizona (past 3 months)1.3No prior immunity.
Chest pain1.2Common in primary coccidioidal pneumonia.
Wet cough0.8More typical of bacterial pneumonia.
Symptoms < 7 days0.8Short, sudden illness is less typical.
X-ray model: pneumonia pattern (output: pneumonia)1.5Score ≥ 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.