<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Parameter Sharing for Spatio-Temporal Process Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Raphael Fischer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nico Piatkowski</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Katharina Morik</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>TU Dortmund, AI Group</institution>
          ,
          <addr-line>Dortmund</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>While probabilistic models such as Markov random elds can be highly bene cial for spatio-temporal data, they often su er from overtting and have limited use in memory-constrained systems. We present a novel method to compress trained models based on temporal parameter sharing, which reduces redundancies in the parameters.</p>
      </abstract>
      <kwd-group>
        <kwd>Markov random eld</kwd>
        <kwd>parameter sharing</kwd>
        <kwd>spatio-temporal data</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Our world is constantly changing, and machine learning provides certain insight
into these interesting procedures. Capturing states of a process at di erent
spatial sites results in spatio-temporal datasets, and creates demand for accordingly
tailored and theoretically well-based methods.</p>
      <p>
        Spatio-temporal random eld (STRF) models, an extension of the widely
investigated Markov random eld s (MRFs), allow to further analyze such processes
with undirected graphical models. STRFs have been experimentally used in
trafc routing [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] and network communication [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Moreover their use in
resourceconstrained environments has been extensively explored [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Possibly the biggest
problem of STRFs is the high number of parameters, which increases
quadratically with the data complexity [
        <xref ref-type="bibr" rid="ref6 ref9">9,6</xref>
        ]. In practice this often limits the model
usability in terms of runtime and storage, and also makes them prone to over
tting. We therefore propose a novel approach to counter these issues by
compressing previously trained STRFs. Our method uses parameter sharing, hence the
compression does neither alter the data nor the underlying graphical structure.
      </p>
      <p>
        Parameter sharing based on quantization was recently used for hard
parameter tying in MRF training [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], which also tackled the problem of over tting and
results in less complex models. Our approach is similar, however we use a
different quantization based on the spatio-temporal structure of the MRF. Similar
methods have also been established for neural networks [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], with the aim of
reducing the complexity.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Methodology</title>
      <p>
        Spatio-Temporal Models A MRF represents a process in form of a
multivariate random variable X = (X1; X2; : : : ; Xn), with dependencies between
components being represented via the conditional independence structure (CIS)
G = (V; E). The concept of exponential families [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] allows parametrization via
the edges of G, and optimal parameters can be determined with maximum
likelihood estimation based on available process data. They resulting model can be
queried to predict the most likely values for unobserved components of a partially
given process state, i.e. to solve the conditional maximum a posteriori problem.
      </p>
      <p>
        The STRF approach [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] extends the MRF framework for spatio-temporal use
cases. STRF models are based on a spatial CIS G0, which is replicated T times,
i.e. the process is modeled for T di erent times. The replicas Gt are connected
with temporal edges, the nal model has temporal edges for each node and spatial
edge. Such a structure allows temporal reparametrization for compressing and
regularizing the parameters [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Our compression approach exploits the temporal
dimension of STRFs further by merging parameters at di erent spatial sites.
      </p>
      <p>The parameters of any STRF can be subdivided into spatial and temporal
parameter groups, if the replica nodes in G share the same state space. The
temporal edges are then represented by parameters temp(vi; vj ; t) 2 which
describe temporal transitions from t to t+1 between replicas of nodes vi; vj 2 V0.
Each parameter spat(vi; vj ; t) 2 of a spatial edge describes a state transition
between replicas of vi; vj 2 V0 at time 1 t T . Accordingly each parameter
belongs to a set of parameters temp(vi; vj ) or spat(vi; vj ), which describe the
same transition at di erent temporal sections of the model. This understanding
is exemplary displayed in Figure 1. We call each set spat(vi; vj ) or temp(vi; vj )
a parameter series. We denote the number of di erent parameter series in the
model with st = j tempj and ss = j spatj.</p>
      <p>
        Compression of parameter series In most models the parameter series at
di erent spatial sections will probably show analogies and thus redundancies.
As an example, a street network model might represent crossings which behave
similarly over time. We therefore propose to quantize the set of parameter series,
meaning that each series spat(vi; vj ) or temp(vi; vj ) is replaced by a speci ed
centroid ~spat(vi; vj ) or ~temp(vi; vj ). As parameter series are essentially T
or (T 1)-dimensional vectors, vector quantization methods such as k-means
clustering [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] can be easily applied for nding good centroids. In a compressed
model, several parameter series share the values of the corresponding centroid
series, hence we name it parameter series cluster sharing (PSCS) compression.
      </p>
      <p>The compression rate r determines the number of temporal and spatial
cluster centroids ct and cs that need to be found, depending on the number of original
series r = sctt++csss . The space savings s can be computed with s = 1 sctt++csss As an
example, a model with st = 1024 di erent temporal parameter series and no
spatial parameters, which are being replaced by ct = 128 clustered centroids, would
be compressed with r = 1024=128 = 8, i.e. a rate of 8:1, 1 (128=1024) = 87:5%
of its original memory space could be saved.
0:5</p>
      <p>0
0:5</p>
      <p>G0:
1
1
c
a
2
t
t
b
3
2
G:
f spat(a; c; 1)g
f spat(a; c; 2)g</p>
      <p>f spat(a; c; 3)g
f temp(b; b; 1)g
f temp(b; b; 2)g
0:5 f temp(a; a)g</p>
      <p>It is important to understand that our approach does not modify the CIS,
as compression only a ects the parameters. This allows nodes in the model to
behave similarly, but does not enforce them to act totally equal. PSCS drastically
decreases memory requirements and thus facilitates the resource-constrained use
of STRFs. It also generalizes the model, which might alleviate over tting.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Experiments</title>
      <p>
        Experimental Settings We chose the INSIGHT Dublin city data for our
experiments [
        <xref ref-type="bibr" rid="ref5 ref6">5,6</xref>
        ]. It was collected in 2013 from Sydney Coordinated Adaptive
Tra c System (SCATS) tra c sensors in Dublin, Ireland. Figure 2 depicts the
placement of sensors in the street network of the city. The dataset features
discretized speed measurements of 2367 SCATS sensors for N = 134 full days, with
T = 12 measurements per day (every two hours). The spatial data
dependencies are approximated with help of the Chow-Liu algorithm, i.e. G0 is a tree
with 2366 edges. The resulting STRF structure contains 12 2366 spatial and
11 (2366 2 + 2367) temporal edges.
      </p>
      <p>
        An extensive framework for probabilistic computations with belief
propagation and gradient descent allowed us to work with STRF models1, we slightly
adadapted it to extract the parameter series. Python scripts were run to cluster
the series with scikit-learn's MiniBatchKMeans implementation2 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] (the value
k is given by ct and cs).
1 https://randomfields.org/px
2 https://scikit-learn.org/
      </p>
      <p>We prepared a 5-fold cross validation, i.e. 20% of the full data was used for
testing in each split, providing averaged results and standard deviation (SD). As
our experiment dataset is fully observed, we arti cially concealed 50% of the test
data. The STRF is used to predict the most likely values based on the remaining
observations, and comparison with the originally measurements allows us to
compute the prediction accuracy. We came up with three realistic scenarios why
measurements might be missing: some SCATS sensors break down on single days
(A1), only the beginning of the days are recorded (i.e. future prognosis) (A2),
or all tra c sensors have random malfunctions (A3). Accordingly we prepared
three di erent versions of the test data, and obtain the accuracy values A1-A3.
Experimental Results We used
PSCS for compressing the models to
80, 60, 40, 20, and 1% of their
original size. The quality of the compressed
models in terms of the prediction
accuracy is shown in Table 1.</p>
      <p>First thing to notice is that our
future prognosis scenario (A2) has a
signi cantly lower accuracy, for which the
lack of local information is the most
plausible explanation. Predicting data
for full break down of some sensors
Fig. 2. Placement of tra c sensors. scores a similar accuracy (A1) to
predicting randomly missing data (A1).</p>
      <p>Probably the local spatial information
is more important for predictions then temporally available data.</p>
      <p>As expected A1 and A3 decrease with rmer compression (i.e. higher value
of r), however the performance only signi cantly drops after a rate of 5:1. In
the second scenario (A2) a compression is even able to increase the prediction
accuracy, which might indicate that the original model slightly out tted the
training data. One can also see that compression increases the robustness of the
model, as the SD is decreases with strong compression.
Our novel PSCS approach allows to compress spatio-temporal Markov models.
The method eliminates parameter redundancies in the STRF, without a ecting
the CIS. Our experiments show that even drastically compressed models still
perform well and are even able to outperform the original model, while requiring
way less memory storage.</p>
      <p>PSCS also holds potential for future work, which we want to shortly discuss
here. Firstly one could incorporate a-priori knowledge of cluster assignments
into the training routine. With adding a regularizing term one could enforce a
soft temporal parameter series tying. By only training the centroid values (i.e.
parameter sharing instead of regularization) it would also be possible to establish
a hard tying of parameter series, which reduces the complexity during training.
Acknowledgement This research has been funded by the Federal Ministry
of Education and Research of Germany as part of the competence center for
machine learning ML2R (01jS18038A).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Chou</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sarkhel</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ruozzi</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gogate</surname>
          </string-name>
          , V.:
          <article-title>On parameter tying by quantization</article-title>
          .
          <source>In: Proceedings of the Thirtieth AAAI Conference on Arti cial Intelligence</source>
          . pp.
          <volume>3241</volume>
          {
          <fpage>3247</fpage>
          . AAAI'
          <fpage>16</fpage>
          , AAAI Press (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Liebig</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Piatkowski</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bockermann</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morik</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Dynamic route planning with real-time tra c predictions</article-title>
          .
          <source>Information Systems</source>
          <volume>64</volume>
          ,
          <fpage>258</fpage>
          {
          <fpage>265</fpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>S.P.</given-names>
          </string-name>
          :
          <article-title>Least squares quantization in PCM</article-title>
          .
          <source>IEEE Trans. Information Theory</source>
          <volume>28</volume>
          (
          <issue>2</issue>
          ),
          <volume>129</volume>
          {
          <fpage>136</fpage>
          (
          <year>1982</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Michaelis</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Piatkowski</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morik</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Predicting next network cell ids for moving users with discriminative and generative models</article-title>
          .
          <source>In: Mobile Data Challenge Workshop at Int. Conf. on Pervasive Computing. Newcastle</source>
          , UK (
          <year>June 2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Panagiotou</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zygouras</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Katakis</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gunopulos</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zacheilas</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boutsis</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kalogeraki</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lynch</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>O</given-names>
            <surname>'Brien</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Kinane</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Marecek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.Y.</given-names>
            ,
            <surname>Verago</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Daly</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Piatkowski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            ,
            <surname>Liebig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Bockermann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Morik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Schnitzler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Weidlich</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Gal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Mannor</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Stange</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Halft</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            ,
            <surname>Andrienko</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.L.</surname>
          </string-name>
          :
          <article-title>Insight: Dynamic tra c management using heterogeneous urban data</article-title>
          .
          <source>In: ECML/PKDD</source>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Piatkowski</surname>
          </string-name>
          , N.:
          <article-title>Exponential families on resource-constrained systems</article-title>
          .
          <source>Ph.D. thesis</source>
          , Technical University of Dortmund, Germany (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Piatkowski</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morik</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Spatio-temporal random elds: compressible representation and distributed estimation</article-title>
          .
          <source>Machine Learning</source>
          <volume>93</volume>
          (
          <issue>1</issue>
          ),
          <volume>115</volume>
          {
          <fpage>139</fpage>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Sculley</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Web-scale k-means clustering</article-title>
          .
          <source>In: Proceedings of the 19th International Conference on World Wide Web</source>
          . pp.
          <volume>1177</volume>
          {
          <fpage>1178</fpage>
          . WWW '10,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          , New York, NY, USA (
          <year>2010</year>
          ). https://doi.org/10.1145/1772690.1772862
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Wainwright</surname>
            ,
            <given-names>M.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jordan</surname>
            ,
            <given-names>M.I.</given-names>
          </string-name>
          :
          <article-title>Graphical models, exponential families, and variational inference</article-title>
          .
          <source>Foundations and Trends in Machine Learning</source>
          <volume>1</volume>
          (
          <issue>1-2</issue>
          ),
          <volume>1</volume>
          {
          <fpage>305</fpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ruozzi</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gogate</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Scalable neural network compression and pruning using hard clustering and l1 regularization</article-title>
          . CoRR abs/
          <year>1806</year>
          .05355 (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>