Skip to content

ChauhanSai/hacksmu26

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Tusk 'n Tidy ๐Ÿ˜

Decentralized wildlife intelligence, verified by experts.

๐Ÿ† Second place submission to Hack SMU 2026

Tusk 'n Tidy is the world's first smart audio library that cleans up noisy jungle recordings to let experts verify and translate what animals are actually saying: a Web3-powered platform that lets anyone upload, analyze, and verify elephant field data with research-backed audio processing and on-chain trust.


๐ŸŒŽ Social Impact

Language and conservation efforts rely on accurate elephant audio data, but today, that data is often fragmented, unverifiable, or inaccessible. Biologists and citizen scientists collect valuable recordings, yet trust and validation remain bottlenecks.

Tusk โ€™n Tidy ensures that every contribution is traceable, verified, and rewarded, empowering:

  • ๐ŸŒฟ Citizen scientists to contribute meaningful data
  • ๐Ÿงช Biologists to validate findings with confidence
  • ๐ŸŒ Researchers to make elephant emotion-driven decisions

๐Ÿง  Inspiration

Wildlife research is powerful but messy:

โ€œHow do we know this recording is real?โ€ โ€œWhere did this data come from?โ€ โ€œWhats happening in this audio?โ€

We wanted to build a system where every piece of data has proof, provenance, and expert validation.

To do this, we developed the world's largest and most navigable dataset of clean, labeled elephant field recordings covering 29 contexts and 91 actions with a total of 5,510 audio samples with datapoints.


๐Ÿ’ก What it does

  • ๐Ÿงน Multi-Stage Audio Cleaning: Combines classical DSP (spectral subtraction, Wiener filtering, NMF) to produce clean, research-grade audio signals. See our dataflow below:
RAW NOISY WAV FILE
    โ”‚
    โ–ผ
 [1. PAPER IMPLEMENTATION] 
 [pubs.aip](https://pubs.aip.org/asa/jasa/article/141/4/2715/1059147/Automated-detection-of-low-frequency-rumbles-of) 
 STFT with nfft=1024, hop=200, Hann window
    โ”‚ (Complex spectrogram: magnitude + phase)
    โ–ผ
 [2. PAPER IMPLEMENTATION] 
 [arxiv](https://arxiv.org/abs/2410.12082) 
 Log-frequency axis transformation
    โ”‚ (Makes harmonic structure linear)
    โ–ผ
 [3. PAPER IMPLEMENTATION] 
 [pmc.ncbi.nlm.nih](https://pmc.ncbi.nlm.nih.gov/articles/PMC8648737/) 
 SPECTRAL SUBTRACTION (ฮฑ=1.5, ฮฒ=0.02)
    โ”‚ (Removes stationary noise: generator hum)
    โ–ผ
[4] WIENER FILTERING
    โ”‚ (Smooths noise removal, reduces musical noise)
    โ–ผ
[5] NMF SEPARATION
    โ”‚ (Removes tonal components: car engine, generator RPM)
    โ–ผ
[6] U-NET MASK PREDICTION (BioCPPNet architecture)
    โ”‚ (Deep learning source separation)
    โ”‚ Outputs: mask_elephant, mask_noise
    โ–ผ
[7] APPLY MASK: Sxx_elephant = Sxx_noisy ร— mask_elephant
    โ”‚
    โ–ผ
[8] AST FRAME-LEVEL VERIFICATION (arXiv 2410.12082)
    โ”‚ (Detects exact rumble boundaries, removes non-elephant frames)
    โ”‚
    โ–ผ
[9] INVERSE STFT โ†’ Time-domain waveform
    โ”‚ (nfft=1024, hop=200, Hann window)
    โ”‚
    โ–ผ
[10] BAND-PASS FILTER: 8โ€“180 Hz
    โ”‚ (Removes any residual high-freq noise, DC offset
    โ”‚
    โ–ผ
CLEAN ELEPHANT AUDIO RECORDING

  • ๐Ÿง  Research-backed Audio Processing: Filter recordings using research pipelines to detect and isolate animal motivations and thinking.
  • ๐ŸŽค LIVE Monitoring: Capture audio in real time and instantly run cleaning, detection, and labelingโ€”surfacing elephant calls with live spectrograms and on-the-fly annotations for immediate insight.
  • ๐ŸŒ Decentralized Uploads: Users upload raw field recordings directly to IPFS, ensuring permanent, tamper-proof storage.
  • ๐Ÿงช Expert Verification: Verified biologists review uploads, cleaning, and labels and confirm findings via blockchain-backed approvals.
  • ๐Ÿ“Š Interactive Explorer: Browse recordings, view spectrograms, and analyze elephant audio in real time.

๐ŸŒŸ ML-powered Emotion Analysis

  • Behavioral context: Each call is framed as multi-class prediction over ethogram-style contexts (e.g. affiliative, protest & distress, social play, movement & leadership), backed by a high-accuracy acoustic classifier on a 256-D fingerprint.
  • Valence & arousal: The linguistics pipeline also learns coarse valence (positive / neutral / negative) and arousal (low / medium / high) from conttext, used for emotion summaries.
  • Interpretation cards: Fuse cluster ID, predicted context, confidence language, and valence/arousal tags so reviewers can spot-check stories call-by-call.

๐ŸŽฏ Acoustic fingerprint & context classifier

  • Input representation: 256 dimensions of elephant-specific features grouped into rumble-band energy, ~7.7 Hz tremor, temporal phases (onset / body / offset), and timbre (MFCCs + mel statistics), roughly a voice print for infrasonic calls.
  • Model family (dashboard narrative): LightGBM-style gradient boosting on tabular acoustics (91.6% accuracy on evaluation).

๐Ÿ”ฎ KNN Behavior Analysis

  • KNN: KNN uses five audios with the smallest absolute duration gap to the cleaned recording, then overlays them on the same UMAP, visualizing biological differences in duration connection versus emotion connection.
  • Link to behavior: UMAP clusters acoustic clusters to dominant behavioral contexts.

๐ŸŒŸ Key Benefits

  • Open Science: Anyone can explore and contribute to global biodiversity data.
  • Live Field Recordings: Analyze elephant emotions and actions using audio in real-time.

๐Ÿš€ Use Cases

  • Wildlife researchers collecting and validating animal recordings
  • Conservation organizations tracking endangered species
  • Citizen scientists contributing field data globally
  • Academic institutions building open-access biological datasets
  • LIVE environmental monitoring using audio-based species detection

โ˜€๏ธ Solana Integration for Open Science

Our Web3 Stack is as follows:

  • Solana Web3.js for blockchain interaction
  • Wallet authentication via Phantom/Solflare
  • Anchor Framework for smart contracts

What Solana Does in Our System

  • ๐Ÿงพ Proof of Origin: Every audio upload is tied to a wallet signature and stored on-chain as a CID reference, creating a permanent, tamper-proof record of who submitted what.
  • ๐Ÿงช Expert Verification as a Transaction: When a biologist approves a recording, itโ€™s not just a UI action, itโ€™s a verification event.
  • ๐Ÿ… Reputation System: Users build credibility through verified contributions, stored transparently and resistant to manipulation.
  • ๐Ÿช™ Incentive Alignment: Smart contracts reward both contributors and validators, ensuring high-quality data and honest reviews.
  • ๐Ÿ”„ Real-Time Sync: A WebSocket indexer listens to on-chain events and updates the app instantlyโ€”bridging blockchain and a fast user experience.

Heavy data stored on IPFS + Trust/verification stored on Solana = efficient + scalable + verifiable


๐Ÿ› ๏ธ How we built it

Frontend

  • HTML, Tailwind CSS, JavaScript
  • Plotly.js for in-browser waveform visualization

Backend & APIs

  • Python + Flask
  • Audio / DSP: librosa, scipy, soundfile, matplotlib

AIs & Data Processing

  • Audio pipeline: STFT + spectral denoising, U-Net source separation
  • Python: librosa, scipy, scikit-learn
  • Gemini API: Lightweight quiz and answer-card synthesis, grounded to the retrieved transcript span.
  • Google Cloud Text-to-Speech: Reads back care instructions in a clear, natural voice.

Media & Data

  • Custom largest dataset: 5,510+ segmented elephant field recordings covering 29 contexts and 91 actions.

๐Ÿšง Challenges we overcame

  • Handling large audio uploads with efficient browser chunking + IPFS storage
  • Designing a robust non-AI processing pipeline and bridging it with AI for noisy real-world field recordings
  • Creating a UX that balances scientific depth with accessibility

๐Ÿ† Accomplishments

  • End-to-End Pipeline: Upload โ†’ IPFS โ†’ Research-backed processing โ†’ expert verification โ†’ on-chain record
  • AI-Powered Bioacoustics: Accurate emotion analyzer of wildlife sounds
  • Decentralized Trust Layer: Every contribution backed by verifiable blockchain transactions
  • Interactive Explorer: Real-time browsing of verified biological data
  • Incentive System: Contributors and experts rewarded fairly via smart contracts

๐Ÿ“š What we learned

  • Real-world data (like wildlife audio) is messy, and signal processing matters
  • UX is critical, even in technical platforms, to drive adoption for biologists

๐Ÿš€ Next Steps

  • Build a mobile field recording app for phones for easier data collection
  • Add DAO governance for community-driven validation standards
  • Integrate with global biodiversity databases (e.g., GBIF)
  • Introduce real-time alerts for species safety concerns

โค๏ธ Why Tusk 'n Tidy

Tusk โ€™n Tidy transforms biological data into a trusted knowledge network. Weโ€™re cleaning the noise, proving the truth, and protecting the giants.

Letโ€™s change conservation together, one recording at a time! ๐Ÿž๏ธ

Quick Start Guide

Project Structure

hacksmu26/
โ”œโ”€โ”€ frontend/                    # Web dashboard
โ”‚   โ”œโ”€โ”€ index.html              # Landing page
โ”‚   โ”œโ”€โ”€ analysis.html           # Analysis dashboard
โ”‚   โ”œโ”€โ”€ cleanup.html            # Audio cleanup terminal
โ”‚   โ”œโ”€โ”€ css/styles.css          # Dark institutional theme
โ”‚   โ””โ”€โ”€ js/                     # Frontend scripts
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ elephant_linguistics/   # Call analysis pipeline
โ”‚   โ””โ”€โ”€ elephant_ethogram/      # Ethogram data processing
โ”œโ”€โ”€ app.py                      # Flask API for audio cleanup
โ”œโ”€โ”€ elephant_audio_cleaner.py   # Audio cleaning module
โ””โ”€โ”€ requirements.txt            # Python dependencies

1. Install Dependencies

cd hacksmu26

# Install root dependencies (for audio cleanup)
pip install -r requirements.txt

# Install linguistics pipeline dependencies
pip install -r backend/elephant_linguistics/requirements.txt

2. Run the Linguistics Analysis Pipeline

cd backend/elephant_linguistics

# Generate sample data (optional, for testing)
python generate_sample_data.py

# Run the full analysis pipeline
python run_from_csv.py --csv sample_data/features.csv

This will:

  • Analyze elephant calls and cluster them into call types
  • Train context classifiers
  • Generate visualizations and export data to the frontend

3. Start the Frontend Dashboard

cd frontend

# Start a local HTTP server
python -m http.server 8080

Then open http://localhost:8080 in your browser.

4. Start the Audio Cleanup Backend (Optional)

cd hacksmu26

# Start the Flask API server
python app.py

The audio cleanup API will run at http://127.0.0.1:5000

Then navigate to http://localhost:8080/cleanup.html to use the audio cleanup feature.

See /backend/elephant_training for more details on the audio processing pipeline and how it can be run independently.