아... Chest CT 로 text-to-image 모델 훈련하는거 너무 힘듬 ㅜㅜ
Prompt: "Massive pleural effusion is observed on the left. There is a total loss of aeration in the left lung. There is no pleural effusion on the right."
이런식으로 해서 만들어봤는데,

ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ.. 퀄리티가 이상한건 그렇다 치고, 왼쪽에 massive pleural effusion 은 어디감??
뭔가 훈련 스킴에 문제가 있다고 생각이 들었음. 범인은 아래 두 시나리오 중 하나라고 생각함.
물론 근본적으로는 데이터가 20,000 개 가량밖에 없어서 그런거긴 하지만, 그래도 뭔가 작동하는 모델 만들기는 충분하지 않은가?
어쨌든, 다른 사람들은 어떻게 했는지 진지하게 살펴볼 필요가 있다고 느껴서 논문 리뷰를 시작함.
CT-RATE 사용했다. 데이터는 (512, 512, 201) 로 고정한다.
{age} years old {sex}: {impression}
프롬프트가 특이한데, findings 를 아예 안쓰고 그냥 환자 정보에 바로 impression 을 썼다 (!!). 이게 왜 의외냐면, findings 에 CT 에 관한 정보가 다 들어있기 때문이다... 어디에 무슨 병이 있는지, 크기는 어느정도인지 다 써놓는데, impression 에는 그런 정보가 없다. 그치만, 오히려 findings 가 너무 복잡해서 훈련이 안될 수 있다는 내 가설에 힘을 실어주는 전처리 방식이다.
Text prompt 는 T5 encoder 을 활용하여 처리한다.

3D CT volume 을 인코딩하는 역할. (Latent representation 쓰겠다는 거죠?)

딱 보니 ViViT (video vision transformer) 쓴 티가 남.
Masked autoencoder 마냥 Patch 를 마스킹한다음에 self attention + text 와의 cross attention 을 통해 복구하는 작업.
masked_input = torch.where(mask_token_mask, self.mask_id, video_codebook_ids)
masked_input, = unpack(masked_input, packed_shape, 'b *')
maskgit_forward_context = torch.no_grad if only_train_critic else nullcontext
with maskgit_forward_context():
logits = self.maskgit(
masked_input,
video_mask = video_mask,
cond_drop_prob = cond_drop_prob,
text_mask = text_mask,
context = text_embeds
)
또 하나 critic loss 라는 게 있다. Video codebook ID sequences 가 real 인지 generated 인지 확인해주는 (약간 spelling checker 느낌? 이라고 생각하면 될듯) 녀석인데, transformer architecture 을 활용해서 self attention + text report 와의 cross attention 을 활용해서 각 패치마다 logit 을 뽑아준다. Real / generated 여부는
critic_labels = (video_codebook_ids != pred_video_ids).float()
으로 코드북 일치 여부를 통해 알아낸다.
마지막으로는 diffusion-based super-resolution model 이다. 128 x 128 슬라이스들을 512 x 512 로 upsampling 하는 과정이다. 이 때,


