首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做 MPHY0041、代写 C++设计编程
项目预算:
开发周期:
发布时间:
要求地区:
UCL DEPARTMANT OF MEDICAL PHYSICS AND
BIOMEDICAL ENGINEERING
Module Code: Module Title : Coursework Title : Lecturer:
Date Handed out: Student ID (Not Name)
MPHY0041
Machine Learning in Medical Imaging Assessed Coursework
Dr. Andre Altmann
Friday, October 25th 2024
Undergraduate / Postgraduate Assessed Coursework Tracking Sheet
Submission Instruction: Before the submission deadline, you should digitally submit your source code and generated figures (a single jupyter notebook file including your written answers). In case you submit multiple files, all files need to be combined in one single zip file and submitted on the module page at UCL Moodle.
Coursework Deadline: Friday, November 29th 2024 at 16:00 at UCL Moodle submission section
Date Received
Date Returned to Student:
The Department of Medical Physics and Biomedical Engineering follows the UCL Academic Manual with regards to plagiarism and coursework late submission. UCL Policy on Plagiarism
UCL Policy on Late Submission of Coursework
If you are unable to submit on-time due to extenuating circumstances (EC), please refer to the UCL Policy on Extenuating Circumstances and contact our EC Secretary at medphys.teaching@ucl.ac.uk as soon as possible.
UCL Policy on Extenuating Circumstances
Please indicate what areas of your coursework you particularly would like feedback on:
Mark (%):
Please note that the mark is provisional and could be changed when the exam boards meet to moderate marks.
Please note: This is an AI Category 1 coursework (i.e., AI technologies cannot be used to solve the questions): https://www.ucl.ac.uk/teaching-learning/generative-ai-hub/using- ai-tools-assessment.
Please submit a single jupyter notebook file for Exercises 1, 2, and 3. The file should contain code, plots and comments that help the understanding of your answers. You can give your written answers as a Markdown within the jupyter notebook.
The provided jupyter notebook Notebook_MPHY0041_2425_CW1.ipynb contains the individual gap codes/functions for Exercise 2 and the functions provided for Exercise 3. Please use this notebook as the basis for your submission.
1. Load the dataset ‘Dementia_train.csv’ it contains diagnosis (DX), a cognitive score (ADAS13) and two cerebrospinal fluid (CSF) measurements for two proteins: amyloid and tau. There are three diagnostic labels: CN, MCI, and Dementia.
a) Remove MCI subjects from the dataset. Compute means for each of the three
measurements (ADAS13, ABETA, TAU) for the ‘CN’ (𝜇!") and the ‘Dementia’ (𝜇#$)
groups. In addition, compute the standard deviation (𝜎) for these three measures
across the diagnostic groups. Assume that the data follow a Gaussian distribution:
1 %&( *%+ -! 𝑓(𝑥)= 𝜎√2𝜋𝑒 ' ,
,
with the means and standard deviation as computed above. Compute the decision boundary between the two disease groups for each of the three features (with the prior probabilities 𝜋.! = 𝜋#$ = 0.5).
Load the dataset ‘Dementia_test.csv’ that contains the same information for another 400 participants. After removing people with MCI, use the decision boundaries from above to compute accuracy, sensitivity and specificity for separating CN from Dementia for each of the three features. [8]
b) Using sklearn functions, train a LinearRegression to separate CN from Dementia subjects using ABETA and TAU values as inputs. Generate a scatter plot for ABETA and TAU using different colours for the two diagnostic groups. Compute the decision boundary based on the linear regression and add it to the plot. What is the accuracy, sensitivity and specificity of your model on the test data for separating CN from Dementia? [7]
c) The previous analyses ignored the subjects with MCI. Going back to the full dataset, compute means for all three groups for ABETA and TAU as well as the joint variance-covariance matrix Σ. Use these to compute linear decision boundaries between all pairs of classes (with the prior probabilities 𝜋.! = 𝜋/!0 =
𝜋#$ = 0.33) without using any models implemented in sklearn. Generate a new scatterplot and add the three decision boundaries. What is the accuracy, sensitivity and specificity for separating CN from Dementia with this method?
[10]
2. Here we complete implementations for different machine learning algorithms. The code with gaps can be found in the notebook Notebook_MPHY0041_2425_CW1.ipynb.
a) The function fit_LogReg_IWLS contains a few gaps that need to be filled for the function to work. This function implements Logistic Regression using iterative weighted least squares (IWLS) as introduced in the lectures. Use your function to train a model that separates Healthy controls from PD subjects in the LogReg_data.csv dataset (DX column indicates PD status, remaining columns are the features). Use the LogisticRegression implemented in sklearn to train a model on the same data. Make a scatter plot between the coefficients obtained from your implementation and the sklearn model. Comment on the
result.
(Hint: The operator @ can be used for matrix multiplications; the function np.linalg.pinv() computes the pseudo-inverse of the matrix: X-1). [7]
b) The function fit_LogReg_GRAD aims to implement Logistic Regression using gradient descent. However, there are still a few gaps in the code. Complete the computation of the cost (J(β)) as well as the update of the beta coefficients. (Hint: gradient descent aims to minimise the cost; however, Logistic Regression is fitted by maximising the log likelihood). Use your function to train a model that separates Healthy controls from PD subjects in the LogReg_data.csv dataset.
Run the training for 3000 iterations with 𝛼 = 0.1. Compare the obtained coefficients to the ones obtained from the IWLS implementation in part a). Comment on the result. [7]
c) The function fit_LogReg_GRAD_momentum aims to implement Logistic Regression using gradient descent with momentum. Extend your solution from (b) and add momentum to the optimization as introduced in the lectures. Use the parameter gamma as the trade-off between momentum and gradient. Train your model on the dataset Syn_Momentum.csv (two inputs X1, X2, and one target y). Run the gradient descent for 100 iterations and compare to the standard gradient descent from (b) also run for 100 iterations (both with 𝛼 = 0.001). How does the Loss evolve over the iterations? Explain your observation. [7]
d) When working with medical data we often encounter biases. This could mean that our target variable (𝑦) is accidentally correlated to another variable (𝑦'). We would like to estimate the model to predict 𝑦, while ignoring the effects introduced by 𝑦'. The trade-off between the objectives can be modified using the parameter 𝛿. Provide a Loss function for this scenario (where both 𝑦 and 𝑦'are fitted using a Logistic Regression). Complete the function fit_LogReg_GRAD_competing, which should implement these logistic regressions with gradient descent. Use the variable delta to implement the trade-off. Load the dataset sim_competitive.csv, it contains two input features (x1, x2) and two output features (y1, y2). Apply your function with different values for 𝛿 (0, 0.5, 0.75, 1.0). Make a scatter plot of the data and add the decision boundaries produced by the four models. [9]
3. This exercise uses T2-weighted MR images of the prostate and surrounding tissue (information here). The task to be solved is to automatically segment the prostate in these images. The input images are gray-scale images with 128x128 pixels (below left) and the output should be a binary matrix of size 128x128, where a 1 indicates the prostate (below right).
The promise1215.zip archive contains three sets of images: training, validation, test. For training, there are 30 MR images paired with their ground truth (i.e., masks). For instance, train/img_02_15.png is the MRI and train/lab_02_15.png is the corresponding ground truth. The function preprocess_img computes a series of filters (raw, sobel, gabor, difference of gaussians, etc.) to be used for the machine learning algorithm. For instance, application to the above image results in the following channels (Figure 1). Use the function provided in create_training_set to randomly sample 1000 patches of size 21x21 from the 30 training images to generate an initial dataset. The resulting dataset is heavily imbalanced (more background patches than target), the function sub_sample is used to generate a random subset of 1000 patches from the entire training data with an approximate 50-50 distribution.
a) Using sklearn, train an SVC model to segment the prostate. Optimize kernel choice (e.g., RBF or polynomial with degree 3) and the cost parameter (e.g., C in the range 0.1 to 1000) using an appropriate variant of cross-validation. Measure performance using the Area Under the ROC Curve (roc_auc) and plot the performance of the kernels depending on the C parameter. (Hint: when SVC seems to take an endless time to train, then change your choice of C parameters; large C parameters ® little regularization ® long training time. E.g., in Colab this took about 30 minutes). [10]
b) Based on your result from a) select the best model parameters and make predictions of the 10 images in the validation dataset. Compute the DICE coefficient and roc_auc for each image. Display the original image, the ground truth, and your segmentations for any 5 images in your validation set. Provide the average DICE coefficient and roc_auc for the entire validation dataset. (Hint: this can take a few minutes per image.) [8]
Figure 1: Feature channels. Numbered from top left to bottom right. (1) raw input image (2) Scharr filter, (3-6) Gabor filter with frequency 0.2 in four directions (7-10) Gabor filter with frequency 0.4 in four directions (11-14) Gabor filter with frequency 0.6 in four directions (15-18) Gabor filter with frequency 0.8 in four directions (19) Local Binary Pattern (LBP) features, and (20) difference of gaussians.
c) Instead of the SVC, train a tree-based ensemble classifier and make predictions for the validation images. Report the average roc_auc and DICE coefficient for the entire validation set. What performs better: the SVC or the tree ensemble? Are tree ensembles or the SVC faster to train and apply? Explain why this is the case.
[7]
d) Use the tree-based ensemble method and explore how the amount of training data (i.e., sub sample size: 500, 1000, 2500, 5000), the patch dimensions (11x11, 17x17, 21x21, 27x27, 31x31) affects the performance on the validation set. [10]
e) As shown in the lectures, post-process your prediction using morphological operations and filters to achieve a better segmentation result. (Hint: some morphological operations are implemented in skimage.morphology; link). Report how your post-processing influences your DICE score on the validation
data. [5]
f) Using your best combination of training data size and patch dimension (from d) and post processing methods (from e), estimate the performance on unseen samples from the test set. Display the original image, the ground truth, and your segmentations for any 5 images in your test set. Provide average DICE coefficient for the entire test set. [5]
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做 program、代写 c++设计程...
2024-12-23
comp2012j 代写、代做 java 设...
2024-12-23
代做 data 编程、代写 python/...
2024-12-23
代做en.553.413-613 applied s...
2024-12-23
代做steady-state analvsis代做...
2024-12-23
代写photo essay of a deciduo...
2024-12-23
代写gpa analyzer调试c/c++语言
2024-12-23
代做comp 330 (fall 2024): as...
2024-12-23
代写pstat 160a fall 2024 - a...
2024-12-23
代做pstat 160a: stochastic p...
2024-12-23
代做7ssgn110 environmental d...
2024-12-23
代做compsci 4039 programming...
2024-12-23
代做lab exercise 8: dictiona...
2024-12-23
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!