{"id":23749380,"url":"https://github.com/dewitt4/edge-ai-optimization","last_synced_at":"2026-03-11T02:30:18.573Z","repository":{"id":269469208,"uuid":"907512064","full_name":"dewitt4/edge-ai-optimization","owner":"dewitt4","description":"Some practical Python scripts for AI model optimization","archived":false,"fork":false,"pushed_at":"2024-12-23T18:57:11.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T15:18:28.891Z","etag":null,"topics":["ai","optimization","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dewitt4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-23T18:48:56.000Z","updated_at":"2024-12-23T18:57:14.000Z","dependencies_parsed_at":"2024-12-28T03:30:55.343Z","dependency_job_id":null,"html_url":"https://github.com/dewitt4/edge-ai-optimization","commit_stats":null,"previous_names":["dewitt4/edge-ai-optimization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dewitt4%2Fedge-ai-optimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dewitt4%2Fedge-ai-optimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dewitt4%2Fedge-ai-optimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dewitt4%2Fedge-ai-optimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dewitt4","download_url":"https://codeload.github.com/dewitt4/edge-ai-optimization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239908987,"owners_count":19716891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","optimization","python"],"created_at":"2024-12-31T15:18:32.849Z","updated_at":"2025-02-20T20:26:13.045Z","avatar_url":"https://github.com/dewitt4.png","language":"Python","readme":"# Edge AI Optimization Tools\n\nA collection of Python utilities for optimizing and deploying AI models on edge devices.\n\n## Features\n\n- Model quantization using PyTorch\n- Weight pruning for model compression\n- Knowledge distillation framework\n- ONNX export with optimization\n- Performance benchmarking tools\n\n## Requirements\n\n```\ntorch\u003e=1.9.0\nonnx\u003e=1.10.0\nonnxruntime\u003e=1.8.0\nnumpy\u003e=1.19.0\n```\n\n## Installation\n\n```bash\ngit clone https://github.com/yourusername/edge-ai-optimization\ncd edge-ai-optimization\npip install -r requirements.txt\n```\n\n## Usage\n\n### Quantization\n\nReduces model precision to decrease size while maintaining accuracy:\n\n```python\nfrom edge_optimization import quantize_model\n\nquantized_model = quantize_model(your_model, calibration_data)\n```\n\n### Pruning\n\nRemoves unnecessary weights to reduce model size:\n\n```python\nfrom edge_optimization import prune_model\n\npruned_model = prune_model(your_model, amount=0.3)  # Removes 30% of weights\n```\n\n### Knowledge Distillation\n\nTrains a smaller student model using a larger teacher model:\n\n```python\ndistillation_loss = DistillationLoss(temperature=3.0)\nloss = distillation_loss(student_logits, teacher_logits)\n```\n\n### ONNX Export\n\nExports and optimizes models for edge deployment:\n\n```python\nfrom edge_optimization import optimize_for_edge\n\noptimize_for_edge(model, sample_input, \"model.onnx\")\n```\n\n### Benchmarking\n\nMeasures model performance metrics:\n\n```python\nmetrics = benchmark_model(model, test_data, device='cuda')\nprint(f\"FPS: {metrics['fps']}\")\n```\n\n## Performance Considerations\n\n- Quantization typically reduces model size by 75% with minimal accuracy loss\n- Pruning can reduce model size by 30-50% depending on architecture\n- ONNX optimization can improve inference speed by 20-40%\n- Consider batch size and input dimensions for optimal performance\n\n## Known Limitations\n\n- Quantization requires calibration data for best results\n- Pruning may affect model accuracy on complex tasks\n- ONNX optimization is model-architecture dependent\n- GPU required for maximum performance benefits\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Citation\n\nIf you use this code in your research, please cite:\n\n```bibtex\n@software{edge_ai_optimization,\n  author = {dewitt4},\n  title = {Edge AI Optimization Tools},\n  year = {2024},\n  url = {https://github.com/dewitt4/edge-ai-optimization}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdewitt4%2Fedge-ai-optimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdewitt4%2Fedge-ai-optimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdewitt4%2Fedge-ai-optimization/lists"}