File: client_model.fbs

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (113 lines) | stat: -rw-r--r-- 2,850 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This flatbuffer represents a machine learning model which is used to compute
// the probability that a particular page visited by Chrome is phishing.
//
// Note: since the machine learning model is trained on the server-side and then
// downloaded onto the client it is important that this flatbuffer file stays in
// sync with the server-side copy.  Otherwise, the client may not be able to
// parse the server generated model anymore.  If you want to change this
// flatbuffer definition or you have questions regarding its format please contact
// safebrowsing@chromium.org.

include "components/safe_browsing/core/common/fbs/csd.fbs";

namespace safe_browsing.flat;

table Hash {
  data:[ubyte];
}

table ClientSideModel {
  hashes:[Hash];
  rule:[safe_browsing.flat.ClientSideModel_.Rule];
  page_term:[int];
  page_word:[uint];
  max_words_per_term:int;
  version:int;
  bad_subnet:[safe_browsing.flat.ClientSideModel_.IPSubnet];
  murmur_hash_seed:uint;
  max_shingles_per_page:int = 200;
  shingle_size:int = 4;
  threshold_probability:float = 0.5;
  vision_model:safe_browsing.flat.VisionModel;
  tflite_model_version:int (deprecated);
  tflite_thresholds:[safe_browsing.flat.TfLiteModelMetadata_.Threshold]
  (deprecated);
  tflite_model_input_width: int (deprecated);
  tflite_model_input_height: int (deprecated);
  tflite_metadata:safe_browsing.flat.TfLiteModelMetadata;
  img_embedding_metadata:safe_browsing.flat.TfLiteModelMetadata;
  dom_model_version:int;
}

root_type ClientSideModel;

namespace safe_browsing.flat.ClientSideModel_;

table Rule {
  feature:[int];
  weight:float;
}

table IPSubnet {
  prefix:[ubyte] (required);
  size:int = 128;
}

namespace safe_browsing.flat;

table TfLiteModelMetadata {
  version:int;
  thresholds:[safe_browsing.flat.TfLiteModelMetadata_.Threshold];
  input_width: int;
  input_height: int;
}

namespace safe_browsing.flat.TfLiteModelMetadata_;

table Threshold {
  label:string;
  threshold:float;
  esb_threshold:float;
}

namespace safe_browsing.flat;

table VisionModel {
  targets:[safe_browsing.flat.VisualTarget];
}

table VisualTarget {
  digest:[ubyte];
  timestamp_usec:long;
  hash:[ubyte];
  dimension_size:int;
  bins:[safe_browsing.flat.VisualFeatures_.ColorHistogramBin];
  match_config:safe_browsing.flat.MatchConfig;
}

table MatchConfig {
  match_rule:[safe_browsing.flat.MatchRule];
}

table MatchRule {
  hash_distance:double;
  color_distance:double;
  color_range:[safe_browsing.flat.MatchRule_.ColorRange];
  float_color_range:[safe_browsing.flat.MatchRule_.FloatColorRange];
}

namespace safe_browsing.flat.MatchRule_;

table ColorRange {
  low:int;
  high:int;
}

table FloatColorRange {
  low:float;
  high:float;
}