深度学习模型分析工具箱

BioExp的Python项目详细描述


生物经验

Build StatusDocumentation StatusPyPI versionLicense: MIT

解释在医学图像和自然图像中执行各种图像处理任务的深度学习模型。在

特点

  • [x] 解剖分析
  • [x] 烧蚀分析
  • [x] 不确定性分析
    • [x] 基于Bayesian-Dropout的认知不确定性
    • [x] 利用测试时间增加的任意不确定度
  • [x] 活化最大化
  • [x] 凸轮分析
  • [x] 输入与概念空间的RCT
  • [x] 概念生成聚类分析
    • [x] 基于wts的聚类
    • [x] 基于特征的聚类
  • [x] 概念识别
    • [x] 基于解剖的
    • [x] 基于流的
  • [x] 因果图
  • [x] 推理方法
  • []视觉轨迹上的反事实
  • []反事实生成
  • []事前方法(元因果关系)

引用

如果您使用BioExp,请引用我们的工作:

@article{natekar2019demystifying,
  title={Demystifying Brain Tumour Segmentation Networks: Interpretability and Uncertainty Analysis},
  author={Natekar, Parth and Kori, Avinash and Krishnamurthi, Ganapathy},
  journal={arXiv preprint arXiv:1909.01498},
  year={2019}
}

定义的管道

pipeline

安装

运行可解释性管道需要一个GPU和几个深度学习模块。在

要求

  • “熊猫”
  • “纽比”
  • 'scipy==1.6.0'
  • 'matplotlib'
  • “枕头”
  • “简单点”
  • “opencv python”
  • 'tensorflow gpu==1.14'
  • “克拉斯”
  • “keras-vis”
  • “清醒”

下面的命令将只安装上面列出的依赖项。在

^{pr2}$

烧蚀

使用

from BioExp.spatial import Ablation

A = spatial.Ablation(model = model, 
				weights_pth = weights_path, 
				metric      = dice_label_coef, 
				layer_name  = layer_name, 
				test_image  = test_image, 
				gt 	    = gt, 
				classes     = infoclasses, 
				nclasses    = 4)

df = A.ablate_filter(step = 1)

解剖

使用

from BioExp.spatial import Dissector

layer_name = 'conv2d_3'
infoclasses = {}
for i in range(1): infoclasses['class_'+str(i)] = (i,)
infoclasses['whole'] = (1,2,3)

dissector = Dissector(model=model,
                        layer_name = layer_name)

threshold_maps = dissector.get_threshold_maps(dataset_path = data_root_path,
                                                save_path  = savepath,
                                                percentile = 85)
dissector.apply_threshold(image, threshold_maps, 
                        nfeatures =9, 
                        save_path = savepath, 
                        ROI       = ROI)

dissector.quantify_gt_features(image, gt, 
                        threshold_maps, 
                        nclasses   = infoclass, 
                        nfeatures  = 9, 
                        save_path  = savepath,
                        save_fmaps = False, 
                        ROI        = ROI)

结果

dissection

格拉德卡姆

使用

from BioExp.spatial import cam

dice = flow.cam(model, img, gt, 
				nclasses = nclasses, 
				save_path = save_path, 
				layer_idx = -1, 
				threshol = 0.5,
				modifier = 'guided')

结果

gradcam

活化最大化

使用

from BioExp.concept.feature import Feature_Visualizer

class Load_Model(Model):

  model_path = '../../saved_models/model_flair_scaled/model.pb'
  image_shape = [None, 1, 240, 240]
  image_value_range = (0, 10)
  input_name = 'input_1'

E = Feature_Visualizer(Load_Model, savepath = '../results/', regularizer_params={'L1':1e-3, 'rotate':8})
a = E.run(layer = 'conv2d_17', class_ = 'None', channel = 95, transforms=True)

激活结果 lucid

不确定性

使用

from BioExp.uncertainty import uncertainty

D = uncertainty(test_image)
            
# for aleatoric
mean, var = D.aleatoric(model, iterations = 50)

# for epistemic
mean, var = D.epistemic(model, iterations = 50)
 
# for combined
mean, var = D.combined(model, iterations = 50)

结果

un

无线电技术

使用

from BioExp.helpers import radfeatures
feat_extractor = radfeatures.ExtractRadiomicFeatures(image, mask, save_path = pth)
df = feat_extractor.all_features()

因果推理管道

un

联系人

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java需要一种简单的方法来创建用于排序的comparator类   java getReadableDatabase和getWriteableDatabase无法解析   查找列表<Long>中与某个元素对应的所有索引的java方法   安卓将视图添加到ViewFlipper会导致java。StackOverflowerr语言   java根据它所包含的长“curTime”类字段将N的列表拆分为24(小时)   Android N中的Java8流API   自动生成Java策略文件的安全性   垃圾收集鼓励Java中的主要GC(但不是STW GC)   java如何检查UDP服务器上侦听的客户端数量   在前一台主机被Datastax Java驱动程序关闭后,Cassandra尝试重新连接到下一台主机   java如何使用Spring Boot创建部分代理   java是否有一个网站或资源可以完全比较EJB版本   java无需使用第三方库从gradle生成输出   继承由于这个多态性的基本示例中的语法有什么不同吗?(爪哇)   java字符串数组中的空字符串   java为什么CMS中的初始标记阶段是串行的   为什么Lucene有时与InChIKeys不匹配?   安卓通知Java应用程序数据库中的更改   java如何将单个json对象值解析为按钮   java打印堆栈将运行时错误跟踪到文件