guybenyosef / EchoGraphs

[MICCAI 2022] The official repository of Light-weight spatio-temporal graphs for segmentation and ejection fraction prediction in cardiac ultrasound. Project page: https://guybenyosef.github.io/EchoGraphs/
MIT License
24 stars 8 forks source link

What's the edges in EchoGraph? #10

Open 7oud opened 1 year ago

7oud commented 1 year ago

From the figures in paper, the vertex v1 is connect to v2 and v0 in the ED, and there is another edge between v1 and its according vertex v1' in the ES. But after I read the code, it seems that v1 is connected with all the vertices in the same image, ED and v1' in ES. I understand right?

SarTho9 commented 1 year ago

Hi 7oud, you are right, the Fig is somewhat misleading. So in general the connections (orginally as a spiral on the mesh, in our case as a loop around the contour) are ordered, hence the arrows in the Fig, but they still have a connection to all vertices in the same time frame plus one connection to the neighboring frame. We decided to have it fully connected but this can be changed.

Note that in the MICCAI implementation there is also a small bug in terms of how the sequence is ordered. If you change the following line in the nets/CNN_GCN.py:

def create_graph(self, num_nodes: int) -> np.ndarray:
    adjacency = []
    for ii in range(num_nodes):
        x = list(range(num_nodes))
        #x.insert(0, x.pop(ii)) changed with the line below
        x=np.roll(x,-ii)
        adjacency.append(x)
    adjacency = np.array(adjacency)

Then the order is acutally reflecting the loop. We did some experiments and realized that the final accuracy is not significantly influenced but definetely the performance on how fast the model converges.