feat(ml): implement v3.0 architecture with CBAM and calibrated inference
- Integrate Convolutional Block Attention Module (CBAM) for improved feature focus - Implement temperature scaling and confidence-based status reporting - Automate dataset acquisition using kagglehub - Update ONNX opset to 18 and refine preprocessing validation
This commit is contained in:
@@ -23,13 +23,20 @@ async fn main() -> Result<()> {
|
||||
// Load configuration from environment
|
||||
let config = Config::from_env()?;
|
||||
|
||||
// Create ModelService and wrap in Arc
|
||||
let model = Arc::new(ModelService::new(&config.model_path, config.input_size));
|
||||
|
||||
// Log model status
|
||||
// Create ModelService with calibration and wrap in Arc
|
||||
let model = Arc::new(ModelService::with_calibration(
|
||||
&config.model_path,
|
||||
config.input_size,
|
||||
config.temperature,
|
||||
config.conf_threshold_high,
|
||||
config.conf_threshold_low,
|
||||
));
|
||||
tracing::info!(
|
||||
model_loaded = model.is_loaded(),
|
||||
model_path = ?config.model_path,
|
||||
temperature = config.temperature,
|
||||
conf_high = config.conf_threshold_high,
|
||||
conf_low = config.conf_threshold_low,
|
||||
"Model service initialized"
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user