|
1 | 1 | # Step Detection Configuration |
2 | 2 |
|
3 | | -# Model Configuration |
4 | | -model: |
5 | | - input_shape: [6] # 6 sensor features (3 accel + 3 gyro) |
6 | | - output_classes: 3 # No Label, Start, End |
7 | | - architecture: "CNN" # Original high-accuracy CNN architecture |
8 | | - framework: "TensorFlow" |
| 3 | +# Step Detection Configuration |
| 4 | +detection: |
| 5 | + # Sensor buffer and thresholds |
| 6 | + window_size: 10 # Number of recent sensor readings to consider |
| 7 | + start_threshold: 0.3 # Threshold for step start detection (increased from 0.3) |
| 8 | + end_threshold: 0.3 # Threshold for step end detection (increased from 0.3) |
9 | 9 |
|
10 | | -# Training Configuration |
11 | | -training: |
12 | | - epochs: 50 # Increased for better convergence |
13 | | - batch_size: 32 # Reduced for better gradient updates |
14 | | - learning_rate: 0.001 |
15 | | - validation_split: 0.2 |
16 | | - early_stopping_patience: 10 |
17 | | - reduce_lr_patience: 5 |
| 10 | + # AI Model confidence requirements |
| 11 | + ai_high_confidence_threshold: 0.75 # High confidence threshold for AI-only detection |
| 12 | + ai_sensor_disagree_threshold: 0.80 # Required AI confidence when sensors disagree |
18 | 13 |
|
19 | | - # Model architecture parameters |
20 | | - dropout_rate: 0.3 # Increased to reduce overfitting to small movements |
21 | | - regularization: 0.001 # L2 regularization factor |
| 14 | + # Motion detection thresholds (balanced for accuracy) |
| 15 | + motion_threshold: 11.0 # Acceleration magnitude threshold for step detection (above gravity + margin) |
| 16 | + gyro_threshold: 1.5 # Gyroscope magnitude threshold for step detection (increased to reduce false positives) |
22 | 17 |
|
23 | | - # Class balancing |
24 | | - use_class_weights: true # Automatically calculate class weights |
| 18 | + # Timing constraints |
| 19 | + min_step_interval: 0.4 # Minimum time (seconds) between step detections |
25 | 20 |
|
26 | | - # Data augmentation (if needed) |
27 | | - data_augmentation: false |
28 | | - noise_factor: 0.01 |
| 21 | + # Advanced filtering to reduce false positives (made less restrictive) |
| 22 | + enable_motion_variance_filter: true # Only detect steps with varying motion patterns |
| 23 | + min_motion_variance: 1.0 # Minimum variance in motion to consider it walking (lowered from 2.0) |
| 24 | + enable_stillness_detection: true # Detect when user is stationary |
| 25 | + stillness_threshold: 0.8 # Max motion variance when considered "still" (lowered from 1.5) |
29 | 26 |
|
30 | | -# Detection Configuration |
31 | | -detection: |
32 | | - window_size: 50 |
33 | | - # Enhanced sensitivity controls |
34 | | - confidence_threshold: 0.001 # Lowered to match model output range |
35 | | - magnitude_threshold: 8.0 # Reduced from 15.0 to capture normal walking patterns |
| 27 | + # Advanced detection settings (less restrictive) |
| 28 | + enable_peak_detection: true # Enable peak-based detection for better accuracy |
| 29 | + enable_adaptive_thresholds: false # Disable adaptive thresholds to prevent over-adjustment |
| 30 | + motion_sensitivity: 0.9 # Sensitivity multiplier (closer to 1.0 = less adjustment) |
36 | 31 |
|
37 | | - # Model prediction thresholds |
38 | | - prediction_confidence_min: 0.5 # Minimum confidence to consider any prediction |
39 | | - step_class_threshold: 0.6 # Specific threshold for step classes (1=start, 2=end) |
| 32 | + # Hybrid detection mode |
| 33 | + enable_hybrid_detection: true # Use multiple detection methods |
| 34 | + require_all_conditions: false # Don't require ALL conditions (OR logic instead of AND) |
40 | 35 |
|
41 | | - # Filtering parameters |
42 | | - enable_magnitude_filter: true # Enable/disable magnitude-based filtering |
43 | | - enable_confidence_filter: true # Enable/disable confidence-based filtering |
44 | | - temporal_smoothing: false # Enable temporal smoothing (future feature) |
| 36 | + # Peak detection parameters |
| 37 | + peak_prominence: 2.0 # Minimum prominence for peak detection |
| 38 | + peak_distance: 5 # Minimum distance between peaks (in samples) |
45 | 39 |
|
46 | | - # Advanced filtering options |
47 | | - adaptive_magnitude: true # Adjust magnitude threshold based on recent activity |
48 | | - min_magnitude_threshold: 6.0 # Absolute minimum to filter out phone shakes |
49 | | - max_magnitude_threshold: 25.0 # Maximum to filter out extreme movements |
50 | | - |
51 | | -# Data Configuration |
52 | | -data: |
53 | | - raw_data_path: "data/raw" |
54 | | - processed_data_path: "data/processed" |
55 | | - model_save_path: "models" |
| 40 | + # Buffer settings |
| 41 | + processing_buffer_size: 100 # Size of processing times buffer |
56 | 42 |
|
57 | 43 | # API Configuration |
58 | 44 | api: |
59 | 45 | host: "0.0.0.0" |
60 | 46 | port: 8000 |
61 | 47 | reload: true |
62 | 48 | title: "Step Detection API" |
63 | | - version: "1.0.0" |
| 49 | + version: "2.0.0" |
| 50 | + |
| 51 | +# Model Configuration (currently used values only) |
| 52 | +model: |
| 53 | + input_shape: [6] # 6 sensor features (3 accel + 3 gyro) |
| 54 | + output_classes: 3 # No Label, Start, End |
| 55 | + |
| 56 | +# Data Configuration |
| 57 | +data: |
| 58 | + raw_data_path: "data/raw" |
| 59 | + processed_data_path: "data/processed" |
| 60 | + model_save_path: "models" |
64 | 61 |
|
65 | | -# Logging Configuration |
66 | | -logging: |
67 | | - level: "INFO" |
68 | | - format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s" |
69 | | - log_file: "logs/step_detection.log" |
| 62 | +# Debug Configuration |
| 63 | +debug: |
| 64 | + enable_step_detection_logs: true |
| 65 | + log_only_on_steps: false |
0 commit comments