GithubHelp home page GithubHelp logo

face-asymmetry's Introduction

Face Asymmetry

This undertaking employs advanced statistical techniques in higher dimensions to evaluate the fundamental asymmetry of a patient's facial muscle movements. The primary statistical test utilized is Marietan's "T1-test."

An illustration of the utility usage is present in the main.py file. The application involves three distinct stages of data transformations, commencing from the raw data situated in the /data/ directory, culminating in the computation of the final p-value.

[_xy, _dxdy, _ids, _frames, _x_mean] = stage_1()
_left_ids, _right_ids                = stage_2(_xy, _dxdy, _ids, _frames, _x_mean)
L, R                                 = stage_3(_left_ids, _right_ids, _dxdy, _frames)
print("p value is", stats.marietan_test.marietan_T1_test(L,R))

The initial phase (refer to stage_1()) entails converting the raw data into a more usable format, which includes xy, dxdy, ids, frames, x_mean. In this context, xy represents the (x,y) coordinates of each id, dxdy indicates the smoothed vectors corresponding to any given frame and id, ids records the available ids, frames gathers the available frames, and x_mean denotes the average x-coordinate value of all the points.

Subsequently, in the second stage (refer to stage_2()), the primary objective is to establish a correspondence between the left and right half points of the face. This is accomplished using the Hungarian algorithm. The outcomes of stage_2 are two lists, namely _left_ids and _right_ids. The first list contains the ids of the points on the left-half of the face, while the second list contains the ids of the points on the right-half of the face. Specifically, _left_ids[j] represents the point on the left-half of the face, and its corresponding mirrored point is _right_ids[j].

In the third stage (refer to stage_3()), we create two matrices, the Left Matrix L and the Right Matrix R. L contains ten vectors of the same size, one for each frame. Each vector corresponds to a particular frame and comprises the concatenation of all [dx, dy] pairs for all the points on the left side of the face, as per the order specified by _left_ids. The Right Matrix R is similar to L, except that all its dx values are multiplied by -1.

Finally, we use the marietan_T1_test() function to evaluate L and R and obtain the p_value. If the computed p_value is less than 0.05, it implies that the face muscle movements are significantly asymmetrical, based on statistical analysis.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.