{
  "id": 396293,
  "title": "Path Signature Method for Landmark-based Recognition tasks",
  "url": "/competitions/asl-signs/discussion/396293",
  "author_name": "Jordan Connolly",
  "post_date": "2023-03-21T04:04:13.464000",
  "votes": 3,
  "comment_count": 5,
  "views": 0,
  "content": "<p>I found an interesting paper that describes a methodology for using the path signature method for classification problems that are similar to the ASL problem. Their approach used the signature method to transform a data stream into a set of features, which were fed into a simple MLP that was able to outperform more complex models such as LSTM in classifying . The signature method essentially takes a stream of data and returns a series of iterated integrals for that stream, which are generally unique to each stream, with the only exception being that if a path were to retrace over itself, it would not be unique from a path that did not retrace over the same points. This limitation can be handled by adding time/frames as a dimension. Some current packages that implement this method are signatory, iisignature, and esig. Unfortunately, to my understanding, doing this sort of feature engineering must be done in TensorFlow or PyTorch in order to be converted into TF-Lite, so we can't use those packages. I've tried but have found it too challenging for myself to implement this method in Torch. Hopefully, someone else can and can improve their model.</p>\n<p>\"Developing the Path Signature Methodology and its Application to Landmark-based Human Action Recognition\" <a href=\"https://arxiv.org/abs/1707.03993\" target=\"_blank\">https://arxiv.org/abs/1707.03993</a></p>\n<p>Another paper, \"Deep Signature Transforms\" <a href=\"https://arxiv.org/abs/1905.08494\" target=\"_blank\">https://arxiv.org/abs/1905.08494</a>, was written by the developer for Signatory, which uses the transformation as layers in an NN. Though this method will be even more difficult to implement in TF-Lite.</p>",
  "messages": [
    {
      "id": 2190128,
      "postDate": "2023-03-21T04:04:13.463Z",
      "content": "<p>I found an interesting paper that describes a methodology for using the path signature method for classification problems that are similar to the ASL problem. Their approach used the signature method to transform a data stream into a set of features, which were fed into a simple MLP that was able to outperform more complex models such as LSTM in classifying . The signature method essentially takes a stream of data and returns a series of iterated integrals for that stream, which are generally unique to each stream, with the only exception being that if a path were to retrace over itself, it would not be unique from a path that did not retrace over the same points. This limitation can be handled by adding time/frames as a dimension. Some current packages that implement this method are signatory, iisignature, and esig. Unfortunately, to my understanding, doing this sort of feature engineering must be done in TensorFlow or PyTorch in order to be converted into TF-Lite, so we can't use those packages. I've tried but have found it too challenging for myself to implement this method in Torch. Hopefully, someone else can and can improve their model.</p>\n<p>\"Developing the Path Signature Methodology and its Application to Landmark-based Human Action Recognition\" <a href=\"https://arxiv.org/abs/1707.03993\" target=\"_blank\">https://arxiv.org/abs/1707.03993</a></p>\n<p>Another paper, \"Deep Signature Transforms\" <a href=\"https://arxiv.org/abs/1905.08494\" target=\"_blank\">https://arxiv.org/abs/1905.08494</a>, was written by the developer for Signatory, which uses the transformation as layers in an NN. Though this method will be even more difficult to implement in TF-Lite.</p>",
      "rawMarkdown": "I found an interesting paper that describes a methodology for using the path signature method for classification problems that are similar to the ASL problem. Their approach used the signature method to transform a data stream into a set of features, which were fed into a simple MLP that was able to outperform more complex models such as LSTM in classifying . The signature method essentially takes a stream of data and returns a series of iterated integrals for that stream, which are generally unique to each stream, with the only exception being that if a path were to retrace over itself, it would not be unique from a path that did not retrace over the same points. This limitation can be handled by adding time/frames as a dimension. Some current packages that implement this method are signatory, iisignature, and esig. Unfortunately, to my understanding, doing this sort of feature engineering must be done in TensorFlow or PyTorch in order to be converted into TF-Lite, so we can't use those packages. I've tried but have found it too challenging for myself to implement this method in Torch. Hopefully, someone else can and can improve their model.\n\n\"Developing the Path Signature Methodology and its Application to Landmark-based Human Action Recognition\" https://arxiv.org/abs/1707.03993\n\nAnother paper, \"Deep Signature Transforms\" https://arxiv.org/abs/1905.08494, was written by the developer for Signatory, which uses the transformation as layers in an NN. Though this method will be even more difficult to implement in TF-Lite.",
      "votes": 3
    },
    {
      "id": 2190148,
      "postDate": "2023-03-21T04:31:50.410Z",
      "content": "<p>\"Though this method will be even more difficult to implement in TF-Lite\"</p>\n<p>you can always  use this as a teacher for distillation</p>",
      "rawMarkdown": "\"Though this method will be even more difficult to implement in TF-Lite\"\n\nyou can always  use this as a teacher for distillation",
      "votes": 2,
      "replies": [
        {
          "id": 2190154,
          "postDate": "2023-03-21T04:38:48.693Z",
          "content": "<p>I haven't heard of this before, and a quick google search has me interested.  Thanks for the advice</p>",
          "rawMarkdown": "I haven't heard of this before, and a quick google search has me interested.  Thanks for the advice",
          "votes": 1,
          "replies": [
            {
              "id": 2190232,
              "postDate": "2023-03-21T05:59:55.240Z",
              "content": "<p>take the famous DEIT in vision transformer as an example:<br>\n<img src=\"https://i.ibb.co/TP72zHd/Selection-999-1549.png\" alt=\"https://i.ibb.co/TP72zHd/Selection-999-1549.png\"></p>\n<p>the extra distllation token and loss force the model to learn information not only from the train data but also from other model (teacher)</p>\n<p>another way to think if it as aux loss with teacher label, etc as aux target</p>",
              "rawMarkdown": "take the famous DEIT in vision transformer as an example:\n![https://i.ibb.co/TP72zHd/Selection-999-1549.png](https://i.ibb.co/TP72zHd/Selection-999-1549.png)\n\nthe extra distllation token and loss force the model to learn information not only from the train data but also from other model (teacher)\n\nanother way to think if it as aux loss with teacher label, etc as aux target",
              "votes": 3
            }
          ]
        }
      ]
    },
    {
      "id": 2232510,
      "postDate": "2023-04-24T11:57:43.910Z",
      "content": "<p>Thanks for posting! I tried to find the discussion where this was posted a few days ago, but couldn't. </p>\n<p>Reviewing this has helped me learn quite a bit.</p>\n<p><a href=\"https://www.youtube.com/watch?v=Lj_vs0nq1NA\" target=\"_blank\">This video</a> explains some of the background. It begins very abstractly, but eventually comes around: </p>\n<p><a href=\"https://github.com/kormilitzin/the-signature-method-in-machine-learning\" target=\"_blank\">This repo</a> also has useful resources for background on signatures: </p>\n<p>The signatory library can calculate the required dimensionality <a href=\"https://signatory.readthedocs.io/en/latest/pages/examples/simple.html\" target=\"_blank\">like so</a></p>\n<p>For sequences of length 10 sampled from 5D space to depth k=3, each signature requires 155 dimensions. For points sampled from 3D that would be significantly less, but I haven't calculated it yet. Not every hand landmark needs to be included. It's not clear that 10 frames would be sufficient.</p>\n<p>There are alot of discussions involving performance cutoffs. Does anyone have any feedback on how this works for TF Lite?</p>",
      "rawMarkdown": "Thanks for posting! I tried to find the discussion where this was posted a few days ago, but couldn't. \n\nReviewing this has helped me learn quite a bit.\n\n[This video](https://www.youtube.com/watch?v=Lj_vs0nq1NA) explains some of the background. It begins very abstractly, but eventually comes around: \n\n[This repo](https://github.com/kormilitzin/the-signature-method-in-machine-learning) also has useful resources for background on signatures: \n\nThe signatory library can calculate the required dimensionality [like so](https://signatory.readthedocs.io/en/latest/pages/examples/simple.html)\n\nFor sequences of length 10 sampled from 5D space to depth k=3, each signature requires 155 dimensions. For points sampled from 3D that would be significantly less, but I haven't calculated it yet. Not every hand landmark needs to be included. It's not clear that 10 frames would be sufficient.\n\nThere are alot of discussions involving performance cutoffs. Does anyone have any feedback on how this works for TF Lite?"
    },
    {
      "id": 2232501,
      "postDate": "2023-04-24T11:54:49.040Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 2190148,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-03-21T04:31:50.410000",
      "content": "<p>\"Though this method will be even more difficult to implement in TF-Lite\"</p>\n<p>you can always  use this as a teacher for distillation</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2190154,
          "author_name": "Jordan Connolly",
          "author_url": "",
          "post_date": "2023-03-21T04:38:48.693000",
          "content": "<p>I haven't heard of this before, and a quick google search has me interested.  Thanks for the advice</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2190232,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-03-21T05:59:55.240000",
              "content": "<p>take the famous DEIT in vision transformer as an example:<br>\n<img src=\"https://i.ibb.co/TP72zHd/Selection-999-1549.png\" alt=\"https://i.ibb.co/TP72zHd/Selection-999-1549.png\"></p>\n<p>the extra distllation token and loss force the model to learn information not only from the train data but also from other model (teacher)</p>\n<p>another way to think if it as aux loss with teacher label, etc as aux target</p>",
              "votes": 3,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2232510,
      "author_name": "davidconner",
      "author_url": "",
      "post_date": "2023-04-24T11:57:43.910000",
      "content": "<p>Thanks for posting! I tried to find the discussion where this was posted a few days ago, but couldn't. </p>\n<p>Reviewing this has helped me learn quite a bit.</p>\n<p><a href=\"https://www.youtube.com/watch?v=Lj_vs0nq1NA\" target=\"_blank\">This video</a> explains some of the background. It begins very abstractly, but eventually comes around: </p>\n<p><a href=\"https://github.com/kormilitzin/the-signature-method-in-machine-learning\" target=\"_blank\">This repo</a> also has useful resources for background on signatures: </p>\n<p>The signatory library can calculate the required dimensionality <a href=\"https://signatory.readthedocs.io/en/latest/pages/examples/simple.html\" target=\"_blank\">like so</a></p>\n<p>For sequences of length 10 sampled from 5D space to depth k=3, each signature requires 155 dimensions. For points sampled from 3D that would be significantly less, but I haven't calculated it yet. Not every hand landmark needs to be included. It's not clear that 10 frames would be sufficient.</p>\n<p>There are alot of discussions involving performance cutoffs. Does anyone have any feedback on how this works for TF Lite?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2232501,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-04-24T11:54:49.040000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2190128": "I found an interesting paper that describes a methodology for using the path signature method for classification problems that are similar to the ASL problem. Their approach used the signature method to transform a data stream into a set of features, which were fed into a simple MLP that was able to outperform more complex models such as LSTM in classifying . The signature method essentially takes a stream of data and returns a series of iterated integrals for that stream, which are generally unique to each stream, with the only exception being that if a path were to retrace over itself, it would not be unique from a path that did not retrace over the same points. This limitation can be handled by adding time/frames as a dimension. Some current packages that implement this method are signatory, iisignature, and esig. Unfortunately, to my understanding, doing this sort of feature engineering must be done in TensorFlow or PyTorch in order to be converted into TF-Lite, so we can't use those packages. I've tried but have found it too challenging for myself to implement this method in Torch. Hopefully, someone else can and can improve their model.\n\n\"Developing the Path Signature Methodology and its Application to Landmark-based Human Action Recognition\" https://arxiv.org/abs/1707.03993\n\nAnother paper, \"Deep Signature Transforms\" https://arxiv.org/abs/1905.08494, was written by the developer for Signatory, which uses the transformation as layers in an NN. Though this method will be even more difficult to implement in TF-Lite.",
    "2190148": "\"Though this method will be even more difficult to implement in TF-Lite\"\n\nyou can always  use this as a teacher for distillation",
    "2232510": "Thanks for posting! I tried to find the discussion where this was posted a few days ago, but couldn't. \n\nReviewing this has helped me learn quite a bit.\n\n[This video](https://www.youtube.com/watch?v=Lj_vs0nq1NA) explains some of the background. It begins very abstractly, but eventually comes around: \n\n[This repo](https://github.com/kormilitzin/the-signature-method-in-machine-learning) also has useful resources for background on signatures: \n\nThe signatory library can calculate the required dimensionality [like so](https://signatory.readthedocs.io/en/latest/pages/examples/simple.html)\n\nFor sequences of length 10 sampled from 5D space to depth k=3, each signature requires 155 dimensions. For points sampled from 3D that would be significantly less, but I haven't calculated it yet. Not every hand landmark needs to be included. It's not clear that 10 frames would be sufficient.\n\nThere are alot of discussions involving performance cutoffs. Does anyone have any feedback on how this works for TF Lite?",
    "2232501": ""
  }
}