Google har offentliggjort Magika 1.0, et værktøj til bestemmelse af filindholdstype

Google har præsenteret udgivelsen af værktøjet Magika 1.0, der er designet til at bestemme typen af indhold baseret på analysen af de data, der findes i filen. Magika kan præcist identificere de programmeringssprog, komprimeringsmetoder, installationspakker, eksekverbare kode, typer af markup, lyd-, video-, dokument- og bildeformat, der anvendes i indholdet. Værktøjet relateret til projektet og den færdige maskinlæringsmodel distribueres under Apache 2.0-licensen. Wrapperne er forberedt til sprog som Rust, Python, JavaScript/TypeScript og Go.

I modsætning til lignende projekter, der bestemmer MIME-typen baseret på indhold, adskiller Magika sig ved at anvende metoder inden for maskinlæring, ydelse og præcisionen i sin bestemmelse. Modellen er trænet ved hjælp af Keras-rammen på 100 millioner filprøver (datasætstørrelsen er over 3 TB) og understøtter genkendelse af 200 datatyper med en nøjagtighed på mindst 99 %. Modellen er komprimeret i ONNX-format og fylder kun et par megabyte. Anvendelsen af metoder til dyb læring har muliggjort en 50 % stigning i præcisionsbestemmelsen sammenlignet med det tidligere anvendte system i Google, som var baseret på manuelt definerede regler.

I Google-systemet bruges det til klassificering af filer i tjenester som Gmail, Drive, Code Insight og Safe Browsing under sikkerheds- og overholdelsestests. Der er sikret integration af Magika i platformene VirusTotal og abuse.ch som et led i den primære filtrering af filer før specifikke analyser udføres. Den implementerede konfiguration af Magika i Googles infrastruktur muliggør scanning af flere millioner filer pr. sekund og flere hundrede milliarder filer pr. uge. Efter download af modellen er tiden til at generere output 5 ms ved test på en CPU-kerne. Bestemmelsestiden afhænger næsten ikke af filens størrelse.

For integrating Magika into your projects, a command-line utility, packages for Python, Rust, and Go, as well as a JavaScript library capable of running in a browser or in Node.js-based projects have been prepared. The command-line interface and API support batch operations, allowing multiple files to be checked in a single request. There is a recursive scanning mode for the entire contents of a directory and three prediction modes to adjust fault tolerance (high confidence, medium confidence, and best guess).

Initially, the project was developed in Python, but for the release of version 1.0, the content type detection engine was rewritten in Rust, which allowed for higher performance while maintaining adequate code security. The ONNX Runtime framework is used to execute the machine learning model, and the Tokio library is used for parallel asynchronous request processing. On a MacBook Pro (M4), the engine's performance allows processing of about 1000 files per second.

In addition to the new engine, the release of version 1.0 includes an increase in the number of supported types from about 100 to 200; the addition of a new command-line client written in Rust; improved accuracy in detecting text formats such as configuration files and code; and the rework of modules for Python and TypeScript to simplify their integration with other projects. Among the newly supported content types are formats used in machine learning and AI; programming languages Swift, Kotlin, TypeScript, Dart, Solidity (solidity), Web Assembly, and Zig; DevOps components (Dockerfiles, TOML, HashiCorp, Bazel build files, and YARA rules); SQLite databases; AutoCAD files (dwg, dxf), Adobe Photoshop (psd), and fonts (woff, woff2). Improved separation of code in C++ and C, JavaScript, and TypeScript.

Kilde: opennet.ru

Køb pålidelig webhosting med DDoS-beskyttelse, VPS VDS-servere 🔥 Køb pålidelig webhosting med DDoS-beskyttelse, VPS VDS-servere | ProHoster